mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 00/13] ARM: misc cleanups
@ 2023-03-02 11:15 Sascha Hauer
  2023-03-02 11:15 ` [PATCH 01/13] ARM: add ENTRY_FUNCTION_HEAD macro Sascha Hauer
                   ` (12 more replies)
  0 siblings, 13 replies; 16+ messages in thread
From: Sascha Hauer @ 2023-03-02 11:15 UTC (permalink / raw)
  To: Barebox List

This series has some misc cleanups I came along while working
on ARM multi-arch support.

Sascha

Sascha Hauer (13):
  ARM: add ENTRY_FUNCTION_HEAD macro
  ARM: mvebu: Use ENTRY_FUNCTION_HEAD
  ARM: at91: Use ENTRY_FUNCTION_HEAD
  ARM: Drop HAVE_MACH_ARM_HEAD
  ARM: drop CONFIG_HAS_ASM_DEBUG_LL
  regulator: pfuze: remove unused include
  ARM: drop unused zynq code in Makefile
  ARM: drop unused mvebu code in Makefile
  ARM: drop unused am35xx code in Makefile
  ARM: Makefile: Drop board-y
  ARM: i.MX: Add missing include
  ARM: stm32mp_defconfig: Enable remaining boards
  mci: imx-esdhc-pbl: add missing include

 Makefile                                      |  4 +-
 arch/arm/Kconfig                              |  6 +-
 arch/arm/Makefile                             | 65 +------------------
 arch/arm/boards/Makefile                      |  2 +
 arch/arm/boards/animeo_ip/lowlevel.c          |  4 +-
 arch/arm/boards/at91rm9200ek/lowlevel.c       |  6 +-
 arch/arm/boards/at91sam9260ek/lowlevel.c      |  6 +-
 arch/arm/boards/at91sam9261ek/lowlevel_init.c |  5 +-
 arch/arm/boards/at91sam9m10g45ek/lowlevel.c   |  4 +-
 arch/arm/boards/at91sam9m10ihd/lowlevel.c     |  4 +-
 arch/arm/boards/at91sam9n12ek/lowlevel.c      |  4 +-
 arch/arm/boards/dss11/lowlevel.c              |  4 +-
 .../boards/globalscale-guruplug/lowlevel.c    |  4 +-
 .../arm/boards/globalscale-mirabox/lowlevel.c |  4 +-
 arch/arm/boards/haba-knx/lowlevel.c           |  4 +-
 arch/arm/boards/lenovo-ix4-300d/lowlevel.c    |  4 +-
 .../boards/marvell-armada-xp-db/lowlevel.c    |  4 +-
 .../boards/marvell-armada-xp-gp/lowlevel.c    |  4 +-
 arch/arm/boards/netgear-rn104/lowlevel.c      |  4 +-
 arch/arm/boards/netgear-rn2120/lowlevel.c     |  4 +-
 .../phytec-phycore-pxa270/lowlevel_init.S     |  1 +
 .../boards/plathome-openblocks-a6/lowlevel.c  |  4 +-
 .../boards/plathome-openblocks-ax3/lowlevel.c |  4 +-
 arch/arm/boards/pm9261/lowlevel_init.c        |  3 +-
 arch/arm/boards/pm9263/lowlevel_init.c        |  3 +-
 arch/arm/boards/pm9g45/lowlevel.c             |  4 +-
 arch/arm/boards/qil-a926x/lowlevel.c          |  6 +-
 arch/arm/boards/solidrun-cubox/lowlevel.c     |  4 +-
 arch/arm/boards/telit-evk-pro3/lowlevel.c     |  4 +-
 .../arm/boards/tny-a926x/tny_a9260_lowlevel.c |  6 +-
 .../arm/boards/tny-a926x/tny_a9263_lowlevel.c |  4 +-
 arch/arm/boards/turris-omnia/lowlevel.c       |  4 +-
 .../arm/boards/usb-a926x/usb_a9260_lowlevel.c |  6 +-
 .../arm/boards/usb-a926x/usb_a9263_lowlevel.c |  5 +-
 arch/arm/boards/usi-topkick/lowlevel.c        |  4 +-
 arch/arm/configs/stm32mp_defconfig            |  2 +
 arch/arm/include/asm/barebox-arm-head.h       |  4 --
 arch/arm/include/asm/barebox-arm.h            |  7 +-
 arch/arm/include/asm/debug_ll.h               |  2 +
 arch/arm/mach-at91/Kconfig                    |  8 ---
 .../mach-at91/include/mach/barebox-arm-head.h | 12 ++--
 .../arm/mach-imx/include/mach/imx7-ccm-regs.h |  1 +
 .../include/mach/barebox-arm-head.h           | 12 ++--
 arch/mips/include/asm/debug_ll.h              |  6 ++
 arch/riscv/Kconfig.socs                       | 12 ++--
 arch/sandbox/Kconfig                          |  2 +-
 arch/x86/include/asm/debug_ll.h               |  6 ++
 common/Kconfig                                |  4 --
 drivers/mci/imx-esdhc-pbl.c                   |  3 +
 drivers/regulator/pfuze.c                     |  1 -
 include/debug_ll.h                            |  8 +--
 51 files changed, 117 insertions(+), 181 deletions(-)
 create mode 100644 arch/mips/include/asm/debug_ll.h
 create mode 100644 arch/x86/include/asm/debug_ll.h

-- 
2.30.2




^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH 01/13] ARM: add ENTRY_FUNCTION_HEAD macro
  2023-03-02 11:15 [PATCH 00/13] ARM: misc cleanups Sascha Hauer
@ 2023-03-02 11:15 ` Sascha Hauer
  2023-03-02 11:15 ` [PATCH 02/13] ARM: mvebu: Use ENTRY_FUNCTION_HEAD Sascha Hauer
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 16+ messages in thread
From: Sascha Hauer @ 2023-03-02 11:15 UTC (permalink / raw)
  To: Barebox List

Some architectures set CONFIG_HAVE_MACH_ARM_HEAD to customize the
barebox image header. Add a ENTRY_FUNCTION_HEAD macro which allows
a board to customize the barebox image header without having to
hook into a generic include file.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/include/asm/barebox-arm.h | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/arch/arm/include/asm/barebox-arm.h b/arch/arm/include/asm/barebox-arm.h
index d4be719bc4..0cf4549cd7 100644
--- a/arch/arm/include/asm/barebox-arm.h
+++ b/arch/arm/include/asm/barebox-arm.h
@@ -183,7 +183,7 @@ void __barebox_arm64_head(ulong x0, ulong x1, ulong x2);
 	static void noinline ____##name					\
 		(ulong arg0, ulong arg1, ulong arg2)
 
-#define ENTRY_FUNCTION(name, arg0, arg1, arg2)				\
+#define ENTRY_FUNCTION_HEAD(name, head, arg0, arg1, arg2)		\
 	void name(ulong r0, ulong r1, ulong r2);			\
 									\
 	static void __##name(ulong, ulong, ulong);			\
@@ -191,11 +191,14 @@ void __barebox_arm64_head(ulong x0, ulong x1, ulong x2);
 	void __naked __section(.text_head_entry_##name)	name		\
 				(ulong r0, ulong r1, ulong r2)		\
 		{							\
-			__barebox_arm_head();				\
+			head();				\
 			__##name(r0, r1, r2);				\
 		}							\
 	static void __naked noinline __##name				\
 		(ulong arg0, ulong arg1, ulong arg2)
+
+#define ENTRY_FUNCTION(name, arg0, arg1, arg2)		\
+		ENTRY_FUNCTION_HEAD(name, __barebox_arm_head, arg0, arg1, arg2)
 #endif
 
 /*
-- 
2.30.2




^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH 02/13] ARM: mvebu: Use ENTRY_FUNCTION_HEAD
  2023-03-02 11:15 [PATCH 00/13] ARM: misc cleanups Sascha Hauer
  2023-03-02 11:15 ` [PATCH 01/13] ARM: add ENTRY_FUNCTION_HEAD macro Sascha Hauer
@ 2023-03-02 11:15 ` Sascha Hauer
  2023-03-02 11:15 ` [PATCH 03/13] ARM: at91: " Sascha Hauer
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 16+ messages in thread
From: Sascha Hauer @ 2023-03-02 11:15 UTC (permalink / raw)
  To: Barebox List

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@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




^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH 03/13] ARM: at91: Use ENTRY_FUNCTION_HEAD
  2023-03-02 11:15 [PATCH 00/13] ARM: misc cleanups Sascha Hauer
  2023-03-02 11:15 ` [PATCH 01/13] ARM: add ENTRY_FUNCTION_HEAD macro Sascha Hauer
  2023-03-02 11:15 ` [PATCH 02/13] ARM: mvebu: Use ENTRY_FUNCTION_HEAD Sascha Hauer
@ 2023-03-02 11:15 ` Sascha Hauer
  2023-03-02 16:40   ` Ahmad Fatoum
  2023-03-02 11:15 ` [PATCH 04/13] ARM: Drop HAVE_MACH_ARM_HEAD Sascha Hauer
                   ` (9 subsequent siblings)
  12 siblings, 1 reply; 16+ messages in thread
From: Sascha Hauer @ 2023-03-02 11:15 UTC (permalink / raw)
  To: Barebox List

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

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/boards/animeo_ip/lowlevel.c               |  4 ++--
 arch/arm/boards/at91rm9200ek/lowlevel.c            |  4 ++--
 arch/arm/boards/at91sam9260ek/lowlevel.c           |  6 +++---
 arch/arm/boards/at91sam9261ek/lowlevel_init.c      |  5 +++--
 arch/arm/boards/at91sam9m10g45ek/lowlevel.c        |  4 ++--
 arch/arm/boards/at91sam9m10ihd/lowlevel.c          |  4 ++--
 arch/arm/boards/at91sam9n12ek/lowlevel.c           |  4 ++--
 arch/arm/boards/dss11/lowlevel.c                   |  4 ++--
 arch/arm/boards/haba-knx/lowlevel.c                |  4 ++--
 arch/arm/boards/pm9261/lowlevel_init.c             |  3 ++-
 arch/arm/boards/pm9263/lowlevel_init.c             |  3 ++-
 arch/arm/boards/pm9g45/lowlevel.c                  |  4 ++--
 arch/arm/boards/qil-a926x/lowlevel.c               |  6 +++---
 arch/arm/boards/telit-evk-pro3/lowlevel.c          |  4 ++--
 arch/arm/boards/tny-a926x/tny_a9260_lowlevel.c     |  6 +++---
 arch/arm/boards/tny-a926x/tny_a9263_lowlevel.c     |  4 ++--
 arch/arm/boards/usb-a926x/usb_a9260_lowlevel.c     |  6 +++---
 arch/arm/boards/usb-a926x/usb_a9263_lowlevel.c     |  5 +++--
 arch/arm/mach-at91/Kconfig                         |  8 --------
 arch/arm/mach-at91/include/mach/barebox-arm-head.h | 12 ++++--------
 20 files changed, 46 insertions(+), 54 deletions(-)

diff --git a/arch/arm/boards/animeo_ip/lowlevel.c b/arch/arm/boards/animeo_ip/lowlevel.c
index 2d443f5384..f56f59fa8e 100644
--- a/arch/arm/boards/animeo_ip/lowlevel.c
+++ b/arch/arm/boards/animeo_ip/lowlevel.c
@@ -7,14 +7,14 @@
 #include <common.h>
 #include <init.h>
 
-#include <asm/barebox-arm-head.h>
+#include <mach/barebox-arm-head.h>
 #include <asm/barebox-arm.h>
 
 #include <mach/at91sam9_sdramc.h>
 #include <mach/at91sam9260.h>
 #include <mach/hardware.h>
 
-ENTRY_FUNCTION(start_animeo_ip, r0, r1, r2)
+ENTRY_FUNCTION_AT91(start_animeo_ip, r0, r1, r2)
 {
 	arm_cpu_lowlevel_init();
 
diff --git a/arch/arm/boards/at91rm9200ek/lowlevel.c b/arch/arm/boards/at91rm9200ek/lowlevel.c
index ba62f1116d..9180a484aa 100644
--- a/arch/arm/boards/at91rm9200ek/lowlevel.c
+++ b/arch/arm/boards/at91rm9200ek/lowlevel.c
@@ -7,7 +7,7 @@
 #include <common.h>
 #include <init.h>
 
-#include <asm/barebox-arm-head.h>
+#include <mach/barebox-arm-head.h>
 #include <asm/barebox-arm.h>
 
 #include <mach/at91rm9200_mc.h>
@@ -21,7 +21,7 @@ void static inline access_sdram(void)
 	writel(0x00000000, AT91_CHIPSELECT_1);
 }
 
-ENTRY_FUNCTION(start_at91rm9200ek, r0, r1, r2)
+ENTRY_FUNCTION_AT91(start_at91rm9200ek, r0, r1, r2)
 {
 	u32 r;
 	int i;
diff --git a/arch/arm/boards/at91sam9260ek/lowlevel.c b/arch/arm/boards/at91sam9260ek/lowlevel.c
index 81fe70278b..a44cfc6b35 100644
--- a/arch/arm/boards/at91sam9260ek/lowlevel.c
+++ b/arch/arm/boards/at91sam9260ek/lowlevel.c
@@ -7,14 +7,14 @@
 #include <common.h>
 #include <init.h>
 
-#include <asm/barebox-arm-head.h>
+#include <mach/barebox-arm-head.h>
 #include <asm/barebox-arm.h>
 
 #include <mach/at91sam9_sdramc.h>
 #include <mach/at91sam9260.h>
 #include <mach/hardware.h>
 
-ENTRY_FUNCTION(start_at91sam9260ek, r0, r1, r2)
+ENTRY_FUNCTION_AT91(start_at91sam9260ek, r0, r1, r2)
 {
 	arm_cpu_lowlevel_init();
 
@@ -25,7 +25,7 @@ ENTRY_FUNCTION(start_at91sam9260ek, r0, r1, r2)
 			  NULL);
 }
 
-ENTRY_FUNCTION(start_at91sam9g20ek, r0, r1, r2)
+ENTRY_FUNCTION_AT91(start_at91sam9g20ek, r0, r1, r2)
 {
 	arm_cpu_lowlevel_init();
 
diff --git a/arch/arm/boards/at91sam9261ek/lowlevel_init.c b/arch/arm/boards/at91sam9261ek/lowlevel_init.c
index 47a8f21db8..1dd2a6b113 100644
--- a/arch/arm/boards/at91sam9261ek/lowlevel_init.c
+++ b/arch/arm/boards/at91sam9261ek/lowlevel_init.c
@@ -4,6 +4,7 @@
  * Under GPLv2
  */
 
+#include <mach/barebox-arm-head.h>
 #include <asm/barebox-arm.h>
 
 #include <mach/at91sam926x_board_init.h>
@@ -117,7 +118,7 @@ static void __bare_init at91sam9261ek_init(void)
 	                  NULL);
 }
 
-ENTRY_FUNCTION(start_at91sam9261ek, r0, r1, r2)
+ENTRY_FUNCTION_AT91(start_at91sam9261ek, r0, r1, r2)
 {
 	arm_cpu_lowlevel_init();
 
@@ -126,7 +127,7 @@ ENTRY_FUNCTION(start_at91sam9261ek, r0, r1, r2)
 	at91sam9261ek_init();
 }
 
