1 CE4100 I2C 2 ---------- 3 4 CE4100 has one PCI device which is described a 5 PCI device has three PCI-bars, each bar contai 6 controller. So we have a total of three indepe 7 which share only an interrupt line. 8 The driver is probed via the PCI-ID and is gat 9 attached devices from the devices tree. 10 Grant Likely recommended to use the ranges pro 11 number to its physical address and to use this 12 of the specific I2C controller. This were his 13 14 Here's where the magic happens. Each e 15 ranges describes how the parent pci add 16 (middle group of 3) is translated to th 17 address space (first group of 2) and th 18 each range (last cell). In this partic 19 the first cell of the local address is 20 1:1 mapped to the BARs, and the second 21 offset from be base of the BAR (which w 22 non-zero if you had 2 or more devices m 23 the same BAR) 24 25 ranges allows the address mapping to be 26 in a way that the OS can interpret with 27 requiring custom device driver code. 28 29 This is an example which is used on FalconFall 30 ---------------------------------------------- 31 i2c-controller@b,2 { 32 #address-cells = <2>; 33 #size-cells = <1>; 34 compatible = "pci8086,2e68.2", 35 "pci8086,2e68" 36 "pciclass,ff00 37 "pciclass,ff00 38 39 reg = <0x15a00 0x0 0x0 0x0 0x0 40 interrupts = <16 1>; 41 42 /* as described by Grant, the 43 * three is the bar number foll 44 * followed by size of the mapp 45 * requires also a valid transl 46 * property. 47 */ 48 ranges = <0 0 0x02000000 0 0 49 1 0 0x02000000 0 0 50 2 0 0x02000000 0 0 51 52 i2c@0 { 53 #address-cells = <1>; 54 #size-cells = <0>; 55 compatible = "intel,ce 56 57 /* The first number in 58 * number of the bar 59 */ 60 reg = <0 0 0x100>; 61 62 /* This I2C controller 63 }; 64 65 i2c@1 { 66 #address-cells = <1>; 67 #size-cells = <0>; 68 compatible = "intel,ce 69 reg = <1 0 0x100>; 70 71 /* This I2C controller 72 gpio@26 { 73 #gpio-cells = 74 compatible = " 75 reg = <0x26>; 76 gpio-controlle 77 }; 78 }; 79 80 i2c@2 { 81 #address-cells = <1>; 82 #size-cells = <0>; 83 compatible = "intel,ce 84 reg = <2 0 0x100>; 85 86 gpio@26 { 87 #gpio-cells = 88 compatible = " 89 reg = <0x26>; 90 gpio-controlle 91 }; 92 }; 93 };
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.