| * Copyright (c) 2016, NVIDIA CORPORATION. |
| * SPDX-License-Identifier: GPL-2.0+ |
| #include <asm/arch/tegra.h> |
| extern unsigned long nvtboot_boot_x0; |
| * Attempt to use /chosen/nvidia,ether-mac in the nvtboot DTB to U-Boot's |
| * ethaddr environment variable if possible. |
| static int set_ethaddr_from_nvtboot(void) |
| const void *nvtboot_blob = (void *)nvtboot_boot_x0; |
| /* Already a valid address in the environment? If so, keep it */ |
| node = fdt_path_offset(nvtboot_blob, "/chosen"); |
| printf("Can't find /chosen node in nvtboot DTB\n"); |
| prop = fdt_getprop(nvtboot_blob, node, "nvidia,ether-mac", &len); |
| printf("Can't find nvidia,ether-mac property in nvtboot DTB\n"); |
| ret = setenv("ethaddr", (void *)prop); |
| printf("Failed to set ethaddr from nvtboot DTB: %d\n", ret); |
| int tegra_soc_board_init_late(void) |
| /* Ignore errors here; not all cases care about Ethernet addresses */ |
| set_ethaddr_from_nvtboot(); |