diff mbox

[U-Boot,1/7] armv7: Mark the default lowlevel_init function as weak

Message ID 1494960400-15763-1-git-send-email-trini@konsulko.com
State Accepted
Commit ffb56568626be636f0256795df5322633f50cde3
Delegated to: Tom Rini
Headers show

Commit Message

Tom Rini May 16, 2017, 6:46 p.m. UTC
Rather than have a long and if check in the Makefile, mark the default
lowlevel_init function as weak (as we do on armv8) so that SoCs can
override it if needed, and it will still be discarded if unused.
Provide a weak s_init as well to allow for this to link and be
discarded.

Signed-off-by: Tom Rini <trini@konsulko.com>
---
 arch/arm/cpu/armv7/Makefile        |  2 --
 arch/arm/cpu/armv7/lowlevel_init.S | 10 +++++++++-
 2 files changed, 9 insertions(+), 3 deletions(-)

Comments

Tom Rini June 6, 2017, 12:13 a.m. UTC | #1
On Tue, May 16, 2017 at 02:46:34PM -0400, Tom Rini wrote:

> Rather than have a long and if check in the Makefile, mark the default
> lowlevel_init function as weak (as we do on armv8) so that SoCs can
> override it if needed, and it will still be discarded if unused.
> Provide a weak s_init as well to allow for this to link and be
> discarded.
> 
> Signed-off-by: Tom Rini <trini@konsulko.com>

Applied to u-boot/master, thanks!
diff mbox

Patch

diff --git a/arch/arm/cpu/armv7/Makefile b/arch/arm/cpu/armv7/Makefile
index 5fac252c0e00..45dd3caec6b3 100644
--- a/arch/arm/cpu/armv7/Makefile
+++ b/arch/arm/cpu/armv7/Makefile
@@ -12,11 +12,9 @@  obj-y	+= cache_v7.o cache_v7_asm.o
 obj-y	+= cpu.o cp15.o
 obj-y	+= syslib.o
 
-ifneq ($(CONFIG_AM43XX)$(CONFIG_AM33XX)$(CONFIG_OMAP44XX)$(CONFIG_OMAP54XX)$(CONFIG_TEGRA)$(CONFIG_MX6)$(CONFIG_MX7)$(CONFIG_TI81XX)$(CONFIG_AT91FAMILY)$(CONFIG_ARCH_SUNXI)$(CONFIG_ARCH_SOCFPGA)$(CONFIG_ARCH_MX7ULP)$(CONFIG_ARCH_LS1021A),)
 ifneq ($(CONFIG_SKIP_LOWLEVEL_INIT),y)
 obj-y	+= lowlevel_init.o
 endif
-endif
 
 obj-$(CONFIG_ARM_SMCCC)		+= smccc-call.o
 obj-$(CONFIG_ARMV7_NONSEC)	+= nonsec_virt.o virt-v7.o virt-dt.o
diff --git a/arch/arm/cpu/armv7/lowlevel_init.S b/arch/arm/cpu/armv7/lowlevel_init.S
index 658934d664a4..64f105864f87 100644
--- a/arch/arm/cpu/armv7/lowlevel_init.S
+++ b/arch/arm/cpu/armv7/lowlevel_init.S
@@ -15,7 +15,14 @@ 
 #include <config.h>
 #include <linux/linkage.h>
 
-ENTRY(lowlevel_init)
+.pushsection .text.s_init, "ax"
+WEAK(s_init)
+	bx	lr
+ENDPROC(s_init)
+.popsection
+
+.pushsection .text.lowlevel_init, "ax"
+WEAK(lowlevel_init)
 	/*
 	 * Setup a temporary stack. Global data is not available yet.
 	 */
@@ -61,3 +68,4 @@  ENTRY(lowlevel_init)
 	bl	s_init
 	pop	{ip, pc}
 ENDPROC(lowlevel_init)
+.popsection