* [PATCH] arm: boot: ep93xx: don't rely on machine_is_*() for removed board files
@ 2026-05-09 22:38 Ethan Nelson-Moore
2026-05-10 17:40 ` Alexander Sverdlin
2026-05-10 22:45 ` Alexander Sverdlin
0 siblings, 2 replies; 4+ messages in thread
From: Ethan Nelson-Moore @ 2026-05-09 22:38 UTC (permalink / raw)
To: linux-arm-kernel, linux-kernel
Cc: Russell King, Ethan Nelson-Moore, Hartley Sweeten,
Alexander Sverdlin, Nikita Shubin
Code in misc-ep93xx.h relies on machine_is_*() macros for several
boards that no longer have legacy board files. They were removed in
commit e5ef574dda70 ("ARM: ep93xx: delete all boardfiles"). This
prevents the removal of machine IDs no longer used by the kernel from
mach-types. To resolve this issue, create local copies of these macros.
(The checks themselves are still valid because the IDs are still passed
in by the bootloader on these machines.) Also take the opportunity to
remove three repeated checks for the same ID.
Signed-off-by: Ethan Nelson-Moore <enelsonmoore@gmail.com>
---
arch/arm/boot/compressed/misc-ep93xx.h | 20 ++++++++++++++++----
1 file changed, 16 insertions(+), 4 deletions(-)
diff --git a/arch/arm/boot/compressed/misc-ep93xx.h b/arch/arm/boot/compressed/misc-ep93xx.h
index 65b4121d1490..b0a1b42aab31 100644
--- a/arch/arm/boot/compressed/misc-ep93xx.h
+++ b/arch/arm/boot/compressed/misc-ep93xx.h
@@ -3,7 +3,22 @@
* Copyright (C) 2006 Lennert Buytenhek <buytenh@wantstofly.org>
*/
-#include <asm/mach-types.h>
+/*
+ * These machine IDs are no longer used by the kernel since EP93xx was converted
+ * to DT booting, but they are still passed in by bootloaders, so we use our own
+ * local definitions of the relevant macros.
+ */
+#define machine_is_bk3() (__machine_arch_type == 1880)
+#define machine_is_edb9301() (__machine_arch_type == 462)
+#define machine_is_edb9302a() (__machine_arch_type == 1127)
+#define machine_is_edb9302() (__machine_arch_type == 538)
+#define machine_is_edb9307a() (__machine_arch_type == 1128)
+#define machine_is_edb9307() (__machine_arch_type == 607)
+#define machine_is_edb9312() (__machine_arch_type == 451)
+#define machine_is_edb9315a() (__machine_arch_type == 772)
+#define machine_is_edb9315() (__machine_arch_type == 463)
+#define machine_is_ts72xx() (__machine_arch_type == 673)
+#define machine_is_vision_ep9307() (__machine_arch_type == 1578)
static inline unsigned int __raw_readl(unsigned int ptr)
{
@@ -60,14 +75,11 @@ static inline void ep93xx_decomp_setup(void)
if (machine_is_edb9301() ||
machine_is_edb9302() ||
machine_is_edb9302a() ||
- machine_is_edb9302a() ||
machine_is_edb9307() ||
machine_is_edb9307a() ||
- machine_is_edb9307a() ||
machine_is_edb9312() ||
machine_is_edb9315() ||
machine_is_edb9315a() ||
- machine_is_edb9315a() ||
machine_is_ts72xx() ||
machine_is_bk3() ||
machine_is_vision_ep9307())
--
2.43.0
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] arm: boot: ep93xx: don't rely on machine_is_*() for removed board files
2026-05-09 22:38 [PATCH] arm: boot: ep93xx: don't rely on machine_is_*() for removed board files Ethan Nelson-Moore
@ 2026-05-10 17:40 ` Alexander Sverdlin
2026-05-10 21:53 ` Ethan Nelson-Moore
2026-05-10 22:45 ` Alexander Sverdlin
1 sibling, 1 reply; 4+ messages in thread
From: Alexander Sverdlin @ 2026-05-10 17:40 UTC (permalink / raw)
To: Ethan Nelson-Moore, linux-arm-kernel, linux-kernel
Cc: Russell King, Hartley Sweeten, Nikita Shubin
Hi Ethan,
On Sat, 2026-05-09 at 15:38 -0700, Ethan Nelson-Moore wrote:
> Code in misc-ep93xx.h relies on machine_is_*() macros for several
> boards that no longer have legacy board files. They were removed in
> commit e5ef574dda70 ("ARM: ep93xx: delete all boardfiles"). This
> prevents the removal of machine IDs no longer used by the kernel from
> mach-types. To resolve this issue, create local copies of these macros.
> (The checks themselves are still valid because the IDs are still passed
> in by the bootloader on these machines.) Also take the opportunity to
> remove three repeated checks for the same ID.
I most probably miss something, but what is the reason for removing
the machine IDs from the mach-types, especially if they are still used
by the kernel (though only in its decompressor code)?
> Signed-off-by: Ethan Nelson-Moore <enelsonmoore@gmail.com>
> ---
> arch/arm/boot/compressed/misc-ep93xx.h | 20 ++++++++++++++++----
> 1 file changed, 16 insertions(+), 4 deletions(-)
>
> diff --git a/arch/arm/boot/compressed/misc-ep93xx.h b/arch/arm/boot/compressed/misc-ep93xx.h
> index 65b4121d1490..b0a1b42aab31 100644
> --- a/arch/arm/boot/compressed/misc-ep93xx.h
> +++ b/arch/arm/boot/compressed/misc-ep93xx.h
> @@ -3,7 +3,22 @@
> * Copyright (C) 2006 Lennert Buytenhek <buytenh@wantstofly.org>
> */
>
> -#include <asm/mach-types.h>
> +/*
> + * These machine IDs are no longer used by the kernel since EP93xx was converted
> + * to DT booting, but they are still passed in by bootloaders, so we use our own
> + * local definitions of the relevant macros.
> + */
> +#define machine_is_bk3() (__machine_arch_type == 1880)
> +#define machine_is_edb9301() (__machine_arch_type == 462)
> +#define machine_is_edb9302a() (__machine_arch_type == 1127)
> +#define machine_is_edb9302() (__machine_arch_type == 538)
> +#define machine_is_edb9307a() (__machine_arch_type == 1128)
> +#define machine_is_edb9307() (__machine_arch_type == 607)
> +#define machine_is_edb9312() (__machine_arch_type == 451)
> +#define machine_is_edb9315a() (__machine_arch_type == 772)
> +#define machine_is_edb9315() (__machine_arch_type == 463)
> +#define machine_is_ts72xx() (__machine_arch_type == 673)
> +#define machine_is_vision_ep9307() (__machine_arch_type == 1578)
>
> static inline unsigned int __raw_readl(unsigned int ptr)
> {
> @@ -60,14 +75,11 @@ static inline void ep93xx_decomp_setup(void)
> if (machine_is_edb9301() ||
> machine_is_edb9302() ||
> machine_is_edb9302a() ||
> - machine_is_edb9302a() ||
> machine_is_edb9307() ||
> machine_is_edb9307a() ||
> - machine_is_edb9307a() ||
> machine_is_edb9312() ||
> machine_is_edb9315() ||
> machine_is_edb9315a() ||
> - machine_is_edb9315a() ||
> machine_is_ts72xx() ||
> machine_is_bk3() ||
> machine_is_vision_ep9307())
--
Alexander Sverdlin.
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] arm: boot: ep93xx: don't rely on machine_is_*() for removed board files
2026-05-10 17:40 ` Alexander Sverdlin
@ 2026-05-10 21:53 ` Ethan Nelson-Moore
0 siblings, 0 replies; 4+ messages in thread
From: Ethan Nelson-Moore @ 2026-05-10 21:53 UTC (permalink / raw)
To: Alexander Sverdlin
Cc: linux-arm-kernel, linux-kernel, Russell King, Hartley Sweeten,
Nikita Shubin
On Sun, May 10, 2026 at 10:40 AM Alexander Sverdlin
<alexander.sverdlin@gmail.com> wrote:
> I most probably miss something, but what is the reason for removing
> the machine IDs from the mach-types, especially if they are still used
> by the kernel (though only in its decompressor code)?
Hi, Alexander,
My plan after all my related patches are merged is to remove all
entries for legacy board files that are not used by the kernel (i.e.:
boards that were removed, never in mainline, or converted to DT
booting). This would reduce mach-types from 579 to 28 entries and
would allow it to be used as a list of non-DT boards remaining in the
kernel. The last time mach-types was similarly filtered was in 2016.
Ethan
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] arm: boot: ep93xx: don't rely on machine_is_*() for removed board files
2026-05-09 22:38 [PATCH] arm: boot: ep93xx: don't rely on machine_is_*() for removed board files Ethan Nelson-Moore
2026-05-10 17:40 ` Alexander Sverdlin
@ 2026-05-10 22:45 ` Alexander Sverdlin
1 sibling, 0 replies; 4+ messages in thread
From: Alexander Sverdlin @ 2026-05-10 22:45 UTC (permalink / raw)
To: Ethan Nelson-Moore, linux-arm-kernel, linux-kernel
Cc: Russell King, Hartley Sweeten, Nikita Shubin
Hi Ethan,
On Sat, 2026-05-09 at 15:38 -0700, Ethan Nelson-Moore wrote:
> Code in misc-ep93xx.h relies on machine_is_*() macros for several
> boards that no longer have legacy board files. They were removed in
> commit e5ef574dda70 ("ARM: ep93xx: delete all boardfiles"). This
> prevents the removal of machine IDs no longer used by the kernel from
> mach-types. To resolve this issue, create local copies of these macros.
> (The checks themselves are still valid because the IDs are still passed
> in by the bootloader on these machines.) Also take the opportunity to
> remove three repeated checks for the same ID.
>
> Signed-off-by: Ethan Nelson-Moore <enelsonmoore@gmail.com>
Acked-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>
I'll pick the patch and send it to Arnd if there will be no objection
during this week.
> ---
> arch/arm/boot/compressed/misc-ep93xx.h | 20 ++++++++++++++++----
> 1 file changed, 16 insertions(+), 4 deletions(-)
>
> diff --git a/arch/arm/boot/compressed/misc-ep93xx.h b/arch/arm/boot/compressed/misc-ep93xx.h
> index 65b4121d1490..b0a1b42aab31 100644
> --- a/arch/arm/boot/compressed/misc-ep93xx.h
> +++ b/arch/arm/boot/compressed/misc-ep93xx.h
> @@ -3,7 +3,22 @@
> * Copyright (C) 2006 Lennert Buytenhek <buytenh@wantstofly.org>
> */
>
> -#include <asm/mach-types.h>
> +/*
> + * These machine IDs are no longer used by the kernel since EP93xx was converted
> + * to DT booting, but they are still passed in by bootloaders, so we use our own
> + * local definitions of the relevant macros.
> + */
> +#define machine_is_bk3() (__machine_arch_type == 1880)
> +#define machine_is_edb9301() (__machine_arch_type == 462)
> +#define machine_is_edb9302a() (__machine_arch_type == 1127)
> +#define machine_is_edb9302() (__machine_arch_type == 538)
> +#define machine_is_edb9307a() (__machine_arch_type == 1128)
> +#define machine_is_edb9307() (__machine_arch_type == 607)
> +#define machine_is_edb9312() (__machine_arch_type == 451)
> +#define machine_is_edb9315a() (__machine_arch_type == 772)
> +#define machine_is_edb9315() (__machine_arch_type == 463)
> +#define machine_is_ts72xx() (__machine_arch_type == 673)
> +#define machine_is_vision_ep9307() (__machine_arch_type == 1578)
>
> static inline unsigned int __raw_readl(unsigned int ptr)
> {
> @@ -60,14 +75,11 @@ static inline void ep93xx_decomp_setup(void)
> if (machine_is_edb9301() ||
> machine_is_edb9302() ||
> machine_is_edb9302a() ||
> - machine_is_edb9302a() ||
> machine_is_edb9307() ||
> machine_is_edb9307a() ||
> - machine_is_edb9307a() ||
> machine_is_edb9312() ||
> machine_is_edb9315() ||
> machine_is_edb9315a() ||
> - machine_is_edb9315a() ||
> machine_is_ts72xx() ||
> machine_is_bk3() ||
> machine_is_vision_ep9307())
--
Alexander Sverdlin.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-05-10 22:45 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-09 22:38 [PATCH] arm: boot: ep93xx: don't rely on machine_is_*() for removed board files Ethan Nelson-Moore
2026-05-10 17:40 ` Alexander Sverdlin
2026-05-10 21:53 ` Ethan Nelson-Moore
2026-05-10 22:45 ` Alexander Sverdlin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox