mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] Documentation: i.MX8M: add EVK barebox installation documentation
@ 2023-01-03 21:54 Ahmad Fatoum
  2023-01-04  7:00 ` Ulrich Ölmann
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Ahmad Fatoum @ 2023-01-03 21:54 UTC (permalink / raw)
  To: barebox; +Cc: BAUER Bernd, Ahmad Fatoum

The barebox i.MX images have a preamble that pads the i.MX header to the
offset expected by the BootROM. This allows writing barebox images
directly to offset 0 on SD-Cards and eMMC user area. For some i.MX8M,
these images can't be directly written to eMMC boot partitions and
instead require special handling. Add a note about this to the
documentation.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 Documentation/boards/imx/nxp-imx8mm-evk.rst | 18 ++++++++++++++++
 Documentation/boards/imx/nxp-imx8mn-evk.rst | 24 +++++++++++++++++++++
 Documentation/boards/imx/nxp-imx8mp-evk.rst | 24 +++++++++++++++++++++
 3 files changed, 66 insertions(+)

diff --git a/Documentation/boards/imx/nxp-imx8mm-evk.rst b/Documentation/boards/imx/nxp-imx8mm-evk.rst
index c3cd35ae38a2..7ed7459c08a6 100644
--- a/Documentation/boards/imx/nxp-imx8mm-evk.rst
+++ b/Documentation/boards/imx/nxp-imx8mm-evk.rst
@@ -69,3 +69,21 @@ board for serial download mode as printed on the PCB. You can start barebox with
 the imx-usb-loader tool that comes with barebox like this:
 
 ./scripts/imx/imx-usb-loader images/barebox-nxp-imx8mm-evk.img
+
+Installing barebox
+==================
+
+When the EVK is strapped to boot from eMMC, the i.MX8M bootrom will
+consult the eMMC ext_csd register to determine whether to boot
+from the active eMMC boot partition or from the user area.
+
+The same barebox image written to the start of the SD-Card can
+be written to the start of the eMMC user area. Power-fail installation
+to the eMMC boot partition requires special handling:
+
+  - The barebox image must be written to the inactive boot partition,
+    then afterwards, the newly written boot partition is activated
+    (This is controlled by the barebox ``mmcX.boot`` variable).
+
+The ``barebox_update`` command takes care of this and need just be
+supplied a barebox image as argument.
diff --git a/Documentation/boards/imx/nxp-imx8mn-evk.rst b/Documentation/boards/imx/nxp-imx8mn-evk.rst
index b920e22d33e9..4c07b949dafb 100644
--- a/Documentation/boards/imx/nxp-imx8mn-evk.rst
+++ b/Documentation/boards/imx/nxp-imx8mn-evk.rst
@@ -58,3 +58,27 @@ Build barebox
 
  make imx_v8_defconfig
  make
+
+Installing barebox
+==================
+
+When the EVK is strapped to boot from eMMC, the i.MX8M bootrom will
+consult the eMMC ext_csd register to determine whether to boot
+from the active eMMC boot partition or from the user area.
+
+The same barebox image written to the start of the SD-Card can
+be written to the start of the eMMC user area. Power-fail installation
+to the eMMC boot partition requires special handling:
+
+  - The barebox image must be written to the inactive boot partition,
+    then afterwards, the newly written boot partition is activated
+    (This is controlled by the barebox ``mmcX.boot`` variable).
+
+  - The barebox image includes a 32KiB preamble that allows the image
+    to be directly writable to the start of the SD-Card or eMMC user area.
+    Unlike older i.MX8M, the i.MX8MN BootROM expects the bootloader to not
+    start as an offset when booting from eMMC boot partitions, thus the first
+    32KiB must be stripped.
+
+The ``barebox_update`` command takes care of this and need just be
+supplied a barebox image as argument.
diff --git a/Documentation/boards/imx/nxp-imx8mp-evk.rst b/Documentation/boards/imx/nxp-imx8mp-evk.rst
index 1074992f2f88..60e9f9eaea5d 100644
--- a/Documentation/boards/imx/nxp-imx8mp-evk.rst
+++ b/Documentation/boards/imx/nxp-imx8mp-evk.rst
@@ -66,3 +66,27 @@ Boot Configuration
 The NXP i.MX8MP-EVK board has four switches responsible for configuring
 bootsource/boot mode. The settings for the different boot sources are
 printed on the board.
+
+Installing barebox
+==================
+
+When the EVK is strapped to boot from eMMC, the i.MX8M bootrom will
+consult the eMMC ext_csd register to determine whether to boot
+from the active eMMC boot partition or from the user area.
+
+The same barebox image written to the start of the SD-Card can
+be written to the start of the eMMC user area. Power-fail installation
+to the eMMC boot partition requires special handling:
+
+  - The barebox image must be written to the inactive boot partition,
+    then afterwards, the newly written boot partition is activated
+    (This is controlled by the barebox ``mmcX.boot`` variable).
+
+  - The barebox image includes a 32KiB preamble that allows the image
+    to be directly writable to the start of the SD-Card or eMMC user area.
+    Unlike older i.MX8M, the i.MX8MP BootROM expects the bootloader to not
+    start as an offset when booting from eMMC boot partitions, thus the first
+    32KiB must be stripped.
+
+The ``barebox_update`` command takes care of this and need just be
+supplied a barebox image as argument.
-- 
2.30.2




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

* Re: [PATCH] Documentation: i.MX8M: add EVK barebox installation documentation
  2023-01-03 21:54 [PATCH] Documentation: i.MX8M: add EVK barebox installation documentation Ahmad Fatoum
@ 2023-01-04  7:00 ` Ulrich Ölmann
  2023-01-04  7:20 ` [PATCH] fixup! " Ahmad Fatoum
  2023-01-04 10:50 ` [PATCH] " Sascha Hauer
  2 siblings, 0 replies; 4+ messages in thread
