mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Bastian Krause <bst@pengutronix.de>
To: Ahmad Fatoum <a.fatoum@pengutronix.de>, barebox@lists.infradead.org
Subject: Re: [PATCH v3 2/2] ARM: start: drop support for machine type casted to boarddata pointer
Date: Wed, 12 Oct 2022 13:05:58 +0200	[thread overview]
Message-ID: <3185bf68-2dd7-a8f8-9583-4e8088c59bb3@pengutronix.de> (raw)
In-Reply-To: <20221011114927.546670-2-a.fatoum@pengutronix.de>

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@pengutronix.de>

Tested-by: Bastian Krause <bst@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 |




  reply	other threads:[~2022-10-12 11:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-11 11:49 [PATCH master v3 1/2] ARM: MXS: fix breakage for non-DT boards Ahmad Fatoum
2022-10-11 11:49 ` [PATCH v3 2/2] ARM: start: drop support for machine type casted to boarddata pointer Ahmad Fatoum
2022-10-12 11:05   ` Bastian Krause [this message]
2022-10-12 11:05 ` [PATCH master v3 1/2] ARM: MXS: fix breakage for non-DT boards Bastian Krause
2022-10-12 12:18 ` 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=3185bf68-2dd7-a8f8-9583-4e8088c59bb3@pengutronix.de \
    --to=bst@pengutronix.de \
    --cc=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /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