[PATCH 02/13] ARM: mvebu: Use ENTRY_FUNCTION_HEAD

Sascha Hauer s.hauer at pengutronix.de
Thu Mar 2 03:15:55 PST 2023


Use ENTRY_FUNCTION_HEAD in the mvebu boards to customize the barebox
image header without having to hook into a generic include file.

Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 arch/arm/Kconfig                                    |  1 -
 arch/arm/boards/globalscale-guruplug/lowlevel.c     |  4 ++--
 arch/arm/boards/globalscale-mirabox/lowlevel.c      |  4 ++--
 arch/arm/boards/lenovo-ix4-300d/lowlevel.c          |  4 ++--
 arch/arm/boards/marvell-armada-xp-db/lowlevel.c     |  4 ++--
 arch/arm/boards/marvell-armada-xp-gp/lowlevel.c     |  4 ++--
 arch/arm/boards/netgear-rn104/lowlevel.c            |  4 ++--
 arch/arm/boards/netgear-rn2120/lowlevel.c           |  4 ++--
 arch/arm/boards/plathome-openblocks-a6/lowlevel.c   |  4 ++--
 arch/arm/boards/plathome-openblocks-ax3/lowlevel.c  |  4 ++--
 arch/arm/boards/solidrun-cubox/lowlevel.c           |  4 ++--
 arch/arm/boards/turris-omnia/lowlevel.c             |  4 ++--
 arch/arm/boards/usi-topkick/lowlevel.c              |  4 ++--
 arch/arm/mach-mvebu/include/mach/barebox-arm-head.h | 12 ++++--------
 14 files changed, 28 insertions(+), 33 deletions(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index c5645c540e..1281b8be38 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -126,7 +126,6 @@ config ARCH_MVEBU
 	select CLKDEV_LOOKUP
 	select GPIOLIB
 	select HAS_DEBUG_LL
-	select HAVE_MACH_ARM_HEAD
 	select HAVE_PBL_MULTI_IMAGES
 	select HW_HAS_PCI
 	select MVEBU_MBUS
diff --git a/arch/arm/boards/globalscale-guruplug/lowlevel.c b/arch/arm/boards/globalscale-guruplug/lowlevel.c
index 964d3510ee..35b2150960 100644
--- a/arch/arm/boards/globalscale-guruplug/lowlevel.c
+++ b/arch/arm/boards/globalscale-guruplug/lowlevel.c
@@ -4,12 +4,12 @@
 #include <common.h>
 #include <linux/sizes.h>
 #include <asm/barebox-arm.h>
-#include <asm/barebox-arm-head.h>
+#include <mach/barebox-arm-head.h>
 #include <mach/lowlevel.h>
 
 extern char __dtb_kirkwood_guruplug_server_plus_bb_start[];
 
-ENTRY_FUNCTION(start_globalscale_guruplug, r0, r1, r2)
+ENTRY_FUNCTION_MVEBU(start_globalscale_guruplug, r0, r1, r2)
 {
 	void *fdt;
 
diff --git a/arch/arm/boards/globalscale-mirabox/lowlevel.c b/arch/arm/boards/globalscale-mirabox/lowlevel.c
index 094792d461..9d03dfd418 100644
--- a/arch/arm/boards/globalscale-mirabox/lowlevel.c
+++ b/arch/arm/boards/globalscale-mirabox/lowlevel.c
@@ -4,12 +4,12 @@
 #include <common.h>
 #include <linux/sizes.h>
 #include <asm/barebox-arm.h>
-#include <asm/barebox-arm-head.h>
+#include <mach/barebox-arm-head.h>
 #include <mach/lowlevel.h>
 
 extern char __dtb_armada_370_mirabox_bb_start[];
 
-ENTRY_FUNCTION(start_globalscale_mirabox, r0, r1, r2)
+ENTRY_FUNCTION_MVEBU(start_globalscale_mirabox, r0, r1, r2)
 {
 	void *fdt;
 
diff --git a/arch/arm/boards/lenovo-ix4-300d/lowlevel.c b/arch/arm/boards/lenovo-ix4-300d/lowlevel.c
index c0a695908f..2ca6c6b5f9 100644
--- a/arch/arm/boards/lenovo-ix4-300d/lowlevel.c
+++ b/arch/arm/boards/lenovo-ix4-300d/lowlevel.c
@@ -3,13 +3,13 @@
 
 #include <common.h>
 #include <asm/barebox-arm.h>
-#include <asm/barebox-arm-head.h>
+#include <mach/barebox-arm-head.h>
 #include <linux/sizes.h>
 #include <mach/lowlevel.h>
 
 extern char __dtb_armada_xp_lenovo_ix4_300d_bb_start[];
 
-ENTRY_FUNCTION(start_lenovo_ix4_300d, r0, r1, r2)
+ENTRY_FUNCTION_MVEBU(start_lenovo_ix4_300d, r0, r1, r2)
 {
 	void *fdt;
 
diff --git a/arch/arm/boards/marvell-armada-xp-db/lowlevel.c b/arch/arm/boards/marvell-armada-xp-db/lowlevel.c
index 4752bbf1b4..4850cf4c2f 100644
--- a/arch/arm/boards/marvell-armada-xp-db/lowlevel.c
+++ b/arch/arm/boards/marvell-armada-xp-db/lowlevel.c
@@ -7,13 +7,13 @@
 #include <common.h>
 #include <linux/sizes.h>
 #include <asm/barebox-arm.h>
-#include <asm/barebox-arm-head.h>
+#include <mach/barebox-arm-head.h>
 #include <mach/lowlevel.h>
 #include <io.h>
 
 extern char __dtb_armada_xp_db_bb_start[];
 
-ENTRY_FUNCTION(start_marvell_armada_xp_db, r0, r1, r2)
+ENTRY_FUNCTION_MVEBU(start_marvell_armada_xp_db, r0, r1, r2)
 {
 	void *fdt;
 	uint32_t reg;
diff --git a/arch/arm/boards/marvell-armada-xp-gp/lowlevel.c b/arch/arm/boards/marvell-armada-xp-gp/lowlevel.c
index 43b1ba8c9a..e6242e36a7 100644
--- a/arch/arm/boards/marvell-armada-xp-gp/lowlevel.c
+++ b/arch/arm/boards/marvell-armada-xp-gp/lowlevel.c
@@ -4,12 +4,12 @@
 #include <common.h>
 #include <linux/sizes.h>
 #include <asm/barebox-arm.h>
-#include <asm/barebox-arm-head.h>
+#include <mach/barebox-arm-head.h>
 #include <mach/lowlevel.h>
 
 extern char __dtb_armada_xp_gp_bb_start[];
 
-ENTRY_FUNCTION(start_marvell_armada_xp_gp, r0, r1, r2)
+ENTRY_FUNCTION_MVEBU(start_marvell_armada_xp_gp, r0, r1, r2)
 {
 	void *fdt;
 
diff --git a/arch/arm/boards/netgear-rn104/lowlevel.c b/arch/arm/boards/netgear-rn104/lowlevel.c
index c6c8e84023..5005129555 100644
--- a/arch/arm/boards/netgear-rn104/lowlevel.c
+++ b/arch/arm/boards/netgear-rn104/lowlevel.c
@@ -6,12 +6,12 @@
 
 #include <common.h>
 #include <asm/barebox-arm.h>
-#include <asm/barebox-arm-head.h>
+#include <mach/barebox-arm-head.h>
 #include <mach/lowlevel.h>
 
 extern char __dtb_armada_370_rn104_bb_start[];
 
-ENTRY_FUNCTION(start_netgear_rn104, r0, r1, r2)
+ENTRY_FUNCTION_MVEBU(start_netgear_rn104, r0, r1, r2)
 {
 	void *fdt;
 
diff --git a/arch/arm/boards/netgear-rn2120/lowlevel.c b/arch/arm/boards/netgear-rn2120/lowlevel.c
index c78d3644b5..f88f46c037 100644
--- a/arch/arm/boards/netgear-rn2120/lowlevel.c
+++ b/arch/arm/boards/netgear-rn2120/lowlevel.c
@@ -3,14 +3,14 @@
 
 #include <common.h>
 #include <asm/barebox-arm.h>
-#include <asm/barebox-arm-head.h>
+#include <mach/barebox-arm-head.h>
 #include <asm/io.h>
 #include <mach/lowlevel.h>
 #include <mach/common.h>
 
 extern char __dtb_armada_xp_rn2120_bb_start[];
 
-ENTRY_FUNCTION(start_netgear_rn2120, r0, r1, r2)
+ENTRY_FUNCTION_MVEBU(start_netgear_rn2120, r0, r1, r2)
 {
 	void *fdt;
 	void __iomem *base = mvebu_get_initial_int_reg_base();
diff --git a/arch/arm/boards/plathome-openblocks-a6/lowlevel.c b/arch/arm/boards/plathome-openblocks-a6/lowlevel.c
index a480c966a4..daa482dd4f 100644
--- a/arch/arm/boards/plathome-openblocks-a6/lowlevel.c
+++ b/arch/arm/boards/plathome-openblocks-a6/lowlevel.c
@@ -3,12 +3,12 @@
 #include <common.h>
 #include <linux/sizes.h>
 #include <asm/barebox-arm.h>
-#include <asm/barebox-arm-head.h>
+#include <mach/barebox-arm-head.h>
 #include <mach/lowlevel.h>
 
 extern char __dtb_kirkwood_openblocks_a6_bb_start[];
 
-ENTRY_FUNCTION(start_plathome_openblocks_a6, r0, r1, r2)
+ENTRY_FUNCTION_MVEBU(start_plathome_openblocks_a6, r0, r1, r2)
 {
 	void *fdt;
 
diff --git a/arch/arm/boards/plathome-openblocks-ax3/lowlevel.c b/arch/arm/boards/plathome-openblocks-ax3/lowlevel.c
index 42b291df9f..bab44590c7 100644
--- a/arch/arm/boards/plathome-openblocks-ax3/lowlevel.c
+++ b/arch/arm/boards/plathome-openblocks-ax3/lowlevel.c
@@ -4,12 +4,12 @@
 #include <common.h>
 #include <linux/sizes.h>
 #include <asm/barebox-arm.h>
-#include <asm/barebox-arm-head.h>
+#include <mach/barebox-arm-head.h>
 #include <mach/lowlevel.h>
 
 extern char __dtb_armada_xp_openblocks_ax3_4_bb_start[];
 
-ENTRY_FUNCTION(start_plathome_openblocks_ax3, r0, r1, r2)
+ENTRY_FUNCTION_MVEBU(start_plathome_openblocks_ax3, r0, r1, r2)
 {
 	void *fdt;
 
diff --git a/arch/arm/boards/solidrun-cubox/lowlevel.c b/arch/arm/boards/solidrun-cubox/lowlevel.c
index 94ed9a4fd7..5bcd0751fc 100644
--- a/arch/arm/boards/solidrun-cubox/lowlevel.c
+++ b/arch/arm/boards/solidrun-cubox/lowlevel.c
@@ -5,12 +5,12 @@
 #include <common.h>
 #include <linux/sizes.h>
 #include <asm/barebox-arm.h>
-#include <asm/barebox-arm-head.h>
+#include <mach/barebox-arm-head.h>
 #include <mach/lowlevel.h>
 
 extern char __dtb_dove_cubox_bb_start[];
 
-ENTRY_FUNCTION(start_solidrun_cubox, r0, r1, r2)
+ENTRY_FUNCTION_MVEBU(start_solidrun_cubox, r0, r1, r2)
 {
 	void *fdt;
 
diff --git a/arch/arm/boards/turris-omnia/lowlevel.c b/arch/arm/boards/turris-omnia/lowlevel.c
index b6520b5775..8ec2a0bf82 100644
--- a/arch/arm/boards/turris-omnia/lowlevel.c
+++ b/arch/arm/boards/turris-omnia/lowlevel.c
@@ -3,14 +3,14 @@
 
 #include <common.h>
 #include <asm/barebox-arm.h>
-#include <asm/barebox-arm-head.h>
+#include <mach/barebox-arm-head.h>
 #include <mach/lowlevel.h>
 
 #include <asm/io.h>
 
 extern char __dtb_armada_385_turris_omnia_bb_start[];
 
-ENTRY_FUNCTION(start_turris_omnia, r0, r1, r2)
+ENTRY_FUNCTION_MVEBU(start_turris_omnia, r0, r1, r2)
 {
 	void *fdt;
 
diff --git a/arch/arm/boards/usi-topkick/lowlevel.c b/arch/arm/boards/usi-topkick/lowlevel.c
index 0193deadbe..51aa29e047 100644
--- a/arch/arm/boards/usi-topkick/lowlevel.c
+++ b/arch/arm/boards/usi-topkick/lowlevel.c
@@ -4,12 +4,12 @@
 #include <common.h>
 #include <linux/sizes.h>
 #include <asm/barebox-arm.h>
-#include <asm/barebox-arm-head.h>
+#include <mach/barebox-arm-head.h>
 #include <mach/lowlevel.h>
 
 extern char __dtb_kirkwood_topkick_bb_start[];
 
-ENTRY_FUNCTION(start_usi_topkick, r0, r1, r2)
+ENTRY_FUNCTION_MVEBU(start_usi_topkick, r0, r1, r2)
 {
 	void *fdt;
 
diff --git a/arch/arm/mach-mvebu/include/mach/barebox-arm-head.h b/arch/arm/mach-mvebu/include/mach/barebox-arm-head.h
index 2ef3377402..72afd10005 100644
--- a/arch/arm/mach-mvebu/include/mach/barebox-arm-head.h
+++ b/arch/arm/mach-mvebu/include/mach/barebox-arm-head.h
@@ -3,7 +3,7 @@
 #include <linux/stringify.h>
 #include <mach/common.h>
 
-static inline void __barebox_arm_head(void)
+static inline void __barebox_mvebu_head(void)
 {
 	__asm__ __volatile__ (
 #ifdef CONFIG_THUMB2_BAREBOX
@@ -53,10 +53,6 @@ static inline void __barebox_arm_head(void)
 #endif
 	);
 }
-static inline void barebox_arm_head(void)
-{
-	__barebox_arm_head();
-	__asm__ __volatile__ (
-		"b barebox_arm_reset_vector\n"
-	);
-}
+
+#define ENTRY_FUNCTION_MVEBU(name, arg0, arg1, arg2) \
+	ENTRY_FUNCTION_HEAD(name, __barebox_mvebu_head, arg0, arg1, arg2)
-- 
2.30.2




More information about the barebox mailing list