Skip to contentSkip to conversation

i2c -dev and i2c bus driver

lm-sensors Howard Wang 2 participants 10 messages Nov 3, 2005 – Nov 11, 2005

lore
Share & tools
lore
#0 lore raw

Hi All,

I have got a question about i2c:

is it possible for one i2c bus driver to be used for two i2c busses ? if yes, then how ?

currently I am using scx200_i2c bus driver and i2c-dev device driver, it can only detect one bus. the i2c device is microchip 24C04.

thanks for the help.

howard

#1 lore raw
Quoted 6 lines · Howard Wang

Hi All,

I have got a question about i2c:

is it possible for one i2c bus driver to be used for two i2c busses ? if yes, then how ?

Yes, all you need to register it to the subsystem. (They can share common functions). Please have a look to i2c-nvidia.c If you have more questions, just write.

Thanks,

Regards
Rudolf

#2 lore raw
In reply to Howard Wang
Quoted 3 lines

Yes, all you need to register it to the subsystem. (They can share common functions). Please have a look to i2c-nvidia.c If you have more questions, just write.

I mean i2c-nforce2.c
Sorry,
Rudolf

#3 lore raw
In reply to Howard Wang

appreciate your help. the i2c bus driver of my system is sc1200 from AMD, there is i2c bus driver scx200_i2c, I just wonder whether this driver supports two buses, currently it only talks to one bus on my system. I dont know how I can make it to talk to the second bus.

regards

howard

-----Original Message-----
From: Rudolf Marek [mailto:[email protected]]
Sent: Fri 11/4/2005 5:55 PM
To: Howard Wang
Cc: [email protected]
Subject: Re: [lm-sensors] i2c -dev and i2c bus driver

Quoted 2 lines

Yes, all you need to register it to the subsystem. (They can share common functions). Please have a look to i2c-nvidia.c If you have more questions, just write.

I mean i2c-nforce2.c
Sorry,
Rudolf

#4 lore raw
In reply to Howard Wang
Quoted 4 lines · Howard Wang

appreciate your help. the i2c bus driver of my system is sc1200 from AMD, there is i2c bus driver scx200_i2c, I just wonder whether this driver supports two buses, currently it only talks to one bus on my system. I dont know how I can make it to talk to the second bus.

Well I dont know the architecture (and today have no time to look deeper) but I can see (in kernel 2.6.14) second i2c driver:

scx200_acb.c
scx200_i2c.c

Maybe it is what you want?

Regards
Rudolf

#5 lore raw
In reply to Howard Wang

-----Original Message-----
From: Howard Wang
Sent: Mon 11/7/2005 12:31 PM
To: [email protected]
Cc:
Subject: RE: [lm-sensors] i2c -dev and i2c bus driver
Hi,

Well I dont know the architecture (and today have no time to look deeper) but I can see (in kernel 2.6.14) second i2c driver:

scx200_acb.c
scx200_i2c.c

Maybe it is what you want?

yes, that's what I loaded after booing and using i2c-dev driver to talk to our i2c device, for the devices connnected to the ACB 2 of superIO from the microporcessor, every thing works. however, for the device, connected to ACB 1 of superIO, I won't be able to talk to them.

any suggestions.

really appreciate your help.

howard

Regards
Rudolf

#6 lore raw
In reply to Howard Wang
Quoted 5 lines

yes, that's what I loaded after booing and using i2c-dev driver to talk to our i2c device, for the devices connnected to the ACB 2 of superIO from the microporcessor, every thing works. however, for the device, connected to ACB 1 of superIO, I won't be able to talk to them.

Hmm bad is that I dont know the hardware.
But from the driver i can see:

         for (i = 0; i < MAX_DEVICES; ++i) {
                if (base[i] > 0)
                        rc = scx200_acb_create(base[i], i);
        }

And there are two base defined.
So this could create two busses.

When you modprobe i2c-dev and the scx driver you should see in

i2cdump -l

Listed two ACB busses
Do you see them?

If so I would suggest:

1) plug your device to ACB 2 where it works
do: i2cdetect (put acb2 bus number here)

       i2cdump (put acb2 bus number here) 0xyourdeviceaddr

2) repeat with plugged to ACB1

Please post results here. Also, please point me to some documenattion of ACCESS bus... I'm really very short with my time...

Thanks
Regards
Rudolf

#7 lore raw
In reply to Howard Wang

I sent you an email with the sc1200 datasheet attached, unfortunately, it bounced back due to large

size. since I don't have access to the target today, I just briefly reply answer your questions and

tomorrow I'll try to post more detailed info from the target as well as the datasheet.

