i2c-pxa-pci-ce4100.txt 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. CE4100 I2C
  2. ----------
  3. CE4100 has one PCI device which is described as the I2C-Controller. This
  4. PCI device has three PCI-bars, each bar contains a complete I2C
  5. controller. So we have a total of three independent I2C-Controllers
  6. which share only an interrupt line.
  7. The driver is probed via the PCI-ID and is gathering the information of
  8. attached devices from the devices tree.
  9. Grant Likely recommended to use the ranges property to map the PCI-Bar
  10. number to its physical address and to use this to find the child nodes
  11. of the specific I2C controller. This were his exact words:
  12. Here's where the magic happens. Each entry in
  13. ranges describes how the parent pci address space
  14. (middle group of 3) is translated to the local
  15. address space (first group of 2) and the size of
  16. each range (last cell). In this particular case,
  17. the first cell of the local address is chosen to be
  18. 1:1 mapped to the BARs, and the second is the
  19. offset from be base of the BAR (which would be
  20. non-zero if you had 2 or more devices mapped off
  21. the same BAR)
  22. ranges allows the address mapping to be described
  23. in a way that the OS can interpret without
  24. requiring custom device driver code.
  25. This is an example which is used on FalconFalls:
  26. ------------------------------------------------
  27. i2c-controller@b,2 {
  28. #address-cells = <2>;
  29. #size-cells = <1>;
  30. compatible = "pci8086,2e68.2",
  31. "pci8086,2e68",
  32. "pciclass,ff0000",
  33. "pciclass,ff00";
  34. reg = <0x15a00 0x0 0x0 0x0 0x0>;
  35. interrupts = <16 1>;
  36. /* as described by Grant, the first number in the group of
  37. * three is the bar number followed by the 64bit bar address
  38. * followed by size of the mapping. The bar address
  39. * requires also a valid translation in parents ranges
  40. * property.
  41. */
  42. ranges = <0 0 0x02000000 0 0xdffe0500 0x100
  43. 1 0 0x02000000 0 0xdffe0600 0x100
  44. 2 0 0x02000000 0 0xdffe0700 0x100>;
  45. i2c@0 {
  46. #address-cells = <1>;
  47. #size-cells = <0>;
  48. compatible = "intel,ce4100-i2c-controller";
  49. /* The first number in the reg property is the
  50. * number of the bar
  51. */
  52. reg = <0 0 0x100>;
  53. /* This I2C controller has no devices */
  54. };
  55. i2c@1 {
  56. #address-cells = <1>;
  57. #size-cells = <0>;
  58. compatible = "intel,ce4100-i2c-controller";
  59. reg = <1 0 0x100>;
  60. /* This I2C controller has one gpio controller */
  61. gpio@26 {
  62. #gpio-cells = <2>;
  63. compatible = "ti,pcf8575";
  64. reg = <0x26>;
  65. gpio-controller;
  66. };
  67. };
  68. i2c@2 {
  69. #address-cells = <1>;
  70. #size-cells = <0>;
  71. compatible = "intel,ce4100-i2c-controller";
  72. reg = <2 0 0x100>;
  73. gpio@26 {
  74. #gpio-cells = <2>;
  75. compatible = "ti,pcf8575";
  76. reg = <0x26>;
  77. gpio-controller;
  78. };
  79. };
  80. };