From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: barebox@lists.infradead.org, str@pengutronix.de
Subject: Re: [PATCH] ARM: i.MX: prevent use of imx_cpu_type in PBL
Date: Tue, 26 May 2026 08:41:39 +0200 [thread overview]
Message-ID: <8ca9c8ba-374c-4ded-80ef-1d3f151a72be@pengutronix.de> (raw)
In-Reply-To: <E1wRlO9-0000000GFFg-0VaP@pty.whiteo.stw.pengutronix.de>
Hello Sascha,
On 5/26/26 08:35, Sascha Hauer wrote:
> On 2026-05-22 15:48, Ahmad Fatoum wrote:
>> Functions like cpu_is_mx6q internally call cpu_is_mx6() first,
>> which can be evaluated at compile-time if only i.MX6 boards are enabled.
>>
>> This allowed calling cpu_is_mx6q in PBL entry points as long as barebox was
>> compiled for only a single SoC.
>>
>> Since the multi-arch/multi-platform support was added however,
>> cpu_is_mx6 became a runtime check that's never true in PBL, leading all
>> cpu_is_mx* in 32-boards to silently fail at runtime.
>>
>> We have no in-tree boards that are affected by this, so until some
>> out-of-tree user is bothered enough to fix is, acknowledge that this no
>> longer works and turn the silent breakage into a loud compile-time error
>> whenever anything ends up referencing __imx_cpu_type.
>
> imx_set_cpu_type() has users in PBL:
>
> arch/arm/mach-imx/atf.c:280: imx_set_cpu_type(IMX_CPU_IMX8MM);
> arch/arm/mach-imx/atf.c:343: imx_set_cpu_type(IMX_CPU_IMX8MP);
> arch/arm/mach-imx/atf.c:406: imx_set_cpu_type(IMX_CPU_IMX8MN);
> arch/arm/mach-imx/atf.c:463: imx_set_cpu_type(IMX_CPU_IMX8MQ);
> arch/arm/mach-imx/atf.c:492: imx_set_cpu_type(IMX_CPU_IMX93);
>
> Also several consumers rely on it in PBL:
>
> arch/arm/mach-imx/tzasc.c:358: if (cpu_is_mx8mm() || cpu_is_mx8mn() || cpu_is_mx8mp())
> arch/arm/mach-imx/tzasc.c:365: if (cpu_is_mx8mn() || cpu_is_mx8mp())
> arch/arm/mach-imx/atf.c:90: if (cpu_is_mx8mn())
> arch/arm/mach-imx/atf.c:143: if (cpu_is_mx8mn())
> arch/arm/mach-imx/atf.c:198: if (!IS_ENABLED(CONFIG_ARCH_IMX_ATF_PASS_BL_PARAMS) || cpu_is_mx8mq()) {
Yes and the definition is still emitted for CONFIG_ARCH_IMX_ATF=y.
The change here onl affects 32-bit i.MX.
Cheers,
Ahmad
>
> Sascha
>
> --
> Pengutronix e.K. | |
> Steuerwalder Str. 21 | http://www.pengutronix.de/ |
> 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
> Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
>
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
next prev parent reply other threads:[~2026-05-26 6:43 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-22 13:48 Ahmad Fatoum
2026-05-26 6:35 ` Sascha Hauer
2026-05-26 6:41 ` Ahmad Fatoum [this message]
2026-05-26 6:56 ` Sascha Hauer
2026-05-26 6:56 ` 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=8ca9c8ba-374c-4ded-80ef-1d3f151a72be@pengutronix.de \
--to=a.fatoum@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=s.hauer@pengutronix.de \
--cc=str@pengutronix.de \
/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