"cell-index" vs. "index" vs. no index in I2C device nodes
Grant Likely
grant.likely at secretlab.ca
Fri Jun 6 02:35:42 EST 2008
On Thu, Jun 5, 2008 at 10:18 AM, Timur Tabi <timur at freescale.com> wrote:
> Grant Likely wrote:
>
>> multifunction at 0 {
>> #size-cells = <1>;
>> #address-cells = <1>;
>> ranges = <0 0xe00000000 0x1000>;
>> i2c at 0 {
>> cell-index = <0>;
>> regs = <0 0x100>;
>> }
>> i2c at 100 {
>> cell-index = <1>;
>> regs = <0x100 0x100>;
>> }
>> }
>> multifunction at 1 {
>> #size-cells = <1>;
>> #address-cells = <1>;
>> ranges = <0 0xe10000000 0x1000>;
>> i2c at 0 {
>> cell-index = <0>;
>> regs = <0 0x100>;
>> }
>> i2c at 100 {
>> cell-index = <1>;
>> regs = <0x100 0x100>;
>> }
>> }
>
> What resources are being shared in this example? Each I2C device has its own
> address ranges. I don't see how cell-index provides any useful info here.
As I said; *assume* that the i2c devices have shared resources. I
didn't explicitly show them in the example, but assume that there are
shared registers in the multifunction nodes.
cell-index provides details about which bits in the shared registers
belong to the device, but since there are 2 identical multifunction
devices in the system there are 2 sets of shared regs. You cannot now
use the values 0, 1, 2 and 3 for each cell index because '2' and '3'
have no valid meaning on how to reference the shared resource. So,
cell-index isn't useful for enumerating the i2c busses at the system
level.
Cheers,
g.
--
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
More information about the Linuxppc-dev
mailing list