[PATCH] pinctrl: sunxi: Avoid using .bss for SPL

Andre Przywara andre.przywara at arm.com
Wed Nov 1 13:33:12 CET 2023


On Mon, 30 Oct 2023 23:57:40 -0500
Samuel Holland <samuel at sholland.org> wrote:

> sunxi platforms put .bss in DRAM, so .bss is not available in SPL before
> DRAM controller initialization. Therefore, this buffer must be placed in
> the .data section.

Right, this results in 0 bytes of .BSS, down from 5.
Though I am wondering how much of the (SPL-)DM code gets away without
using BSS, or if we get accidental BSS additions from the framework, over
time.

But if this patch helps your SPL_DM efforts:

> Signed-off-by: Samuel Holland <samuel at sholland.org>

Reviewed-by: Andre Przywara <andre.przywara at arm.com>

Cheers,
Andre

> ---
> 
>  drivers/pinctrl/sunxi/pinctrl-sunxi.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/pinctrl/sunxi/pinctrl-sunxi.c b/drivers/pinctrl/sunxi/pinctrl-sunxi.c
> index bdf6360f176..37ea93715d1 100644
> --- a/drivers/pinctrl/sunxi/pinctrl-sunxi.c
> +++ b/drivers/pinctrl/sunxi/pinctrl-sunxi.c
> @@ -50,7 +50,7 @@ static const char *sunxi_pinctrl_get_pin_name(struct udevice *dev,
>  					      uint pin_selector)
>  {
>  	const struct sunxi_pinctrl_desc *desc = dev_get_priv(dev);
> -	static char pin_name[sizeof("PN31")];
> +	static char pin_name[sizeof("PN31")] __section(".data");
>  
>  	snprintf(pin_name, sizeof(pin_name), "P%c%d",
>  		 pin_selector / SUNXI_GPIOS_PER_BANK + desc->first_bank + 'A',



More information about the U-Boot mailing list