mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Subject: [PATCH 09/16] ARM: Freescale i.MX23 evk: Check machine type in initcalls
Date: Wed, 18 Sep 2019 09:54:14 +0200	[thread overview]
Message-ID: <20190918075421.20456-10-s.hauer@pengutronix.de> (raw)
In-Reply-To: <20190918075421.20456-1-s.hauer@pengutronix.de>

Check for the right machine type in initcalls before executing them to
make the board multi image safe.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/boards/freescale-mx23-evk/lowlevel.c | 3 ++-
 arch/arm/boards/freescale-mx23-evk/mx23-evk.c | 7 +++++++
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boards/freescale-mx23-evk/lowlevel.c b/arch/arm/boards/freescale-mx23-evk/lowlevel.c
index 13c7435cd6..2321a469ab 100644
--- a/arch/arm/boards/freescale-mx23-evk/lowlevel.c
+++ b/arch/arm/boards/freescale-mx23-evk/lowlevel.c
@@ -1,5 +1,6 @@
 #include <common.h>
 #include <linux/sizes.h>
+#include <generated/mach-types.h>
 #include <asm/barebox-arm-head.h>
 #include <asm/barebox-arm.h>
 #include <mach/imx23-regs.h>
@@ -7,5 +8,5 @@
 void __naked barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
 {
 	arm_cpu_lowlevel_init();
-	barebox_arm_entry(IMX_MEMORY_BASE, SZ_32M, NULL);
+	barebox_arm_entry(IMX_MEMORY_BASE, SZ_32M, (void *)MACH_TYPE_MX23EVK);
 }
diff --git a/arch/arm/boards/freescale-mx23-evk/mx23-evk.c b/arch/arm/boards/freescale-mx23-evk/mx23-evk.c
index a3587db063..75a7d5a6b4 100644
--- a/arch/arm/boards/freescale-mx23-evk/mx23-evk.c
+++ b/arch/arm/boards/freescale-mx23-evk/mx23-evk.c
@@ -22,6 +22,7 @@
 #include <linux/err.h>
 #include <asm/armlinux.h>
 #include <generated/mach-types.h>
+#include <asm/barebox-arm.h>
 #include <mach/imx-regs.h>
 #include <mach/clock.h>
 #include <mach/mci.h>
@@ -99,6 +100,9 @@ static int mx23_evk_devices_init(void)
 {
 	int i, rc;
 
+	if (barebox_arm_machine() != MACH_TYPE_MX23EVK)
+		return 0;
+
 	/* initizalize gpios */
 	for (i = 0; i < ARRAY_SIZE(pad_setup); i++)
 		imx_gpio_mode(pad_setup[i]);
@@ -126,6 +130,9 @@ device_initcall(mx23_evk_devices_init);
 
 static int mx23_evk_console_init(void)
 {
+	if (barebox_arm_machine() != MACH_TYPE_MX23EVK)
+		return 0;
+
 	barebox_set_model("Freescale i.MX23 EVK");
 	barebox_set_hostname("mx23evk");
 
-- 
2.23.0


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

  parent reply	other threads:[~2019-09-18  7:54 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-18  7:54 [PATCH 00/16] ARM: mxs: full multi image support Sascha Hauer
2019-09-18  7:54 ` [PATCH 01/16] ARM: start: Allow to pass machine type as boarddata Sascha Hauer
2019-09-18  7:54 ` [PATCH 02/16] ARM: tx28: Pass and check machine type Sascha Hauer
2019-09-18  7:54 ` [PATCH 03/16] ARM: tx28: Make locally used function static Sascha Hauer
2019-09-18  7:54 ` [PATCH 04/16] ARM: duckbill: Check machine type in initcalls Sascha Hauer
2019-09-18  7:54 ` [PATCH 05/16] ARM: Freescale mx28evk: " Sascha Hauer
2019-09-18  7:54 ` [PATCH 06/16] ARM: i.MX23 olinuxino: " Sascha Hauer
2019-09-18  7:54 ` [PATCH 07/16] ARM: Crytalfonts cfa10036: " Sascha Hauer
2019-09-18  7:54 ` [PATCH 08/16] ARM: i.MX23 Chumby: " Sascha Hauer
2019-09-18  7:54 ` Sascha Hauer [this message]
2019-09-18  7:54 ` [PATCH 10/16] ARM: mxs: cfa10036: Switch to multi image support Sascha Hauer
2019-09-18  7:54 ` [PATCH 11/16] ARM: mxs: imx23-evk: " Sascha Hauer
2019-09-18  7:54 ` [PATCH 12/16] ARM: mxs: chumby: " Sascha Hauer
2019-09-18  7:54 ` [PATCH 13/16] ARM: mxs: Move HAVE_PBL_MULTI_IMAGES up to ARCH Sascha Hauer
2019-09-18  7:54 ` [PATCH 14/16] ARM: mxs: Allow to compile all boards for a SoC together Sascha Hauer
2019-09-18  7:54 ` [PATCH 15/16] ARM: add common i.MX28 defconfig file Sascha Hauer
2019-09-18  7:54 ` [PATCH 16/16] ARM: add common i.MX23 " 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=20190918075421.20456-10-s.hauer@pengutronix.de \
    --to=s.hauer@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