mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 3/4] arm/boards: Convert a few boards to the new entry macros
Date: Thu, 17 Sep 2020 22:17:07 +0200	[thread overview]
Message-ID: <20200917201708.12168-3-u.kleine-koenig@pengutronix.de> (raw)
In-Reply-To: <20200917201708.12168-1-u.kleine-koenig@pengutronix.de>

Some boards don't add get_runtime_offset() to the device tree address,
while the now used macro does it. This is ok as get_runtime_offset()
returns 0 after relocate_to_current_adr().

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 arch/arm/boards/ac-sxb/lowlevel.c             |  4 +--
 arch/arm/boards/advantech-mx6/lowlevel.c      |  4 +--
 .../boundarydevices-nitrogen6/lowlevel.c      | 36 +++----------------
 arch/arm/boards/cm-fx6/lowlevel.c             | 14 +++-----
 arch/arm/boards/embest-marsboard/lowlevel.c   |  8 +----
 arch/arm/boards/freescale-mx53-qsb/lowlevel.c | 16 ++-------
 .../boards/freescale-mx7-sabresd/lowlevel.c   |  2 +-
 arch/arm/boards/nxp-imx6ull-evk/lowlevel.c    |  4 +--
 arch/arm/boards/udoo-neo/lowlevel.c           |  8 +----
 arch/arm/boards/zii-imx6q-rdu2/lowlevel.c     |  9 ++---
 10 files changed, 19 insertions(+), 86 deletions(-)

diff --git a/arch/arm/boards/ac-sxb/lowlevel.c b/arch/arm/boards/ac-sxb/lowlevel.c
index a910555f9bd7..c0cdf0617f7d 100644
--- a/arch/arm/boards/ac-sxb/lowlevel.c
+++ b/arch/arm/boards/ac-sxb/lowlevel.c
@@ -89,8 +89,6 @@ static inline void write_regs(const struct reginit *initvals, int count)
 		writel(initvals[i].value, initvals[i].address);
 }
 
-extern char __dtb_z_ac_sxb_start[];
-
 static inline void setup_uart(void)
 {
 	imx7_early_setup_uart_clock();
@@ -127,5 +125,5 @@ ENTRY_FUNCTION(start_ac_sxb, r0, r1, r2)
 	if (get_pc() < 0x80000000)
 		imx7d_sxb_sram_setup();
 
-	imx7d_barebox_entry(__dtb_z_ac_sxb_start + get_runtime_offset());
+	IMX7D_BAREBOX_ZENTRY(ac_sxb);
 }
diff --git a/arch/arm/boards/advantech-mx6/lowlevel.c b/arch/arm/boards/advantech-mx6/lowlevel.c
index d762f0e9a745..11cebfa27353 100644
--- a/arch/arm/boards/advantech-mx6/lowlevel.c
+++ b/arch/arm/boards/advantech-mx6/lowlevel.c
@@ -24,8 +24,6 @@ static inline void setup_uart(void)
 	putc_ll('>');
 }
 
-extern char __dtb_imx6dl_advantech_rom_7421_start[];
-
 ENTRY_FUNCTION(start_advantech_imx6dl_rom_7421, r0, r1, r2)
 {
 	imx6_cpu_lowlevel_init();
@@ -37,5 +35,5 @@ ENTRY_FUNCTION(start_advantech_imx6dl_rom_7421, r0, r1, r2)
 	if (IS_ENABLED(CONFIG_DEBUG_LL))
 		setup_uart();
 
-	imx6q_barebox_entry(__dtb_imx6dl_advantech_rom_7421_start);
+	IMX6Q_BAREBOX_ENTRY(imx6dl_advantech_rom_7421);
 }
diff --git a/arch/arm/boards/boundarydevices-nitrogen6/lowlevel.c b/arch/arm/boards/boundarydevices-nitrogen6/lowlevel.c
index 74ff71fc246a..5d663cde5cc4 100644
--- a/arch/arm/boards/boundarydevices-nitrogen6/lowlevel.c
+++ b/arch/arm/boards/boundarydevices-nitrogen6/lowlevel.c
@@ -3,63 +3,37 @@
 #include <mach/esdctl.h>
 #include <asm/barebox-arm.h>
 
-extern char __dtb_imx6q_nitrogen6x_start[];
-
 ENTRY_FUNCTION(start_imx6q_nitrogen6x_1g, r0, r1, r2)
 {
-	void *fdt;
-
 	imx6_cpu_lowlevel_init();
 
-	fdt = __dtb_imx6q_nitrogen6x_start + get_runtime_offset();
-
-	imx6q_barebox_entry(fdt);
+	IMX6Q_BAREBOX_ENTRY(imx6q_nitrogen6x);
 }
 
 ENTRY_FUNCTION(start_imx6q_nitrogen6x_2g, r0, r1, r2)
 {
-	void *fdt;
-
 	imx6_cpu_lowlevel_init();
 
-	fdt = __dtb_imx6q_nitrogen6x_start + get_runtime_offset();
-
-	imx6q_barebox_entry(fdt);
+	IMX6Q_BAREBOX_ENTRY(imx6q_nitrogen6x);
 }
 
-extern char __dtb_imx6dl_nitrogen6x_start[];
-
 ENTRY_FUNCTION(start_imx6dl_nitrogen6x_1g, r0, r1, r2)
 {
-	void *fdt;
-
 	imx6_cpu_lowlevel_init();
 
-	fdt = __dtb_imx6dl_nitrogen6x_start + get_runtime_offset();
-
-	imx6q_barebox_entry(fdt);
+	IMX6Q_BAREBOX_ENTRY(imx6dl_nitrogen6x);
 }
 
 ENTRY_FUNCTION(start_imx6dl_nitrogen6x_2g, r0, r1, r2)
 {
-	void *fdt;
-
 	imx6_cpu_lowlevel_init();
 
-	fdt = __dtb_imx6dl_nitrogen6x_start + get_runtime_offset();
-
-	imx6q_barebox_entry(fdt);
+	IMX6Q_BAREBOX_ENTRY(imx6dl_nitrogen6x);
 }
 
-extern char __dtb_imx6qp_nitrogen6_max_start[];
-
 ENTRY_FUNCTION(start_imx6qp_nitrogen6_max, r0, r1, r2)
 {
-	void *fdt;
-
 	imx6_cpu_lowlevel_init();
 
-	fdt = __dtb_imx6qp_nitrogen6_max_start + get_runtime_offset();
-
-	imx6q_barebox_entry(fdt);
+	IMX6Q_BAREBOX_ENTRY(imx6qp_nitrogen6_max);
 }
diff --git a/arch/arm/boards/cm-fx6/lowlevel.c b/arch/arm/boards/cm-fx6/lowlevel.c
index fd86e159aaae..9a4b012b338f 100644
--- a/arch/arm/boards/cm-fx6/lowlevel.c
+++ b/arch/arm/boards/cm-fx6/lowlevel.c
@@ -315,9 +315,6 @@ static void cm_fx6_init(void)
 	imx6_spi_start_image(0);
 }
 
-extern char __dtb_imx6q_cm_fx6_start[];
-extern char __dtb_imx6dl_cm_fx6_start[];
-
 static noinline void cm_fx6_start(void)
 {
 	int cpu_type = __imx6_cpu_type();
@@ -325,9 +322,9 @@ static noinline void cm_fx6_start(void)
 	cm_fx6_init();
 
 	if (cpu_type == IMX6_CPUTYPE_IMX6S)
-		imx6q_barebox_entry(__dtb_imx6dl_cm_fx6_start);
+		IMX6Q_BAREBOX_ENTRY(imx6dl_cm_fx6);
 	else
-		imx6q_barebox_entry(__dtb_imx6q_cm_fx6_start);
+		IMX6Q_BAREBOX_ENTRY(imx6q_cm_fx6);
 }
 
 ENTRY_FUNCTION(start_imx6_cm_fx6, r0, r1, r2)
@@ -341,9 +338,6 @@ ENTRY_FUNCTION(start_imx6_cm_fx6, r0, r1, r2)
 	cm_fx6_start();
 }
 
