mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH 2/2] ARM: stm32mp: init: expand bootsource logic to STM32MP13{1,3}
Date: Wed,  9 Apr 2025 15:19:20 +0200	[thread overview]
Message-ID: <20250409131920.1949534-2-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20250409131920.1949534-1-a.fatoum@pengutronix.de>

We currently run through the bootsource logic only for STM32MP135, but
the code is equally applicable to the cheaper variants that only differ
in available peripherals.

Change the check to account for current STM32MP13 variants.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 arch/arm/mach-stm32mp/init.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-stm32mp/init.c b/arch/arm/mach-stm32mp/init.c
index b24649e86658..1c7f62dbb033 100644
--- a/arch/arm/mach-stm32mp/init.c
+++ b/arch/arm/mach-stm32mp/init.c
@@ -240,7 +240,11 @@ static int stm32mp_init(void)
 {
 	u32 boot_ctx;
 
-	if (of_machine_is_compatible("st,stm32mp135"))
+	if (of_machine_is_compatible("st,stm32mp131"))
+		__st32mp_soc = 0x32131;
+	else if (of_machine_is_compatible("st,stm32mp133"))
+		__st32mp_soc = 0x32133;
+	else if (of_machine_is_compatible("st,stm32mp135"))
 		__st32mp_soc = 0x32135;
 	else if (of_machine_is_compatible("st,stm32mp151"))
 		__st32mp_soc = 0x32151;
@@ -251,7 +255,7 @@ static int stm32mp_init(void)
 	else
 		return 0;
 
-	if (__st32mp_soc == 0x32135) {
+	if ((__st32mp_soc & 0xFF0) == 0x130) {
 		boot_ctx = readl(STM32MP13_TAMP_BOOT_CONTEXT);
 	} else {
 		stm32mp15_setup_cpu_type();
-- 
2.39.5




  reply	other threads:[~2025-04-09 14:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-09 13:19 [PATCH 1/2] ARM: stm32mp: switch internal SoC code to hexadecimal Ahmad Fatoum
2025-04-09 13:19 ` Ahmad Fatoum [this message]
2025-04-10  6:37 ` 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=20250409131920.1949534-2-a.fatoum@pengutronix.de \
    --to=a.fatoum@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