-ENTRY_FUNCTION(start_at91sam9g10ek, r0, r1, r2)
+ENTRY_FUNCTION_AT91(start_at91sam9g10ek, r0, r1, r2)
 {
 	arm_cpu_lowlevel_init();
 
diff --git a/arch/arm/boards/at91sam9m10g45ek/lowlevel.c b/arch/arm/boards/at91sam9m10g45ek/lowlevel.c
index 94732df14f..d3654df70b 100644
--- a/arch/arm/boards/at91sam9m10g45ek/lowlevel.c
+++ b/arch/arm/boards/at91sam9m10g45ek/lowlevel.c
@@ -7,13 +7,13 @@
 #include <common.h>
 #include <init.h>
 
-#include <asm/barebox-arm-head.h>
+#include <mach/barebox-arm-head.h>
 #include <asm/barebox-arm.h>
 
 #include <mach/hardware.h>
 #include <mach/at91_ddrsdrc.h>
 
-ENTRY_FUNCTION(start_at91sam9m10g45ek, r0, r1, r2)
+ENTRY_FUNCTION_AT91(start_at91sam9m10g45ek, r0, r1, r2)
 {
 	arm_cpu_lowlevel_init();
 
diff --git a/arch/arm/boards/at91sam9m10ihd/lowlevel.c b/arch/arm/boards/at91sam9m10ihd/lowlevel.c
index 1dd17ee263..9ea128cd4d 100644
--- a/arch/arm/boards/at91sam9m10ihd/lowlevel.c
+++ b/arch/arm/boards/at91sam9m10ihd/lowlevel.c
@@ -7,14 +7,14 @@
 #include <common.h>
 #include <init.h>
 
-#include <asm/barebox-arm-head.h>
+#include <mach/barebox-arm-head.h>
 #include <asm/barebox-arm.h>
 
 #include <mach/at91_ddrsdrc.h>
 #include <mach/at91sam9g45.h>
 #include <mach/hardware.h>
 
-ENTRY_FUNCTION(start_at91sam9m10ihd, r0, r1, r2)
+ENTRY_FUNCTION_AT91(start_at91sam9m10ihd, r0, r1, r2)
 {
 	arm_cpu_lowlevel_init();
 
diff --git a/arch/arm/boards/at91sam9n12ek/lowlevel.c b/arch/arm/boards/at91sam9n12ek/lowlevel.c
index 7366e74c3c..6911840388 100644
--- a/arch/arm/boards/at91sam9n12ek/lowlevel.c
+++ b/arch/arm/boards/at91sam9n12ek/lowlevel.c
@@ -7,13 +7,13 @@
 #include <common.h>
 #include <init.h>
 
-#include <asm/barebox-arm-head.h>
+#include <mach/barebox-arm-head.h>
 #include <asm/barebox-arm.h>
 
 #include <mach/at91_ddrsdrc.h>
 #include <mach/hardware.h>
 
-ENTRY_FUNCTION(start_at91sam9n12ek, r0, r1, r2)
+ENTRY_FUNCTION_AT91(start_at91sam9n12ek, r0, r1, r2)
 {
 	arm_cpu_lowlevel_init();
 
diff --git a/arch/arm/boards/dss11/lowlevel.c b/arch/arm/boards/dss11/lowlevel.c
index 86cc295e8b..734d4c94be 100644
--- a/arch/arm/boards/dss11/lowlevel.c
+++ b/arch/arm/boards/dss11/lowlevel.c
@@ -7,14 +7,14 @@
 #include <common.h>
 #include <init.h>
 
-#include <asm/barebox-arm-head.h>
+#include <mach/barebox-arm-head.h>
 #include <asm/barebox-arm.h>
 
 #include <mach/at91sam9_sdramc.h>
 #include <mach/at91sam9260.h>
 #include <mach/hardware.h>
 
-ENTRY_FUNCTION(start_dss11, r0, r1, r2)
+ENTRY_FUNCTION_AT91(start_dss11, r0, r1, r2)
 {
 	arm_cpu_lowlevel_init();
 
diff --git a/arch/arm/boards/haba-knx/lowlevel.c b/arch/arm/boards/haba-knx/lowlevel.c
index 3f810a396d..980cf55f83 100644
--- a/arch/arm/boards/haba-knx/lowlevel.c
+++ b/arch/arm/boards/haba-knx/lowlevel.c
@@ -7,14 +7,14 @@
 #include <common.h>
 #include <init.h>
 
-#include <asm/barebox-arm-head.h>
+#include <mach/barebox-arm-head.h>
 #include <asm/barebox-arm.h>
 
 #include <mach/at91sam9_sdramc.h>
 #include <mach/at91sam9260.h>
 #include <mach/hardware.h>
 
-ENTRY_FUNCTION(start_haba_knx_lite, r0, r1, r2)
+ENTRY_FUNCTION_AT91(start_haba_knx_lite, r0, r1, r2)
 {
 	arm_cpu_lowlevel_init();
 
diff --git a/arch/arm/boards/pm9261/lowlevel_init.c b/arch/arm/boards/pm9261/lowlevel_init.c
index 13a604ceb8..ce2fc1f507 100644
--- a/arch/arm/boards/pm9261/lowlevel_init.c
+++ b/arch/arm/boards/pm9261/lowlevel_init.c
@@ -4,6 +4,7 @@
  * Under GPLv2
  */
 
+#include <mach/barebox-arm-head.h>
 #include <asm/barebox-arm.h>
 
 #include <mach/at91sam926x_board_init.h>
@@ -111,7 +112,7 @@ static void __bare_init pm9261_init(void)
 	                  NULL);
 }
 
-ENTRY_FUNCTION(start_pm9261, r0, r1, r2)
+ENTRY_FUNCTION_AT91(start_pm9261, r0, r1, r2)
 {
 	arm_cpu_lowlevel_init();
 
diff --git a/arch/arm/boards/pm9263/lowlevel_init.c b/arch/arm/boards/pm9263/lowlevel_init.c
index 9a690531e3..752e36a79f 100644
--- a/arch/arm/boards/pm9263/lowlevel_init.c
+++ b/arch/arm/boards/pm9263/lowlevel_init.c
@@ -6,6 +6,7 @@
 
 #include <linux/sizes.h>
 
+#include <mach/barebox-arm-head.h>
 #include <asm/barebox-arm.h>
 
 #include <mach/at91sam926x_board_init.h>
@@ -132,7 +133,7 @@ static void __bare_init pm9263_board_init(void)
 	                  NULL);
 }
 
-ENTRY_FUNCTION(start_pm9263, r0, r1, r2)
+ENTRY_FUNCTION_AT91(start_pm9263, r0, r1, r2)
 {
 	arm_cpu_lowlevel_init();
 
diff --git a/arch/arm/boards/pm9g45/lowlevel.c b/arch/arm/boards/pm9g45/lowlevel.c
index 096bbc485a..a6d54a0627 100644
--- a/arch/arm/boards/pm9g45/lowlevel.c
+++ b/arch/arm/boards/pm9g45/lowlevel.c
@@ -7,14 +7,14 @@
 #include <common.h>
 #include <init.h>
 
-#include <asm/barebox-arm-head.h>
+#include <mach/barebox-arm-head.h>
 #include <asm/barebox-arm.h>
 
 #include <mach/at91_ddrsdrc.h>
 
 #include <mach/hardware.h>
 
-ENTRY_FUNCTION(start_pm9g45, r0, r1, r2)
+ENTRY_FUNCTION_AT91(start_pm9g45, r0, r1, r2)
 {
 	arm_cpu_lowlevel_init();
 
diff --git a/arch/arm/boards/qil-a926x/lowlevel.c b/arch/arm/boards/qil-a926x/lowlevel.c
index 3a233fcf17..b75d8ab761 100644
--- a/arch/arm/boards/qil-a926x/lowlevel.c
+++ b/arch/arm/boards/qil-a926x/lowlevel.c
@@ -7,14 +7,14 @@
 #include <common.h>
 #include <init.h>
 
-#include <asm/barebox-arm-head.h>
+#include <mach/barebox-arm-head.h>
 #include <asm/barebox-arm.h>
 
 #include <mach/at91sam9_sdramc.h>
 #include <mach/at91sam9260.h>
 #include <mach/hardware.h>
 
-ENTRY_FUNCTION(start_qil_a926x, r0, r1, r2)
+ENTRY_FUNCTION_AT91(start_qil_a926x, r0, r1, r2)
 {
 	arm_cpu_lowlevel_init();
 
@@ -25,7 +25,7 @@ ENTRY_FUNCTION(start_qil_a926x, r0, r1, r2)
 			  NULL);
 }
 
-ENTRY_FUNCTION(start_qil_a9g20, r0, r1, r2)
+ENTRY_FUNCTION_AT91(start_qil_a9g20, r0, r1, r2)
 {
 	arm_cpu_lowlevel_init();
 
diff --git a/arch/arm/boards/telit-evk-pro3/lowlevel.c b/arch/arm/boards/telit-evk-pro3/lowlevel.c
index 3a613a65a8..f4ea203283 100644
--- a/arch/arm/boards/telit-evk-pro3/lowlevel.c
+++ b/arch/arm/boards/telit-evk-pro3/lowlevel.c
@@ -7,14 +7,14 @@
 #include <common.h>
 #include <init.h>
 
-#include <asm/barebox-arm-head.h>
+#include <mach/barebox-arm-head.h>
 #include <asm/barebox-arm.h>
 
 #include <mach/at91sam9_sdramc.h>
 #include <mach/at91sam9260.h>
 #include <mach/hardware.h>
 
-ENTRY_FUNCTION(start_telit_evk_pro3, r0, r1, r2)
+ENTRY_FUNCTION_AT91(start_telit_evk_pro3, r0, r1, r2)
 {
 	arm_cpu_lowlevel_init();
 
diff --git a/arch/arm/boards/tny-a926x/tny_a9260_lowlevel.c b/arch/arm/boards/tny-a926x/tny_a9260_lowlevel.c
index e78e93528d..1cd420d902 100644
--- a/arch/arm/boards/tny-a926x/tny_a9260_lowlevel.c
+++ b/arch/arm/boards/tny-a926x/tny_a9260_lowlevel.c
@@ -7,14 +7,14 @@
 #include <common.h>
 #include <init.h>
 
-#include <asm/barebox-arm-head.h>
+#include <mach/barebox-arm-head.h>
 #include <asm/barebox-arm.h>
 
 #include <mach/at91sam9_sdramc.h>
 #include <mach/at91sam9260.h>
 #include <mach/hardware.h>
 
-ENTRY_FUNCTION(start_tny_a9260, r0, r1, r2)
+ENTRY_FUNCTION_AT91(start_tny_a9260, r0, r1, r2)
 {
 	arm_cpu_lowlevel_init();
 
@@ -25,7 +25,7 @@ ENTRY_FUNCTION(start_tny_a9260, r0, r1, r2)
 			  NULL);
 }
 
-ENTRY_FUNCTION(start_tny_a9g20, r0, r1, r2)
+ENTRY_FUNCTION_AT91(start_tny_a9g20, r0, r1, r2)
 {
 	arm_cpu_lowlevel_init();
 
diff --git a/arch/arm/boards/tny-a926x/tny_a9263_lowlevel.c b/arch/arm/boards/tny-a926x/tny_a9263_lowlevel.c
index b8b813ef12..93c601c8cb 100644
--- a/arch/arm/boards/tny-a926x/tny_a9263_lowlevel.c
+++ b/arch/arm/boards/tny-a926x/tny_a9263_lowlevel.c
@@ -7,7 +7,7 @@
 #include <common.h>
 #include <init.h>
 
-#include <asm/barebox-arm-head.h>
+#include <mach/barebox-arm-head.h>
 #include <asm/barebox-arm.h>
 
 #include <mach/at91sam926x_board_init.h>
@@ -118,7 +118,7 @@ static void __bare_init tny_a9263_init(void)
 	                  NULL);
 }
 
-ENTRY_FUNCTION(start_tny_a9263, r0, r1, r2)
+ENTRY_FUNCTION_AT91(start_tny_a9263, r0, r1, r2)
 {
 	arm_cpu_lowlevel_init();
 
diff --git a/arch/arm/boards/usb-a926x/usb_a9260_lowlevel.c b/arch/arm/boards/usb-a926x/usb_a9260_lowlevel.c
index 7e3ee80ab7..1f4febde11 100644
--- a/arch/arm/boards/usb-a926x/usb_a9260_lowlevel.c
+++ b/arch/arm/boards/usb-a926x/usb_a9260_lowlevel.c
@@ -7,14 +7,14 @@
 #include <common.h>
 #include <init.h>
 
-#include <asm/barebox-arm-head.h>
+#include <mach/barebox-arm-head.h>
 #include <asm/barebox-arm.h>
 
 #include <mach/at91sam9_sdramc.h>
 #include <mach/at91sam9260.h>
 #include <mach/hardware.h>
 
-ENTRY_FUNCTION(start_usb_a9260, r0, r1, r2)
+ENTRY_FUNCTION_AT91(start_usb_a9260, r0, r1, r2)
 {
 	arm_cpu_lowlevel_init();
 
@@ -25,7 +25,7 @@ ENTRY_FUNCTION(start_usb_a9260, r0, r1, r2)
 			  NULL);
 }
 
-ENTRY_FUNCTION(start_usb_a9g20, r0, r1, r2)
+ENTRY_FUNCTION_AT91(start_usb_a9g20, r0, r1, r2)
 {
 	arm_cpu_lowlevel_init();
 
diff --git a/arch/arm/boards/usb-a926x/usb_a9263_lowlevel.c b/arch/arm/boards/usb-a926x/usb_a9263_lowlevel.c
index 0597321084..25e63f5180 100644
--- a/arch/arm/boards/usb-a926x/usb_a9263_lowlevel.c
+++ b/arch/arm/boards/usb-a926x/usb_a9263_lowlevel.c
@@ -6,6 +6,7 @@
 
 #include <linux/sizes.h>
 
+#include <mach/barebox-arm-head.h>
 #include <asm/barebox-arm.h>
 
 #include <mach/at91sam926x_board_init.h>
@@ -122,7 +123,7 @@ static void __bare_init usb_a9263_init(bool has_mem_128m)
 	                  NULL);
 }
 
-ENTRY_FUNCTION(start_usb_a9263, r0, r1, r2)
+ENTRY_FUNCTION_AT91(start_usb_a9263, r0, r1, r2)
 {
 	arm_cpu_lowlevel_init();
 
@@ -131,7 +132,7 @@ ENTRY_FUNCTION(start_usb_a9263, r0, r1, r2)
 	usb_a9263_init(false);
 }
 
-ENTRY_FUNCTION(start_usb_a9263_128m, r0, r1, r2)
+ENTRY_FUNCTION_AT91(start_usb_a9263_128m, r0, r1, r2)
 {
 	arm_cpu_lowlevel_init();
 
diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
index caf296dfcd..b803a1185d 100644
--- a/arch/arm/mach-at91/Kconfig
+++ b/arch/arm/mach-at91/Kconfig
@@ -92,7 +92,6 @@ config SOC_SAMA5D2
 	select HAVE_AT91_I2S_MUX_CLK
 	select PINCTRL_AT91PIO4
 	select HAS_MACB
-	select HAVE_MACH_ARM_HEAD
 	select HAVE_AT91_DDRAMC
 
 config SOC_SAMA5D3
@@ -105,7 +104,6 @@ config SOC_SAMA5D3
 	select HAVE_AT91_UTMI
 	select PINCTRL_AT91
 	select HAS_MACB
-	select HAVE_MACH_ARM_HEAD
 
 config SOC_SAMA5D4
 	bool
@@ -118,7 +116,6 @@ config SOC_SAMA5D4
 	select HAVE_AT91_UTMI
 	select PINCTRL_AT91
 	select HAS_MACB
-	select HAVE_MACH_ARM_HEAD
 
 config SOC_SAM9X60
 	bool
@@ -159,7 +156,6 @@ config SOC_AT91SAM9260
 	select SOC_AT91SAM9
 	select HAS_MACB
 	select PINCTRL_AT91
-	select HAVE_MACH_ARM_HEAD
 	help
 	  Select this if you are using one of Atmel's AT91SAM9260, AT91SAM9XE
 	  or AT91SAM9G20 SoC.
@@ -169,7 +165,6 @@ config SOC_AT91SAM9261
 	select SOC_AT91SAM9
 	select PINCTRL_AT91
 	select HAVE_AT91_LOAD_BAREBOX_SRAM
-	select HAVE_MACH_ARM_HEAD
 	help
 	  Select this if you are using one of Atmel's AT91SAM9261 or AT91SAM9G10 SoC.
 
@@ -178,7 +173,6 @@ config SOC_AT91SAM9263
 	select SOC_AT91SAM9
 	select HAS_MACB
 	select HAVE_AT91_LOAD_BAREBOX_SRAM
-	select HAVE_MACH_ARM_HEAD
 	select PINCTRL_AT91
 
 config SOC_AT91SAM9G45
@@ -186,7 +180,6 @@ config SOC_AT91SAM9G45
 	select SOC_AT91SAM9
 	select HAS_MACB
 	select PINCTRL_AT91
-	select HAVE_MACH_ARM_HEAD
 	help
 	  Select this if you are using one of Atmel's AT91SAM9G45 family SoC.
 	  This support covers AT91SAM9G45, AT91SAM9G46, AT91SAM9M10 and AT91SAM9M11.
@@ -209,7 +202,6 @@ config SOC_AT91SAM9N12
 	bool
 	select SOC_AT91SAM9
 	select PINCTRL_AT91
-	select HAVE_MACH_ARM_HEAD
 	help
 	  Select this if you are using Atmel's AT91SAM9N12 SoC.
 
diff --git a/arch/arm/mach-at91/include/mach/barebox-arm-head.h b/arch/arm/mach-at91/include/mach/barebox-arm-head.h
index 4a95f89fc9..68539ea48f 100644
--- a/arch/arm/mach-at91/include/mach/barebox-arm-head.h
+++ b/arch/arm/mach-at91/include/mach/barebox-arm-head.h
@@ -9,7 +9,9 @@
 #define AT91_EXV6	".word _barebox_bare_init_size\n"
 #endif
 
-static inline void __barebox_arm_head(void)
+#include <linux/compiler.h>
+
+static __always_inline void __barebox_at91_head(void)
 {
 	__asm__ __volatile__ (
 #ifdef CONFIG_THUMB2_BAREBOX
@@ -36,12 +38,6 @@ static inline void __barebox_arm_head(void)
 	);
 }
 
-static inline void barebox_arm_head(void)
-{
-	__barebox_arm_head();
-	__asm__ __volatile__ (
-		"b barebox_arm_reset_vector\n"
-	);
-}
+#define ENTRY_FUNCTION_AT91(fn, r0, r1, r2) ENTRY_FUNCTION_HEAD(fn, __barebox_at91_head, r0, r1, r2)
 
 #endif /* __MACH_ARM_HEAD_H */
-- 
2.30.2




^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH 04/13] ARM: Drop HAVE_MACH_ARM_HEAD
  2023-03-02 11:15 [PATCH 00/13] ARM: misc cleanups Sascha Hauer
                   ` (2 preceding siblings ...)
  2023-03-02 11:15 ` [PATCH 03/13] ARM: at91: " Sascha Hauer
@ 2023-03-02 11:15 ` Sascha Hauer
  2023-03-02 11:15 ` [PATCH 05/13] ARM: drop CONFIG_HAS_ASM_DEBUG_LL Sascha Hauer
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 16+ messages in thread
From: Sascha Hauer @ 2023-03-02 11:15 UTC (permalink / raw)
  To: Barebox List

HAVE_MACH_ARM_HEAD stands in the way of adding multi arch support,
as barebox-arm-head.h compiles differently on different archs.
There are no users left, so remove it.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/Kconfig                        | 3 ---
 arch/arm/include/asm/barebox-arm-head.h | 4 ----
 2 files changed, 7 deletions(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 1281b8be38..6aa0ec4074 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -16,9 +16,6 @@ config ARM_LINUX
 	default y
 	depends on CMD_BOOTZ || CMD_BOOTU || BOOTM
 
-config HAVE_MACH_ARM_HEAD
-	bool
-
 config ARM_USE_COMPRESSED_DTB
        bool
        select USE_COMPRESSED_DTB
diff --git a/arch/arm/include/asm/barebox-arm-head.h b/arch/arm/include/asm/barebox-arm-head.h
index 1a1d58c1aa..135d0585b1 100644
--- a/arch/arm/include/asm/barebox-arm-head.h
+++ b/arch/arm/include/asm/barebox-arm-head.h
@@ -19,9 +19,6 @@ void barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2);
 #define ARM_HEAD_SPARE_MARKER	0x55555555
 
 #ifdef CONFIG_CPU_32
-#ifdef CONFIG_HAVE_MACH_ARM_HEAD
-#include <mach/barebox-arm-head.h>
-#else
 static inline void __barebox_arm_head(void)
 {
 	__asm__ __volatile__ (
@@ -71,7 +68,6 @@ static inline void barebox_arm_head(void)
 	);
 }
 #endif
-#endif
 
 #endif /* __ASSEMBLY__ */
 
-- 
2.30.2




^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH 05/13] ARM: drop CONFIG_HAS_ASM_DEBUG_LL
  2023-03-02 11:15 [PATCH 00/13] ARM: misc cleanups Sascha Hauer
                   ` (3 preceding siblings ...)
  2023-03-02 11:15 ` [PATCH 04/13] ARM: Drop HAVE_MACH_ARM_HEAD Sascha Hauer
@ 2023-03-02 11:15 ` Sascha Hauer
  2023-03-02 11:15 ` [PATCH 06/13] regulator: pfuze: remove unused include Sascha Hauer
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 16+ messages in thread
From: Sascha Hauer @ 2023-03-02 11:15 UTC (permalink / raw)
  To: Barebox List

When CONFIG_HAS_ASM_DEBUG_LL is set then include/debug_ll.h includes
asm/debug_ll.h, otherwise it includes mach/debug_ll.h.  Drop this option
and instead always include asm/debug_ll.h and include mach/debug_ll.h
from there if necessary. This also adds the missing asm/debug_ll.h for
architectures which previously did not have that file.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/Kconfig                 |  2 +-
 arch/arm/include/asm/debug_ll.h  |  2 ++
 arch/mips/include/asm/debug_ll.h |  6 ++++++
 arch/riscv/Kconfig.socs          | 12 ++++++------
 arch/sandbox/Kconfig             |  2 +-
 arch/x86/include/asm/debug_ll.h  |  6 ++++++
 common/Kconfig                   |  4 ----
 include/debug_ll.h               |  8 ++------
 8 files changed, 24 insertions(+), 18 deletions(-)
 create mode 100644 arch/mips/include/asm/debug_ll.h
 create mode 100644 arch/x86/include/asm/debug_ll.h

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 6aa0ec4074..fccdef9d71 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -273,7 +273,7 @@ config ARCH_ARM64_VIRT
 	select ARM_AMBA
 	select BOARD_ARM_VIRT
 	select HW_HAS_PCI
-	select HAS_ASM_DEBUG_LL
+	select HAS_DEBUG_LL
 
 endchoice
 
diff --git a/arch/arm/include/asm/debug_ll.h b/arch/arm/include/asm/debug_ll.h
index d7b25a7fca..89ca106117 100644
--- a/arch/arm/include/asm/debug_ll.h
+++ b/arch/arm/include/asm/debug_ll.h
@@ -6,6 +6,8 @@
 #ifdef CONFIG_DEBUG_QEMU_ARM64_VIRT
 #define DEBUG_LL_UART_ADDR		0x9000000
 #include <debug_ll/pl011.h>
+#else
+#include <mach/debug_ll.h>
 #endif
 
 #endif
diff --git a/arch/mips/include/asm/debug_ll.h b/arch/mips/include/asm/debug_ll.h
new file mode 100644
index 0000000000..96e2082dc8
--- /dev/null
+++ b/arch/mips/include/asm/debug_ll.h
@@ -0,0 +1,6 @@
+#ifndef __ASM_MIPS_DEBUG_LL_H
+#define __ASM_MIPS_DEBUG_LL_H
+
+#include <mach/debug_ll.h>
+
+#endif /* __ASM_MIPS_DEBUG_LL_H */
diff --git a/arch/riscv/Kconfig.socs b/arch/riscv/Kconfig.socs
index 0f03637a66..2cb0716cd5 100644
--- a/arch/riscv/Kconfig.socs
+++ b/arch/riscv/Kconfig.socs
@@ -5,7 +5,7 @@ menu "SoC selection"
 config SOC_ERIZO
 	bool "Erizo SoC"
 	depends on ARCH_RV32I
-	select HAS_ASM_DEBUG_LL
+	select HAS_DEBUG_LL
 	select HAS_NMON
 	select USE_COMPRESSED_DTB
 	select RISCV_M_MODE
@@ -20,7 +20,7 @@ config SOC_VIRT
 	select RISCV_S_MODE
 	select BOARD_RISCV_GENERIC_DT
 	select HAS_CACHE
-	select HAS_ASM_DEBUG_LL
+	select HAS_DEBUG_LL
 	help
 	  Generates an image tht can be be booted by QEMU. The image is called
 	  barebox-dt-2nd.img
@@ -55,7 +55,7 @@ config SOC_SIFIVE
 	select CLK_SIFIVE_PRCI
 	select RISCV_TIMER
 	select HAS_MACB
-	select HAS_ASM_DEBUG_LL
+	select HAS_DEBUG_LL
 	help
 	  This enables support for SiFive SoC platform hardware.
 
@@ -72,7 +72,7 @@ config SOC_STARFIVE
 	bool "StarFive SoCs"
 	select ARCH_HAS_RESET_CONTROLLER
 	select RISCV_S_MODE
-	select HAS_ASM_DEBUG_LL
+	select HAS_DEBUG_LL
 	select HAS_NMON
 	help
 	  This enables support for SiFive SoC platform hardware.
@@ -113,7 +113,7 @@ endif
 config SOC_ALLWINNER_SUN20I
 	bool "Allwinner Sun20i SoCs"
 	depends on ARCH_RV64I
-	select HAS_ASM_DEBUG_LL
+	select HAS_DEBUG_LL
 	select HAS_CACHE
 
 if SOC_ALLWINNER_SUN20I
@@ -135,7 +135,7 @@ config SIFIVE_L2
 config SOC_LITEX
 	bool "LiteX SoCs"
 	depends on ARCH_RV32I
-	select HAS_ASM_DEBUG_LL
+	select HAS_DEBUG_LL
 	select HAS_NMON
 	select USE_COMPRESSED_DTB
 	select RISCV_TIMER
diff --git a/arch/sandbox/Kconfig b/arch/sandbox/Kconfig
index 366a1d0b52..31c4484cf1 100644
--- a/arch/sandbox/Kconfig
+++ b/arch/sandbox/Kconfig
@@ -16,7 +16,7 @@ config SANDBOX
 	select ARCH_HAS_STACK_DUMP if ASAN
 	select GENERIC_FIND_NEXT_BIT
 	select ARCH_HAS_SJLJ
-	select HAS_ASM_DEBUG_LL
+	select HAS_DEBUG_LL
 	default y
 
 config ARCH_TEXT_BASE
diff --git a/arch/x86/include/asm/debug_ll.h b/arch/x86/include/asm/debug_ll.h
new file mode 100644
index 0000000000..e75090b4ba
--- /dev/null
+++ b/arch/x86/include/asm/debug_ll.h
@@ -0,0 +1,6 @@
+#ifndef __ASM_X86_DEBUG_LL_H
+#define __ASM_X86_DEBUG_LL_H
+
+#include <mach/debug_ll.h>
+
+#endif /* __ASM_X86_DEBUG_LL_H */
diff --git a/common/Kconfig b/common/Kconfig
index d957970993..96ab687af2 100644
--- a/common/Kconfig
+++ b/common/Kconfig
@@ -1639,10 +1639,6 @@ source "common/efi/Kconfig"
 config HAS_DEBUG_LL
 	bool
 
-config HAS_ASM_DEBUG_LL
-	bool
-	select HAS_DEBUG_LL
-
 config DDR_SPD
 	bool
 	select CRC_ITU_T
diff --git a/include/debug_ll.h b/include/debug_ll.h
index 856a157bf5..0128ab524a 100644
--- a/include/debug_ll.h
+++ b/include/debug_ll.h
@@ -12,18 +12,14 @@
 #define   __INCLUDE_DEBUG_LL_H__
 
 #ifdef CONFIG_HAS_DEBUG_LL
-#ifdef CONFIG_HAS_ASM_DEBUG_LL
-#include <asm/debug_ll.h>
-#else
 /*
- * mach/debug_ll.h should implement PUTC_LL. This can be a macro or a static
+ * asm/debug_ll.h should implement PUTC_LL. This can be a macro or a static
  * inline function. Note that several SoCs expect the UART to be initialized
  * by a debugger or a first stage bootloader. You won't see anything without
  * this initialization. Depending on the PUTC_LL implementation the board might
  * also hang in PUTC_LL without proper initialization.
  */
-#include <mach/debug_ll.h>
-#endif
+#include <asm/debug_ll.h>
 #endif
 
 #if defined (CONFIG_DEBUG_LL)
-- 
2.30.2




^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH 06/13] regulator: pfuze: remove unused include
  2023-03-02 11:15 [PATCH 00/13] ARM: misc cleanups Sascha Hauer
                   ` (4 preceding siblings ...)
  2023-03-02 11:15 ` [PATCH 05/13] ARM: drop CONFIG_HAS_ASM_DEBUG_LL Sascha Hauer
@ 2023-03-02 11:15 ` Sascha Hauer
  2023-03-02 11:16 ` [PATCH 07/13] ARM: drop unused zynq code in Makefile Sascha Hauer
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 16+ messages in thread
From: Sascha Hauer @ 2023-03-02 11:15 UTC (permalink / raw)
  To: Barebox List

Nothing is used from mach/imx6.h, so drop its inclusion.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/regulator/pfuze.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/regulator/pfuze.c b/drivers/regulator/pfuze.c
index 51a2ca1245..8945ee7c15 100644
--- a/drivers/regulator/pfuze.c
+++ b/drivers/regulator/pfuze.c
@@ -16,7 +16,6 @@
 #include <i2c/i2c.h>
 
 #include <poweroff.h>
-#include <mach/imx6.h>
 
 #define DRIVERNAME		"pfuze"
 
-- 
2.30.2




^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH 07/13] ARM: drop unused zynq code in Makefile
  2023-03-02 11:15 [PATCH 00/13] ARM: misc cleanups Sascha Hauer
                   ` (5 preceding siblings ...)
  2023-03-02 11:15 ` [PATCH 06/13] regulator: pfuze: remove unused include Sascha Hauer
