[PATCH v2 1/2] scripts: gen-dtb-s: reference OF IMD entries automatically

Sascha Hauer sha at pengutronix.de
Wed Apr 12 03:58:10 PDT 2023


On Tue, Apr 04, 2023 at 12:17:05PM +0200, Ahmad Fatoum wrote:
> We currently require IMD_OF_USED to get the DT compatible into the
> barebox image data meta section. As the PBL is already referencing the
> DT to pass it along to barebox proper, let's add a reference from the DT
> to the image data section to make IMD_OF_USED unnecessary.
> 
> Suggested-by: Antony Pavlov <antonynpavlov at gmail.com>
> Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
> --
> v1 -> v2:
>   - use dword, to fix build for 64-bit (Sascha)

Indeed it fixes it for 64-bit, but now breaks it for 32-bit. Do we have
to #ifdef this or is there something clever we can do about this?

Sascha

>   - place IMD reference before STRUCT_ALIGNMENT
> ---
>  scripts/gen-dtb-s | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/scripts/gen-dtb-s b/scripts/gen-dtb-s
> index c5c46a4d8675..6309a814a483 100755
> --- a/scripts/gen-dtb-s
> +++ b/scripts/gen-dtb-s
> @@ -49,6 +49,9 @@ echo "__dtb_${name}_start:"
>  echo ".incbin \"$dtb\""
>  echo "__dtb_${name}_end:"
>  echo ".global __dtb_${name}_end"
> +if [ "$imd" = "y" ]; then
> +	echo ".dword __barebox_imd_OF_${name}"
> +fi
>  echo ".balign STRUCT_ALIGNMENT"
>  
>  compressed=$(${CONFIG_SHELL} "${srctree}/scripts/file-size.sh" $dtb.z)
> @@ -65,5 +68,8 @@ printf ".int 0x%08x\n"  $uncompressed
>  echo ".incbin \"$dtb.z\""
>  echo "__dtb_z_${name}_end:"
>  echo ".global __dtb_z_${name}_end"
> +if [ "$imd" = "y" ]; then
> +	echo ".dword __barebox_imd_OF_${name}"
> +fi
>  echo ".balign STRUCT_ALIGNMENT"
>  echo "#endif"
> -- 
> 2.39.2
> 
> 
> 

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