>Hmm bad is that I dont know the hardware.
But from the driver i can see:
for (i = 0; i < MAX_DEVICES; ++i) {
if (base[i] > 0)
rc = scx200_acb_create(base[i], i);
}
And there are two base defined.
So this could create two busses.
When you modprobe i2c-dev and the scx driver you should see in
i2cdump -l

Listed two ACB busses
Do you see them?

No. I only saw one: i2c-0 with the bus type of unknown. but this doesn't matter. the smbus just works fine

with i2cdump 0 0x50 and 0x51.

i2cdump -l

Installed I2C busses:

i2c-0 unknown netSemi sc1200

>
If so I would suggest:
1) plug your device to ACB 2 where it works
do: i2cdetect (put acb2 bus number here)
i2cdump (put acb2 bus number here) 0xyourdeviceaddr

this works fine. no problem.

>
2) repeat with plugged to ACB1

i2cdump 1 0x57 ( a same type of device is connected to bus 1 with A0,A1,A2 pulled to high )

return with open error. no such device. for i2c-1. ( the i2c node: 0 to32 under /dev/ do exist).

Error: Could not open file '/dev/i2c-1': No such device

one question for you: if let's say:

the acb1 has been configured to use different protocol other than acb2, how can I find out and reconfigure

the acb1 to be the same as acb2 ?

appreciated your help.

howard

#8 lore raw
In reply to Howard Wang

Hi Rudolf,

I got the scx200_i2c driver working on the second i2c bus, which is acb1, however, when I use i2cset and i2cdump, it seems that only 128 bytes is accessible, it repeats after 128 bytes, while my device is:
microchip 24AA128 which is 128K bits (16K bytes). see attached log:
in fact, I just set the first 10 bytes and it repeats after 128 bytes.

any suggestions ?

thanks

howard

*** ***
/usr/test # i2cdump -y 0 0x57
No size specified (using byte-data access)

     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f    0123456789abcdef
00: 43 69 72 ff 45 45 50 52 4f 4d ff ff ff ff ff 42    Cir.EEPROM.....B
10: ff ff ff ff ff ff 01 ff ff ff ff ff ff ff ff ff    ......?.........
20: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
30: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
40: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
50: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
60: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
70: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
80: 43 69 72 ff 45 45 50 52 4f 4d ff ff ff ff ff 42    Cir.EEPROM.....B
90: ff ff ff ff ff ff 01 ff ff ff ff ff ff ff ff ff    ......?.........
a0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
b0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
c0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
d0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
e0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
f0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................

*** ***

-----Original Message-----
From: Rudolf Marek [mailto:[email protected]]
Sent: Tue 11/8/2005 10:47 AM
To: Howard Wang
Cc: [email protected]
Subject: Re: [lm-sensors] i2c -dev and i2c bus driver

Quoted 4 lines

yes, that's what I loaded after booing and using i2c-dev driver to talk to our i2c device, for the devices connnected to the ACB 2 of superIO from the microporcessor, every thing works. however, for the device, connected to ACB 1 of superIO, I won't be able to talk to them.

Hmm bad is that I dont know the hardware.
But from the driver i can see:

         for (i = 0; i < MAX_DEVICES; ++i) {
                if (base[i] > 0)
                        rc = scx200_acb_create(base[i], i);
        }

And there are two base defined.
So this could create two busses.

When you modprobe i2c-dev and the scx driver you should see in

i2cdump -l

Listed two ACB busses
Do you see them?

If so I would suggest:

1) plug your device to ACB 2 where it works
do: i2cdetect (put acb2 bus number here)

       i2cdump (put acb2 bus number here) 0xyourdeviceaddr

2) repeat with plugged to ACB1

Please post results here. Also, please point me to some documenattion of ACCESS bus... I'm really very short with my time...

Thanks
Regards
Rudolf

#9 lore raw
In reply to Howard Wang
Quoted 9 lines · Howard Wang

Hi Rudolf,

I got the scx200_i2c driver working on the second i2c bus, which is acb1, however, when I use i2cset and i2cdump, it seems that only 128 bytes is accessible, it repeats after 128 bytes, while my device is:
microchip 24AA128 which is 128K bits (16K bytes). see attached log:
in fact, I just set the first 10 bytes and it repeats after 128 bytes.

any suggestions ?

I'm in hury, must go back to my hometown, so just quick note before I leave:
Perhaps it uses two bytes addressing. You will need special driver for it

Hoever some driver that works for 16KBit eeproms is here. (somewhere in this thread)
http://lists.lm-sensors.org/pipermail/lm-sensors/2005-July/012987.html

Maybe you can take a look and extend it to your needs. I can take a look ttoday in evening or at weekend.

Regards
Rudolf