host-generic-pci.txt 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. * Generic PCI host controller
  2. Firmware-initialised PCI host controllers and PCI emulations, such as the
  3. virtio-pci implementations found in kvmtool and other para-virtualised
  4. systems, do not require driver support for complexities such as regulator
  5. and clock management. In fact, the controller may not even require the
  6. configuration of a control interface by the operating system, instead
  7. presenting a set of fixed windows describing a subset of IO, Memory and
  8. Configuration Spaces.
  9. Such a controller can be described purely in terms of the standardized device
  10. tree bindings communicated in pci.txt:
  11. Properties of the host controller node:
  12. - compatible : Must be "pci-host-cam-generic" or "pci-host-ecam-generic"
  13. depending on the layout of configuration space (CAM vs
  14. ECAM respectively).
  15. - device_type : Must be "pci".
  16. - ranges : As described in IEEE Std 1275-1994, but must provide
  17. at least a definition of non-prefetchable memory. One
  18. or both of prefetchable Memory and IO Space may also
  19. be provided.
  20. - bus-range : Optional property (also described in IEEE Std 1275-1994)
  21. to indicate the range of bus numbers for this controller.
  22. If absent, defaults to <0 255> (i.e. all buses).
  23. - #address-cells : Must be 3.
  24. - #size-cells : Must be 2.
  25. - reg : The Configuration Space base address and size, as accessed
  26. from the parent bus. The base address corresponds to
  27. the first bus in the "bus-range" property. If no
  28. "bus-range" is specified, this will be bus 0 (the default).
  29. Properties of the /chosen node:
  30. - linux,pci-probe-only
  31. : Optional property which takes a single-cell argument.
  32. If '0', then Linux will assign devices in its usual manner,
  33. otherwise it will not try to assign devices and instead use
  34. them as they are configured already.
  35. Configuration Space is assumed to be memory-mapped (as opposed to being
  36. accessed via an ioport) and laid out with a direct correspondence to the
  37. geography of a PCI bus address by concatenating the various components to
  38. form an offset.
  39. For CAM, this 24-bit offset is:
  40. cfg_offset(bus, device, function, register) =
  41. bus << 16 | device << 11 | function << 8 | register
  42. Whilst ECAM extends this by 4 bits to accommodate 4k of function space:
  43. cfg_offset(bus, device, function, register) =
  44. bus << 20 | device << 15 | function << 12 | register
  45. Interrupt mapping is exactly as described in `Open Firmware Recommended
  46. Practice: Interrupt Mapping' and requires the following properties:
  47. - #interrupt-cells : Must be 1
  48. - interrupt-map : <see aforementioned specification>
  49. - interrupt-map-mask : <see aforementioned specification>
  50. Example:
  51. pci {
  52. compatible = "pci-host-cam-generic"
  53. device_type = "pci";
  54. #address-cells = <3>;
  55. #size-cells = <2>;
  56. bus-range = <0x0 0x1>;
  57. // CPU_PHYSICAL(2) SIZE(2)
  58. reg = <0x0 0x40000000 0x0 0x1000000>;
  59. // BUS_ADDRESS(3) CPU_PHYSICAL(2) SIZE(2)
  60. ranges = <0x01000000 0x0 0x01000000 0x0 0x01000000 0x0 0x00010000>,
  61. <0x02000000 0x0 0x41000000 0x0 0x41000000 0x0 0x3f000000>;
  62. #interrupt-cells = <0x1>;
  63. // PCI_DEVICE(3) INT#(1) CONTROLLER(PHANDLE) CONTROLLER_DATA(3)
  64. interrupt-map = < 0x0 0x0 0x0 0x1 &gic 0x0 0x4 0x1
  65. 0x800 0x0 0x0 0x1 &gic 0x0 0x5 0x1
  66. 0x1000 0x0 0x0 0x1 &gic 0x0 0x6 0x1
  67. 0x1800 0x0 0x0 0x1 &gic 0x0 0x7 0x1>;
  68. // PCI_DEVICE(3) INT#(1)
  69. interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
  70. }