[U-Boot] [PATCHv4] Retrieve MAC address from EEPROM

Igor Grinberg grinberg at compulab.co.il
Mon Nov 28 13:19:25 CET 2016


Added Nikita to Cc.

On 11/28/16 12:45, Olliver Schinagl wrote:
> On 28-11-16 10:13, Igor Grinberg wrote:
>> Hi Olliver,
>>
>> On 11/25/16 17:30, Olliver Schinagl wrote:
>>
>> [...]
>>
>>> The current idea of the eeprom layout, is to skip the first 8 bytes, so that
>>> other information can be stored there if needed, for example a header with some
>>> magic to identify the EEPROM. Or equivalent purposes.
>>>
>>> After those 8 bytes the MAC address follows the first macaddress. The macaddress
>>> is appended by a CRC8 byte and then padded to make for nice 8 bytes. Following
>>> the first macaddress one can store a second, or a third etc etc mac address.
>>>
>>> The CRC8 is optional (via a define) but is strongly recommended to have. It
>>> helps preventing user error and more importantly, checks if the bytes read are
>>> actually a user inserted address. E.g. only writing 1 macaddress into the eeprom
>>> but trying to consume 2.
>> While reading the above, I'm wondering, have you considered the eeprom layout
>> feature that we have in: common/eeprom/... ?
> Last year, when starting this patch series, this did not really exist in so far (iirc).
>>
>> The layout feature was actually designed for these tasks, but in a more generic
>> way then just Ethernet MAC address.
> I did see it and I was quite excited. I think a follow up patch should switch over.

Sounds great!

> I did not yet use the new eeprom layout thing as I am hoping for Maxime's patches to
> land first, where he makes the whole eeprom interfacing more generic.

That's interesting. I haven't been around for some time, are there any public patches
already? If so, can you please point where should I look at?

>>
>> What do you think?
> I'll have to look at the eeprom layout feature a little more in depth, the one thing
> that was a little 'annoying' (from a short quick glance) was that the layout was
> jumping around a bit (eth0, eth1, something else, eth2, eth3). But yes,
> I was quite intrigued herein.

Ohh.. you mean compulab layout? I see.
Compulab layout is already out there for 6 years in various devices.
It has gone through several versions, so to be backward compatible (and currently it is,
besides the legacy version), it had to do the "jumping" thing.
It is only last year Nikita has started to facilitate it a bit in upstream.
Anyway, the point is that eeprom layout in u-boot/common/eeprom/... should be generic
as a framework and any vendor/board can define their own layout in vendor/board location.
We are also going to extend the layout framework to provide more in-U-Boot APIs.

-- 
Regards,
Igor.


More information about the U-Boot mailing list