Welcome, Guest

Author Topic: U-Boot I2C EEPROM  (Read 4858 times)

croemmich

  • Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
U-Boot I2C EEPROM
« on: March 27, 2014, 07:29:55 AM »
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

  • Newbie
  • *
  • Posts: 5
  • Karma: +2/-0
Re: U-Boot I2C EEPROM
« Reply #1 on: March 29, 2014, 12:16:44 AM »
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

  • Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
Re: U-Boot I2C EEPROM
« Reply #2 on: March 29, 2014, 12:26:15 AM »
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.