U-Boot I2C EEPROM

Started by croemmich, March 27, 2014, 07:29:55 AM

Previous topic - Next topic

croemmich

Hello,

First off, let me apologize for not really knowing what I am doing... this is my first attempt into embedded systems.

I have the A10-OLinuXino-LIME and I'm having issues reading/writing the EEPROM via the i2c command in U-Boot.

No matter what I do, I get "Error writing the chip" or "Error reading the chip"

I've build U-Boot from sources using the instructions here:
https://olimex.wordpress.com/2014/01/15/building-debian-linux-bootable-sd-card-with-hardware-accelerated-video-decoding-and-kernel-3-4-for-a10-olinuxino-lime/

I've also tried modifying the U-Boot configuration for saving the environment to EEPROM, which also doesn't work:
https://github.com/Flowcore/u-boot-sunxi/commit/51f81e6a6a1fead10a3fa2a2e874f67327ea5466

Thoughts on what I'm doing wrong?

Thanks!

flobber

I've not used the sunxi-uboot (yet), but from the
schematics it looks like the (IMHO superfluous)
EEPROM is on the second I2C bus.  Maybe uboot
only handles the first bus, the one where the
power management IC is connected to.

Anyway, usually the memory assigned to the env
is much bigger, often two 64kByte blocks.  You
have to be very careful with the tiny 2kByte
EEPROM...

croemmich

Thanks flobber!

I was able to verify in linux that the EEPROM is indeed on the second bus. After a look in to the source of the sunxi i2c driver for u-boot (which is rather incomplete), I think you are correct in that only the first bus is used. I might try to hack on it a bit to try to get it to work.

Thanks for the heads up on the env size. All I really want to store in the EEPROM is a serial number and mac address. I think I can make a u-boot script that can populate those two environment vars.