[RFT PATCH 2/2] ARM: start: drop support for machine type casted to boarddata pointer

Ahmad Fatoum a.fatoum at pengutronix.de
Sun Oct 9 23:12:35 PDT 2022


Commit 84d28cec7f49 ("ARM: add a machine number mechanism for boarddata")
added in 2015 added a struct barebox_arm_boarddata mechanism for PBL to
pass machine type to barebox proper without going the legacy router of
casting the machine type integer to a pointer directly.

The legacy way with casting was mostly broken two years ago with commit
390bc7834ffc ("ARM: start: check for machine type last").

Only user that complained about it was using an in-tree board that has
in the meantime been fixed to use struct barebox_arm_boarddata instead.

Take this as indication that the code is dead and can be safely removed.

This may introduce regressions for boards that happened to work, despite
their machine type integer being dereferenced as a pointer. If you
happen to have such a board, please pass a pointer to a
struct barebox_arm_boarddata instead.

Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
 arch/arm/cpu/start.c | 12 ------------
 1 file changed, 12 deletions(-)

diff --git a/arch/arm/cpu/start.c b/arch/arm/cpu/start.c
index 672f26e0063c..f9b617aa855a 100644
--- a/arch/arm/cpu/start.c
+++ b/arch/arm/cpu/start.c
@@ -189,18 +189,6 @@ __noreturn __no_sanitize_address void barebox_non_pbl_start(unsigned long membas
 		} else if (blob_is_arm_boarddata(boarddata)) {
 			totalsize = sizeof(struct barebox_arm_boarddata);
 			name = "machine type";
-		} else if ((unsigned long)boarddata < 8192) {
-			struct barebox_arm_boarddata *bd;
-			uint32_t machine_type = (unsigned long)boarddata;
-			unsigned long mem = arm_mem_boarddata(membase, endmem,
-							      sizeof(*bd));
-			pr_debug("found machine type %d in boarddata\n",
-				 machine_type);
-			bd = barebox_boarddata = (void *)mem;
-			barebox_boarddata_size = sizeof(*bd);
-			bd->magic = BAREBOX_ARM_BOARDDATA_MAGIC;
-			bd->machine = machine_type;
-			malloc_end = mem;
 		}
 
 		if (totalsize) {
-- 
2.30.2




More information about the barebox mailing list