From patchwork Fri Jan 10 00:28:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Vasut X-Patchwork-Id: 239356 List-Id: U-Boot discussion From: marex at denx.de (Marek Vasut) Date: Fri, 10 Jan 2020 01:28:36 +0100 Subject: [PATCH 2/5] ARM: stm32: Allow overriding setup_mac_address() In-Reply-To: <20200110002839.97868-1-marex@denx.de> References: <20200110002839.97868-1-marex@denx.de> Message-ID: <20200110002839.97868-2-marex@denx.de> Let board code override setup_mac_address(), which is useful e.g. if the board derives the MAC address from another source, like an I2C EEPROM. Signed-off-by: Marek Vasut Cc: Patrick Delaunay Cc: Patrice Chotard --- V2: Add prototype to sys_proto.h --- arch/arm/mach-stm32mp/cpu.c | 2 +- arch/arm/mach-stm32mp/include/mach/sys_proto.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-stm32mp/cpu.c b/arch/arm/mach-stm32mp/cpu.c index 6a71465494..de7891b5c4 100644 --- a/arch/arm/mach-stm32mp/cpu.c +++ b/arch/arm/mach-stm32mp/cpu.c @@ -456,7 +456,7 @@ static void setup_boot_mode(void) * If there is no MAC address in the environment, then it will be initialized * (silently) from the value in the OTP. */ -static int setup_mac_address(void) +__weak int setup_mac_address(void) { #if defined(CONFIG_NET) int ret; diff --git a/arch/arm/mach-stm32mp/include/mach/sys_proto.h b/arch/arm/mach-stm32mp/include/mach/sys_proto.h index 99eefabf6e..47e57922d1 100644 --- a/arch/arm/mach-stm32mp/include/mach/sys_proto.h +++ b/arch/arm/mach-stm32mp/include/mach/sys_proto.h @@ -30,3 +30,5 @@ u32 get_cpu_package(void); /* return boot mode */ u32 get_bootmode(void); + +int setup_mac_address(void);