I2C2 during boot

Hi all,

BeagleBoard -xM A2
Ubuntu 10.10
2.6.35.6-15

We're using the I2C, bus #2 to talk to some external chips via P9, the
expansion bus.

I've noticed:
During boot a read request to 0x50 is always automatically generated
by the BB. The i2c clock is 100kHz. This is not our doing.

Why 0x50(read)?
Why 100Khz clock?

When we use the bus using the supported methods (whatever i2c-tools
use), the clock speed magically changes to ~400kHz.

See pics at (notes below):
http://www.dropbox.com/gallery/1861361/1/bb?h=7cc2f9

The above is not causing any problems. I'm just trying to understand
what's happening.

Can we set the bus speed?

What else can we twiddle?

Links to docs appreciated.

Best regards,

Chris

**About the images:
The top trace is interpreted data, the next 2 traces are the i2c lines
from P9 (SDA, SCK).
Clock period is displayed in the "Interval A->B" section on the bottom
of each window.

This is the UBoot reading the board ID of the expansion cards to determine the proper setting of the signals on the expansion headers to match those required by the expansion card connected. You can see this in the UBoot message on bootup.

Gerald

Thanks Gerald.

Where might I look for the clock configuration (or other goodies)?

-Chris

I believe it should be found in the uboot code. There used to be a command that let you set the speed from Uboot, but it seems to keep changing. We are getting ready to hopefully release a new Uboot soon and I hope that one has the ability to set it in there.

As to the kernel, I will defer to others to comment on that. As I am the only HW guy on Beagle and there are thousands of SW people out there, I will not try to take their jobs and leave the work for them! Besides, I don’t know the answer to that one!

Gerald

Thanks Gerald.

Where might I look for the clock configuration (or other goodies)?

For U-Boot have a look to e.g.

http://git.denx.de/cgi-bin/gitweb.cgi?p=u-boot.git;a=blob;f=board/ti/beagle/beagle.c;h=c066d6ef52ba6ed7cd26babba65b6ff2c3784d60;hb=HEAD#l118

Best regards

Dirk

Hi all,

BeagleBoard -xM A2
Ubuntu 10.10
2.6.35.6-15

We're using the I2C, bus #2 to talk to some external chips via P9, the
expansion bus.

I've noticed:
During boot a read request to 0x50 is always automatically generated
by the BB. The i2c clock is 100kHz. This is not our doing.

It's set in: arch/arm/mach-omap2/board-omap3beagle.c

mainline example:
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=arch/arm/mach-omap2/board-omap3beagle.c;h=46d814ab5656c078e6fad0a013c2ce8c39e312e5;hb=HEAD#l476

However, your running a kernel that has a patch on top of that..

http://rcn-ee.net/deb/maverick/v2.6.35.6-l5/patch-2.6.35.6-l5.diff.gz

Why 0x50(read)?
Why 100Khz clock?

When we use the bus using the supported methods (whatever i2c-tools
use), the clock speed magically changes to ~400kHz.

Bus 2 (on expansion port) is:

+omap_register_i2c_bus(2, 400, NULL, 0);

So 400kHz..

Bus 3 (on hdmi connector) is;

+omap_register_i2c_bus(3, 100, beagle_i2c_eeprom,
ARRAY_SIZE(beagle_i2c_eeprom));

So 100kHz, next looking at "beagle_i2c_eeprom"

we see:

+static struct i2c_board_info __initdata beagle_i2c_eeprom[] = {
+ {
+ I2C_BOARD_INFO("eeprom", 0x50),
+ },
+};

There's the 0x50 address you see called, in the log... (it's the same
address you'd see to pul the edid info from a monitor..)

Regards,

Thanks Robert, Dirk and Gerald,

This should give us enough to chew on for the moment.

-Chris