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-tk1/apalis-tk1.c | |
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-tk1/apalis-tk1.c')
-rw-r--r-- | board/toradex/apalis-tk1/apalis-tk1.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/board/toradex/apalis-tk1/apalis-tk1.c b/board/toradex/apalis-tk1/apalis-tk1.c index b70f5649e9..7058cb3efc 100644 --- a/board/toradex/apalis-tk1/apalis-tk1.c +++ b/board/toradex/apalis-tk1/apalis-tk1.c @@ -10,6 +10,7 @@ #include <asm/io.h> #include <asm/arch/gpio.h> #include <asm/arch/pinmux.h> +#include <fdt_support.h> #include <pci_tegra.h> #include <power/as3722.h> @@ -81,6 +82,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@1003000/pci@2,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 |