[PATCH] arm: boot: head-sharpsl.S: don't rely on MACH_TYPE_* of removed boards

Ethan Nelson-Moore posted 1 patch 1 month ago
arch/arm/boot/compressed/head-sharpsl.S | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
[PATCH] arm: boot: head-sharpsl.S: don't rely on MACH_TYPE_* of removed boards
Posted by Ethan Nelson-Moore 1 month ago
Code in head-sharpsl.S relies on the MACH_TYPE_* constants for five
boards that are no longer supported by the kernel. They were removed in
commit d6df7df7ae5a ("ARM: pxa: remove unused board files"). This
prevents the removal of boards no longer present in the kernel from
mach-types. Replace the MACH_TYPE_* references with hardcoded values.
(If the IDs were simply removed, these boards would be detected as
other supported machines, causing incorrect behavior. The kernel will
abort on detecting an unsupported machine ID.)

Signed-off-by: Ethan Nelson-Moore <enelsonmoore@gmail.com>
---
 arch/arm/boot/compressed/head-sharpsl.S | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/arch/arm/boot/compressed/head-sharpsl.S b/arch/arm/boot/compressed/head-sharpsl.S
index 992e784500fa..da05e01903e2 100644
--- a/arch/arm/boot/compressed/head-sharpsl.S
+++ b/arch/arm/boot/compressed/head-sharpsl.S
@@ -103,16 +103,22 @@ __SharpSL_start:
 	.word 	0x08010000		@ w100 Chip ID Reg Address
 .SCOOP2ADDR:
 	.word	0x08800040
+/*
+ * These five machines are no longer supported by the kernel, but if checks for
+ * them were removed, they would be detected as other supported machines,
+ * causing incorrect behavior. The kernel will abort on detecting an unsupported
+ * machine ID.
+ */
 .POODLEID:
-	.word	MACH_TYPE_POODLE
+	.word	424			@ MACH_TYPE_POODLE
 .CORGIID:
-	.word	MACH_TYPE_CORGI
+	.word	423			@ MACH_TYPE_CORGI
 .SHEPHERDID:
-	.word	MACH_TYPE_SHEPHERD
+	.word	545			@ MACH_TYPE_SHEPHERD
 .HUSKYID:
-	.word	MACH_TYPE_HUSKY
+	.word	543			@ MACH_TYPE_HUSKY
 .TOSAID:
-	.word	MACH_TYPE_TOSA
+	.word	520			@ MACH_TYPE_TOSA
 .SPITZID:
 	.word	MACH_TYPE_SPITZ
 .AKITAID:
-- 
2.43.0