All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] rockchip: Set default LNX_KRNL_IMG_TEXT_OFFSET_BASE to SYS_TEXT_BASE
@ 2022-01-29 15:27 Alper Nebi Yasak
  2022-02-11 15:05 ` Simon Glass
  2022-03-14  8:00 ` Kever Yang
  0 siblings, 2 replies; 3+ messages in thread
From: Alper Nebi Yasak @ 2022-01-29 15:27 UTC (permalink / raw)
  To: u-boot; +Cc: Kever Yang, Simon Glass, Philipp Tomsich, Alper Nebi Yasak

U-Boot can be chainloaded from vendor firmware on ARM64 chromebooks from
a GPT partition (roughly the same as in doc/chromium/chainload.rst), but
an appropriate image header must be built-in to the U-Boot binary by
enabling LINUX_KERNEL_IMAGE_HEADER.

This header has a field for an image load offset from 2MiB alignment
which must also be customized through LNX_KRNL_IMG_TEXT_OFFSET_BASE.
Set it equal to SYS_TEXT_BASE by default for Rockchip boards, which
happens to make this offset zero and works fine on chromebook_kevin
both for chainloading and bare-metal use.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
---
Looks like ARM64 chromebooks also need POSITION_INDEPENDENT=y to
chainload that way, but I'm not enabling the configs here. I'm thinking
of selecting these from new configs that also enable binman definitions
for the kernel partition and legacy boot images.

 arch/arm/mach-rockchip/Kconfig | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/arm/mach-rockchip/Kconfig b/arch/arm/mach-rockchip/Kconfig
index 92f35309e4a6..308dc09b0389 100644
--- a/arch/arm/mach-rockchip/Kconfig
+++ b/arch/arm/mach-rockchip/Kconfig
@@ -390,6 +390,9 @@ config ROCKCHIP_SPI_IMAGE
 	  containing U-Boot. The image is built by binman. U-Boot sits near
 	  the start of the image.
 
+config LNX_KRNL_IMG_TEXT_OFFSET_BASE
+	default SYS_TEXT_BASE
+
 source "arch/arm/mach-rockchip/px30/Kconfig"
 source "arch/arm/mach-rockchip/rk3036/Kconfig"
 source "arch/arm/mach-rockchip/rk3128/Kconfig"
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] rockchip: Set default LNX_KRNL_IMG_TEXT_OFFSET_BASE to SYS_TEXT_BASE
  2022-01-29 15:27 [PATCH] rockchip: Set default LNX_KRNL_IMG_TEXT_OFFSET_BASE to SYS_TEXT_BASE Alper Nebi Yasak
@ 2022-02-11 15:05 ` Simon Glass
  2022-03-14  8:00 ` Kever Yang
  1 sibling, 0 replies; 3+ messages in thread
From: Simon Glass @ 2022-02-11 15:05 UTC (permalink / raw)
  To: Alper Nebi Yasak; +Cc: U-Boot Mailing List, Kever Yang, Philipp Tomsich

On Sat, 29 Jan 2022 at 08:28, Alper Nebi Yasak <alpernebiyasak@gmail.com> wrote:
>
> U-Boot can be chainloaded from vendor firmware on ARM64 chromebooks from
> a GPT partition (roughly the same as in doc/chromium/chainload.rst), but
> an appropriate image header must be built-in to the U-Boot binary by
> enabling LINUX_KERNEL_IMAGE_HEADER.
>
> This header has a field for an image load offset from 2MiB alignment
> which must also be customized through LNX_KRNL_IMG_TEXT_OFFSET_BASE.
> Set it equal to SYS_TEXT_BASE by default for Rockchip boards, which
> happens to make this offset zero and works fine on chromebook_kevin
> both for chainloading and bare-metal use.
>
> Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
> ---
> Looks like ARM64 chromebooks also need POSITION_INDEPENDENT=y to
> chainload that way, but I'm not enabling the configs here. I'm thinking
> of selecting these from new configs that also enable binman definitions
> for the kernel partition and legacy boot images.
>
>  arch/arm/mach-rockchip/Kconfig | 3 +++
>  1 file changed, 3 insertions(+)
>

Reviewed-by: Simon Glass <sjg@chromium.org>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] rockchip: Set default LNX_KRNL_IMG_TEXT_OFFSET_BASE to SYS_TEXT_BASE
  2022-01-29 15:27 [PATCH] rockchip: Set default LNX_KRNL_IMG_TEXT_OFFSET_BASE to SYS_TEXT_BASE Alper Nebi Yasak
  2022-02-11 15:05 ` Simon Glass
@ 2022-03-14  8:00 ` Kever Yang
  1 sibling, 0 replies; 3+ messages in thread
From: Kever Yang @ 2022-03-14  8:00 UTC (permalink / raw)
  To: Alper Nebi Yasak; +Cc: U-Boot-Denx, Kever Yang, Simon Glass, Philipp Tomsich

Hi Alper,

Alper Nebi Yasak <alpernebiyasak@gmail.com> 于2022年1月29日周六 23:28写道:
>
> U-Boot can be chainloaded from vendor firmware on ARM64 chromebooks from
> a GPT partition (roughly the same as in doc/chromium/chainload.rst), but
> an appropriate image header must be built-in to the U-Boot binary by
> enabling LINUX_KERNEL_IMAGE_HEADER.
>
> This header has a field for an image load offset from 2MiB alignment
> which must also be customized through LNX_KRNL_IMG_TEXT_OFFSET_BASE.
> Set it equal to SYS_TEXT_BASE by default for Rockchip boards, which
> happens to make this offset zero and works fine on chromebook_kevin
> both for chainloading and bare-metal use.
>
> Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>

Reviewed-by: Kever Yang <kever.yang@rock-chips.com>

Thanks,
- Kever
> ---
> Looks like ARM64 chromebooks also need POSITION_INDEPENDENT=y to
> chainload that way, but I'm not enabling the configs here. I'm thinking
> of selecting these from new configs that also enable binman definitions
> for the kernel partition and legacy boot images.
>
>  arch/arm/mach-rockchip/Kconfig | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/arch/arm/mach-rockchip/Kconfig b/arch/arm/mach-rockchip/Kconfig
> index 92f35309e4a6..308dc09b0389 100644
> --- a/arch/arm/mach-rockchip/Kconfig
> +++ b/arch/arm/mach-rockchip/Kconfig
> @@ -390,6 +390,9 @@ config ROCKCHIP_SPI_IMAGE
>           containing U-Boot. The image is built by binman. U-Boot sits near
>           the start of the image.
>
> +config LNX_KRNL_IMG_TEXT_OFFSET_BASE
> +       default SYS_TEXT_BASE
> +
>  source "arch/arm/mach-rockchip/px30/Kconfig"
>  source "arch/arm/mach-rockchip/rk3036/Kconfig"
>  source "arch/arm/mach-rockchip/rk3128/Kconfig"
> --
> 2.34.1
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-03-14  8:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-29 15:27 [PATCH] rockchip: Set default LNX_KRNL_IMG_TEXT_OFFSET_BASE to SYS_TEXT_BASE Alper Nebi Yasak
2022-02-11 15:05 ` Simon Glass
2022-03-14  8:00 ` Kever Yang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.