Skip to content

Retrieve MAC address from EEPROM

Tom Rini u-boot 1 version New

Get series with b4
b4 am 20170515124709.GY5701@bill-the-cat

Versions newest first

  1. v6 Latest6 of 28 patches 0 repliesNew

6 of 28 patches are in this archive. The cover letter announces 28.

Patches in v6 No applies recorded yet

#Subject and filesSizeRepliesApplied
3/28net: core: Add PHY_GIGE as a Kconfig symbol+0 -00 replies
8/28net: cosmetic: Do not use magic values for ARP_HLEN+0 -00 replies
9/28net: core: Sanitize get/set operations for enetaddr+0 -00 replies
11/28net: core: Add MAC address helper functions+0 -00 replies
14/28net: cosmetic: A MAC address is not limited to SROM+0 -02 replies
15/28net: core: Check return value of read_rom_hwaddr+0 -00 replies

Reviews trailers per patch

5 of 6 patches have a Reviewed-by or Acked-by.

PatchTom Rini
3/28R-b
8/28R-b
9/28R-b
11/28R-b
14/28
15/28R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v6 thread

Cover letter [U-Boot] [PATCHv6 00/28] Retrieve MAC address from EEPROM
Quoted 46 lines · Olliver Schinagl

Hey all,

Quoted 43 lines · Olliver Schinagl

This patch-series introduces methods to retrieve the MAC address from an onboard EEPROM. The series does a few small cleanups at the start, as either I ran into them while doing this series and fixed them along the way or actually depended on them.

A manufacturer wants to produce boards and may even have MAC addresses for boards. Maintaining unique environments on a per-board basis however is horrible. Also this data should be very persistent, and not easily deletable by simply wiping the environment or device tree. Finally there are chips available on the market with a pre-programmed MAC address chips (proms)
that a board manufacturer wants to use. Because of this, the MAC needs to be stored be able to read from such an 'external' source.

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 macaddress.

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.

These patches where tested on Olimex OLinuXino Lime1 (A10/A20), Lime2 (NAND and eMMC) and A20-OLinuXino-MICRO-4G variants and have been in use internally on our production systems since v2 of this patch set.

TODO in a follow up series:
* Replace the I2C specific read function to a generic function using Maxime Ripard's EEPROM uclass once merged.
* Upgrade to use the EERPOM layout functionality as suggested by Igor Grinberg
* Add EEPROM/Mac commands suggested by York Sun

The series was initially based ontop of Joe's u-boot_net/next branches, but I rebased it ontop of u-boot/master to get the latest sunxi changes, including:
sun7i: Add support for Olimex A20-OLinuXino-LIME2-eMMC
ARM: dts: sunxi: Change node name for pwrseq pin on Olinuxino-lime2-emmc

Quoted 7 lines
Quoted 2 lines

Which are on their way to being merged in master. So once those land into master this all should apply cleanly. Sorry Joe!

So I accidentally added those too to this patch series as well (first two patches). Which are technically not part of this series and are on their way as it is. Does patchwork figure out this automatically, or do you prefer a resend with the 2 patches removed?

I've made patchwork reflect things correctly.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170515/e38cb692/attachment.sig>