@ 2023-03-02 11:16 ` Sascha Hauer
  2023-03-02 11:16 ` [PATCH 08/13] ARM: drop unused mvebu " Sascha Hauer
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 16+ messages in thread
From: Sascha Hauer @ 2023-03-02 11:16 UTC (permalink / raw)
  To: Barebox List

The Zynq board in tree is converted to multi-image, thus doesn't
need image generation in arch/arm/Makefile anymore. Drop it.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 Makefile          |  2 +-
 arch/arm/Makefile | 10 ----------
 2 files changed, 1 insertion(+), 11 deletions(-)

diff --git a/Makefile b/Makefile
index aff89bb939..bcc94cd13a 100644
--- a/Makefile
+++ b/Makefile
@@ -1145,7 +1145,7 @@ CLEAN_FILES +=	barebox System.map stickypage.bin include/generated/barebox_defau
                 .tmp_version .tmp_barebox* barebox.bin barebox.map \
 		.tmp_kallsyms* barebox.ldr compile_commands.json \
 		barebox-flash-image \
-		barebox.srec barebox.s5p barebox.ubl barebox.zynq \
+		barebox.srec barebox.s5p barebox.ubl \
 		barebox.uimage barebox.spi barebox.kwb barebox.kwbuart \
 		barebox.efi barebox.canon-a1100.bin
 
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index 861b726496..3738b4d15a 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -187,16 +187,6 @@ ifeq ($(CONFIG_OMAP_BUILD_SPI),y)
 KBUILD_IMAGE := MLO.spi
 endif
 
