board: dhelectronics: Implement common MAC address functions
authorPhilip Oberfichtner <pro@denx.de>
Tue, 26 Jul 2022 13:04:50 +0000 (15:04 +0200)
committerTom Rini <trini@konsulko.com>
Fri, 12 Aug 2022 20:10:49 +0000 (16:10 -0400)
commit386f921cee3de9200bdd920cccd72fb3bc9a262a
tree8b75955275b042bf37f5f4e7c475e0cc832f6409
parent24291741f660d058573089d5e83e2f8aefc4661f
board: dhelectronics: Implement common MAC address functions

This is a starting point for unifying duplicate code in the DH board
files. The functions for setting up MAC addresses are very similar for
the i.MX6, i.MX8 and stm32mp1 based boards.

All pre-existing implementations follow the same logic:

(1) Check if ethaddr is already set in the environment
(2) If not, try to get it from a board specific location (e.g. fuse)
(3) If not, try to get it from eeprom

After this commit, (1) and (3) are implemented as common functions,
ready to be used by board specific files.

Furthermore there is an implementation of (2) for imx based boards.

Signed-off-by: Philip Oberfichtner <pro@denx.de>
Reviewed-by: Marek Vasut <marex@denx.de>
board/dhelectronics/common/Makefile [new file with mode: 0644]
board/dhelectronics/common/dh_common.c [new file with mode: 0644]
board/dhelectronics/common/dh_common.h [new file with mode: 0644]
board/dhelectronics/common/dh_imx.c [new file with mode: 0644]
board/dhelectronics/common/dh_imx.h [new file with mode: 0644]