Subject: Re: mpc8270 : i2c support

From: Heiko Schocher <[email-masked]>
Date: Wed, 03 May 2006 22:11:17 +0200

Hello jfaslist,

on Wed, 03 May 2006 14:33:37 jfaslist wrote:
> But when we try to access i2c devices from under linux 2.6 using 
> the /dev/i2c-0 special file we get an ENODEV on opening that 
> file. I think it is because we lack an adapter driver.
> 
> If I look in the official kernel, it looks like the adapter 
> driver for the mpc8270 i2c system is 
> ./drivers/i2c/busses/i2c-mpc.c. Is this correct?

No. It is for:
MODULE_DESCRIPTION
("I2C-Bus adapter for MPC107 bridge and MPC824x/85xx/52xx processors");

> In DENX ELDK there is also a i2c-mpc8260.c, but we couldn't get 
> that to work either.

OK, this was the right driver ... but it was tested on a MPC826x
Processor.

Hmmm.... I think there are differences in the memory map between
MPC826x and MPC827x ... can you try following Hack in
include/asm-ppc/cpm_8260.h?

-#define PROFF_I2C       ((16 * 1024) - 64)
+#define PROFF_I2C       ((8 * 1024) - 64)

[If it solves the problem, we must do this on a better way ;-)]

I think i had the same problem with a 2.4er Kernel ... Yes,
this is in my queue, but not merged in our official 2.4er Tree ...

Maybe you have to set other Portsettings in
drivers/i2c/busses/i2c-cpm2.c cpm2_iic_init() ... ?

> What should I do to be able to access i2c devices using the 
> /dev/i2c-0 file? I feel I need to modify the i2c adapter driver 
> to follow the driver model, but in what ways?

Bring up the driver running, and then read:
Documentation/i2c/dev-interface.

Best regards
Heiko