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 07/12] ARM: versatile: make sure to run initcalls on versatile only
Date: Tue,  2 May 2023 11:14:14 +0200	[thread overview]
Message-ID: <20230502091419.2551228-8-s.hauer@pengutronix.de> (raw)
In-Reply-To: <20230502091419.2551228-1-s.hauer@pengutronix.de>

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/boards/versatile/versatilepb.c | 13 +++++--------
 arch/arm/mach-versatile/core.c          |  9 ++++++---
 2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/arch/arm/boards/versatile/versatilepb.c b/arch/arm/boards/versatile/versatilepb.c
index 8079ade9a5..3eae1e4f78 100644
--- a/arch/arm/boards/versatile/versatilepb.c
+++ b/arch/arm/boards/versatile/versatilepb.c
@@ -24,6 +24,10 @@ static int vpb_console_init(void)
 	char *hostname = "versatilepb-unknown";
 	char *model = "ARM Versatile PB";
 
+	if (!of_machine_is_compatible("arm,versatile-pb") &&
+	    !of_machine_is_compatible("arm,versatile-ab"))
+		return 0;
+
 	if (cpu_is_arm926()) {
 		hostname = "versatilepb-arm926";
 		model = "ARM Versatile PB (arm926)";
@@ -32,17 +36,10 @@ static int vpb_console_init(void)
 		model = "ARM Versatile PB (arm1176)";
 	}
 
+	armlinux_set_architecture(MACH_TYPE_VERSATILE_PB);
 	barebox_set_hostname(hostname);
 	barebox_set_model(model);
 
 	return 0;
 }
 console_initcall(vpb_console_init);
-
-static int vpb_devices_init(void)
-{
-	armlinux_set_architecture(MACH_TYPE_VERSATILE_PB);
-
-	return 0;
-}
-device_initcall(vpb_devices_init);
diff --git a/arch/arm/mach-versatile/core.c b/arch/arm/mach-versatile/core.c
index 8dea053d48..74af8c0804 100644
--- a/arch/arm/mach-versatile/core.c
+++ b/arch/arm/mach-versatile/core.c
@@ -98,8 +98,6 @@ static int vpb_clocksource_init(void)
 	return init_clock(&vpb_cs);
 }
 
-core_initcall(vpb_clocksource_init);
-
 static void __noreturn versatile_reset_soc(struct restart_handler *rst)
 {
 	u32 val;
@@ -116,7 +114,12 @@ static void __noreturn versatile_reset_soc(struct restart_handler *rst)
 
 static int versatile_init(void)
 {
+	if (!of_machine_is_compatible("arm,versatile-pb") &&
+	    !of_machine_is_compatible("arm,versatile-ab"))
+		return 0;
+
+	vpb_clocksource_init();
 	restart_handler_register_fn("soc", versatile_reset_soc);
 	return 0;
 }
-coredevice_initcall(versatile_init);
+core_initcall(versatile_init);
-- 
2.39.2




  parent reply	other threads:[~2023-05-02  9:15 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-02  9:14 [PATCH 00/12] ARM Versatile updates Sascha Hauer
2023-05-02  9:14 ` [PATCH 01/12] ARM: versatile: Enable CONFIG_RELOCATABLE Sascha Hauer
2023-05-02  9:14 ` [PATCH 02/12] ARM: versatile: Use common clk framework Sascha Hauer
2023-05-02  9:14 ` [PATCH 03/12] ARM: versatile: drop platform code to register UART Sascha Hauer
2023-05-02  9:14 ` [PATCH 04/12] ARM: versatile: drop platform code to register GPIOs Sascha Hauer
2023-05-02  9:14 ` [PATCH 05/12] ARM: versatile: Use flash from device tree Sascha Hauer
2023-05-02  9:14 ` [PATCH 06/12] ARM: versatile: Use smc91c111 " Sascha Hauer
2023-05-02  9:17   ` Ahmad Fatoum
2023-05-02 11:41     ` Sascha Hauer
2023-05-02  9:14 ` Sascha Hauer [this message]
2023-05-02  9:14 ` [PATCH 08/12] ARM: versatile: simplify ARM1176 support Sascha Hauer
2023-05-02  9:14 ` [PATCH 09/12] ARM: versatile: move over to multi image support Sascha Hauer
2023-05-02  9:14 ` [PATCH 10/12] ARM: versatile: move over to multi arch support Sascha Hauer
2023-05-02  9:14 ` [PATCH 11/12] ARM: versatile: Use existing clocksource driver Sascha Hauer
2023-05-02  9:14 ` [PATCH 12/12] ARM: Merge imx_defconfig and versatilepb_defconfig into multi_v5_v6_defconfig 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=20230502091419.2551228-8-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