From: Ulrich Ölmann @ 2023-01-04  7:00 UTC (permalink / raw)
  To: Ahmad Fatoum; +Cc: BAUER Bernd, barebox

Hi Ahmad,

just a small copied'n'pasted typo:

On Tue, Jan 03 2023 at 22:54 +0100, Ahmad Fatoum <a.fatoum@pengutronix.de> wrote:
> The barebox i.MX images have a preamble that pads the i.MX header to the
> offset expected by the BootROM. This allows writing barebox images
> directly to offset 0 on SD-Cards and eMMC user area. For some i.MX8M,
> these images can't be directly written to eMMC boot partitions and
> instead require special handling. Add a note about this to the
> documentation.
>
> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
> ---
>  Documentation/boards/imx/nxp-imx8mm-evk.rst | 18 ++++++++++++++++
>  Documentation/boards/imx/nxp-imx8mn-evk.rst | 24 +++++++++++++++++++++
>  Documentation/boards/imx/nxp-imx8mp-evk.rst | 24 +++++++++++++++++++++
>  3 files changed, 66 insertions(+)
>
> diff --git a/Documentation/boards/imx/nxp-imx8mm-evk.rst b/Documentation/boards/imx/nxp-imx8mm-evk.rst
> index c3cd35ae38a2..7ed7459c08a6 100644
> --- a/Documentation/boards/imx/nxp-imx8mm-evk.rst
> +++ b/Documentation/boards/imx/nxp-imx8mm-evk.rst
> @@ -69,3 +69,21 @@ board for serial download mode as printed on the PCB. You can start barebox with
>  the imx-usb-loader tool that comes with barebox like this:
>  
>  ./scripts/imx/imx-usb-loader images/barebox-nxp-imx8mm-evk.img
> +
> +Installing barebox
> +==================
> +
> +When the EVK is strapped to boot from eMMC, the i.MX8M bootrom will
> +consult the eMMC ext_csd register to determine whether to boot
> +from the active eMMC boot partition or from the user area.
> +
> +The same barebox image written to the start of the SD-Card can
> +be written to the start of the eMMC user area. Power-fail installation
> +to the eMMC boot partition requires special handling:
> +
> +  - The barebox image must be written to the inactive boot partition,
> +    then afterwards, the newly written boot partition is activated
> +    (This is controlled by the barebox ``mmcX.boot`` variable).
> +
> +The ``barebox_update`` command takes care of this and need just be
> +supplied a barebox image as argument.
> diff --git a/Documentation/boards/imx/nxp-imx8mn-evk.rst b/Documentation/boards/imx/nxp-imx8mn-evk.rst
> index b920e22d33e9..4c07b949dafb 100644
> --- a/Documentation/boards/imx/nxp-imx8mn-evk.rst
> +++ b/Documentation/boards/imx/nxp-imx8mn-evk.rst
> @@ -58,3 +58,27 @@ Build barebox
>  
>   make imx_v8_defconfig
>   make
> +
> +Installing barebox
> +==================
> +
> +When the EVK is strapped to boot from eMMC, the i.MX8M bootrom will
> +consult the eMMC ext_csd register to determine whether to boot
> +from the active eMMC boot partition or from the user area.
> +
> +The same barebox image written to the start of the SD-Card can
> +be written to the start of the eMMC user area. Power-fail installation
> +to the eMMC boot partition requires special handling:
> +
> +  - The barebox image must be written to the inactive boot partition,
> +    then afterwards, the newly written boot partition is activated
> +    (This is controlled by the barebox ``mmcX.boot`` variable).
> +
> +  - The barebox image includes a 32KiB preamble that allows the image
> +    to be directly writable to the start of the SD-Card or eMMC user area.
> +    Unlike older i.MX8M, the i.MX8MN BootROM expects the bootloader to not
> +    start as an offset when booting from eMMC boot partitions, thus the first

s/start as an offset/start at an offset/

> +    32KiB must be stripped.
> +
> +The ``barebox_update`` command takes care of this and need just be
> +supplied a barebox image as argument.
> diff --git a/Documentation/boards/imx/nxp-imx8mp-evk.rst b/Documentation/boards/imx/nxp-imx8mp-evk.rst
> index 1074992f2f88..60e9f9eaea5d 100644
> --- a/Documentation/boards/imx/nxp-imx8mp-evk.rst
> +++ b/Documentation/boards/imx/nxp-imx8mp-evk.rst
> @@ -66,3 +66,27 @@ Boot Configuration
>  The NXP i.MX8MP-EVK board has four switches responsible for configuring
>  bootsource/boot mode. The settings for the different boot sources are
>  printed on the board.
> +
> +Installing barebox
> +==================
> +
> +When the EVK is strapped to boot from eMMC, the i.MX8M bootrom will
> +consult the eMMC ext_csd register to determine whether to boot
> +from the active eMMC boot partition or from the user area.
> +
> +The same barebox image written to the start of the SD-Card can
> +be written to the start of the eMMC user area. Power-fail installation
> +to the eMMC boot partition requires special handling:
> +
> +  - The barebox image must be written to the inactive boot partition,
> +    then afterwards, the newly written boot partition is activated
> +    (This is controlled by the barebox ``mmcX.boot`` variable).
> +
> +  - The barebox image includes a 32KiB preamble that allows the image
> +    to be directly writable to the start of the SD-Card or eMMC user area.
> +    Unlike older i.MX8M, the i.MX8MP BootROM expects the bootloader to not
> +    start as an offset when booting from eMMC boot partitions, thus the first

s/start as an offset/start at an offset/

Best regards
Ulrich


> +    32KiB must be stripped.
> +
> +The ``barebox_update`` command takes care of this and need just be
> +supplied a barebox image as argument.
-- 
Pengutronix e.K.                           | Ulrich Ölmann               |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



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