-quiet_cmd_zynq_image = ZYNQ-IMG $@
-      cmd_zynq_image = scripts/zynq_mkimage $< $@
-
-barebox.zynq: $(KBUILD_BINARY) FORCE
-	$(call if_changed,zynq_image)
-
-ifeq ($(machine-y),zynq)
-KBUILD_IMAGE := barebox.zynq
-endif
-
 quiet_cmd_canon_a1100_image = DD      $@
       cmd_canon_a1100_image = scripts/canon-a1100-image $< $@ || \
 	echo "WARNING: Couldn't create Canon A1100 image due to previous errors."
-- 
2.30.2




^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH 08/13] ARM: drop unused mvebu code in Makefile
  2023-03-02 11:15 [PATCH 00/13] ARM: misc cleanups Sascha Hauer
                   ` (6 preceding siblings ...)
  2023-03-02 11:16 ` [PATCH 07/13] ARM: drop unused zynq code in Makefile Sascha Hauer
@ 2023-03-02 11:16 ` Sascha Hauer
  2023-03-02 11:16 ` [PATCH 09/13] ARM: drop unused am35xx " Sascha Hauer
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 16+ messages in thread
From: Sascha Hauer @ 2023-03-02 11:16 UTC (permalink / raw)
  To: Barebox List

All mvebu boards are multi-image, so they don't need image generation
in arch/arm/Makefile anymore. Drop it.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 Makefile          |  2 +-
 arch/arm/Makefile | 21 ---------------------
 2 files changed, 1 insertion(+), 22 deletions(-)

diff --git a/Makefile b/Makefile
index bcc94cd13a..d7b4cc6ce9 100644
--- a/Makefile
+++ b/Makefile
@@ -1146,7 +1146,7 @@ CLEAN_FILES +=	barebox System.map stickypage.bin include/generated/barebox_defau
 		.tmp_kallsyms* barebox.ldr compile_commands.json \
 		barebox-flash-image \
 		barebox.srec barebox.s5p barebox.ubl \
-		barebox.uimage barebox.spi barebox.kwb barebox.kwbuart \
+		barebox.uimage barebox.spi \
 		barebox.efi barebox.canon-a1100.bin
 
 CLEAN_FILES +=	scripts/bareboxenv-target scripts/kernel-install-target \
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index 3738b4d15a..3867d48427 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -197,27 +197,6 @@ ifeq ($(CONFIG_MACH_CANON_A1100),y)
 KBUILD_IMAGE := barebox.canon-a1100.bin
 endif
 
-KWBIMAGE_OPTS = \
-	-c -i $(srctree)/$(BOARD)/kwbimage.cfg -d $(TEXT_BASE) -e $(TEXT_BASE)
-
-quiet_cmd_kwbimage = KWB     $@
-      cmd_kwbimage = scripts/kwbimage -p $< $(KWBIMAGE_OPTS) -o $@ || \
-	echo "WARNING: Couldn't create KWB image due to previous errors."
-
-quiet_cmd_kwbimage_uart = KWBUART $@
-      cmd_kwbimage_uart = scripts/kwbimage -m uart -p $< $(KWBIMAGE_OPTS) -o $@ || \
-	echo "WARNING Couldn't create KWB image due to previous errors."
-
-barebox.kwb: $(KBUILD_BINARY) FORCE
-	$(call if_changed,kwbimage)
-
-barebox.kwbuart: $(KBUILD_BINARY) FORCE
-	$(call if_changed,kwbimage_uart)
-
-ifeq ($(CONFIG_ARCH_MVEBU),y)
-KBUILD_IMAGE  := barebox.kwb barebox.kwbuart
-endif
-
 archclean:
 	$(MAKE) $(clean)=$(pbl)
 
-- 
2.30.2




^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH 09/13] ARM: drop unused am35xx code in Makefile
  2023-03-02 11:15 [PATCH 00/13] ARM: misc cleanups Sascha Hauer
                   ` (7 preceding siblings ...)
  2023-03-02 11:16 ` [PATCH 08/13] ARM: drop unused mvebu " Sascha Hauer
@ 2023-03-02 11:16 ` Sascha Hauer
  2023-03-02 11:16 ` [PATCH 10/13] ARM: Makefile: Drop board-y Sascha Hauer
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 16+ messages in thread
From: Sascha Hauer @ 2023-03-02 11:16 UTC (permalink / raw)
  To: Barebox List

All users of AM335x SPI images are multi-image, so the SPI image
generation code in arch/arm/Makefile is unused. Drop it.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 Makefile          |  2 +-
 arch/arm/Makefile | 13 -------------
 2 files changed, 1 insertion(+), 14 deletions(-)

diff --git a/Makefile b/Makefile
index d7b4cc6ce9..b7e22d9e8b 100644
--- a/Makefile
+++ b/Makefile
@@ -1146,7 +1146,7 @@ CLEAN_FILES +=	barebox System.map stickypage.bin include/generated/barebox_defau
 		.tmp_kallsyms* barebox.ldr compile_commands.json \
 		barebox-flash-image \
 		barebox.srec barebox.s5p barebox.ubl \
-		barebox.uimage barebox.spi \
+		barebox.uimage \
 		barebox.efi barebox.canon-a1100.bin
 
 CLEAN_FILES +=	scripts/bareboxenv-target scripts/kernel-install-target \
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index 3867d48427..0a81e6c254 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -174,19 +174,6 @@ ifeq ($(CONFIG_ARCH_DAVINCI),y)
 KBUILD_IMAGE := barebox.ubl
 endif
 
-quiet_cmd_am35xx_spi_image = SPI-IMG $@
-      cmd_am35xx_spi_image = scripts/mk-omap-image -s -a $(TEXT_BASE) $< > $@
-
-barebox.spi: $(KBUILD_BINARY) FORCE
-	$(call if_changed,am35xx_spi_image)
-
-MLO.spi: MLO FORCE
-	$(call if_changed,am35xx_spi_image)
-
-ifeq ($(CONFIG_OMAP_BUILD_SPI),y)
-KBUILD_IMAGE := MLO.spi
-endif
-
 quiet_cmd_canon_a1100_image = DD      $@
       cmd_canon_a1100_image = scripts/canon-a1100-image $< $@ || \
 	echo "WARNING: Couldn't create Canon A1100 image due to previous errors."
-- 
2.30.2




^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH 10/13] ARM: Makefile: Drop board-y
  2023-03-02 11:15 [PATCH 00/13] ARM: misc cleanups Sascha Hauer
                   ` (8 preceding siblings ...)
  2023-03-02 11:16 ` [PATCH 09/13] ARM: drop unused am35xx " Sascha Hauer
@ 2023-03-02 11:16 ` Sascha Hauer
  2023-03-02 11:16 ` [PATCH 11/13] ARM: i.MX: Add missing include Sascha Hauer
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 16+ messages in thread
From: Sascha Hauer @ 2023-03-02 11:16 UTC (permalink / raw)
  To: Barebox List

board-y has the only purpose to include a global config.h file directly
with #include <config.h>. This is no longer needed, let the remaining
users include their config.h directly.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/Makefile                             | 21 +------------------
 arch/arm/boards/Makefile                      |  2 ++
 arch/arm/boards/at91rm9200ek/lowlevel.c       |  2 ++
 .../phytec-phycore-pxa270/lowlevel_init.S     |  1 +
 4 files changed, 6 insertions(+), 20 deletions(-)

diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index 0a81e6c254..6d4bfa8c45 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -109,19 +109,6 @@ machine-$(CONFIG_ARCH_UEMD)		:= uemd
 machine-$(CONFIG_ARCH_ZYNQ)		:= zynq
 machine-$(CONFIG_ARCH_ZYNQMP)		:= zynqmp
 
-
-# Board directory name.  This list is sorted alphanumerically
-# by CONFIG_* macro name.
-#
-# DO NOT ADD NEW ENTRIES TO THIS LIST!
-# Add to arch/arm/boards/Makefile instead.
-#
-# These are here only because they have a board specific config.h.
-# TODO: Get rid of board specific config.h and move these to
-# arch/arm/boards/Makefile aswell.
-board-$(CONFIG_MACH_AT91RM9200EK)		+= at91rm9200ek
-board-$(CONFIG_MACH_PCM027)			+= phytec-phycore-pxa270
-
 machdirs := $(patsubst %,arch/arm/mach-%/,$(machine-y))
 
 KBUILD_CPPFLAGS += $(patsubst %,-I$(srctree)/%include,$(machdirs))
@@ -200,19 +187,13 @@ maketools:
 
 PHONY += maketools
 
-ifneq ($(board-y),)
-BOARD := arch/arm/boards/$(board-y)/
-else
-BOARD :=
-endif
-
 ifneq ($(machine-y),)
 MACH := arch/arm/mach-$(machine-y)/
 else
 MACH :=
 endif
 
-common-y += $(BOARD) arch/arm/boards/ $(MACH)
+common-y += arch/arm/boards/ $(MACH)
 common-y += arch/arm/cpu/
 
 ifeq ($(CONFIG_CPU_V8), y)
diff --git a/arch/arm/boards/Makefile b/arch/arm/boards/Makefile
index 828852c596..1c1b14bca8 100644
--- a/arch/arm/boards/Makefile
+++ b/arch/arm/boards/Makefile
@@ -5,6 +5,7 @@ obj-$(CONFIG_MACH_ADVANTECH_ROM_742X)		+= advantech-mx6/
 obj-$(CONFIG_MACH_AFI_GF)			+= afi-gf/
 obj-$(CONFIG_MACH_ANIMEO_IP)			+= animeo_ip/
 obj-$(CONFIG_MACH_ARCHOSG9)			+= archosg9/
+obj-$(CONFIG_MACH_AT91RM9200EK)			+= at91rm9200ek/
 obj-$(CONFIG_MACH_AT91SAM9260EK)		+= at91sam9260ek/
 obj-$(CONFIG_MACH_AT91SAM9261EK)		+= at91sam9261ek/
 obj-$(CONFIG_MACH_AT91SAM9263EK)		+= at91sam9263ek/
@@ -87,6 +88,7 @@ obj-$(CONFIG_MACH_PANDA)			+= panda/
 obj-$(CONFIG_MACH_PCA100)			+= phytec-phycard-imx27/
 obj-$(CONFIG_MACH_PCAAL1)			+= phytec-phycard-omap3/
 obj-$(CONFIG_MACH_PCAAXL2)			+= phytec-phycard-omap4/
+obj-$(CONFIG_MACH_PCM027)			+= phytec-phycore-pxa270/
 obj-$(CONFIG_MACH_PCM038)			+= phytec-phycore-imx27/
 obj-$(CONFIG_MACH_PCM049)			+= phytec-phycore-omap4460/
 obj-$(CONFIG_MACH_PHYTEC_SOM_AM335X)		+= phytec-som-am335x/
diff --git a/arch/arm/boards/at91rm9200ek/lowlevel.c b/arch/arm/boards/at91rm9200ek/lowlevel.c
index 9180a484aa..0c26d719fd 100644
--- a/arch/arm/boards/at91rm9200ek/lowlevel.c
+++ b/arch/arm/boards/at91rm9200ek/lowlevel.c
@@ -16,6 +16,8 @@
 #include <mach/at91_pmc.h>
 #include <mach/hardware.h>
 
+#include "config.h"
+
 void static inline access_sdram(void)
 {
 	writel(0x00000000, AT91_CHIPSELECT_1);
diff --git a/arch/arm/boards/phytec-phycore-pxa270/lowlevel_init.S b/arch/arm/boards/phytec-phycore-pxa270/lowlevel_init.S
index 9c6366cc2a..8790bdfc09 100644
--- a/arch/arm/boards/phytec-phycore-pxa270/lowlevel_init.S
+++ b/arch/arm/boards/phytec-phycore-pxa270/lowlevel_init.S
@@ -17,6 +17,7 @@
 #include <mach/regs-ost.h>
 #include <mach/regs-intc.h>
 #include <asm/barebox-arm-head.h>
+#include "config.h"
 
 #define GPSR0		0x40E00018	/* GPIO Pin Output Set Register GPIO <31:00> */
 #define GPSR1		0x40E0001C	/* GPIO Pin Output Set Register GPIO <63:32> */
-- 
2.30.2




^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH 11/13] ARM: i.MX: Add missing include
  2023-03-02 11:15 [PATCH 00/13] ARM: misc cleanups Sascha Hauer
                   ` (9 preceding siblings ...)
  2023-03-02 11:16 ` [PATCH 10/13] ARM: Makefile: Drop board-y Sascha Hauer
@ 2023-03-02 11:16 ` Sascha Hauer
  2023-03-02 11:16 ` [PATCH 12/13] ARM: stm32mp_defconfig: Enable remaining boards Sascha Hauer
  2023-03-02 11:16 ` [PATCH 13/13] mci: imx-esdhc-pbl: add missing include Sascha Hauer
  12 siblings, 0 replies; 16+ messages in thread
From: Sascha Hauer @ 2023-03-02 11:16 UTC (permalink / raw)
  To: Barebox List

imx7-ccm-regs.h uses MX7_CCM_BASE_ADDR which is defined in imx7-regs.h,
so include that file.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/mach-imx/include/mach/imx7-ccm-regs.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/mach-imx/include/mach/imx7-ccm-regs.h b/arch/arm/mach-imx/include/mach/imx7-ccm-regs.h
index 96fad868fa..1ad4d4977a 100644
--- a/arch/arm/mach-imx/include/mach/imx7-ccm-regs.h
+++ b/arch/arm/mach-imx/include/mach/imx7-ccm-regs.h
@@ -5,6 +5,7 @@
 
 #include <io.h>
 #include <linux/build_bug.h>
+#include <mach/imx/imx7-regs.h>
 
 #define IMX7_CLOCK_ROOT_INDEX(x)	(((x) - 0x8000) / 128)
 
-- 
2.30.2




^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH 12/13] ARM: stm32mp_defconfig: Enable remaining boards
  2023-03-02 11:15 [PATCH 00/13] ARM: misc cleanups Sascha Hauer
                   ` (10 preceding siblings ...)
  2023-03-02 11:16 ` [PATCH 11/13] ARM: i.MX: Add missing include Sascha Hauer
@ 2023-03-02 11:16 ` Sascha Hauer
  2023-03-02 11:16 ` [PATCH 13/13] mci: imx-esdhc-pbl: add missing include Sascha Hauer
  12 siblings, 0 replies; 16+ messages in thread
From: Sascha Hauer @ 2023-03-02 11:16 UTC (permalink / raw)
  To: Barebox List

The stm32mp13xx-dk and the phytec-phycore-stm32mp1 are not enabled
in the defconfig. Enable them to get a better compile coverage.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/configs/stm32mp_defconfig | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/configs/stm32mp_defconfig b/arch/arm/configs/stm32mp_defconfig
index 2fec3a2d3b..1a8548b3e2 100644
--- a/arch/arm/configs/stm32mp_defconfig
+++ b/arch/arm/configs/stm32mp_defconfig
@@ -1,9 +1,11 @@
 CONFIG_ARCH_STM32MP=y
+CONFIG_MACH_STM32MP13XX_DK=y
 CONFIG_MACH_STM32MP15XX_DKX=y
 CONFIG_MACH_LXA_MC1=y
 CONFIG_MACH_SEEED_ODYSSEY=y
 CONFIG_MACH_STM32MP15X_EV1=y
 CONFIG_MACH_PROTONIC_STM32MP1=y
+CONFIG_MACH_PHYTEC_PHYCORE_STM32MP1=y
 CONFIG_BOARD_ARM_GENERIC_DT=y
 CONFIG_THUMB2_BAREBOX=y
 CONFIG_ARM_BOARD_APPEND_ATAG=y
-- 
2.30.2




^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH 13/13] mci: imx-esdhc-pbl: add missing include
  2023-03-02 11:15 [PATCH 00/13] ARM: misc cleanups Sascha Hauer
                   ` (11 preceding siblings ...)
  2023-03-02 11:16 ` [PATCH 12/13] ARM: stm32mp_defconfig: Enable remaining boards Sascha Hauer
@ 2023-03-02 11:16 ` Sascha Hauer
  12 siblings, 0 replies; 16+ messages in thread
