diff options
| author | Daniel Schultz <[email protected]> | 2024-05-21 23:18:26 -0700 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2024-06-07 14:01:53 -0600 |
| commit | 946ae83246e89c05ddb83af6637b8af29f32bc2f (patch) | |
| tree | 10aa179ba6d6c30de9f1f4ac07af31432c332052 | |
| parent | b100c2458a13356e33ddcad0cb14906e41522cea (diff) | |
board: phytec: common: k3: Set MAC
Read the EEPROM API v3 content and set all available
MAC-Addresses to the environment.
Signed-off-by: Daniel Schultz <[email protected]>
Reviewed-by: Wadim Egorov <[email protected]>
Tested-by: Wadim Egorov <[email protected]>
| -rw-r--r-- | board/phytec/common/k3/board.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/board/phytec/common/k3/board.c b/board/phytec/common/k3/board.c index 9cb168c36cb..f21e154d4fe 100644 --- a/board/phytec/common/k3/board.c +++ b/board/phytec/common/k3/board.c @@ -8,6 +8,8 @@ #include <spl.h> #include <asm/arch/hardware.h> +#include "../am6_som_detection.h" + #if IS_ENABLED(CONFIG_ENV_IS_IN_FAT) || IS_ENABLED(CONFIG_ENV_IS_IN_MMC) int mmc_get_env_dev(void) { @@ -68,6 +70,27 @@ int board_late_init(void) break; }; + if (IS_ENABLED(CONFIG_PHYTEC_SOM_DETECTION_BLOCKS)) { + struct phytec_api3_element *block_element; + struct phytec_eeprom_data data; + int ret; + + ret = phytec_eeprom_data_setup(&data, 0, EEPROM_ADDR); + if (ret || !data.valid) + return 0; + + PHYTEC_API3_FOREACH_BLOCK(block_element, &data) { + switch (block_element->block_type) { + case PHYTEC_API3_BLOCK_MAC: + phytec_blocks_add_mac_to_env(block_element); + break; + default: + debug("%s: Unknown block type %i\n", __func__, + block_element->block_type); + } + } + } + return 0; } #endif |
