aboutsummaryrefslogtreecommitdiff
path: root/arch/arm/include/asm/arch-tegra
diff options
context:
space:
mode:
authorThierry Reding2019-04-15 11:32:30 +0200
committerTom Warren2019-06-05 09:16:34 -0700
commit34e12e03c7f4cbd96e584a590d6e091c48ab8e3d (patch)
treeffd1a951738f281abb76aa044d94816c328a9dd8 /arch/arm/include/asm/arch-tegra
parentce353babdbc478c40f884555b754c533ab8f8af5 (diff)
ARM: tegra: Implement cboot_get_ethaddr()
This function will attempt to look up an Ethernet address in the DTB that was passed in from cboot. It does so by first trying to locate the default Ethernet device for the board (identified by the "ethernet" alias) and if found, reads the "local-mac-address" property. If the "ethernet" alias does not exist, or if it points to a device tree node that doesn't exist, or if the device tree node that it points to does not have a "local-mac-address" property or if the value is invalid, it will fall back to the legacy mechanism of looking for the MAC address stored in the "nvidia,ethernet-mac" or "nvidia,ether-mac" properties of the "/chosen" node. The MAC address is then written to the default Ethernet device for the board (again identified by the "ethernet" alias) in U-Boot's control DTB. This allows the device driver for that device to read the MAC address from the standard location in device tree. Signed-off-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Tom Warren <twarren@nvidia.com>
Diffstat (limited to 'arch/arm/include/asm/arch-tegra')
-rw-r--r--arch/arm/include/asm/arch-tegra/cboot.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/arm/include/asm/arch-tegra/cboot.h b/arch/arm/include/asm/arch-tegra/cboot.h
index b3441ec178b..021c2461757 100644
--- a/arch/arm/include/asm/arch-tegra/cboot.h
+++ b/arch/arm/include/asm/arch-tegra/cboot.h
@@ -14,6 +14,7 @@ void cboot_save_boot_params(unsigned long x0, unsigned long x1,
int cboot_dram_init(void);
int cboot_dram_init_banksize(void);
ulong cboot_get_usable_ram_top(ulong total_size);
+int cboot_get_ethaddr(const void *fdt, uint8_t mac[ETH_ALEN]);
#else
static inline void cboot_save_boot_params(unsigned long x0, unsigned long x1,
unsigned long x2, unsigned long x3)
@@ -34,6 +35,11 @@ static inline ulong cboot_get_usable_ram_top(ulong total_size)
{
return 0;
}
+
+static inline int cboot_get_ethaddr(const void *fdt, uint8_t mac[ETH_ALEN])
+{
+ return -ENOSYS;
+}
#endif
#endif