Configuration of i2c on 8248 (cpm2) help

Alan Bennett alan at akb.net
Sat Nov 17 05:44:37 EST 2007


I'm working to adapt some work by Jochen Friedrich to support CPM2 i2c
devices.  It appears I have the bus loaded and think I am configuring
it properly, but my results tell me different.  I see no messages when
I attach a i2c monitor after u-boot loads.

Can anyone spot what is going wrong based on the following information
and the resulting output?  Does this look proper for a successful
configuration of the cpm2 i2c bus?
  i2c-cpm: iip e0008afc, dp_addr 0x240
  i2c-cpm: iic_tbase 576, iic_rbase 608

Any insight would be greatly appreciated.

-Alan

My Device tree entry:
               i2c at 11860 {
                   compatible = "fsl,mpc8248-i2c",
                        "fsl,cpm2-i2c",
                        "fsl,cpm-i2c";
                   reg = <11860 20 8afc 30>;
                     interrupts = <1 8>;
                   interrupt-parent = <&PIC>;
                   fsl,cpm-command = <29600000>;
               };
... and then later:
			muram at 0 {
				#address-cells = <1>;
				#size-cells = <1>;
				ranges = <0 0 10000>;

				data at 0 {
					compatible = "fsl,cpm-muram-data";
					reg = <80 1f80 9800 800>;
				};
			};
dump of 0xe0008afc (my immr_base=0xe0000000) at boot
    e0008afc : 02600240 10100201 00000000 00000000
    e0008b0c : 02600000 00000000 00000000 00000000
    e0008b1c : 02400000 00000000 78c7ebaf bdefeab1

Probe debug results:
  i2c-cpm: cpm_iic_init()
  i2c-cpm: iip e0008afc, dp_addr 0x240
  i2c-cpm: iic_tbase 576, iic_rbase 608

Log after modprobe:
  modprobe i2c-dev
   Jan  1 00:08:02 192 kernel: i2c /dev entries driver
   Jan  1 00:08:02 192 kernel: i2c-core: driver [dev_driver] registered
   Jan  1 00:08:02 192 kernel: i2c-dev: adapter [i2c-cpm] registered as minor 0

Log entries after trying an i2cset:  (NOTE: sometimes it hangs doing this)
  i2cset 0 0x41 0x1 0xff b
	cpm_xfer:478
	cpm_parse_message:329
	kernel: i2c-adapter i2c-0: ioctl, cmd=0x720, arg=0xbfecaa0c
	kernel: i2c-adapter i2c-0: master_xfer[0] W, addr=0x41, len2
	kernel: cpm_xfer:478
	kernel: i2c-adapter i2c-0: i2c-algo-cpm.o: R: 0 T: 0
	kernel: cpm_parse_message:329
	kernel: i2c-adapter i2c-0: cpm_iic_write(abyte=0x82)
	kernel: i2c-adapter i2c-0: tx sc 0 bc00
	kernel: i2c-adapter i2c-0: test ready.
	kernel: i2c-adapter i2c-0: not ready.
	cpm_xfer:478
	cpm_parse_message:329
	cpm_parse_message:329
	kernel: i2c-adapter i2c-0: force_close()
	kernel: i2c-adapter i2c-0: IIC read: timeout!
	kernel: i2c-adapter i2c-0: ioctl, cmd=0x720, arg=0xbfecaa0c
	kernel: i2c-adapter i2c-0: master_xfer[0] W, addr=0x41, len1
	kernel: i2c-adapter i2c-0: master_xfer[1] R, addr=0x41, len1
	kernel: cpm_xfer:478
	kernel: i2c-adapter i2c-0: i2c-algo-cpm.o: R: 0 T: 0
	kernel: cpm_parse_message:329
	kernel: i2c-adapter i2c-0: cpm_iic_write(abyte=0x82)
	kernel: i2c-adapter i2c-0: tx sc 0 9400
	kernel: i2c-adapter i2c-0: i2c-algo-cpm.o: R: 0 T: 1
	kernel: cpm_parse_message:329
	kernel: i2c-adapter i2c-0: cpm_iic_read(abyte=0x83)
	kernel: i2c-adapter i2c-0: test ready.
	kernel: i2c-adapter i2c-0: not ready.
	kernel: i2c-adapter i2c-0: force_close()
	kernel: i2c-adapter i2c-0: IIC read: timeout!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: i2c-cpm.c
Type: text/x-csrc
Size: 17703 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20071116/943c6ace/attachment.c>


More information about the Linuxppc-dev mailing list