From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH 6/7] ARM: stm32mp: init: don't print STM32MP15 CPU type
Date: Wed, 22 Nov 2023 19:11:15 +0100 [thread overview]
Message-ID: <20231122181116.591131-7-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20231122181116.591131-1-a.fatoum@pengutronix.de>
TF-A already reads the OTP and unconditionally prints at a higher log
level:
NOTICE: CPU: STM32MP157AAA Rev.B
barebox reads the OTP again via the secure monitor only to print:
stm32mp-init: detected STM32MP157AAA Rev.B
which doesn't add any extra information, so drop it.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
arch/arm/mach-stm32mp/init.c | 45 ++----------------------------------
1 file changed, 2 insertions(+), 43 deletions(-)
diff --git a/arch/arm/mach-stm32mp/init.c b/arch/arm/mach-stm32mp/init.c
index 90f331ecd0dd..2b0a665220ce 100644
--- a/arch/arm/mach-stm32mp/init.c
+++ b/arch/arm/mach-stm32mp/init.c
@@ -97,11 +97,6 @@ static void setup_boot_mode(u32 boot_ctx)
bootsource_set_raw(src, instance);
}
-static u32 get_cpu_revision(void)
-{
- return (stm32mp_read_idc() & DBGMCU_IDC_REV_ID_MASK) >> DBGMCU_IDC_REV_ID_SHIFT;
-}
-
static int get_cpu_package(u32 *pkg)
{
int ret = bsec_read_field(BSEC_OTP_PKG, pkg);
@@ -161,107 +156,71 @@ static int stm32mp15_fixup_pkg(struct device_node *root, void *_pkg)
static int stm32mp15_setup_cpu_type(void)
{
- const char *cputypestr, *cpupkgstr, *cpurevstr;
unsigned long cpufixupctx = 0, pkgfixupctx = 0;
- int cputype, silicon_revision, package;
+ int cputype, package;
int ret;
__stm32mp15_get_cpu_type(&cputype);
switch (cputype) {
case CPU_STM32MP157Fxx:
- cputypestr = "157F";
cpufixupctx = FIXUP_CPU_MASK(2, 800);
break;
case CPU_STM32MP157Dxx:
- cputypestr = "157D";
cpufixupctx = FIXUP_CPU_MASK(2, 800);
break;
case CPU_STM32MP157Cxx:
- cputypestr = "157C";
cpufixupctx = FIXUP_CPU_MASK(2, 650);
break;
case CPU_STM32MP157Axx:
- cputypestr = "157A";
cpufixupctx = FIXUP_CPU_MASK(2, 650);
break;
case CPU_STM32MP153Fxx:
- cputypestr = "153F";
cpufixupctx = FIXUP_CPU_MASK(2, 800);
break;
case CPU_STM32MP153Dxx:
- cputypestr = "153D";
cpufixupctx = FIXUP_CPU_MASK(2, 800);
break;
case CPU_STM32MP153Cxx:
- cputypestr = "153C";
cpufixupctx = FIXUP_CPU_MASK(2, 650);
break;
case CPU_STM32MP153Axx:
- cputypestr = "153A";
cpufixupctx = FIXUP_CPU_MASK(2, 650);
break;
case CPU_STM32MP151Cxx:
- cputypestr = "151C";
cpufixupctx = FIXUP_CPU_MASK(1, 650);
break;
case CPU_STM32MP151Axx:
- cputypestr = "151A";
cpufixupctx = FIXUP_CPU_MASK(1, 650);
break;
case CPU_STM32MP151Fxx:
- cputypestr = "151F";
cpufixupctx = FIXUP_CPU_MASK(1, 800);
break;
case CPU_STM32MP151Dxx:
- cputypestr = "151D";
cpufixupctx = FIXUP_CPU_MASK(1, 800);
break;
default:
- cputypestr = "????";
break;
}
get_cpu_package(&package);
switch (package) {
case PKG_AA_LBGA448:
- cpupkgstr = "AA";
pkgfixupctx = STM32MP_PKG_AA;
break;
case PKG_AB_LBGA354:
- cpupkgstr = "AB";
pkgfixupctx = STM32MP_PKG_AB;
break;
case PKG_AC_TFBGA361:
- cpupkgstr = "AC";
pkgfixupctx = STM32MP_PKG_AC;
break;
case PKG_AD_TFBGA257:
- cpupkgstr = "AD";
pkgfixupctx = STM32MP_PKG_AD;
break;
default:
- cpupkgstr = "??";
break;
}
- silicon_revision = get_cpu_revision();
- switch (silicon_revision) {
- case CPU_REV_A:
- cpurevstr = "A";
- break;
- case CPU_REV_B:
- cpurevstr = "B";
- break;
- case CPU_REV_Z:
- cpurevstr = "Z";
- break;
- default:
- cpurevstr = "?";
- }
-
- pr_debug("cputype = 0x%x, package = 0x%x, revision = 0x%x\n",
- cputype, package, silicon_revision);
- pr_info("detected STM32MP%s%s Rev.%s\n", cputypestr, cpupkgstr, cpurevstr);
+ pr_debug("cputype = 0x%x, package = 0x%x\n", cputype, package);
if (cpufixupctx) {
ret = of_register_fixup(stm32mp15_fixup_cpus, (void*)cpufixupctx);
--
2.39.2
next prev parent reply other threads:[~2023-11-22 18:13 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-22 18:11 [PATCH 0/7] ARM: stm32mp: random STM32MP13 fixes Ahmad Fatoum
2023-11-22 18:11 ` [PATCH 1/7] ARM: dts: stm32mp: stm32mp135-dk: drop duplicate property Ahmad Fatoum
2023-11-22 18:11 ` [PATCH 2/7] ARM: dts: stm32mp: fix model string for stm32mp135f-dk Ahmad Fatoum
2023-11-22 18:11 ` [PATCH 3/7] ARM: stm32mp: init: drop unused macros Ahmad Fatoum
2023-11-22 18:11 ` [PATCH 4/7] ARM: stm32mp: don't re-enable DBGCFGR clock Ahmad Fatoum
2023-11-22 18:11 ` [PATCH 5/7] ARM: stm32mp: init: handle differences between STM32MP13 and STM32MP15 Ahmad Fatoum
2023-11-22 18:11 ` Ahmad Fatoum [this message]
2023-11-22 18:11 ` [PATCH 7/7] ARM: stm32mp: init: ignore of_register_fixup return value Ahmad Fatoum
2023-11-23 7:25 ` [PATCH 0/7] ARM: stm32mp: random STM32MP13 fixes 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=20231122181116.591131-7-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