diff options
author | Marcel Ziswiler <marcel.ziswiler@toradex.com> | 2018-03-21 13:13:51 +0100 |
---|---|---|
committer | Stefan Agner <stefan.agner@toradex.com> | 2018-03-21 14:43:33 +0100 |
commit | 9f519a4f5d0659fb21f8b8a88e5d2ac8dea9a5d1 (patch) | |
tree | 46b937ec64b266b5ba8089c638ecf276906e268c /board/toradex/apalis_t30 | |
parent | a1c20450342a758dda7d6ac91ebb4f57290d0520 (diff) |
apalis_t30/tk1/colibri_t20/t30: integrate mac address via dt
Use device tree to set MAC address of the Ethernet chip.
Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Acked-by: Stefan Agner <stefan.agner@toradex.com>
Diffstat (limited to 'board/toradex/apalis_t30')
-rw-r--r-- | board/toradex/apalis_t30/apalis_t30.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/board/toradex/apalis_t30/apalis_t30.c b/board/toradex/apalis_t30/apalis_t30.c index e91267b0b4..3151078119 100644 --- a/board/toradex/apalis_t30/apalis_t30.c +++ b/board/toradex/apalis_t30/apalis_t30.c @@ -13,6 +13,7 @@ #include <asm/io.h> #include <dm.h> #include <i2c.h> +#include <fdt_support.h> #include <pci_tegra.h> #include "../common/tdx-common.h" @@ -71,6 +72,18 @@ int checkboard(void) #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) int ft_board_setup(void *blob, bd_t *bd) { + uint8_t enetaddr[6]; + + /* MAC addr */ + if (eth_getenv_enetaddr("ethaddr", enetaddr)) { + int err = fdt_find_and_setprop(blob, + "/pcie@3000/pci@3,0/pcie@0", + "local-mac-address", enetaddr, 6, 0); + + if (err >= 0) + puts(" MAC address updated...\n"); + } + return ft_common_board_setup(blob, bd); } #endif |