diff options
author | Conor Dooley <conor.dooley@microchip.com> | 2024-05-15 16:04:31 +0100 |
---|---|---|
committer | Leo Yu-Chi Liang <ycliang@andestech.com> | 2024-05-30 16:00:52 +0800 |
commit | 684775fec928b25489321be6e3b3a58f66be5bf6 (patch) | |
tree | 955051bada50e6ff97a06e96249ae325949a760c /board | |
parent | d4573c05cbea34f8d7c3c2d5e49b7b057b895882 (diff) | |
download | u-boot-684775fec928b25489321be6e3b3a58f66be5bf6.zip u-boot-684775fec928b25489321be6e3b3a58f66be5bf6.tar.gz u-boot-684775fec928b25489321be6e3b3a58f66be5bf6.tar.bz2 |
board: microchip: icicle: make both ethernets optional
A given AMP configuration for a board may make either one, or neither
of, the ethernet ports available to U-Boot. The Icicle's init code will
fail if mac1 is not present, so move it to the optional approach taken
for mac0.
Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
Diffstat (limited to 'board')
-rw-r--r-- | board/microchip/mpfs_icicle/mpfs_icicle.c | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/board/microchip/mpfs_icicle/mpfs_icicle.c b/board/microchip/mpfs_icicle/mpfs_icicle.c index 8449379..31523c0 100644 --- a/board/microchip/mpfs_icicle/mpfs_icicle.c +++ b/board/microchip/mpfs_icicle/mpfs_icicle.c @@ -80,18 +80,6 @@ int board_late_init(void) char icicle_mac_addr[20]; void *blob = (void *)gd->fdt_blob; - node = fdt_path_offset(blob, "/soc/ethernet@20112000"); - if (node < 0) { - printf("No ethernet0 path offset\n"); - return -ENODEV; - } - - ret = fdtdec_get_byte_array(blob, node, "local-mac-address", mac_addr, 6); - if (ret) { - printf("No local-mac-address property for ethernet@20112000\n"); - return -EINVAL; - } - read_device_serial_number(device_serial_number, 16); /* Update MAC address with device serial number */ @@ -102,10 +90,13 @@ int board_late_init(void) mac_addr[4] = device_serial_number[1]; mac_addr[5] = device_serial_number[0]; - ret = fdt_setprop(blob, node, "local-mac-address", mac_addr, 6); - if (ret) { - printf("Error setting local-mac-address property for ethernet@20112000\n"); - return -ENODEV; + node = fdt_path_offset(blob, "/soc/ethernet@20112000"); + if (node >= 0) { + ret = fdt_setprop(blob, node, "local-mac-address", mac_addr, 6); + if (ret) { + printf("Error setting local-mac-address property for ethernet@20112000\n"); + return -ENODEV; + } } icicle_mac_addr[0] = '['; |