From: Sascha Hauer @ 2023-03-02 11:16 UTC (permalink / raw)
  To: Barebox List

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/mci/imx-esdhc-pbl.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/mci/imx-esdhc-pbl.c b/drivers/mci/imx-esdhc-pbl.c
index c81eba5b9d..ea0b395bef 100644
--- a/drivers/mci/imx-esdhc-pbl.c
+++ b/drivers/mci/imx-esdhc-pbl.c
@@ -17,6 +17,9 @@
 #include <mach/imx8mm-regs.h>
 #include <mach/imx-header.h>
 #endif
+#ifdef CONFIG_ARCH_LS1046
+#include <mach/layerscape/xload.h>
+#endif
 #include "sdhci.h"
 #include "imx-esdhc.h"
 
-- 
2.30.2




^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 03/13] ARM: at91: Use ENTRY_FUNCTION_HEAD
  2023-03-02 11:15 ` [PATCH 03/13] ARM: at91: " Sascha Hauer
@ 2023-03-02 16:40   ` Ahmad Fatoum
  2023-03-03  8:32     ` Sascha Hauer
  0 siblings, 1 reply; 16+ messages in thread
From: Ahmad Fatoum @ 2023-03-02 16:40 UTC (permalink / raw)
  To: Sascha Hauer, Barebox List

On 02.03.23 12:15, Sascha Hauer wrote:
> Use ENTRY_FUNCTION_HEAD in the at91 boards to customize the barebox
> image header without having to hook into a generic include file.
> 
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> ---
>  arch/arm/boards/animeo_ip/lowlevel.c               |  4 ++--
>  arch/arm/boards/at91rm9200ek/lowlevel.c            |  4 ++--
>  arch/arm/boards/at91sam9260ek/lowlevel.c           |  6 +++---
>  arch/arm/boards/at91sam9261ek/lowlevel_init.c      |  5 +++--
>  arch/arm/boards/at91sam9m10g45ek/lowlevel.c        |  4 ++--
>  arch/arm/boards/at91sam9m10ihd/lowlevel.c          |  4 ++--
>  arch/arm/boards/at91sam9n12ek/lowlevel.c           |  4 ++--
>  arch/arm/boards/dss11/lowlevel.c                   |  4 ++--
>  arch/arm/boards/haba-knx/lowlevel.c                |  4 ++--
>  arch/arm/boards/pm9261/lowlevel_init.c             |  3 ++-
>  arch/arm/boards/pm9263/lowlevel_init.c             |  3 ++-
>  arch/arm/boards/pm9g45/lowlevel.c                  |  4 ++--
>  arch/arm/boards/qil-a926x/lowlevel.c               |  6 +++---
>  arch/arm/boards/telit-evk-pro3/lowlevel.c          |  4 ++--
>  arch/arm/boards/tny-a926x/tny_a9260_lowlevel.c     |  6 +++---
>  arch/arm/boards/tny-a926x/tny_a9263_lowlevel.c     |  4 ++--
>  arch/arm/boards/usb-a926x/usb_a9260_lowlevel.c     |  6 +++---
>  arch/arm/boards/usb-a926x/usb_a9263_lowlevel.c     |  5 +++--
>  arch/arm/mach-at91/Kconfig                         |  8 --------
>  arch/arm/mach-at91/include/mach/barebox-arm-head.h | 12 ++++--------
>  20 files changed, 46 insertions(+), 54 deletions(-)
> 
> diff --git a/arch/arm/boards/animeo_ip/lowlevel.c b/arch/arm/boards/animeo_ip/lowlevel.c
> index 2d443f5384..f56f59fa8e 100644
> --- a/arch/arm/boards/animeo_ip/lowlevel.c
> +++ b/arch/arm/boards/animeo_ip/lowlevel.c
> @@ -7,14 +7,14 @@
>  #include <common.h>
>  #include <init.h>
>  
> -#include <asm/barebox-arm-head.h>
> +#include <mach/barebox-arm-head.h>
>  #include <asm/barebox-arm.h>
>  
>  #include <mach/at91sam9_sdramc.h>
>  #include <mach/at91sam9260.h>
>  #include <mach/hardware.h>
>  
> -ENTRY_FUNCTION(start_animeo_ip, r0, r1, r2)
> +ENTRY_FUNCTION_AT91(start_animeo_ip, r0, r1, r2)

There's SAMA5_ENTRY_FUNCTION, so it's a bit unfortunate that it's
the other way round here.

>  {
>  	arm_cpu_lowlevel_init();
>  
> diff --git a/arch/arm/boards/at91rm9200ek/lowlevel.c b/arch/arm/boards/at91rm9200ek/lowlevel.c
> index ba62f1116d..9180a484aa 100644
> --- a/arch/arm/boards/at91rm9200ek/lowlevel.c
> +++ b/arch/arm/boards/at91rm9200ek/lowlevel.c
> @@ -7,7 +7,7 @@
>  #include <common.h>
>  #include <init.h>
>  
> -#include <asm/barebox-arm-head.h>
> +#include <mach/barebox-arm-head.h>
>  #include <asm/barebox-arm.h>
>  
>  #include <mach/at91rm9200_mc.h>
> @@ -21,7 +21,7 @@ void static inline access_sdram(void)
>  	writel(0x00000000, AT91_CHIPSELECT_1);
>  }
>  
> -ENTRY_FUNCTION(start_at91rm9200ek, r0, r1, r2)
> +ENTRY_FUNCTION_AT91(start_at91rm9200ek, r0, r1, r2)
>  {
>  	u32 r;
>  	int i;
> diff --git a/arch/arm/boards/at91sam9260ek/lowlevel.c b/arch/arm/boards/at91sam9260ek/lowlevel.c
> index 81fe70278b..a44cfc6b35 100644
> --- a/arch/arm/boards/at91sam9260ek/lowlevel.c
> +++ b/arch/arm/boards/at91sam9260ek/lowlevel.c
> @@ -7,14 +7,14 @@
>  #include <common.h>
>  #include <init.h>
>  
> -#include <asm/barebox-arm-head.h>
> +#include <mach/barebox-arm-head.h>
>  #include <asm/barebox-arm.h>
>  
>  #include <mach/at91sam9_sdramc.h>
>  #include <mach/at91sam9260.h>
>  #include <mach/hardware.h>
>  
> -ENTRY_FUNCTION(start_at91sam9260ek, r0, r1, r2)
> +ENTRY_FUNCTION_AT91(start_at91sam9260ek, r0, r1, r2)
>  {
>  	arm_cpu_lowlevel_init();
>  
> @@ -25,7 +25,7 @@ ENTRY_FUNCTION(start_at91sam9260ek, r0, r1, r2)
>  			  NULL);
>  }
>  
> -ENTRY_FUNCTION(start_at91sam9g20ek, r0, r1, r2)
> +ENTRY_FUNCTION_AT91(start_at91sam9g20ek, r0, r1, r2)
>  {
>  	arm_cpu_lowlevel_init();
>  
> diff --git a/arch/arm/boards/at91sam9261ek/lowlevel_init.c b/arch/arm/boards/at91sam9261ek/lowlevel_init.c
> index 47a8f21db8..1dd2a6b113 100644
> --- a/arch/arm/boards/at91sam9261ek/lowlevel_init.c
> +++ b/arch/arm/boards/at91sam9261ek/lowlevel_init.c
> @@ -4,6 +4,7 @@
>   * Under GPLv2
>   */
>  
> +#include <mach/barebox-arm-head.h>
>  #include <asm/barebox-arm.h>
>  
>  #include <mach/at91sam926x_board_init.h>
> @@ -117,7 +118,7 @@ static void __bare_init at91sam9261ek_init(void)
>  	                  NULL);
>  }
>  
> -ENTRY_FUNCTION(start_at91sam9261ek, r0, r1, r2)
> +ENTRY_FUNCTION_AT91(start_at91sam9261ek, r0, r1, r2)
>  {
>  	arm_cpu_lowlevel_init();
>  
> @@ -126,7 +127,7 @@ ENTRY_FUNCTION(start_at91sam9261ek, r0, r1, r2)
>  	at91sam9261ek_init();
>  }
>  
> -ENTRY_FUNCTION(start_at91sam9g10ek, r0, r1, r2)
> +ENTRY_FUNCTION_AT91(start_at91sam9g10ek, r0, r1, r2)
>  {
>  	arm_cpu_lowlevel_init();
>  
> diff --git a/arch/arm/boards/at91sam9m10g45ek/lowlevel.c b/arch/arm/boards/at91sam9m10g45ek/lowlevel.c
> index 94732df14f..d3654df70b 100644
> --- a/arch/arm/boards/at91sam9m10g45ek/lowlevel.c
> +++ b/arch/arm/boards/at91sam9m10g45ek/lowlevel.c
> @@ -7,13 +7,13 @@
>  #include <common.h>
>  #include <init.h>
>  
> -#include <asm/barebox-arm-head.h>
> +#include <mach/barebox-arm-head.h>
>  #include <asm/barebox-arm.h>
>  
>  #include <mach/hardware.h>
>  #include <mach/at91_ddrsdrc.h>
>  
> -ENTRY_FUNCTION(start_at91sam9m10g45ek, r0, r1, r2)
> +ENTRY_FUNCTION_AT91(start_at91sam9m10g45ek, r0, r1, r2)
>  {
>  	arm_cpu_lowlevel_init();
>  
> diff --git a/arch/arm/boards/at91sam9m10ihd/lowlevel.c b/arch/arm/boards/at91sam9m10ihd/lowlevel.c
> index 1dd17ee263..9ea128cd4d 100644
> --- a/arch/arm/boards/at91sam9m10ihd/lowlevel.c
> +++ b/arch/arm/boards/at91sam9m10ihd/lowlevel.c
> @@ -7,14 +7,14 @@
>  #include <common.h>
>  #include <init.h>
>  
> -#include <asm/barebox-arm-head.h>
> +#include <mach/barebox-arm-head.h>
>  #include <asm/barebox-arm.h>
>  
>  #include <mach/at91_ddrsdrc.h>
>  #include <mach/at91sam9g45.h>
>  #include <mach/hardware.h>
>  
> -ENTRY_FUNCTION(start_at91sam9m10ihd, r0, r1, r2)
> +ENTRY_FUNCTION_AT91(start_at91sam9m10ihd, r0, r1, r2)
>  {
>  	arm_cpu_lowlevel_init();
>  
> diff --git a/arch/arm/boards/at91sam9n12ek/lowlevel.c b/arch/arm/boards/at91sam9n12ek/lowlevel.c
> index 7366e74c3c..6911840388 100644
> --- a/arch/arm/boards/at91sam9n12ek/lowlevel.c
> +++ b/arch/arm/boards/at91sam9n12ek/lowlevel.c
> @@ -7,13 +7,13 @@
>  #include <common.h>
>  #include <init.h>
>  
> -#include <asm/barebox-arm-head.h>
> +#include <mach/barebox-arm-head.h>
>  #include <asm/barebox-arm.h>
>  
>  #include <mach/at91_ddrsdrc.h>
>  #include <mach/hardware.h>
>  
> -ENTRY_FUNCTION(start_at91sam9n12ek, r0, r1, r2)
> +ENTRY_FUNCTION_AT91(start_at91sam9n12ek, r0, r1, r2)
>  {
>  	arm_cpu_lowlevel_init();
>  
> diff --git a/arch/arm/boards/dss11/lowlevel.c b/arch/arm/boards/dss11/lowlevel.c
> index 86cc295e8b..734d4c94be 100644
> --- a/arch/arm/boards/dss11/lowlevel.c
> +++ b/arch/arm/boards/dss11/lowlevel.c
> @@ -7,14 +7,14 @@
>  #include <common.h>
>  #include <init.h>
>  
> -#include <asm/barebox-arm-head.h>
> +#include <mach/barebox-arm-head.h>
>  #include <asm/barebox-arm.h>
>  
>  #include <mach/at91sam9_sdramc.h>
>  #include <mach/at91sam9260.h>
>  #include <mach/hardware.h>
>  
> -ENTRY_FUNCTION(start_dss11, r0, r1, r2)
> +ENTRY_FUNCTION_AT91(start_dss11, r0, r1, r2)
>  {
>  	arm_cpu_lowlevel_init();
>  
> diff --git a/arch/arm/boards/haba-knx/lowlevel.c b/arch/arm/boards/haba-knx/lowlevel.c
> index 3f810a396d..980cf55f83 100644
> --- a/arch/arm/boards/haba-knx/lowlevel.c
> +++ b/arch/arm/boards/haba-knx/lowlevel.c
> @@ -7,14 +7,14 @@
>  #include <common.h>
>  #include <init.h>
>  
> -#include <asm/barebox-arm-head.h>
> +#include <mach/barebox-arm-head.h>
>  #include <asm/barebox-arm.h>
>  
>  #include <mach/at91sam9_sdramc.h>
>  #include <mach/at91sam9260.h>
>  #include <mach/hardware.h>
>  
> -ENTRY_FUNCTION(start_haba_knx_lite, r0, r1, r2)
> +ENTRY_FUNCTION_AT91(start_haba_knx_lite, r0, r1, r2)
>  {
>  	arm_cpu_lowlevel_init();
>  
> diff --git a/arch/arm/boards/pm9261/lowlevel_init.c b/arch/arm/boards/pm9261/lowlevel_init.c
> index 13a604ceb8..ce2fc1f507 100644
> --- a/arch/arm/boards/pm9261/lowlevel_init.c
> +++ b/arch/arm/boards/pm9261/lowlevel_init.c
> @@ -4,6 +4,7 @@
>   * Under GPLv2
>   */
>  
> +#include <mach/barebox-arm-head.h>
>  #include <asm/barebox-arm.h>
>  
>  #include <mach/at91sam926x_board_init.h>
> @@ -111,7 +112,7 @@ static void __bare_init pm9261_init(void)
>  	                  NULL);
>  }
>  
> -ENTRY_FUNCTION(start_pm9261, r0, r1, r2)
> +ENTRY_FUNCTION_AT91(start_pm9261, r0, r1, r2)
>  {
>  	arm_cpu_lowlevel_init();
>  
> diff --git a/arch/arm/boards/pm9263/lowlevel_init.c b/arch/arm/boards/pm9263/lowlevel_init.c
> index 9a690531e3..752e36a79f 100644
> --- a/arch/arm/boards/pm9263/lowlevel_init.c
> +++ b/arch/arm/boards/pm9263/lowlevel_init.c
> @@ -6,6 +6,7 @@
>  
>  #include <linux/sizes.h>
>  
> +#include <mach/barebox-arm-head.h>
>  #include <asm/barebox-arm.h>
>  
>  #include <mach/at91sam926x_board_init.h>
> @@ -132,7 +133,7 @@ static void __bare_init pm9263_board_init(void)
>  	                  NULL);
>  }
>  
> -ENTRY_FUNCTION(start_pm9263, r0, r1, r2)
> +ENTRY_FUNCTION_AT91(start_pm9263, r0, r1, r2)
>  {
>  	arm_cpu_lowlevel_init();
>  
> diff --git a/arch/arm/boards/pm9g45/lowlevel.c b/arch/arm/boards/pm9g45/lowlevel.c
> index 096bbc485a..a6d54a0627 100644
> --- a/arch/arm/boards/pm9g45/lowlevel.c
> +++ b/arch/arm/boards/pm9g45/lowlevel.c
> @@ -7,14 +7,14 @@
>  #include <common.h>
>  #include <init.h>
>  
> -#include <asm/barebox-arm-head.h>
> +#include <mach/barebox-arm-head.h>
>  #include <asm/barebox-arm.h>
>  
>  #include <mach/at91_ddrsdrc.h>
>  
>  #include <mach/hardware.h>
>  
> -ENTRY_FUNCTION(start_pm9g45, r0, r1, r2)
> +ENTRY_FUNCTION_AT91(start_pm9g45, r0, r1, r2)
>  {
>  	arm_cpu_lowlevel_init();
>  
> diff --git a/arch/arm/boards/qil-a926x/lowlevel.c b/arch/arm/boards/qil-a926x/lowlevel.c
> index 3a233fcf17..b75d8ab761 100644
> --- a/arch/arm/boards/qil-a926x/lowlevel.c
> +++ b/arch/arm/boards/qil-a926x/lowlevel.c
> @@ -7,14 +7,14 @@
>  #include <common.h>
>  #include <init.h>
>  
> -#include <asm/barebox-arm-head.h>
> +#include <mach/barebox-arm-head.h>
>  #include <asm/barebox-arm.h>
>  
>  #include <mach/at91sam9_sdramc.h>
>  #include <mach/at91sam9260.h>
>  #include <mach/hardware.h>
>  
> -ENTRY_FUNCTION(start_qil_a926x, r0, r1, r2)
> +ENTRY_FUNCTION_AT91(start_qil_a926x, r0, r1, r2)
>  {
>  	arm_cpu_lowlevel_init();
>  
> @@ -25,7 +25,7 @@ ENTRY_FUNCTION(start_qil_a926x, r0, r1, r2)
>  			  NULL);
>  }
>  
> -ENTRY_FUNCTION(start_qil_a9g20, r0, r1, r2)
> +ENTRY_FUNCTION_AT91(start_qil_a9g20, r0, r1, r2)
>  {
>  	arm_cpu_lowlevel_init();
>  
> diff --git a/arch/arm/boards/telit-evk-pro3/lowlevel.c b/arch/arm/boards/telit-evk-pro3/lowlevel.c
> index 3a613a65a8..f4ea203283 100644
> --- a/arch/arm/boards/telit-evk-pro3/lowlevel.c
> +++ b/arch/arm/boards/telit-evk-pro3/lowlevel.c
> @@ -7,14 +7,14 @@
>  #include <common.h>
>  #include <init.h>
>  
> -#include <asm/barebox-arm-head.h>
> +#include <mach/barebox-arm-head.h>
>  #include <asm/barebox-arm.h>
>  
>  #include <mach/at91sam9_sdramc.h>
>  #include <mach/at91sam9260.h>
>  #include <mach/hardware.h>
>  
> -ENTRY_FUNCTION(start_telit_evk_pro3, r0, r1, r2)
> +ENTRY_FUNCTION_AT91(start_telit_evk_pro3, r0, r1, r2)
>  {
>  	arm_cpu_lowlevel_init();
>  
> diff --git a/arch/arm/boards/tny-a926x/tny_a9260_lowlevel.c b/arch/arm/boards/tny-a926x/tny_a9260_lowlevel.c
> index e78e93528d..1cd420d902 100644
> --- a/arch/arm/boards/tny-a926x/tny_a9260_lowlevel.c
> +++ b/arch/arm/boards/tny-a926x/tny_a9260_lowlevel.c
> @@ -7,14 +7,14 @@
>  #include <common.h>
>  #include <init.h>
>  
> -#include <asm/barebox-arm-head.h>
> +#include <mach/barebox-arm-head.h>
>  #include <asm/barebox-arm.h>
>  
>  #include <mach/at91sam9_sdramc.h>
>  #include <mach/at91sam9260.h>
>  #include <mach/hardware.h>
>  
> -ENTRY_FUNCTION(start_tny_a9260, r0, r1, r2)
> +ENTRY_FUNCTION_AT91(start_tny_a9260, r0, r1, r2)
>  {
>  	arm_cpu_lowlevel_init();
>  
> @@ -25,7 +25,7 @@ ENTRY_FUNCTION(start_tny_a9260, r0, r1, r2)
>  			  NULL);
>  }
>  
> -ENTRY_FUNCTION(start_tny_a9g20, r0, r1, r2)
> +ENTRY_FUNCTION_AT91(start_tny_a9g20, r0, r1, r2)
>  {
>  	arm_cpu_lowlevel_init();
>  
> diff --git a/arch/arm/boards/tny-a926x/tny_a9263_lowlevel.c b/arch/arm/boards/tny-a926x/tny_a9263_lowlevel.c
> index b8b813ef12..93c601c8cb 100644
> --- a/arch/arm/boards/tny-a926x/tny_a9263_lowlevel.c
> +++ b/arch/arm/boards/tny-a926x/tny_a9263_lowlevel.c
> @@ -7,7 +7,7 @@
>  #include <common.h>
>  #include <init.h>
>  
> -#include <asm/barebox-arm-head.h>
> +#include <mach/barebox-arm-head.h>
>  #include <asm/barebox-arm.h>
>  
>  #include <mach/at91sam926x_board_init.h>
> @@ -118,7 +118,7 @@ static void __bare_init tny_a9263_init(void)
>  	                  NULL);
>  }
>  
> -ENTRY_FUNCTION(start_tny_a9263, r0, r1, r2)
> +ENTRY_FUNCTION_AT91(start_tny_a9263, r0, r1, r2)
>  {
>  	arm_cpu_lowlevel_init();
>  
> diff --git a/arch/arm/boards/usb-a926x/usb_a9260_lowlevel.c b/arch/arm/boards/usb-a926x/usb_a9260_lowlevel.c
> index 7e3ee80ab7..1f4febde11 100644
> --- a/arch/arm/boards/usb-a926x/usb_a9260_lowlevel.c
> +++ b/arch/arm/boards/usb-a926x/usb_a9260_lowlevel.c
> @@ -7,14 +7,14 @@
>  #include <common.h>
>  #include <init.h>
>  
> -#include <asm/barebox-arm-head.h>
> +#include <mach/barebox-arm-head.h>
>  #include <asm/barebox-arm.h>
>  
>  #include <mach/at91sam9_sdramc.h>
>  #include <mach/at91sam9260.h>
>  #include <mach/hardware.h>
>  
> -ENTRY_FUNCTION(start_usb_a9260, r0, r1, r2)
> +ENTRY_FUNCTION_AT91(start_usb_a9260, r0, r1, r2)
>  {
>  	arm_cpu_lowlevel_init();
>  
> @@ -25,7 +25,7 @@ ENTRY_FUNCTION(start_usb_a9260, r0, r1, r2)
>  			  NULL);
>  }
>  
> -ENTRY_FUNCTION(start_usb_a9g20, r0, r1, r2)
> +ENTRY_FUNCTION_AT91(start_usb_a9g20, r0, r1, r2)
>  {
>  	arm_cpu_lowlevel_init();
>  
> diff --git a/arch/arm/boards/usb-a926x/usb_a9263_lowlevel.c b/arch/arm/boards/usb-a926x/usb_a9263_lowlevel.c
> index 0597321084..25e63f5180 100644
> --- a/arch/arm/boards/usb-a926x/usb_a9263_lowlevel.c
> +++ b/arch/arm/boards/usb-a926x/usb_a9263_lowlevel.c
> @@ -6,6 +6,7 @@
>  
>  #include <linux/sizes.h>
>  
> +#include <mach/barebox-arm-head.h>
>  #include <asm/barebox-arm.h>
>  
>  #include <mach/at91sam926x_board_init.h>
> @@ -122,7 +123,7 @@ static void __bare_init usb_a9263_init(bool has_mem_128m)
>  	                  NULL);
>  }
>  
> -ENTRY_FUNCTION(start_usb_a9263, r0, r1, r2)
> +ENTRY_FUNCTION_AT91(start_usb_a9263, r0, r1, r2)
>  {
>  	arm_cpu_lowlevel_init();
>  
> @@ -131,7 +132,7 @@ ENTRY_FUNCTION(start_usb_a9263, r0, r1, r2)
>  	usb_a9263_init(false);
>  }
>  
> -ENTRY_FUNCTION(start_usb_a9263_128m, r0, r1, r2)
> +ENTRY_FUNCTION_AT91(start_usb_a9263_128m, r0, r1, r2)
>  {
>  	arm_cpu_lowlevel_init();
>  
> diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
> index caf296dfcd..b803a1185d 100644
> --- a/arch/arm/mach-at91/Kconfig
> +++ b/arch/arm/mach-at91/Kconfig
> @@ -92,7 +92,6 @@ config SOC_SAMA5D2
>  	select HAVE_AT91_I2S_MUX_CLK
>  	select PINCTRL_AT91PIO4
>  	select HAS_MACB
> -	select HAVE_MACH_ARM_HEAD
>  	select HAVE_AT91_DDRAMC
>  
>  config SOC_SAMA5D3
> @@ -105,7 +104,6 @@ config SOC_SAMA5D3
>  	select HAVE_AT91_UTMI
>  	select PINCTRL_AT91
>  	select HAS_MACB
> -	select HAVE_MACH_ARM_HEAD
>  
>  config SOC_SAMA5D4
>  	bool
> @@ -118,7 +116,6 @@ config SOC_SAMA5D4
>  	select HAVE_AT91_UTMI
>  	select PINCTRL_AT91
>  	select HAS_MACB
> -	select HAVE_MACH_ARM_HEAD
>  
>  config SOC_SAM9X60
>  	bool
> @@ -159,7 +156,6 @@ config SOC_AT91SAM9260
>  	select SOC_AT91SAM9
>  	select HAS_MACB
>  	select PINCTRL_AT91
> -	select HAVE_MACH_ARM_HEAD
>  	help
>  	  Select this if you are using one of Atmel's AT91SAM9260, AT91SAM9XE
>  	  or AT91SAM9G20 SoC.
> @@ -169,7 +165,6 @@ config SOC_AT91SAM9261
>  	select SOC_AT91SAM9
>  	select PINCTRL_AT91
>  	select HAVE_AT91_LOAD_BAREBOX_SRAM
> -	select HAVE_MACH_ARM_HEAD
>  	help
>  	  Select this if you are using one of Atmel's AT91SAM9261 or AT91SAM9G10 SoC.
>  
> @@ -178,7 +173,6 @@ config SOC_AT91SAM9263
>  	select SOC_AT91SAM9
>  	select HAS_MACB
>  	select HAVE_AT91_LOAD_BAREBOX_SRAM
> -	select HAVE_MACH_ARM_HEAD
>  	select PINCTRL_AT91
>  
>  config SOC_AT91SAM9G45
> @@ -186,7 +180,6 @@ config SOC_AT91SAM9G45
>  	select SOC_AT91SAM9
>  	select HAS_MACB
>  	select PINCTRL_AT91
> -	select HAVE_MACH_ARM_HEAD
>  	help
>  	  Select this if you are using one of Atmel's AT91SAM9G45 family SoC.
>  	  This support covers AT91SAM9G45, AT91SAM9G46, AT91SAM9M10 and AT91SAM9M11.
> @@ -209,7 +202,6 @@ config SOC_AT91SAM9N12
>  	bool
>  	select SOC_AT91SAM9
>  	select PINCTRL_AT91
> -	select HAVE_MACH_ARM_HEAD
>  	help
>  	  Select this if you are using Atmel's AT91SAM9N12 SoC.
>  
> diff --git a/arch/arm/mach-at91/include/mach/barebox-arm-head.h b/arch/arm/mach-at91/include/mach/barebox-arm-head.h
> index 4a95f89fc9..68539ea48f 100644
> --- a/arch/arm/mach-at91/include/mach/barebox-arm-head.h
> +++ b/arch/arm/mach-at91/include/mach/barebox-arm-head.h
> @@ -9,7 +9,9 @@
>  #define AT91_EXV6	".word _barebox_bare_init_size\n"
>  #endif
>  
> -static inline void __barebox_arm_head(void)
> +#include <linux/compiler.h>
> +
> +static __always_inline void __barebox_at91_head(void)
>  {
>  	__asm__ __volatile__ (
>  #ifdef CONFIG_THUMB2_BAREBOX
> @@ -36,12 +38,6 @@ static inline void __barebox_arm_head(void)
>  	);
>  }
>  
> -static inline void barebox_arm_head(void)
> -{
> -	__barebox_arm_head();
> -	__asm__ __volatile__ (
> -		"b barebox_arm_reset_vector\n"
> -	);
> -}
> +#define ENTRY_FUNCTION_AT91(fn, r0, r1, r2) ENTRY_FUNCTION_HEAD(fn, __barebox_at91_head, r0, r1, r2)
>  
>  #endif /* __MACH_ARM_HEAD_H */

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |




^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 03/13] ARM: at91: Use ENTRY_FUNCTION_HEAD
  2023-03-02 16:40   ` Ahmad Fatoum
