mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 0/2] doc: user: barebox: add method for fit image chainloading
@ 2023-12-15 12:11 Stefan Kerkmann
  2023-12-15 12:11 ` [PATCH 1/2] doc: user: barebox: bootz instead of bootm Stefan Kerkmann
  2023-12-15 12:11 ` [PATCH 2/2] doc: user: barebox: add chainloading of fit images Stefan Kerkmann
  0 siblings, 2 replies; 5+ messages in thread
From: Stefan Kerkmann @ 2023-12-15 12:11 UTC (permalink / raw)
  To: BAREBOX; +Cc: Stefan Kerkmann

This small series fixes one small usage of `bootm` and adds a section
for chainloading a Barebox FIT image from U-Boot.

To: open list:BAREBOX <barebox@lists.infradead.org>

Signed-off-by: Stefan Kerkmann <s.kerkmann@pengutronix.de>
---
Stefan Kerkmann (2):
      doc: user: barebox: bootz instead of bootm
      doc: user: barebox: add chainloading of fit images

 Documentation/user/barebox.rst | 28 +++++++++++++++++++++++++++-
 1 file changed, 27 insertions(+), 1 deletion(-)
---
base-commit: 154884d7c0c9dac4578848849c8dac3afc5da3fc
change-id: 20231215-doc-fit-images-for-chainloading-aea9783921d2

Best regards,
-- 
Stefan Kerkmann <s.kerkmann@pengutronix.de>




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

* [PATCH 1/2] doc: user: barebox: bootz instead of bootm
  2023-12-15 12:11 [PATCH 0/2] doc: user: barebox: add method for fit image chainloading Stefan Kerkmann
@ 2023-12-15 12:11 ` Stefan Kerkmann
  2023-12-15 12:14   ` Ahmad Fatoum
  2023-12-15 12:11 ` [PATCH 2/2] doc: user: barebox: add chainloading of fit images Stefan Kerkmann
  1 sibling, 1 reply; 5+ messages in thread
From: Stefan Kerkmann @ 2023-12-15 12:11 UTC (permalink / raw)
  To: BAREBOX; +Cc: Stefan Kerkmann

barebox-dt-2nd.img is in the `zImage` format, therefore use the proper
command for booting on 32-bit platforms.
---
 Documentation/user/barebox.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/user/barebox.rst b/Documentation/user/barebox.rst
index 80f0f96a98..f4e600bde0 100644
--- a/Documentation/user/barebox.rst
+++ b/Documentation/user/barebox.rst
@@ -212,7 +212,7 @@ like a Linux kernel that is passed an external device tree. For example:
 
   U-Boot: tftp $kernel_addr barebox-dt-2nd.img
   U-Boot: tftp $fdt_addr my-board.dtb
-  U-Boot: bootm $kernel_addr - $fdt_addr # On 32-bit ARM
+  U-Boot: bootz $kernel_addr - $fdt_addr # On 32-bit ARM
   U-Boot: booti $kernel_addr - $fdt_addr # for other platforms
 
 For non-DT enabled-bootloaders or other architectures, often the normal barebox

-- 
2.39.2




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

* [PATCH 2/2] doc: user: barebox: add chainloading of fit images
  2023-12-15 12:11 [PATCH 0/2] doc: user: barebox: add method for fit image chainloading Stefan Kerkmann
  2023-12-15 12:11 ` [PATCH 1/2] doc: user: barebox: bootz instead of bootm Stefan Kerkmann
@ 2023-12-15 12:11 ` Stefan Kerkmann
  2023-12-15 12:15   ` Ahmad Fatoum
  1 sibling, 1 reply; 5+ messages in thread
From: Stefan Kerkmann @ 2023-12-15 12:11 UTC (permalink / raw)
  To: BAREBOX; +Cc: Stefan Kerkmann

This documents an alternate method for chainloading Barebox from U-Boot
by packing the Barebox image and matching device tree into an FIT image.
---
 Documentation/user/barebox.rst | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/Documentation/user/barebox.rst b/Documentation/user/barebox.rst
index f4e600bde0..ea4db28d08 100644
--- a/Documentation/user/barebox.rst
+++ b/Documentation/user/barebox.rst
@@ -215,6 +215,32 @@ like a Linux kernel that is passed an external device tree. For example:
   U-Boot: bootz $kernel_addr - $fdt_addr # On 32-bit ARM
   U-Boot: booti $kernel_addr - $fdt_addr # for other platforms
 
+Another option is to generate a FIT image containing the generic DT image and a
+matching device tree with ``mkimage``:
+
+.. code-block:: console
+  sh: mkimage --architecture arm \
+      --os linux \
+      --type kernel \
+      --fit auto \
+      --load-address $kernel_addr_r \
+      --compression none \
+      --image images/barebox-dt-2nd.img \
+      --device-tree arch/${ARCH}/dts/my-board.dtb \
+      barebox-dt-2nd.fit
+
+This FIT image can then be loaded by U-Boot and executed just like a regular
+Linux kernel:
+
+.. code-block:: console
+  U-Boot: tftp $fit_addr barebox-dt-2nd.fit
+  U-Boot: bootm $fit_addr
+
+Make sure that the address in ``$fit_addr`` is different from the
+``$kernel_addr_r`` passed to ``mkimage`` as the load address of the Kernel
+image. Otherwise U-Boot may attempt to overwrite the FIT image with the barebox
+image contained within.
+
 For non-DT enabled-bootloaders or other architectures, often the normal barebox
 binaries can also be used as they are designed to be startable second stage
 from another bootloader, where possible. For example, if you have U-Boot running