-extern char __dtb_imx6q_utilite_start[];
-extern char __dtb_imx6dl_utilite_value_start[];
-
 static noinline void utilite_start(void)
 {
 	int cpu_type = __imx6_cpu_type();
@@ -352,9 +346,9 @@ static noinline void utilite_start(void)
 
 	if (cpu_type == IMX6_CPUTYPE_IMX6S)
 		/* FIXME: This needs a specialized utilite value dts */
-		imx6q_barebox_entry(__dtb_imx6dl_cm_fx6_start);
+		IMX6Q_BAREBOX_ENTRY(imx6dl_cm_fx6);
 	else
-		imx6q_barebox_entry(__dtb_imx6q_utilite_start);
+		IMX6Q_BAREBOX_ENTRY(imx6q_utilite);
 }
 
 ENTRY_FUNCTION(start_imx6_utilite, r0, r1, r2)
diff --git a/arch/arm/boards/embest-marsboard/lowlevel.c b/arch/arm/boards/embest-marsboard/lowlevel.c
index 9e20a2ec0645..a2e6727a4bbb 100644
--- a/arch/arm/boards/embest-marsboard/lowlevel.c
+++ b/arch/arm/boards/embest-marsboard/lowlevel.c
@@ -24,18 +24,12 @@ static inline void setup_uart(void)
 	putc_ll('>');
 }
 
-extern char __dtb_z_imx6q_marsboard_start[];
-
 ENTRY_FUNCTION(start_imx6q_marsboard, r0, r1, r2)
 {
-	void *fdt;
-
 	imx6_cpu_lowlevel_init();
 
 	if (IS_ENABLED(CONFIG_DEBUG_LL))
 		setup_uart();
 
-	fdt = __dtb_z_imx6q_marsboard_start + get_runtime_offset();
-
-	imx6q_barebox_entry(fdt);
+	IMX6Q_BAREBOX_ZENTRY(imx6q_marsboard);
 }
diff --git a/arch/arm/boards/freescale-mx53-qsb/lowlevel.c b/arch/arm/boards/freescale-mx53-qsb/lowlevel.c
index c9044011d599..c67feab9be58 100644
--- a/arch/arm/boards/freescale-mx53-qsb/lowlevel.c
+++ b/arch/arm/boards/freescale-mx53-qsb/lowlevel.c
@@ -6,30 +6,18 @@
 #include <asm/barebox-arm.h>
 #include <image-metadata.h>
 
-extern char __dtb_imx53_qsb_start[];
-
 ENTRY_FUNCTION(start_imx53_loco, r0, r1, r2)
 {
-	void *fdt;
-
 	imx5_cpu_lowlevel_init();
 	arm_setup_stack(MX53_IRAM_BASE_ADDR + MX53_IRAM_SIZE);
 
-	fdt = __dtb_imx53_qsb_start + get_runtime_offset();
-
-	imx53_barebox_entry(fdt);
+	IMX53_BAREBOX_ENTRY(imx53_qsb);
 }
 
-extern char __dtb_imx53_qsrb_start[];
-
 ENTRY_FUNCTION(start_imx53_loco_r, r0, r1, r2)
 {
-	void *fdt;
-
 	imx5_cpu_lowlevel_init();
 	arm_setup_stack(MX53_IRAM_BASE_ADDR + MX53_IRAM_SIZE);
 
-	fdt = __dtb_imx53_qsrb_start + get_runtime_offset();
-
-	imx53_barebox_entry(fdt);
+	IMX53_BAREBOX_ENTRY(imx53_qsrb);
 }
diff --git a/arch/arm/boards/freescale-mx7-sabresd/lowlevel.c b/arch/arm/boards/freescale-mx7-sabresd/lowlevel.c
index 8db46ca69624..0256a8782250 100644
--- a/arch/arm/boards/freescale-mx7-sabresd/lowlevel.c
+++ b/arch/arm/boards/freescale-mx7-sabresd/lowlevel.c
@@ -31,5 +31,5 @@ ENTRY_FUNCTION(start_imx7d_sabresd, r0, r1, r2)
 	if (IS_ENABLED(CONFIG_DEBUG_LL))
 		setup_uart();
 
-	imx7d_barebox_entry(__dtb_imx7d_sdb_start + get_runtime_offset());
+	IMX7D_BAREBOX_ENTRY(imx7d_sdb);
 }
diff --git a/arch/arm/boards/nxp-imx6ull-evk/lowlevel.c b/arch/arm/boards/nxp-imx6ull-evk/lowlevel.c
index afef4c449851..93fc8ef0d671 100644
--- a/arch/arm/boards/nxp-imx6ull-evk/lowlevel.c
+++ b/arch/arm/boards/nxp-imx6ull-evk/lowlevel.c
@@ -35,11 +35,9 @@ static inline void setup_uart(void)
 	putc_ll('>');
 }
 
-extern char __dtb_imx6ull_14x14_evk_start[];
-
 static noinline void nxp_imx6_ull(void)
 {
-	imx6ul_barebox_entry(__dtb_imx6ull_14x14_evk_start);
+	IMX6UL_BAREBOX_ENTRY(imx6ull_14x14_evk);
 }
 
 ENTRY_FUNCTION(start_nxp_imx6ull_evk, r0, r1, r2)
diff --git a/arch/arm/boards/udoo-neo/lowlevel.c b/arch/arm/boards/udoo-neo/lowlevel.c
index bb6b7d833278..5d80de941b89 100644
--- a/arch/arm/boards/udoo-neo/lowlevel.c
+++ b/arch/arm/boards/udoo-neo/lowlevel.c
@@ -22,18 +22,12 @@ static inline void setup_uart(void)
 	putc_ll('>');
 }
 
-extern char __dtb_imx6sx_udoo_neo_full_start[];
-
 ENTRY_FUNCTION(start_imx6sx_udoo_neo, r0, r1, r2)
 {
-	void *fdt;
-
 	imx6_cpu_lowlevel_init();
 
 	if (IS_ENABLED(CONFIG_DEBUG_LL))
 		setup_uart();
 
-	fdt = __dtb_imx6sx_udoo_neo_full_start + get_runtime_offset();
-
-	imx6sx_barebox_entry(fdt);
+	IMX6SX_BAREBOX_ENTRY(imx6sx_udoo_neo_full);
 }
diff --git a/arch/arm/boards/zii-imx6q-rdu2/lowlevel.c b/arch/arm/boards/zii-imx6q-rdu2/lowlevel.c
index a80ce0afc511..6c3da03ca866 100644
--- a/arch/arm/boards/zii-imx6q-rdu2/lowlevel.c
+++ b/arch/arm/boards/zii-imx6q-rdu2/lowlevel.c
@@ -253,9 +253,6 @@ static inline void setup_uart(void)
 	putc_ll('>');
 }
 
-extern char __dtb_z_imx6q_zii_rdu2_start[];
-extern char __dtb_z_imx6qp_zii_rdu2_start[];
-
 static noinline void rdu2_sram_setup(void)
 {
 	enum bootsource bootsrc;
@@ -294,9 +291,7 @@ ENTRY_FUNCTION(start_imx6_zii_rdu2, r0, r1, r2)
 		rdu2_sram_setup();
 
 	if (__imx6_cpu_type() == IMX6_CPUTYPE_IMX6QP)
-		imx6q_barebox_entry(__dtb_z_imx6qp_zii_rdu2_start +
-				    get_runtime_offset());
+		IMX6Q_BAREBOX_ZENTRY(imx6qp_zii_rdu2);
 	else
-		imx6q_barebox_entry(__dtb_z_imx6q_zii_rdu2_start +
-				    get_runtime_offset());
+		IMX6Q_BAREBOX_ZENTRY(imx6q_zii_rdu2);
 }
-- 
2.27.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2020-09-17 20:17 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-17 20:17 [PATCH 1/4] imx/esdctl: reorder some function declarations to be sorted by SoC Uwe Kleine-König
2020-09-17 20:17 ` [PATCH 2/4] imx/esdctl: Define new helper macros to reduce board entry boilerplate Uwe Kleine-König
2020-09-18 10:32   ` Sascha Hauer
2020-09-17 20:17 ` Uwe Kleine-König [this message]
2020-09-17 20:17 ` [PATCH 4/4] arm/boards: Add IMD_USED_OF for a few boards Uwe Kleine-König
2020-09-18 10:03   ` Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200917201708.12168-3-u.kleine-koenig@pengutronix.de \
    --to=u.kleine-koenig@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox