On 9/22/26 2:30 PM, Aleksei Sviridkin wrote:

...

> The obvious shape, a prompt on the generic symbols across the arch, was
> v1's 1/2. Tom Rini declined it:
> 
>   "This isn't a prompted option as boards that need it are expected to
>   select it and provide the correct value."
>   https://lore.kernel.org/u-boot/20260921155055.GZ858934@bill-the-cat/
> 
> After I described the board, he replied:
> 
>   "Then yes, a v2 where you just enable this for the platform that needs
>   it should be fine, and please make sure to CC all of the mediatek
>   maintainers, thanks."
>   https://lore.kernel.org/u-boot/20260922151920.GH858934@bill-the-cat/
> 
> No MediaTek board in the tree uses the header, so there is nothing here to
> just enable it for: the one that does is out of tree, and MediaTek has no
> board Kconfig a select could live in. What this v2 adds instead is a
> prompted bool inside mach-mediatek, with the offset base prompt only
> visible while that bool is on. Tom, is a prompted bool local to MediaTek
> acceptable for this, or would you rather it did not go in?

We don't want to add an option that is only used by downstream (code
janitors tend to like to remove things that aren't being used). But I think
what Tom meant is that you should add a defconfig for this board so that it
isn't downstream anymore. :-)

> diff --git a/arch/arm/mach-mediatek/Kconfig b/arch/arm/mach-mediatek/Kconfig
> index e572cfe857..e48fe88529 100644
> --- a/arch/arm/mach-mediatek/Kconfig
> +++ b/arch/arm/mach-mediatek/Kconfig
> @@ -173,6 +173,23 @@ config MTK_MEM_MAP_MMIO_SIZE
>       help
>         Target-specific MMIO region size in mem_map.
>  
> +config MTK_KERNEL_IMAGE_HEADER
> +     bool "Prepend an arm64 Linux kernel image header"
> +     select LINUX_KERNEL_IMAGE_HEADER
> +     help
> +       Build U-Boot with the arm64 Linux kernel image header in front of
> +       it, so that a vendor bootloader that only starts a Linux kernel
> +       image starts U-Boot as its payload.
> +
> +config LNX_KRNL_IMG_TEXT_OFFSET_BASE
> +     hex "Address the image header's text offset is measured from"
> +     depends on MTK_KERNEL_IMAGE_HEADER
> +     default TEXT_BASE
> +     help
> +       The header's text_offset field is CONFIG_TEXT_BASE minus this value.
> +       Set it so that the difference is the text offset the vendor
> +       bootloader expects; the default gives a zero offset.
> +
>  endif
>  
Then we could do something more like board/armltd/vexpress64/Kconfig where
we just select LINUX_KERNEL_IMAGE_HEADER on a symbol that only applies to
that board (so no MTK_KERNEL_IMAGE_HEADER and no config prompts needed).

Reply via email to