diff options
author | Eugen Hristev | 2020-07-31 15:20:56 +0300 |
---|---|---|
committer | Eugen Hristev | 2021-01-07 09:44:16 +0200 |
commit | a07d2a1121a724733d61f157a2d8b546737c80ae (patch) | |
tree | c51358392d42aeb9b289dc11fa0ad72ee96500a3 /board | |
parent | 9b614c87bb5ed281740b055dbe9ee3cf9c3ed571 (diff) |
board: atmel: sama7g5ek: add support for MAC address retreival
Obtain two MAC addresses from the two EEPROMs and configure the two
available Ethernet interfaces accordingly.
Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
Diffstat (limited to 'board')
-rw-r--r-- | board/atmel/sama7g5ek/sama7g5ek.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/board/atmel/sama7g5ek/sama7g5ek.c b/board/atmel/sama7g5ek/sama7g5ek.c index 42b032cf363..b5cece08ac3 100644 --- a/board/atmel/sama7g5ek/sama7g5ek.c +++ b/board/atmel/sama7g5ek/sama7g5ek.c @@ -46,6 +46,19 @@ int board_early_init_f(void) return 0; } +#define MAC24AA_MAC_OFFSET 0xfa + +#if (IS_ENABLED(CONFIG_MISC_INIT_R)) +int misc_init_r(void) +{ +#if (IS_ENABLED(CONFIG_I2C_EEPROM)) + at91_set_ethaddr(MAC24AA_MAC_OFFSET); + at91_set_eth1addr(MAC24AA_MAC_OFFSET); +#endif + return 0; +} +#endif + int board_init(void) { /* address of boot parameters */ @@ -61,8 +74,3 @@ int dram_init(void) return 0; } -int misc_init_r(void) -{ - return 0; -} - |