All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCHv1 0/3] Retrieve MAC address from EEPROM
@ 2015-11-30 16:50 Olliver Schinagl
  2015-11-30 16:50 ` [U-Boot] [PATCHv1 1/3] net: Add ability to set MAC address via EEPROM to Kconfig Olliver Schinagl
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Olliver Schinagl @ 2015-11-30 16:50 UTC (permalink / raw)
  To: u-boot

From: Olliver Schinagl <o.schinagl@ultimaker.com>

This patch-series introduces methods to retrieve the MAC address from an
onboard EEPROM. I know there is probably a thing or two that might needed
to be changed to make the concept apply in a more generic way.

The reason we might want to read the MAC address from an EEPROM instead of
storing the entire environment is mostly a size thing. Our default environment
already is bigger then the EEPROM so it is understandable that someone might
not give up the entire eeprom just for the u-boot environment. Especially if
only board specific things might be stored in the eeprom (MAC, serial, product
number etc).

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 and identifier byte to indicate the
interface the MAC is applicable too, 0x00 - 0xFE to indicate ethernet interface
0 to 254. 0xFF has special meaning that it does not matter. This bit
(no pun intended) is where I am not sure it should be in here at all, but it
seemed more logical than simple order based. For example, if there are 2
ethernet devices on a board, eth0 being an internal device, and eth1 being an
external facing device and only 1 MAC address per device is allotted, it can
seem logical that eth1 gets the MAC address and eth0 gets a randomly chosen MAC
address (or whatever the fall back behavior is).

These 7 bytes are then appended with a CRC8 byte and can be optionally checked,
although the whole optional-ness could be very well dropped.

Hans de Goede and I talked about retrieving the MAC from the EEPROM for sunxi
based boards a while ago, but hopefully this patch makes possible to have
something slightly more generic, even if only the configuration option and the
EEPROM layout.

Since the Olimex OLinuXino sunxi boards all seem to have an eeprom, I started
my work on one of these and tested the implementation with one of our own real
MAC addresses.

Features planned for v2, simple tool to write the MAC address to the eeprom
from Linux.

Olliver Schinagl (3):
  net: Add ability to set MAC address via EEPROM to Kconfig
  sunxi: net: Allow the sunxi to set the MAC from an EEPROM
  sunxi: net: Enable eeprom on OLinuXino Lime2 boards

 board/sunxi/Kconfig                   |  4 +++
 board/sunxi/board.c                   | 36 +++++++++++++++++++++
 configs/A20-OLinuXino-Lime2_defconfig |  3 ++
 doc/README.enetaddr                   | 36 +++++++++++++++++++++
 net/Kconfig                           | 59 +++++++++++++++++++++++++++++++++++
 5 files changed, 138 insertions(+)

-- 
2.6.2

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

end of thread, other threads:[~2015-12-14 12:15 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-30 16:50 [U-Boot] [PATCHv1 0/3] Retrieve MAC address from EEPROM Olliver Schinagl
2015-11-30 16:50 ` [U-Boot] [PATCHv1 1/3] net: Add ability to set MAC address via EEPROM to Kconfig Olliver Schinagl
2015-12-10 10:29   ` [U-Boot] [U-Boot, PATCHv1, " Hans de Goede
2015-12-10 10:40     ` Olliver Schinagl
2015-12-10 20:25       ` Joe Hershberger
2015-12-14 12:15         ` Olliver Schinagl
2015-12-10 20:26     ` Joe Hershberger
2015-12-11  8:38       ` Hans de Goede
2015-12-10 20:27   ` [U-Boot] [PATCHv1 " Joe Hershberger
2015-11-30 16:50 ` [U-Boot] [PATCHv1 2/3] sunxi: net: Allow the sunxi to set the MAC from an EEPROM Olliver Schinagl
2015-11-30 16:50 ` [U-Boot] [PATCHv1 3/3] sunxi: net: Enable eeprom on OLinuXino Lime2 boards Olliver Schinagl

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.