* [PATCH] fixup! Documentation: i.MX8M: add EVK barebox installation documentation
  2023-01-03 21:54 [PATCH] Documentation: i.MX8M: add EVK barebox installation documentation Ahmad Fatoum
  2023-01-04  7:00 ` Ulrich Ölmann
@ 2023-01-04  7:20 ` Ahmad Fatoum
  2023-01-04 10:50 ` [PATCH] " Sascha Hauer
  2 siblings, 0 replies; 4+ messages in thread
From: Ahmad Fatoum @ 2023-01-04  7:20 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

s/as an/at an/

Cc: Ulrich Ölmann <u.oelmann@pengutronix.de>
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 Documentation/boards/imx/nxp-imx8mn-evk.rst | 2 +-
 Documentation/boards/imx/nxp-imx8mp-evk.rst | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Documentation/boards/imx/nxp-imx8mn-evk.rst b/Documentation/boards/imx/nxp-imx8mn-evk.rst
index 4c07b949dafb..978dfa2db66a 100644
--- a/Documentation/boards/imx/nxp-imx8mn-evk.rst
+++ b/Documentation/boards/imx/nxp-imx8mn-evk.rst
@@ -77,7 +77,7 @@ to the eMMC boot partition requires special handling:
   - The barebox image includes a 32KiB preamble that allows the image
     to be directly writable to the start of the SD-Card or eMMC user area.
     Unlike older i.MX8M, the i.MX8MN BootROM expects the bootloader to not
-    start as an offset when booting from eMMC boot partitions, thus the first
+    start at an offset when booting from eMMC boot partitions, thus the first
     32KiB must be stripped.
 
 The ``barebox_update`` command takes care of this and need just be
diff --git a/Documentation/boards/imx/nxp-imx8mp-evk.rst b/Documentation/boards/imx/nxp-imx8mp-evk.rst
index 60e9f9eaea5d..dde57a37faf9 100644
--- a/Documentation/boards/imx/nxp-imx8mp-evk.rst
+++ b/Documentation/boards/imx/nxp-imx8mp-evk.rst
@@ -85,7 +85,7 @@ to the eMMC boot partition requires special handling:
   - The barebox image includes a 32KiB preamble that allows the image
     to be directly writable to the start of the SD-Card or eMMC user area.
     Unlike older i.MX8M, the i.MX8MP BootROM expects the bootloader to not
-    start as an offset when booting from eMMC boot partitions, thus the first
+    start at an offset when booting from eMMC boot partitions, thus the first
     32KiB must be stripped.
 
 The ``barebox_update`` command takes care of this and need just be
-- 
2.30.2




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

* Re: [PATCH] Documentation: i.MX8M: add EVK barebox installation documentation
  2023-01-03 21:54 [PATCH] Documentation: i.MX8M: add EVK barebox installation documentation Ahmad Fatoum
  2023-01-04  7:00 ` Ulrich Ölmann
  2023-01-04  7:20 ` [PATCH] fixup! " Ahmad Fatoum
@ 2023-01-04 10:50 ` Sascha Hauer
  2 siblings, 0 replies; 4+ messages in thread
From: Sascha Hauer @ 2023-01-04 10:50 UTC (permalink / raw)
  To: Ahmad Fatoum; +Cc: barebox, BAUER Bernd

On Tue, Jan 03, 2023 at 10:54:48PM +0100, Ahmad Fatoum wrote:
> The barebox i.MX images have a preamble that pads the i.MX header to the
> offset expected by the BootROM. This allows writing barebox images
> directly to offset 0 on SD-Cards and eMMC user area. For some i.MX8M,
> these images can't be directly written to eMMC boot partitions and
> instead require special handling. Add a note about this to the
> documentation.
> 
> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
> ---
>  Documentation/boards/imx/nxp-imx8mm-evk.rst | 18 ++++++++++++++++
>  Documentation/boards/imx/nxp-imx8mn-evk.rst | 24 +++++++++++++++++++++
>  Documentation/boards/imx/nxp-imx8mp-evk.rst | 24 +++++++++++++++++++++
>  3 files changed, 66 insertions(+)
> 
> diff --git a/Documentation/boards/imx/nxp-imx8mm-evk.rst b/Documentation/boards/imx/nxp-imx8mm-evk.rst
> index c3cd35ae38a2..7ed7459c08a6 100644
> --- a/Documentation/boards/imx/nxp-imx8mm-evk.rst
> +++ b/Documentation/boards/imx/nxp-imx8mm-evk.rst
> @@ -69,3 +69,21 @@ board for serial download mode as printed on the PCB. You can start barebox with
>  the imx-usb-loader tool that comes with barebox like this:
>  
>  ./scripts/imx/imx-usb-loader images/barebox-nxp-imx8mm-evk.img
> +
> +Installing barebox
> +==================
> +
> +When the EVK is strapped to boot from eMMC, the i.MX8M bootrom will
> +consult the eMMC ext_csd register to determine whether to boot
> +from the active eMMC boot partition or from the user area.
> +
> +The same barebox image written to the start of the SD-Card can
> +be written to the start of the eMMC user area. Power-fail installation
> +to the eMMC boot partition requires special handling:

"Power-fail installation" sounds strange. What you mean is an
installation into the boot partitions which can be updated power fail
safely.

I don't know how to put that into two words, maybe just drop the
"Power-fail" part.

Sascha


-- 
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] 4+ messages in thread

end of thread, other threads:[~2023-01-04 10:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-03 21:54 [PATCH] Documentation: i.MX8M: add EVK barebox installation documentation Ahmad Fatoum
2023-01-04  7:00 ` Ulrich Ölmann
2023-01-04  7:20 ` [PATCH] fixup! " Ahmad Fatoum
2023-01-04 10:50 ` [PATCH] " Sascha Hauer

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