linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* reading i2c eeprom early in boot
@ 2010-06-24 10:19 Karl Hiramoto
       [not found] ` <4C23311B.9090803-CSx8xFHsqFdg9hUCZPvPmw@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Karl Hiramoto @ 2010-06-24 10:19 UTC (permalink / raw)
  To: linux-i2c-u79uwXL29TY76Z2rM5mHXA


Hi,

My goal is to assign a MAC address stored in a I2C EEPROM to a ethernet device on an ARM  SOC so I can boot via NFS.  Reading and writing this address  works with the at24 driver after its loaded.

Currently the i2c __init call is after the ethernet devices __init, so this makes using the I2C drivers not possible, as nothing is instantiated.

So to me it looks like i have two options.

1.  Reorder the init calls.   I'd prefer not doing this for fear of  breaking something else.

2.  The I2C bus on my board is just using GPIO pins.     I could bit bang these pins before the i2c drivers are loaded, in the arch initcalls.   Are there any functions in the kernel to do this easily?  Like optimally some libary function in the kernel to do something like:

i2c_gpio_read(int sda_pin, int scl_pin, int i2c_address, int len, void *data)

This library function may need to  have to have a spinlock or mutex to avoid conflicts on these pins.



Is there  a better solution?

--
karl

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-06-25  7:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-24 10:19 reading i2c eeprom early in boot Karl Hiramoto
     [not found] ` <4C23311B.9090803-CSx8xFHsqFdg9hUCZPvPmw@public.gmane.org>
2010-06-25  7:49   ` Jean Delvare

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).