@ 2023-03-03  8:32     ` Sascha Hauer
  0 siblings, 0 replies; 16+ messages in thread
From: Sascha Hauer @ 2023-03-03  8:32 UTC (permalink / raw)
  To: Ahmad Fatoum; +Cc: Barebox List

On Thu, Mar 02, 2023 at 05:40:40PM +0100, Ahmad Fatoum wrote:
> On 02.03.23 12:15, Sascha Hauer wrote:
> > Use ENTRY_FUNCTION_HEAD in the at91 boards to customize the barebox
> > image header without having to hook into a generic include file.
> > 
> > Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> > ---
> >  arch/arm/boards/animeo_ip/lowlevel.c               |  4 ++--
> >  arch/arm/boards/at91rm9200ek/lowlevel.c            |  4 ++--
> >  arch/arm/boards/at91sam9260ek/lowlevel.c           |  6 +++---
> >  arch/arm/boards/at91sam9261ek/lowlevel_init.c      |  5 +++--
> >  arch/arm/boards/at91sam9m10g45ek/lowlevel.c        |  4 ++--
> >  arch/arm/boards/at91sam9m10ihd/lowlevel.c          |  4 ++--
> >  arch/arm/boards/at91sam9n12ek/lowlevel.c           |  4 ++--
> >  arch/arm/boards/dss11/lowlevel.c                   |  4 ++--
> >  arch/arm/boards/haba-knx/lowlevel.c                |  4 ++--
> >  arch/arm/boards/pm9261/lowlevel_init.c             |  3 ++-
> >  arch/arm/boards/pm9263/lowlevel_init.c             |  3 ++-
> >  arch/arm/boards/pm9g45/lowlevel.c                  |  4 ++--
> >  arch/arm/boards/qil-a926x/lowlevel.c               |  6 +++---
> >  arch/arm/boards/telit-evk-pro3/lowlevel.c          |  4 ++--
> >  arch/arm/boards/tny-a926x/tny_a9260_lowlevel.c     |  6 +++---
> >  arch/arm/boards/tny-a926x/tny_a9263_lowlevel.c     |  4 ++--
> >  arch/arm/boards/usb-a926x/usb_a9260_lowlevel.c     |  6 +++---
> >  arch/arm/boards/usb-a926x/usb_a9263_lowlevel.c     |  5 +++--
> >  arch/arm/mach-at91/Kconfig                         |  8 --------
> >  arch/arm/mach-at91/include/mach/barebox-arm-head.h | 12 ++++--------
> >  20 files changed, 46 insertions(+), 54 deletions(-)
> > 
> > diff --git a/arch/arm/boards/animeo_ip/lowlevel.c b/arch/arm/boards/animeo_ip/lowlevel.c
> > index 2d443f5384..f56f59fa8e 100644
> > --- a/arch/arm/boards/animeo_ip/lowlevel.c
> > +++ b/arch/arm/boards/animeo_ip/lowlevel.c
> > @@ -7,14 +7,14 @@
> >  #include <common.h>
> >  #include <init.h>
> >  
> > -#include <asm/barebox-arm-head.h>
> > +#include <mach/barebox-arm-head.h>
> >  #include <asm/barebox-arm.h>
> >  
> >  #include <mach/at91sam9_sdramc.h>
> >  #include <mach/at91sam9260.h>
> >  #include <mach/hardware.h>
> >  
> > -ENTRY_FUNCTION(start_animeo_ip, r0, r1, r2)
> > +ENTRY_FUNCTION_AT91(start_animeo_ip, r0, r1, r2)
> 
> There's SAMA5_ENTRY_FUNCTION, so it's a bit unfortunate that it's
> the other way round here.

Indeed. I didn't notice there is such a function.

I have changed the name accordingly and put it barebox-arm.h instead.
Also it seems that SAMA5_ENTRY_FUNCTION should use __barebox_at91_head
as well.

Sascha

-------------------------8<-------------------------

>From 4331e488f36330dfd163b4739e7e326889e67792 Mon Sep 17 00:00:00 2001
From: Sascha Hauer <s.hauer@pengutronix.de>
Date: Thu, 2 Mar 2023 12:15:56 +0100
Subject: [PATCH] ARM: at91: Use ENTRY_FUNCTION_HEAD

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

Link: https://lore.barebox.org/20230302111606.1054037-4-s.hauer@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/boards/animeo_ip/lowlevel.c          |  5 +-
 arch/arm/boards/at91rm9200ek/lowlevel.c       |  5 +-
 arch/arm/boards/at91sam9260ek/lowlevel.c      |  7 ++-
 arch/arm/boards/at91sam9261ek/lowlevel_init.c |  6 +--
 arch/arm/boards/at91sam9m10g45ek/lowlevel.c   |  5 +-
 arch/arm/boards/at91sam9m10ihd/lowlevel.c     |  5 +-
 arch/arm/boards/at91sam9n12ek/lowlevel.c      |  5 +-
 arch/arm/boards/dss11/lowlevel.c              |  5 +-
 arch/arm/boards/haba-knx/lowlevel.c           |  5 +-
 arch/arm/boards/pm9261/lowlevel_init.c        |  4 +-
 arch/arm/boards/pm9263/lowlevel_init.c        |  4 +-
 arch/arm/boards/pm9g45/lowlevel.c             |  5 +-
 arch/arm/boards/qil-a926x/lowlevel.c          |  7 ++-
 arch/arm/boards/telit-evk-pro3/lowlevel.c     |  5 +-
 .../arm/boards/tny-a926x/tny_a9260_lowlevel.c |  7 ++-
 .../arm/boards/tny-a926x/tny_a9263_lowlevel.c |  5 +-
 .../arm/boards/usb-a926x/usb_a9260_lowlevel.c |  7 ++-
 .../arm/boards/usb-a926x/usb_a9263_lowlevel.c |  6 +--
 arch/arm/mach-at91/Kconfig                    |  8 ----
 .../mach-at91/include/mach/barebox-arm-head.h | 47 -------------------
 arch/arm/mach-at91/include/mach/barebox-arm.h | 40 +++++++++++++++-
 21 files changed, 81 insertions(+), 112 deletions(-)
 delete mode 100644 arch/arm/mach-at91/include/mach/barebox-arm-head.h

diff --git a/arch/arm/boards/animeo_ip/lowlevel.c b/arch/arm/boards/animeo_ip/lowlevel.c
index 2d443f5384..dcea35484c 100644
--- a/arch/arm/boards/animeo_ip/lowlevel.c
+++ b/arch/arm/boards/animeo_ip/lowlevel.c
@@ -7,14 +7,13 @@
 #include <common.h>
 #include <init.h>
 
-#include <asm/barebox-arm-head.h>
-#include <asm/barebox-arm.h>
+#include <mach/barebox-arm.h>
 
 #include <mach/at91sam9_sdramc.h>
 #include <mach/at91sam9260.h>
 #include <mach/hardware.h>
 
-ENTRY_FUNCTION(start_animeo_ip, r0, r1, r2)
+AT91_ENTRY_FUNCTION(start_animeo_ip, r0, r1, r2)
 {
 	arm_cpu_lowlevel_init();
 
diff --git a/arch/arm/boards/at91rm9200ek/lowlevel.c b/arch/arm/boards/at91rm9200ek/lowlevel.c
index ba62f1116d..c6b25e830b 100644
--- a/arch/arm/boards/at91rm9200ek/lowlevel.c
+++ b/arch/arm/boards/at91rm9200ek/lowlevel.c
@@ -7,8 +7,7 @@
 #include <common.h>
 #include <init.h>
 
-#include <asm/barebox-arm-head.h>
-#include <asm/barebox-arm.h>
+#include <mach/barebox-arm.h>
 
 #include <mach/at91rm9200_mc.h>
 #include <mach/at91rm9200.h>
@@ -21,7 +20,7 @@ void static inline access_sdram(void)
 	writel(0x00000000, AT91_CHIPSELECT_1);
 }
 
-ENTRY_FUNCTION(start_at91rm9200ek, r0, r1, r2)
+AT91_ENTRY_FUNCTION(start_at91rm9200ek, r0, r1, r2)
 {
 	u32 r;
 	int i;
diff --git a/arch/arm/boards/at91sam9260ek/lowlevel.c b/arch/arm/boards/at91sam9260ek/lowlevel.c
index 81fe70278b..40810f43c9 100644
--- a/arch/arm/boards/at91sam9260ek/lowlevel.c
+++ b/arch/arm/boards/at91sam9260ek/lowlevel.c
@@ -7,14 +7,13 @@
 #include <common.h>
 #include <init.h>
 
-#include <asm/barebox-arm-head.h>
-#include <asm/barebox-arm.h>
+#include <mach/barebox-arm.h>
 
 #include <mach/at91sam9_sdramc.h>
 #include <mach/at91sam9260.h>
 #include <mach/hardware.h>
 
-ENTRY_FUNCTION(start_at91sam9260ek, r0, r1, r2)
+AT91_ENTRY_FUNCTION(start_at91sam9260ek, r0, r1, r2)
 {
 	arm_cpu_lowlevel_init();
 
@@ -25,7 +24,7 @@ ENTRY_FUNCTION(start_at91sam9260ek, r0, r1, r2)
 			  NULL);
 }
 
-ENTRY_FUNCTION(start_at91sam9g20ek, r0, r1, r2)
+AT91_ENTRY_FUNCTION(start_at91sam9g20ek, r0, r1, r2)
 {
 	arm_cpu_lowlevel_init();
 
diff --git a/arch/arm/boards/at91sam9261ek/lowlevel_init.c b/arch/arm/boards/at91sam9261ek/lowlevel_init.c
index 47a8f21db8..17c0094522 100644
--- a/arch/arm/boards/at91sam9261ek/lowlevel_init.c
+++ b/arch/arm/boards/at91sam9261ek/lowlevel_init.c
@@ -4,7 +4,7 @@
  * Under GPLv2
  */
 
-#include <asm/barebox-arm.h>
+#include <mach/barebox-arm.h>
 
 #include <mach/at91sam926x_board_init.h>
 #include <mach/at91sam9261_matrix.h>
@@ -117,7 +117,7 @@ static void __bare_init at91sam9261ek_init(void)
 	                  NULL);
 }
 
-ENTRY_FUNCTION(start_at91sam9261ek, r0, r1, r2)
+AT91_ENTRY_FUNCTION(start_at91sam9261ek, r0, r1, r2)
 {
 	arm_cpu_lowlevel_init();
 
@@ -126,7 +126,7 @@ ENTRY_FUNCTION(start_at91sam9261ek, r0, r1, r2)
 	at91sam9261ek_init();
 }
 
-ENTRY_FUNCTION(start_at91sam9g10ek, r0, r1, r2)
+AT91_ENTRY_FUNCTION(start_at91sam9g10ek, r0, r1, r2)
 {
 	arm_cpu_lowlevel_init();
 
diff --git a/arch/arm/boards/at91sam9m10g45ek/lowlevel.c b/arch/arm/boards/at91sam9m10g45ek/lowlevel.c
index 94732df14f..e0cd647b44 100644
--- a/arch/arm/boards/at91sam9m10g45ek/lowlevel.c
+++ b/arch/arm/boards/at91sam9m10g45ek/lowlevel.c
@@ -7,13 +7,12 @@
 #include <common.h>
 #include <init.h>
 
-#include <asm/barebox-arm-head.h>
-#include <asm/barebox-arm.h>
+#include <mach/barebox-arm.h>
 
 #include <mach/hardware.h>
 #include <mach/at91_ddrsdrc.h>
 
-ENTRY_FUNCTION(start_at91sam9m10g45ek, r0, r1, r2)
+AT91_ENTRY_FUNCTION(start_at91sam9m10g45ek, r0, r1, r2)
 {
 	arm_cpu_lowlevel_init();
 
diff --git a/arch/arm/boards/at91sam9m10ihd/lowlevel.c b/arch/arm/boards/at91sam9m10ihd/lowlevel.c
index 1dd17ee263..4e307c8f41 100644
--- a/arch/arm/boards/at91sam9m10ihd/lowlevel.c
+++ b/arch/arm/boards/at91sam9m10ihd/lowlevel.c
@@ -7,14 +7,13 @@
 #include <common.h>
 #include <init.h>
 
-#include <asm/barebox-arm-head.h>
-#include <asm/barebox-arm.h>
+#include <mach/barebox-arm.h>
 
 #include <mach/at91_ddrsdrc.h>
 #include <mach/at91sam9g45.h>
 #include <mach/hardware.h>
 
-ENTRY_FUNCTION(start_at91sam9m10ihd, r0, r1, r2)
+AT91_ENTRY_FUNCTION(start_at91sam9m10ihd, r0, r1, r2)
 {
 	arm_cpu_lowlevel_init();
 
diff --git a/arch/arm/boards/at91sam9n12ek/lowlevel.c b/arch/arm/boards/at91sam9n12ek/lowlevel.c
index 7366e74c3c..21a0721ecc 100644
--- a/arch/arm/boards/at91sam9n12ek/lowlevel.c
+++ b/arch/arm/boards/at91sam9n12ek/lowlevel.c
@@ -7,13 +7,12 @@
 #include <common.h>
 #include <init.h>
 
-#include <asm/barebox-arm-head.h>
-#include <asm/barebox-arm.h>
+#include <mach/barebox-arm.h>
 
 #include <mach/at91_ddrsdrc.h>
 #include <mach/hardware.h>
 
-ENTRY_FUNCTION(start_at91sam9n12ek, r0, r1, r2)
+AT91_ENTRY_FUNCTION(start_at91sam9n12ek, r0, r1, r2)
 {
 	arm_cpu_lowlevel_init();
 
diff --git a/arch/arm/boards/dss11/lowlevel.c b/arch/arm/boards/dss11/lowlevel.c
index 86cc295e8b..427e9d39cd 100644
--- a/arch/arm/boards/dss11/lowlevel.c
+++ b/arch/arm/boards/dss11/lowlevel.c
@@ -7,14 +7,13 @@
 #include <common.h>
 #include <init.h>
 
-#include <asm/barebox-arm-head.h>
-#include <asm/barebox-arm.h>
+#include <mach/barebox-arm.h>
 
 #include <mach/at91sam9_sdramc.h>
 #include <mach/at91sam9260.h>
 #include <mach/hardware.h>
 
-ENTRY_FUNCTION(start_dss11, r0, r1, r2)
+AT91_ENTRY_FUNCTION(start_dss11, r0, r1, r2)
 {
 	arm_cpu_lowlevel_init();
 
diff --git a/arch/arm/boards/haba-knx/lowlevel.c b/arch/arm/boards/haba-knx/lowlevel.c
index 3f810a396d..76275e440a 100644
--- a/arch/arm/boards/haba-knx/lowlevel.c
+++ b/arch/arm/boards/haba-knx/lowlevel.c
@@ -7,14 +7,13 @@
 #include <common.h>
 #include <init.h>
 
-#include <asm/barebox-arm-head.h>
-#include <asm/barebox-arm.h>
+#include <mach/barebox-arm.h>
 
 #include <mach/at91sam9_sdramc.h>
 #include <mach/at91sam9260.h>
 #include <mach/hardware.h>
 
-ENTRY_FUNCTION(start_haba_knx_lite, r0, r1, r2)
+AT91_ENTRY_FUNCTION(start_haba_knx_lite, r0, r1, r2)
 {
 	arm_cpu_lowlevel_init();
 
diff --git a/arch/arm/boards/pm9261/lowlevel_init.c b/arch/arm/boards/pm9261/lowlevel_init.c
index 13a604ceb8..7131120e97 100644
--- a/arch/arm/boards/pm9261/lowlevel_init.c
+++ b/arch/arm/boards/pm9261/lowlevel_init.c
@@ -4,7 +4,7 @@
  * Under GPLv2
  */
 
-#include <asm/barebox-arm.h>
+#include <mach/barebox-arm.h>
 
 #include <mach/at91sam926x_board_init.h>
 #include <mach/at91sam9261_matrix.h>
@@ -111,7 +111,7 @@ static void __bare_init pm9261_init(void)
 	                  NULL);
 }
 
-ENTRY_FUNCTION(start_pm9261, r0, r1, r2)
+AT91_ENTRY_FUNCTION(start_pm9261, r0, r1, r2)
 {
 	arm_cpu_lowlevel_init();
 
diff --git a/arch/arm/boards/pm9263/lowlevel_init.c b/arch/arm/boards/pm9263/lowlevel_init.c
index 9a690531e3..7a9993c50b 100644
--- a/arch/arm/boards/pm9263/lowlevel_init.c
+++ b/arch/arm/boards/pm9263/lowlevel_init.c
@@ -6,7 +6,7 @@
 
 #include <linux/sizes.h>
 
-#include <asm/barebox-arm.h>
+#include <mach/barebox-arm.h>
 
 #include <mach/at91sam926x_board_init.h>
 #include <mach/at91sam9263_matrix.h>
@@ -132,7 +132,7 @@ static void __bare_init pm9263_board_init(void)
 	                  NULL);
 }
 
-ENTRY_FUNCTION(start_pm9263, r0, r1, r2)
+AT91_ENTRY_FUNCTION(start_pm9263, r0, r1, r2)
 {
 	arm_cpu_lowlevel_init();
 
diff --git a/arch/arm/boards/pm9g45/lowlevel.c b/arch/arm/boards/pm9g45/lowlevel.c
index 096bbc485a..017c8d9b12 100644
--- a/arch/arm/boards/pm9g45/lowlevel.c
+++ b/arch/arm/boards/pm9g45/lowlevel.c
@@ -7,14 +7,13 @@
 #include <common.h>
 #include <init.h>
 
-#include <asm/barebox-arm-head.h>
-#include <asm/barebox-arm.h>
+#include <mach/barebox-arm.h>
 
 #include <mach/at91_ddrsdrc.h>
 
 #include <mach/hardware.h>
 
-ENTRY_FUNCTION(start_pm9g45, r0, r1, r2)
+AT91_ENTRY_FUNCTION(start_pm9g45, r0, r1, r2)
 {
 	arm_cpu_lowlevel_init();
 
diff --git a/arch/arm/boards/qil-a926x/lowlevel.c b/arch/arm/boards/qil-a926x/lowlevel.c
index 3a233fcf17..f21d8b8057 100644
--- a/arch/arm/boards/qil-a926x/lowlevel.c
+++ b/arch/arm/boards/qil-a926x/lowlevel.c
@@ -7,14 +7,13 @@
 #include <common.h>
 #include <init.h>
 
-#include <asm/barebox-arm-head.h>
-#include <asm/barebox-arm.h>
+#include <mach/barebox-arm.h>
 
 #include <mach/at91sam9_sdramc.h>
 #include <mach/at91sam9260.h>
 #include <mach/hardware.h>
 
-ENTRY_FUNCTION(start_qil_a926x, r0, r1, r2)
+AT91_ENTRY_FUNCTION(start_qil_a926x, r0, r1, r2)
 {
 	arm_cpu_lowlevel_init();
 
@@ -25,7 +24,7 @@ ENTRY_FUNCTION(start_qil_a926x, r0, r1, r2)
 			  NULL);
 }
 
-ENTRY_FUNCTION(start_qil_a9g20, r0, r1, r2)
+AT91_ENTRY_FUNCTION(start_qil_a9g20, r0, r1, r2)
 {
 	arm_cpu_lowlevel_init();
 
diff --git a/arch/arm/boards/telit-evk-pro3/lowlevel.c b/arch/arm/boards/telit-evk-pro3/lowlevel.c
index 3a613a65a8..bded2ebf5d 100644
--- a/arch/arm/boards/telit-evk-pro3/lowlevel.c
+++ b/arch/arm/boards/telit-evk-pro3/lowlevel.c
@@ -7,14 +7,13 @@
 #include <common.h>
 #include <init.h>
 
-#include <asm/barebox-arm-head.h>
-#include <asm/barebox-arm.h>
+#include <mach/barebox-arm.h>
 
 #include <mach/at91sam9_sdramc.h>
 #include <mach/at91sam9260.h>
 #include <mach/hardware.h>
 
-ENTRY_FUNCTION(start_telit_evk_pro3, r0, r1, r2)
+AT91_ENTRY_FUNCTION(start_telit_evk_pro3, r0, r1, r2)
 {
 	arm_cpu_lowlevel_init();
 
diff --git a/arch/arm/boards/tny-a926x/tny_a9260_lowlevel.c b/arch/arm/boards/tny-a926x/tny_a9260_lowlevel.c
index e78e93528d..aad5b3de59 100644
--- a/arch/arm/boards/tny-a926x/tny_a9260_lowlevel.c
+++ b/arch/arm/boards/tny-a926x/tny_a9260_lowlevel.c
@@ -7,14 +7,13 @@
 #include <common.h>
 #include <init.h>
 
-#include <asm/barebox-arm-head.h>
-#include <asm/barebox-arm.h>
+#include <mach/barebox-arm.h>
 
 #include <mach/at91sam9_sdramc.h>
 #include <mach/at91sam9260.h>
 #include <mach/hardware.h>
 
-ENTRY_FUNCTION(start_tny_a9260, r0, r1, r2)
+AT91_ENTRY_FUNCTION(start_tny_a9260, r0, r1, r2)
 {
 	arm_cpu_lowlevel_init();
 
@@ -25,7 +24,7 @@ ENTRY_FUNCTION(start_tny_a9260, r0, r1, r2)
 			  NULL);
 }
 
-ENTRY_FUNCTION(start_tny_a9g20, r0, r1, r2)
+AT91_ENTRY_FUNCTION(start_tny_a9g20, r0, r1, r2)
 {
 	arm_cpu_lowlevel_init();
 
diff --git a/arch/arm/boards/tny-a926x/tny_a9263_lowlevel.c b/arch/arm/boards/tny-a926x/tny_a9263_lowlevel.c
index b8b813ef12..34aa10a12a 100644
--- a/arch/arm/boards/tny-a926x/tny_a9263_lowlevel.c
+++ b/arch/arm/boards/tny-a926x/tny_a9263_lowlevel.c
@@ -7,8 +7,7 @@
 #include <common.h>
 #include <init.h>
 
-#include <asm/barebox-arm-head.h>
-#include <asm/barebox-arm.h>
+#include <mach/barebox-arm.h>
 
 #include <mach/at91sam926x_board_init.h>
 #include <mach/at91sam9263_matrix.h>
@@ -118,7 +117,7 @@ static void __bare_init tny_a9263_init(void)
 	                  NULL);
 }
 
-ENTRY_FUNCTION(start_tny_a9263, r0, r1, r2)
+AT91_ENTRY_FUNCTION(start_tny_a9263, r0, r1, r2)
 {
 	arm_cpu_lowlevel_init();
 
diff --git a/arch/arm/boards/usb-a926x/usb_a9260_lowlevel.c b/arch/arm/boards/usb-a926x/usb_a9260_lowlevel.c
index 7e3ee80ab7..c2c8d0f7fe 100644
--- a/arch/arm/boards/usb-a926x/usb_a9260_lowlevel.c
+++ b/arch/arm/boards/usb-a926x/usb_a9260_lowlevel.c
@@ -7,14 +7,13 @@
 #include <common.h>
 #include <init.h>
 
-#include <asm/barebox-arm-head.h>
-#include <asm/barebox-arm.h>
+#include <mach/barebox-arm.h>
 
 #include <mach/at91sam9_sdramc.h>
 #include <mach/at91sam9260.h>
 #include <mach/hardware.h>
 
-ENTRY_FUNCTION(start_usb_a9260, r0, r1, r2)
+AT91_ENTRY_FUNCTION(start_usb_a9260, r0, r1, r2)
 {
 	arm_cpu_lowlevel_init();
 
@@ -25,7 +24,7 @@ ENTRY_FUNCTION(start_usb_a9260, r0, r1, r2)
 			  NULL);
 }
 
-ENTRY_FUNCTION(start_usb_a9g20, r0, r1, r2)
+AT91_ENTRY_FUNCTION(start_usb_a9g20, r0, r1, r2)
 {
 	arm_cpu_lowlevel_init();
 
diff --git a/arch/arm/boards/usb-a926x/usb_a9263_lowlevel.c b/arch/arm/boards/usb-a926x/usb_a9263_lowlevel.c
index 0597321084..4b0a80fa83 100644
--- a/arch/arm/boards/usb-a926x/usb_a9263_lowlevel.c
+++ b/arch/arm/boards/usb-a926x/usb_a9263_lowlevel.c
@@ -6,7 +6,7 @@
 
 #include <linux/sizes.h>
 
-#include <asm/barebox-arm.h>
+#include <mach/barebox-arm.h>
 
 #include <mach/at91sam926x_board_init.h>
 #include <mach/at91sam9263_matrix.h>
@@ -122,7 +122,7 @@ static void __bare_init usb_a9263_init(bool has_mem_128m)
 	                  NULL);
 }
 
-ENTRY_FUNCTION(start_usb_a9263, r0, r1, r2)
+AT91_ENTRY_FUNCTION(start_usb_a9263, r0, r1, r2)
 {
 	arm_cpu_lowlevel_init();
 
@@ -131,7 +131,7 @@ ENTRY_FUNCTION(start_usb_a9263, r0, r1, r2)
 	usb_a9263_init(false);
 }
 
-ENTRY_FUNCTION(start_usb_a9263_128m, r0, r1, r2)
+AT91_ENTRY_FUNCTION(start_usb_a9263_128m, r0, r1, r2)
 {
 	arm_cpu_lowlevel_init();
 
diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
index caf296dfcd..b803a1185d 100644
--- a/arch/arm/mach-at91/Kconfig
+++ b/arch/arm/mach-at91/Kconfig
@@ -92,7 +92,6 @@ config SOC_SAMA5D2
 	select HAVE_AT91_I2S_MUX_CLK
 	select PINCTRL_AT91PIO4
 	select HAS_MACB
-	select HAVE_MACH_ARM_HEAD
 	select HAVE_AT91_DDRAMC
 
 config SOC_SAMA5D3
@@ -105,7 +104,6 @@ config SOC_SAMA5D3
 	select HAVE_AT91_UTMI
 	select PINCTRL_AT91
 	select HAS_MACB
-	select HAVE_MACH_ARM_HEAD
 
 config SOC_SAMA5D4
 	bool
@@ -118,7 +116,6 @@ config SOC_SAMA5D4
 	select HAVE_AT91_UTMI
 	select PINCTRL_AT91
 	select HAS_MACB
-	select HAVE_MACH_ARM_HEAD
 
 config SOC_SAM9X60
 	bool
@@ -159,7 +156,6 @@ config SOC_AT91SAM9260
 	select SOC_AT91SAM9
 	select HAS_MACB
 	select PINCTRL_AT91
-	select HAVE_MACH_ARM_HEAD
 	help
 	  Select this if you are using one of Atmel's AT91SAM9260, AT91SAM9XE
 	  or AT91SAM9G20 SoC.
@@ -169,7 +165,6 @@ config SOC_AT91SAM9261
 	select SOC_AT91SAM9
 	select PINCTRL_AT91
 	select HAVE_AT91_LOAD_BAREBOX_SRAM
-	select HAVE_MACH_ARM_HEAD
 	help
 	  Select this if you are using one of Atmel's AT91SAM9261 or AT91SAM9G10 SoC.
 
@@ -178,7 +173,6 @@ config SOC_AT91SAM9263
 	select SOC_AT91SAM9
 	select HAS_MACB
 	select HAVE_AT91_LOAD_BAREBOX_SRAM
-	select HAVE_MACH_ARM_HEAD
 	select PINCTRL_AT91
 
 config SOC_AT91SAM9G45
@@ -186,7 +180,6 @@ config SOC_AT91SAM9G45
 	select SOC_AT91SAM9
 	select HAS_MACB
 	select PINCTRL_AT91
-	select HAVE_MACH_ARM_HEAD
 	help
 	  Select this if you are using one of Atmel's AT91SAM9G45 family SoC.
 	  This support covers AT91SAM9G45, AT91SAM9G46, AT91SAM9M10 and AT91SAM9M11.
@@ -209,7 +202,6 @@ config SOC_AT91SAM9N12
 	bool
 	select SOC_AT91SAM9
 	select PINCTRL_AT91
-	select HAVE_MACH_ARM_HEAD
 	help
 	  Select this if you are using Atmel's AT91SAM9N12 SoC.
 
diff --git a/arch/arm/mach-at91/include/mach/barebox-arm-head.h b/arch/arm/mach-at91/include/mach/barebox-arm-head.h
deleted file mode 100644
index 4a95f89fc9..0000000000
--- a/arch/arm/mach-at91/include/mach/barebox-arm-head.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-
-#ifndef __MACH_ARM_HEAD_H
-#define __MACH_ARM_HEAD_H
-
-#ifdef CONFIG_AT91_LOAD_BAREBOX_SRAM
-#define AT91_EXV6	".word _barebox_image_size\n"
-#else
-#define AT91_EXV6	".word _barebox_bare_init_size\n"
-#endif
-
-static inline void __barebox_arm_head(void)
-{
-	__asm__ __volatile__ (
-#ifdef CONFIG_THUMB2_BAREBOX
-#error Thumb2 is not supported
-#else
-		"b 2f\n"
-		"1: b 1b\n"
-		"1: b 1b\n"
-		"1: b 1b\n"
-		"1: b 1b\n"
-		AT91_EXV6				/* image size to load by the bootrom */
-		"1: b 1b\n"
-		"1: b 1b\n"
-#endif
-		".asciz \"barebox\"\n"
-		".word _text\n"				/* text base. If copied there,
-							 * barebox can skip relocation
-							 */
-		".word _barebox_image_size\n"		/* image size to copy */
-		".rept 8\n"
-		".word 0x55555555\n"
-		".endr\n"
-		"2:\n"
-	);
-}
-
-static inline void barebox_arm_head(void)
-{
-	__barebox_arm_head();
-	__asm__ __volatile__ (
-		"b barebox_arm_reset_vector\n"
-	);
-}
-
-#endif /* __MACH_ARM_HEAD_H */
diff --git a/arch/arm/mach-at91/include/mach/barebox-arm.h b/arch/arm/mach-at91/include/mach/barebox-arm.h
index 707444180c..a0c51118c9 100644
--- a/arch/arm/mach-at91/include/mach/barebox-arm.h
+++ b/arch/arm/mach-at91/include/mach/barebox-arm.h
@@ -7,6 +7,41 @@
 #include <mach/sama5d3.h>
 #include <mach/sama5d4.h>
 
+#ifdef CONFIG_AT91_LOAD_BAREBOX_SRAM
+#define AT91_EXV6	".word _barebox_image_size\n"
+#else
+#define AT91_EXV6	".word _barebox_bare_init_size\n"
+#endif
+
+#include <linux/compiler.h>
+
+static __always_inline void __barebox_at91_head(void)
+{
+	__asm__ __volatile__ (
+#ifdef CONFIG_THUMB2_BAREBOX
+#error Thumb2 is not supported
+#else
+		"b 2f\n"
+		"1: b 1b\n"
+		"1: b 1b\n"
+		"1: b 1b\n"
+		"1: b 1b\n"
+		AT91_EXV6				/* image size to load by the bootrom */
+		"1: b 1b\n"
+		"1: b 1b\n"
+#endif
+		".asciz \"barebox\"\n"
+		".word _text\n"				/* text base. If copied there,
+							 * barebox can skip relocation
+							 */
+		".word _barebox_image_size\n"		/* image size to copy */
+		".rept 8\n"
+		".word 0x55555555\n"
+		".endr\n"
+		"2:\n"
+	);
+}
+
 #define SAMA5_ENTRY_FUNCTION(name, stack_top, r4)				\
 	void name (u32 r0, u32 r1, u32 r2, u32 r3);				\
 										\
@@ -16,7 +51,7 @@
 				(u32 r0, u32 r1, u32 r2, u32 r3)		\
 		{								\
 			register u32 r4 asm("r4");				\
-			__barebox_arm_head();					\
+			__barebox_at91_head();					\
 			if (stack_top)						\
 				arm_setup_stack(stack_top);			\
 			__##name(r4);						\
@@ -33,4 +68,7 @@
 #define SAMA5D4_ENTRY_FUNCTION(name, r4)					\
 	SAMA5_ENTRY_FUNCTION(name, SAMA5D4_SRAM_BASE + SAMA5D4_SRAM_SIZE, r4)
 
+#define AT91_ENTRY_FUNCTION(fn, r0, r1, r2)					\
+	ENTRY_FUNCTION_HEAD(fn, __barebox_at91_head, r0, r1, r2)
+
 #endif
-- 
2.30.2

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2023-03-03  8:34 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-02 11:15 [PATCH 00/13] ARM: misc cleanups Sascha Hauer
2023-03-02 11:15 ` [PATCH 01/13] ARM: add ENTRY_FUNCTION_HEAD macro Sascha Hauer
2023-03-02 11:15 ` [PATCH 02/13] ARM: mvebu: Use ENTRY_FUNCTION_HEAD Sascha Hauer
2023-03-02 11:15 ` [PATCH 03/13] ARM: at91: " Sascha Hauer
2023-03-02 16:40   ` Ahmad Fatoum
2023-03-03  8:32     ` Sascha Hauer
2023-03-02 11:15 ` [PATCH 04/13] ARM: Drop HAVE_MACH_ARM_HEAD Sascha Hauer
2023-03-02 11:15 ` [PATCH 05/13] ARM: drop CONFIG_HAS_ASM_DEBUG_LL Sascha Hauer
2023-03-02 11:15 ` [PATCH 06/13] regulator: pfuze: remove unused include Sascha Hauer
2023-03-02 11:16 ` [PATCH 07/13] ARM: drop unused zynq code in Makefile Sascha Hauer
2023-03-02 11:16 ` [PATCH 08/13] ARM: drop unused mvebu " Sascha Hauer
2023-03-02 11:16 ` [PATCH 09/13] ARM: drop unused am35xx " Sascha Hauer
2023-03-02 11:16 ` [PATCH 10/13] ARM: Makefile: Drop board-y Sascha Hauer
2023-03-02 11:16 ` [PATCH 11/13] ARM: i.MX: Add missing include Sascha Hauer
2023-03-02 11:16 ` [PATCH 12/13] ARM: stm32mp_defconfig: Enable remaining boards Sascha Hauer
2023-03-02 11:16 ` [PATCH 13/13] mci: imx-esdhc-pbl: add missing include Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox