* MPC5200 (Board: PM520) I2C Problem
@ 2006-10-19 15:05 RPo
2006-10-27 7:29 ` Andrey Volkov
0 siblings, 1 reply; 4+ messages in thread
From: RPo @ 2006-10-19 15:05 UTC (permalink / raw)
To: 'linuxppc-embedded@ozlabs.org'
Hi,
I'm currently using the MPC5200 based board "PM520" and
want to access the I2C bus. To do so, I attached a PCF8574P
to the bus. But I was not successful in setting the outputs
of this IC.
Here is the code with which I tried to access the bus:
8<==================================================
int i2c = 0, i = 0xfffffff;
i2c = open("/dev/i2c-0",O_RDWR);
if(i2c > 0)
RT_TRACE(printf("I2C opened successfully.\n"));
else
RT_TRACE(printf("Error: I2C could not be opened.\n"));
ioctl(i2c, I2C_SLAVE, 0x46);
write(i2c, &i, 1);
8<==================================================
The open() and ioctl() calls are successful (checked with
strace) but the write() call always returns -1 and an
EREMOTEIO error. The device nodes have been created this way:
8<==================================================
mknod /dev/i2c-0 c 89 0
mknod /dev/i2c-1 c 89 1
chmod 666 /dev/i2c-*
8<==================================================
So here is my configuration:
Linux 2.4.25 (ELDK 3.1.1-2005-06-07)
The I2C modules were compiled after I had made some changes
to the i2c-pm520.c file in the kernel-tree:
8<================== ORIGINAL ======================
/* #define MPC5xxx_I2C1_ENABLE 0 */ /* Disabled */
8<================== ORIGINAL ======================
8<================== MODIFIED ======================
#define MPC5xxx_I2C1_ENABLE 1 /* Enabled */
8<================== MODIFIED ======================
I was unsure about the bus my code uses and so I decided to
enable both busses. These are the printks I get, when I load
the modules:
8<==================================================
# /ftp/sbin/insmod ./i2c-core.o
i2c-core.o: i2c core module version 2.6.1 (20010830)
# /ftp/sbin/insmod ./i2c-proc.o
i2c-proc.o version 2.6.1 (20010830)
# /ftp/sbin/insmod ./i2c-dev.o
i2c-dev.o: i2c /dev entries driver module version 2.6.1 (20010830)
# /ftp/sbin/insmod ./i2c-algo-mpc5xxx.o speed=85
# /ftp/sbin/insmod ./i2c-pm520.o
i2c-algo-5xxx.o: scanning bus PM520 I2C module #1 interface...
............................................................................
....
................................................
i2c-pm520.o: I2C module #1 installed
i2c-algo-5xxx.o: scanning bus PM520 I2C module #2 interface...
............................................................................
....
.(0x51)......(0x58)(0x59)(0x5a)(0x5b)(0x5c)(0x5d)(0x5e)(0x5f)...............
....
............(0x7f)
i2c-pm520.o: I2C module #2 installed
8<==================================================
So, what are these identifiers on I2C module #2 interface?
I can neither find them in the documentation of the EEPROM
nor the one of the realtime clock. write() calls to these
IDs are succesful, but it seems like nothing happens. The
same is for the other bus (module #1 interface).
Has anyone an idea or experience with I2C bus on the MPC5200?
Best regards and thanks for reading,
Rainer
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: MPC5200 (Board: PM520) I2C Problem
2006-10-19 15:05 MPC5200 (Board: PM520) I2C Problem RPo
@ 2006-10-27 7:29 ` Andrey Volkov
2006-10-27 11:15 ` Roman Fietze
0 siblings, 1 reply; 4+ messages in thread
From: Andrey Volkov @ 2006-10-27 7:29 UTC (permalink / raw)
To: RPo; +Cc: 'linuxppc-embedded@ozlabs.org'
Hello Rainer
RPo wrote:
> Hi,
>
> I'm currently using the MPC5200 based board "PM520" and
> want to access the I2C bus. To do so, I attached a PCF8574P
> to the bus. But I was not successful in setting the outputs
> of this IC.
<...snip..>
Revision of MPC5200? (third string engraved on the MPC)
If L25R then check this doco:
http://www.freescale.com/files/32bit/doc/errata/MPC5200E.pdf
(if be short - I2C didn't work on this revision chips)
--
Regards
Andrey Volkov
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: MPC5200 (Board: PM520) I2C Problem
2006-10-27 7:29 ` Andrey Volkov
@ 2006-10-27 11:15 ` Roman Fietze
2006-10-27 12:44 ` Andrey Volkov
0 siblings, 1 reply; 4+ messages in thread
From: Roman Fietze @ 2006-10-27 11:15 UTC (permalink / raw)
To: linuxppc-embedded
[-- Attachment #1: Type: text/plain, Size: 818 bytes --]
Hello,
On Friday 27 October 2006 09:29, Andrey Volkov wrote:
> Revision of MPC5200? (third string engraved on the MPC)
> If L25R then check this doco:
> http://www.freescale.com/files/32bit/doc/errata/MPC5200E.pdf
> (if be short - I2C didn't work on this revision chips)
We have an "MPC5200CBV400 L25R Rev 2" on our boards, and we
successfully drive a PCF8563 real time clock and an UDA1380 Codec on
the same line.
The problems described in the errata are an arbitration loss problem
and, depending on teh chp's Rev, a clock noise problem.
Probably your problem is related to the connected I2C client?
Roman
--
Roman Fietze Telemotive AG Büro Mühlhausen
Breitwiesen 73347 Mühlhausen
Tel.: +49(0)7335/18493-45 http://www.telemotive.de
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: MPC5200 (Board: PM520) I2C Problem
2006-10-27 11:15 ` Roman Fietze
@ 2006-10-27 12:44 ` Andrey Volkov
0 siblings, 0 replies; 4+ messages in thread
From: Andrey Volkov @ 2006-10-27 12:44 UTC (permalink / raw)
To: Roman Fietze; +Cc: linuxppc-embedded
Hi,
Roman Fietze wrote:
> Hello,
>
> On Friday 27 October 2006 09:29, Andrey Volkov wrote:
>
>> Revision of MPC5200? (third string engraved on the MPC)
>> If L25R then check this doco:
>> http://www.freescale.com/files/32bit/doc/errata/MPC5200E.pdf
>> (if be short - I2C didn't work on this revision chips)
>
> We have an "MPC5200CBV400 L25R Rev 2" on our boards, and we
> successfully drive a PCF8563 real time clock and an UDA1380 Codec on
> the same line.
>
> The problems described in the errata are an arbitration loss problem
> and, depending on teh chp's Rev, a clock noise problem.
>
> Probably your problem is related to the connected I2C client?
Problem was not in noise. Chips of this rev. _sometime_ didn't
generate clock in ACK/NAK phase. Such behavior acceptable for
a RTC (you could reread clock, after timeout), but for eeprom - not.
--
Regards
Andrey
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2006-10-27 12:45 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-19 15:05 MPC5200 (Board: PM520) I2C Problem RPo
2006-10-27 7:29 ` Andrey Volkov
2006-10-27 11:15 ` Roman Fietze
2006-10-27 12:44 ` Andrey Volkov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).