* Accessing EEPROM from Linux driver
@ 2012-01-24 9:51 Yegor Yefremov
[not found] ` <CAGm1_ku3N0ksJ4USt9Rae=Yo3xcTFX=dLVh6=YMkFjUaLABu-A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
0 siblings, 1 reply; 8+ messages in thread
From: Yegor Yefremov @ 2012-01-24 9:51 UTC (permalink / raw)
To: Linux I2C; +Cc: Wolfram Sang
I've an external i2c attached EEPROM, where I hold the MAC addresses
for 3 interfaces including WLAN. My SoC is am3517 from TI. I found
EEPROM driver under drivers/misc/eeprom/at24.c I can access EEPROM via
sysfs from userland. What were the appropriate method of accessing
EEPROM from a network driver? AFAIK no functions were exported from
eeprom.c.
Regards,
Yegor
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Accessing EEPROM from Linux driver
[not found] ` <CAGm1_ku3N0ksJ4USt9Rae=Yo3xcTFX=dLVh6=YMkFjUaLABu-A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2012-01-24 9:54 ` Bill Gatliff
2012-01-24 10:06 ` Wolfram Sang
1 sibling, 0 replies; 8+ messages in thread
From: Bill Gatliff @ 2012-01-24 9:54 UTC (permalink / raw)
To: Yegor Yefremov; +Cc: Linux I2C, Wolfram Sang
Yegor:
On Tue, Jan 24, 2012 at 10:51 AM, Yegor Yefremov
<yegorslists-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:
> What were the appropriate method of accessing
> EEPROM from a network driver? AFAIK no functions were exported from
> eeprom.c.
You probably want to read those values in userspace, and then stuff
them back into the ethernet device via ifconfig or similar when you
bring the interface up. Then you can leave both drivers as-is.
b.g.
--
Bill Gatliff
bgat-uPd5UNENI//N9NzbbXoYwQ@public.gmane.org
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Accessing EEPROM from Linux driver
[not found] ` <CAGm1_ku3N0ksJ4USt9Rae=Yo3xcTFX=dLVh6=YMkFjUaLABu-A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-01-24 9:54 ` Bill Gatliff
@ 2012-01-24 10:06 ` Wolfram Sang
[not found] ` <20120124100636.GB2609-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
1 sibling, 1 reply; 8+ messages in thread
From: Wolfram Sang @ 2012-01-24 10:06 UTC (permalink / raw)
To: Yegor Yefremov; +Cc: Linux I2C
[-- Attachment #1: Type: text/plain, Size: 720 bytes --]
> sysfs from userland. What were the appropriate method of accessing
> EEPROM from a network driver? AFAIK no functions were exported from
> eeprom.c.
Please state always which version you are using. There is code exactly
for your use case in the driver since ~2.6.30 (and clearly described as
such).
437 /*
438 * This lets other kernel code access the eeprom data. For example, it
439 * might hold a board's Ethernet address, or board-specific calibration
440 * data generated on the manufacturing floor.
441 */
Regards,
Wolfram
--
Pengutronix e.K. | Wolfram Sang |
Industrial Linux Solutions | http://www.pengutronix.de/ |
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Accessing EEPROM from Linux driver
[not found] ` <20120124100636.GB2609-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
@ 2012-01-24 10:13 ` Yegor Yefremov
[not found] ` <CAGm1_ksgrtyAmo73f-GCr_ZH=8i8LxbwFpMH81U2STQzmT9GYQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
0 siblings, 1 reply; 8+ messages in thread
From: Yegor Yefremov @ 2012-01-24 10:13 UTC (permalink / raw)
To: Wolfram Sang; +Cc: Linux I2C
On Tue, Jan 24, 2012 at 11:06 AM, Wolfram Sang <w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org> wrote:
>
>> sysfs from userland. What were the appropriate method of accessing
>> EEPROM from a network driver? AFAIK no functions were exported from
>> eeprom.c.
>
> Please state always which version you are using. There is code exactly
> for your use case in the driver since ~2.6.30 (and clearly described as
> such).
>
> 437 /*
> 438 * This lets other kernel code access the eeprom data. For example, it
> 439 * might hold a board's Ethernet address, or board-specific calibration
> 440 * data generated on the manufacturing floor.
> 441 */
Thanks. My bad, I overlooked this.
Regards,
Yegor
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Accessing EEPROM from Linux driver
[not found] ` <CAGm1_ksgrtyAmo73f-GCr_ZH=8i8LxbwFpMH81U2STQzmT9GYQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2012-01-24 11:03 ` Yegor Yefremov
[not found] ` <CAGm1_kugwA-rWXmCNNcxRc4XZ5u-2N8Rwf+LBaoRrOgBWMTbDg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
0 siblings, 1 reply; 8+ messages in thread
From: Yegor Yefremov @ 2012-01-24 11:03 UTC (permalink / raw)
To: Wolfram Sang; +Cc: Linux I2C
On Tue, Jan 24, 2012 at 11:13 AM, Yegor Yefremov
<yegorslists-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:
> On Tue, Jan 24, 2012 at 11:06 AM, Wolfram Sang <w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org> wrote:
>>
>>> sysfs from userland. What were the appropriate method of accessing
>>> EEPROM from a network driver? AFAIK no functions were exported from
>>> eeprom.c.
>>
>> Please state always which version you are using. There is code exactly
>> for your use case in the driver since ~2.6.30 (and clearly described as
>> such).
>>
>> 437 /*
>> 438 * This lets other kernel code access the eeprom data. For example, it
>> 439 * might hold a board's Ethernet address, or board-specific calibration
>> 440 * data generated on the manufacturing floor.
>> 441 */
>
> Thanks. My bad, I overlooked this.
Wolfram, do you have any example how to access at24_macc_read()? My
kernel is 2.6.37. Theres is a statement to export this code to the
kernel via chip.setup(), which appears to be NULL. What headers do I
need in the network driver?
Regards,
Yegor
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Accessing EEPROM from Linux driver
[not found] ` <CAGm1_kugwA-rWXmCNNcxRc4XZ5u-2N8Rwf+LBaoRrOgBWMTbDg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2012-01-24 11:13 ` Wolfram Sang
[not found] ` <20120124111320.GD2609-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
0 siblings, 1 reply; 8+ messages in thread
From: Wolfram Sang @ 2012-01-24 11:13 UTC (permalink / raw)
To: Yegor Yefremov; +Cc: Linux I2C
[-- Attachment #1: Type: text/plain, Size: 612 bytes --]
> Wolfram, do you have any example how to access at24_macc_read()? My
> kernel is 2.6.37. Theres is a statement to export this code to the
> kernel via chip.setup(), which appears to be NULL. What headers do I
> need in the network driver?
I haven't used it myself, but using LXR [1] you can check current users
of at24_platform_data and find users (davinci) using this feature.
[1] http://lxr.linux.no/#linux+v3.2.1/include/linux/i2c/at24.h
--
Pengutronix e.K. | Wolfram Sang |
Industrial Linux Solutions | http://www.pengutronix.de/ |
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Accessing EEPROM from Linux driver
[not found] ` <20120124111320.GD2609-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
@ 2012-01-25 11:19 ` Yegor Yefremov
2012-10-11 9:58 ` samir
0 siblings, 1 reply; 8+ messages in thread
From: Yegor Yefremov @ 2012-01-25 11:19 UTC (permalink / raw)
To: Wolfram Sang; +Cc: Linux I2C
On Tue, Jan 24, 2012 at 12:13 PM, Wolfram Sang <w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org> wrote:
>> Wolfram, do you have any example how to access at24_macc_read()? My
>> kernel is 2.6.37. Theres is a statement to export this code to the
>> kernel via chip.setup(), which appears to be NULL. What headers do I
>> need in the network driver?
>
> I haven't used it myself, but using LXR [1] you can check current users
> of at24_platform_data and find users (davinci) using this feature.
>
> [1] http://lxr.linux.no/#linux+v3.2.1/include/linux/i2c/at24.h
Thanks. It's working now. I was lucky to have DaVinci based EMAC in
am3517, so I only had to adjust the code on the platform side. The
driver itself was left untouched. For USB based NIC and WLAN I'll need
to get my hands on their drivers :-(
I submitted a patch to eeprom's documentation. At this point I have a
question? Are those TODO items still valid? At least in regards of
write capability? In 2.6.37 kernel I can write to EEPROM through sysfs
entry. Unfortunately I can't test any 3.x kernel because PSP for
am3517 is still not finished.
Regards,
Yegor
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Accessing EEPROM from Linux driver
2012-01-25 11:19 ` Yegor Yefremov
@ 2012-10-11 9:58 ` samir
0 siblings, 0 replies; 8+ messages in thread
From: samir @ 2012-10-11 9:58 UTC (permalink / raw)
To: linux-i2c-u79uwXL29TY76Z2rM5mHXA
Yegor Yefremov <yegorslists@...> writes:
Dear all,
I interest about at24_macc_read, but I don't how to call the function,
Could you give me some example,
thanks and regards.
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2012-10-11 9:58 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-24 9:51 Accessing EEPROM from Linux driver Yegor Yefremov
[not found] ` <CAGm1_ku3N0ksJ4USt9Rae=Yo3xcTFX=dLVh6=YMkFjUaLABu-A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-01-24 9:54 ` Bill Gatliff
2012-01-24 10:06 ` Wolfram Sang
[not found] ` <20120124100636.GB2609-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2012-01-24 10:13 ` Yegor Yefremov
[not found] ` <CAGm1_ksgrtyAmo73f-GCr_ZH=8i8LxbwFpMH81U2STQzmT9GYQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-01-24 11:03 ` Yegor Yefremov
[not found] ` <CAGm1_kugwA-rWXmCNNcxRc4XZ5u-2N8Rwf+LBaoRrOgBWMTbDg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-01-24 11:13 ` Wolfram Sang
[not found] ` <20120124111320.GD2609-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2012-01-25 11:19 ` Yegor Yefremov
2012-10-11 9:58 ` samir
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).