[PATCH 7/9] ARM: at91: Switch all boards to multiimage
Sascha Hauer
s.hauer at pengutronix.de
Tue Feb 28 06:30:29 PST 2023
Most at91 boards are not safe for multiimage support. We can however
switch their compilation to the multiimage way which allows us to get
rid of some legacy cruft in the longer run.
Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
arch/arm/Kconfig | 1 +
arch/arm/boards/animeo_ip/lowlevel.c | 2 +-
arch/arm/boards/at91rm9200ek/lowlevel.c | 2 +-
arch/arm/boards/at91sam9260ek/lowlevel.c | 13 ++-
arch/arm/boards/at91sam9261ek/lowlevel_init.c | 11 ++-
arch/arm/boards/at91sam9m10g45ek/lowlevel.c | 2 +-
arch/arm/boards/at91sam9m10ihd/lowlevel.c | 2 +-
arch/arm/boards/at91sam9n12ek/lowlevel.c | 2 +-
arch/arm/boards/dss11/lowlevel.c | 2 +-
arch/arm/boards/haba-knx/lowlevel.c | 2 +-
arch/arm/boards/pm9261/lowlevel_init.c | 2 +-
arch/arm/boards/pm9263/lowlevel_init.c | 2 +-
arch/arm/boards/pm9g45/lowlevel.c | 2 +-
arch/arm/boards/qil-a926x/lowlevel.c | 13 ++-
arch/arm/boards/telit-evk-pro3/lowlevel.c | 2 +-
.../arm/boards/tny-a926x/tny_a9260_lowlevel.c | 13 ++-
.../arm/boards/tny-a926x/tny_a9263_lowlevel.c | 2 +-
.../arm/boards/usb-a926x/usb_a9260_lowlevel.c | 13 ++-
.../arm/boards/usb-a926x/usb_a9263_lowlevel.c | 2 +-
arch/arm/mach-at91/Kconfig | 1 -
images/Makefile.at91 | 92 +++++++++++++++++++
21 files changed, 164 insertions(+), 19 deletions(-)
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 8183f6d546..3ac9bc4ad7 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -42,6 +42,7 @@ config ARCH_AT91
bool "Atmel AT91"
select GPIOLIB
select CLKDEV_LOOKUP
+ select HAVE_PBL_MULTI_IMAGES
select HAS_DEBUG_LL
select HAVE_CLK
select COMMON_CLK_AT91 if COMMON_CLK_OF_PROVIDER
diff --git a/arch/arm/boards/animeo_ip/lowlevel.c b/arch/arm/boards/animeo_ip/lowlevel.c
index 7f52f824df..2d443f5384 100644
--- a/arch/arm/boards/animeo_ip/lowlevel.c
+++ b/arch/arm/boards/animeo_ip/lowlevel.c
@@ -14,7 +14,7 @@
#include <mach/at91sam9260.h>
#include <mach/hardware.h>
-void __naked __bare_init barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
+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 b132ccc084..ba62f1116d 100644
--- a/arch/arm/boards/at91rm9200ek/lowlevel.c
+++ b/arch/arm/boards/at91rm9200ek/lowlevel.c
@@ -21,7 +21,7 @@ void static inline access_sdram(void)
writel(0x00000000, AT91_CHIPSELECT_1);
}
-void __naked __bare_init barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
+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 7f52f824df..81fe70278b 100644
--- a/arch/arm/boards/at91sam9260ek/lowlevel.c
+++ b/arch/arm/boards/at91sam9260ek/lowlevel.c
@@ -14,7 +14,18 @@
#include <mach/at91sam9260.h>
#include <mach/hardware.h>
-void __naked __bare_init barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
+ENTRY_FUNCTION(start_at91sam9260ek, r0, r1, r2)
+{
+ arm_cpu_lowlevel_init();
+
+ arm_setup_stack(AT91SAM9260_SRAM_BASE + AT91SAM9260_SRAM_SIZE);
+
+ barebox_arm_entry(AT91_CHIPSELECT_1,
+ at91_get_sdram_size(IOMEM(AT91SAM9260_BASE_SDRAMC)),
+ NULL);
+}
+
+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 bb9b905c65..47a8f21db8 100644
--- a/arch/arm/boards/at91sam9261ek/lowlevel_init.c
+++ b/arch/arm/boards/at91sam9261ek/lowlevel_init.c
@@ -117,7 +117,16 @@ static void __bare_init at91sam9261ek_init(void)
NULL);
}
-void __naked __bare_init barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
+ENTRY_FUNCTION(start_at91sam9261ek, r0, r1, r2)
+{
+ arm_cpu_lowlevel_init();
+
+ arm_setup_stack(AT91SAM9261_SRAM_BASE + AT91SAM9261_SRAM_SIZE);
+
+ at91sam9261ek_init();
+}
+
+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 755e7ec029..94732df14f 100644
--- a/arch/arm/boards/at91sam9m10g45ek/lowlevel.c
+++ b/arch/arm/boards/at91sam9m10g45ek/lowlevel.c
@@ -13,7 +13,7 @@
#include <mach/hardware.h>
#include <mach/at91_ddrsdrc.h>
-void __naked __bare_init barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
+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 817c7548c9..1dd17ee263 100644
--- a/arch/arm/boards/at91sam9m10ihd/lowlevel.c
+++ b/arch/arm/boards/at91sam9m10ihd/lowlevel.c
@@ -14,7 +14,7 @@
#include <mach/at91sam9g45.h>
#include <mach/hardware.h>
-void __naked __bare_init barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
+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 4353555d0d..7366e74c3c 100644
--- a/arch/arm/boards/at91sam9n12ek/lowlevel.c
+++ b/arch/arm/boards/at91sam9n12ek/lowlevel.c
@@ -13,7 +13,7 @@
#include <mach/at91_ddrsdrc.h>
#include <mach/hardware.h>
-void __naked __bare_init barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
+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 7f52f824df..86cc295e8b 100644
--- a/arch/arm/boards/dss11/lowlevel.c
+++ b/arch/arm/boards/dss11/lowlevel.c
@@ -14,7 +14,7 @@
#include <mach/at91sam9260.h>
#include <mach/hardware.h>
-void __naked __bare_init barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
+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 7f52f824df..3f810a396d 100644
--- a/arch/arm/boards/haba-knx/lowlevel.c
+++ b/arch/arm/boards/haba-knx/lowlevel.c
@@ -14,7 +14,7 @@
#include <mach/at91sam9260.h>
#include <mach/hardware.h>
-void __naked __bare_init barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
+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 b18cd067b7..13a604ceb8 100644
--- a/arch/arm/boards/pm9261/lowlevel_init.c
+++ b/arch/arm/boards/pm9261/lowlevel_init.c
@@ -111,7 +111,7 @@ static void __bare_init pm9261_init(void)
NULL);
}
-void __naked __bare_init barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
+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 8f44adee99..9a690531e3 100644
--- a/arch/arm/boards/pm9263/lowlevel_init.c
+++ b/arch/arm/boards/pm9263/lowlevel_init.c
@@ -132,7 +132,7 @@ static void __bare_init pm9263_board_init(void)
NULL);
}
-void __naked __bare_init barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
+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 5f66b28254..096bbc485a 100644
--- a/arch/arm/boards/pm9g45/lowlevel.c
+++ b/arch/arm/boards/pm9g45/lowlevel.c
@@ -14,7 +14,7 @@
#include <mach/hardware.h>
-void __naked __bare_init barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
+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 7f52f824df..3a233fcf17 100644
--- a/arch/arm/boards/qil-a926x/lowlevel.c
+++ b/arch/arm/boards/qil-a926x/lowlevel.c
@@ -14,7 +14,18 @@
#include <mach/at91sam9260.h>
#include <mach/hardware.h>
-void __naked __bare_init barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
+ENTRY_FUNCTION(start_qil_a926x, r0, r1, r2)
+{
+ arm_cpu_lowlevel_init();
+
+ arm_setup_stack(AT91SAM9260_SRAM_BASE + AT91SAM9260_SRAM_SIZE);
+
+ barebox_arm_entry(AT91_CHIPSELECT_1,
+ at91_get_sdram_size(IOMEM(AT91SAM9260_BASE_SDRAMC)),
+ NULL);
+}
+
+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 7f52f824df..3a613a65a8 100644
--- a/arch/arm/boards/telit-evk-pro3/lowlevel.c
+++ b/arch/arm/boards/telit-evk-pro3/lowlevel.c
@@ -14,7 +14,7 @@
#include <mach/at91sam9260.h>
#include <mach/hardware.h>
-void __naked __bare_init barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
+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 7f52f824df..e78e93528d 100644
--- a/arch/arm/boards/tny-a926x/tny_a9260_lowlevel.c
+++ b/arch/arm/boards/tny-a926x/tny_a9260_lowlevel.c
@@ -14,7 +14,18 @@
#include <mach/at91sam9260.h>
#include <mach/hardware.h>
-void __naked __bare_init barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
+ENTRY_FUNCTION(start_tny_a9260, r0, r1, r2)
+{
+ arm_cpu_lowlevel_init();
+
+ arm_setup_stack(AT91SAM9260_SRAM_BASE + AT91SAM9260_SRAM_SIZE);
+
+ barebox_arm_entry(AT91_CHIPSELECT_1,
+ at91_get_sdram_size(IOMEM(AT91SAM9260_BASE_SDRAMC)),
+ NULL);
+}
+
+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 565ba438d2..b8b813ef12 100644
--- a/arch/arm/boards/tny-a926x/tny_a9263_lowlevel.c
+++ b/arch/arm/boards/tny-a926x/tny_a9263_lowlevel.c
@@ -118,7 +118,7 @@ static void __bare_init tny_a9263_init(void)
NULL);
}
-void __naked __bare_init barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
+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 7f52f824df..7e3ee80ab7 100644
--- a/arch/arm/boards/usb-a926x/usb_a9260_lowlevel.c
+++ b/arch/arm/boards/usb-a926x/usb_a9260_lowlevel.c
@@ -14,7 +14,18 @@
#include <mach/at91sam9260.h>
#include <mach/hardware.h>
-void __naked __bare_init barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
+ENTRY_FUNCTION(start_usb_a9260, r0, r1, r2)
+{
+ arm_cpu_lowlevel_init();
+
+ arm_setup_stack(AT91SAM9260_SRAM_BASE + AT91SAM9260_SRAM_SIZE);
+
+ barebox_arm_entry(AT91_CHIPSELECT_1,
+ at91_get_sdram_size(IOMEM(AT91SAM9260_BASE_SDRAMC)),
+ NULL);
+}
+
+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 2ad88d7f22..e54c8442c4 100644
--- a/arch/arm/boards/usb-a926x/usb_a9263_lowlevel.c
+++ b/arch/arm/boards/usb-a926x/usb_a9263_lowlevel.c
@@ -122,7 +122,7 @@ static void __bare_init usb_a9263_init(void)
NULL);
}
-void __naked __bare_init barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
+ENTRY_FUNCTION(start_usb_a9263, r0, r1, r2)
{
arm_cpu_lowlevel_init();
diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
index 22ed71350c..67d428e210 100644
--- a/arch/arm/mach-at91/Kconfig
+++ b/arch/arm/mach-at91/Kconfig
@@ -570,7 +570,6 @@ endif
config AT91_MULTI_BOARDS
bool "Allow multiple boards to be selected"
- select HAVE_PBL_MULTI_IMAGES
select ARM_USE_COMPRESSED_DTB
if AT91_MULTI_BOARDS
diff --git a/images/Makefile.at91 b/images/Makefile.at91
index c6a6fb697b..bbb291bcbe 100644
--- a/images/Makefile.at91
+++ b/images/Makefile.at91
@@ -55,3 +55,95 @@ image-$(CONFIG_MACH_SKOV_ARM9CPU) += barebox-skov-arm9cpu.img
pblb-$(CONFIG_MACH_SAMA5D4_WIFX) += start_sama5d4_wifx_l1
FILE_barebox-wifx-l1.img = start_sama5d4_wifx_l1.pblb
image-$(CONFIG_MACH_SAMA5D4_WIFX) += barebox-wifx-l1.img
+
+pblb-$(CONFIG_MACH_AT91SAM9261EK) += start_at91sam9261ek
+FILE_barebox-at91sam9261ek.img = start_at91sam9261ek.pblb
+image-$(CONFIG_MACH_AT91SAM9261EK) += barebox-at91sam9261ek.img
+
+pblb-$(CONFIG_MACH_AT91SAM9G10EK) += start_at91sam9g10ek
+FILE_barebox-at91sam9g10ek.img = start_at91sam9g10ek.pblb
+image-$(CONFIG_MACH_AT91SAM9G10EK) += barebox-at91sam9g10ek.img
+
+pblb-$(CONFIG_MACH_ANIMEO_IP) += start_animeo_ip
+FILE_barebox-animeo-ip.img = start_animeo_ip.pblb
+image-$(CONFIG_MACH_ANIMEO_IP) += barebox-animeo-ip.img
+
+pblb-$(CONFIG_MACH_AT91RM9200EK) += start_at91rm9200ek
+FILE_barebox-at91rm9200ek.img = start_at91rm9200ek.pblb
+image-$(CONFIG_MACH_AT91RM9200EK) += barebox-at91rm9200ek.img
+
+pblb-$(CONFIG_MACH_AT91SAM9260EK) += start_at91sam9260ek
+FILE_barebox-at91sam9260ek.img = start_at91sam9260ek.pblb
+image-$(CONFIG_MACH_AT91SAM9260EK) += barebox-at91sam9260ek.img
+
+pblb-$(CONFIG_MACH_AT91SAM9G20EK) += start_at91sam9g20ek
+FILE_barebox-at91sam9g20ek.img = start_at91sam9g20ek.pblb
+image-$(CONFIG_MACH_AT91SAM9G20EK) += barebox-at91sam9g20ek.img
+
+pblb-$(CONFIG_MACH_AT91SAM9M10G45EK) += start_at91sam9m10g45ek
+FILE_barebox-at91sam9m10g45ek.img = start_at91sam9m10g45ek.pblb
+image-$(CONFIG_MACH_AT91SAM9M10G45EK) += barebox-at91sam9m10g45ek.img
+
+pblb-$(CONFIG_MACH_AT91SAM9M10IHD) += start_at91sam9m10ihd
+FILE_barebox-at91sam9m10ihd.img = start_at91sam9m10ihd.pblb
+image-$(CONFIG_MACH_AT91SAM9M10IHD) += barebox-at91sam9m10ihd.img
+
+pblb-$(CONFIG_MACH_AT91SAM9N12EK) += start_at91sam9n12ek
+FILE_barebox-at91sam9n12ek.img = start_at91sam9n12ek.pblb
+image-$(CONFIG_MACH_AT91SAM9N12EK) += barebox-at91sam9n12ek.img
+
+pblb-$(CONFIG_MACH_DSS11) += start_dss11
+FILE_barebox-dss11.img = start_dss11.pblb
+image-$(CONFIG_MACH_DSS11) += barebox-dss11.img
+
+pblb-$(CONFIG_MACH_HABA_KNX_LITE) += start_haba_knx_lite
+FILE_barebox-haba-knx-lite.img = start_haba_knx_lite.pblb
+image-$(CONFIG_MACH_HABA_KNX_LITE) += barebox-haba-knx-lite.img
+
+pblb-$(CONFIG_MACH_PM9261) += start_pm9261
+FILE_barebox-pm9261.img = start_pm9261.pblb
+image-$(CONFIG_MACH_PM9261) += barebox-pm9261.img
+
+pblb-$(CONFIG_MACH_PM9263) += start_pm9263
+FILE_barebox-pm9263.img = start_pm9263.pblb
+image-$(CONFIG_MACH_PM9263) += barebox-pm9263.img
+
+pblb-$(CONFIG_MACH_PM9G45) += start_pm9g45
+FILE_barebox-pm9g45.img = start_pm9g45.pblb
+image-$(CONFIG_MACH_PM9G45) += barebox-pm9g45.img
+
+pblb-$(CONFIG_MACH_QIL_A9260) += start_qil_a926x
+FILE_barebox-qil-a926x.img = start_qil_a926x.pblb
+image-$(CONFIG_MACH_QIL_A9260) += barebox-qil-a926x.img
+
+pblb-$(CONFIG_MACH_QIL_A9G20) += start_qil_a9g20
+FILE_barebox-qil-a9g20.img = start_qil_a9g20.pblb
+image-$(CONFIG_MACH_QIL_A9G20) += barebox-qil-a9g20.img
+
+pblb-$(CONFIG_MACH_GE863) += start_telit_evk_pro3
+FILE_barebox-telit-evk-pro3.img = start_telit_evk_pro3.pblb
+image-$(CONFIG_MACH_GE863) += barebox-telit-evk-pro3.img
+
+pblb-$(CONFIG_MACH_TNY_A9260) += start_tny_a9260
+FILE_barebox-tny-a9260.img = start_tny_a9260.pblb
+image-$(CONFIG_MACH_TNY_A9260) += barebox-tny-a9260.img
+
+pblb-$(CONFIG_MACH_TNY_A9263) += start_tny_a9263
+FILE_barebox-tny-a9263.img = start_tny_a9263.pblb
+image-$(CONFIG_MACH_TNY_A9263) += barebox-tny-a9263.img
+
+pblb-$(CONFIG_MACH_TNY_A9G20) += start_tny_a9g20
+FILE_barebox-tny-a9g20.img = start_tny_a9g20.pblb
+image-$(CONFIG_MACH_TNY_A9G20) += barebox-tny-a9g20.img
+
+pblb-$(CONFIG_MACH_USB_A9260) += start_usb_a9260
+FILE_barebox-usb-a9260.img = start_usb_a9260.pblb
+image-$(CONFIG_MACH_USB_A9260) += barebox-usb-a9260.img
+
+pblb-$(CONFIG_MACH_USB_A9263) += start_usb_a9263
+FILE_barebox-usb-a9263.img = start_usb_a9263.pblb
+image-$(CONFIG_MACH_USB_A9263) += barebox-usb-a9263.img
+
+pblb-$(CONFIG_MACH_USB_A9G20) += start_usb_a9g20
+FILE_barebox-usb-a9g20.img = start_usb_a9g20.pblb
+image-$(CONFIG_MACH_USB_A9G20) += barebox-usb-a9g20.img
--
2.30.2
More information about the barebox
mailing list