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

Bastian Krause bst at pengutronix.de
Wed Oct 12 04:05:58 PDT 2022


On 10/11/22 13:49, Ahmad Fatoum wrote:
> 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>

Tested-by: Bastian Krause <bst at pengutronix.de>

Regards,
Bastian

> ---
> v2 -> v3:
>    - no change
> v1 -> v2:
>    - no change
> ---
>   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) {

-- 
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 |




More information about the barebox mailing list