-- 
2.39.2




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

* Re: [PATCH 1/2] doc: user: barebox: bootz instead of bootm
  2023-12-15 12:11 ` [PATCH 1/2] doc: user: barebox: bootz instead of bootm Stefan Kerkmann
@ 2023-12-15 12:14   ` Ahmad Fatoum
  0 siblings, 0 replies; 5+ messages in thread
From: Ahmad Fatoum @ 2023-12-15 12:14 UTC (permalink / raw)
  To: Stefan Kerkmann, BAREBOX

On 15.12.23 13:11, Stefan Kerkmann wrote:
> barebox-dt-2nd.img is in the `zImage` format, therefore use the proper
> command for booting on 32-bit platforms.

S-o-b missing.

With this address:

Acked-by: Ahmad Fatoum <a.fatoum@pengutronix.de>

> ---
>  Documentation/user/barebox.rst | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/Documentation/user/barebox.rst b/Documentation/user/barebox.rst
> index 80f0f96a98..f4e600bde0 100644
> --- a/Documentation/user/barebox.rst
> +++ b/Documentation/user/barebox.rst
> @@ -212,7 +212,7 @@ like a Linux kernel that is passed an external device tree. For example:
>  
>    U-Boot: tftp $kernel_addr barebox-dt-2nd.img
>    U-Boot: tftp $fdt_addr my-board.dtb
> -  U-Boot: bootm $kernel_addr - $fdt_addr # On 32-bit ARM
> +  U-Boot: bootz $kernel_addr - $fdt_addr # On 32-bit ARM
>    U-Boot: booti $kernel_addr - $fdt_addr # for other platforms
>  
>  For non-DT enabled-bootloaders or other architectures, often the normal barebox
> 

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




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

* Re: [PATCH 2/2] doc: user: barebox: add chainloading of fit images
  2023-12-15 12:11 ` [PATCH 2/2] doc: user: barebox: add chainloading of fit images Stefan Kerkmann
@ 2023-12-15 12:15   ` Ahmad Fatoum
  0 siblings, 0 replies; 5+ messages in thread
From: Ahmad Fatoum @ 2023-12-15 12:15 UTC (permalink / raw)
  To: Stefan Kerkmann, BAREBOX

On 15.12.23 13:11, Stefan Kerkmann wrote:
> This documents an alternate method for chainloading Barebox from U-Boot
> by packing the Barebox image and matching device tree into an FIT image.

S-o-b missing.

With that fixed:

Acked-by: Ahmad Fatoum <a.fatoum@pengutronix.de>

> ---
>  Documentation/user/barebox.rst | 26 ++++++++++++++++++++++++++
>  1 file changed, 26 insertions(+)
> 
> diff --git a/Documentation/user/barebox.rst b/Documentation/user/barebox.rst
> index f4e600bde0..ea4db28d08 100644
> --- a/Documentation/user/barebox.rst
> +++ b/Documentation/user/barebox.rst
> @@ -215,6 +215,32 @@ like a Linux kernel that is passed an external device tree. For example:
>    U-Boot: bootz $kernel_addr - $fdt_addr # On 32-bit ARM
>    U-Boot: booti $kernel_addr - $fdt_addr # for other platforms
>  
> +Another option is to generate a FIT image containing the generic DT image and a
> +matching device tree with ``mkimage``:
> +
> +.. code-block:: console
> +  sh: mkimage --architecture arm \
> +      --os linux \
> +      --type kernel \
> +      --fit auto \
> +      --load-address $kernel_addr_r \
> +      --compression none \
> +      --image images/barebox-dt-2nd.img \
> +      --device-tree arch/${ARCH}/dts/my-board.dtb \
> +      barebox-dt-2nd.fit
> +
> +This FIT image can then be loaded by U-Boot and executed just like a regular
> +Linux kernel:
> +
> +.. code-block:: console
> +  U-Boot: tftp $fit_addr barebox-dt-2nd.fit
> +  U-Boot: bootm $fit_addr
> +
> +Make sure that the address in ``$fit_addr`` is different from the
> +``$kernel_addr_r`` passed to ``mkimage`` as the load address of the Kernel
> +image. Otherwise U-Boot may attempt to overwrite the FIT image with the barebox
> +image contained within.
> +
>  For non-DT enabled-bootloaders or other architectures, often the normal barebox
>  binaries can also be used as they are designed to be startable second stage
>  from another bootloader, where possible. For example, if you have U-Boot running
> 

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




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

end of thread, other threads:[~2023-12-15 12:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-15 12:11 [PATCH 0/2] doc: user: barebox: add method for fit image chainloading Stefan Kerkmann
2023-12-15 12:11 ` [PATCH 1/2] doc: user: barebox: bootz instead of bootm Stefan Kerkmann
2023-12-15 12:14   ` Ahmad Fatoum
2023-12-15 12:11 ` [PATCH 2/2] doc: user: barebox: add chainloading of fit images Stefan Kerkmann
2023-12-15 12:15   ` Ahmad Fatoum

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox