summaryrefslogtreecommitdiffstats
path: root/Documentation/boards/imx.rst
diff options
context:
space:
mode:
Diffstat (limited to 'Documentation/boards/imx.rst')
-rw-r--r--Documentation/boards/imx.rst162
1 files changed, 148 insertions, 14 deletions
diff --git a/Documentation/boards/imx.rst b/Documentation/boards/imx.rst
index 4ce9d9808c..1324659983 100644
--- a/Documentation/boards/imx.rst
+++ b/Documentation/boards/imx.rst
@@ -21,7 +21,7 @@ The Internal Boot Mode is supported on:
* i.MX53
* i.MX6
* i.MX7
-* i.MX8MQ
+* i.MX8M
With the Internal Boot Mode, the images contain a header which describes
where the binary shall be loaded and started. These headers also contain
@@ -64,8 +64,8 @@ of the image to the card, use:
dd if=images/barebox-freescale-imx51-babbage.img of=/dev/sdd bs=1024 skip=1 seek=1
-Note that MaskROM on i.MX8 expects the image to start at the +33KiB mark, so the
-following command has to be used instead:
+Note that MaskROM on i.MX8M expects the image to start at the +33KiB mark, so
+the following command has to be used instead:
.. code-block:: sh
@@ -86,8 +86,8 @@ The images can also always be started as second stage on the target:
BootROM Reboot mode codes (bmode)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-For select SoCs, barebox supports communicating an alternative boot medium
-that BootROM should select after a warm reset::
+For selected SoCs, barebox supports communicating an alternative boot medium
+that the BootROM should select after a warm reset::
barebox@FSL i.MX8MM EVK board:/ devinfo gpr.reboot_mode
Driver: syscon-reboot-mode
@@ -105,12 +105,19 @@ that BootROM should select after a warm reset::
mode-serial = <0x10 0x40000000>;
};
- barebox@FSL i.MX8MM EVK board:/ gpr.reboot_mode.next=serial reset -r imxwd-warm
+ barebox@FSL i.MX8MM EVK board:/ gpr.reboot_mode.next=serial reset -w
-This will cause barebox to fall into serial download mode on an i.MX8MM.
+The example above will cause barebox to jump back into serial download mode on
+an i.MX8MM by writing 0x10 into the *SRC_GPR9* register (offset 0x30390094) and
+0x40000000 into the *SRC_GPR10* register (offset 0x30390098), and then issuing a
+warm :ref:`reset <command_reset>`.
Different SoCs may have more possible reboot modes available.
-See the section on :ref:`Reboot modes<reboot_mode>` for more information.
+Look for documentation of the *SRC_SBMR* and *SRC_GPR* registers in the
+Reference Manual of your SoC; the values for the ``mode-*`` properties often
+correspond directly to the boot fusemap settings.
+
+See the section on :ref:`Reboot modes<reboot_mode>` for general information.
High Assurance Boot
^^^^^^^^^^^^^^^^^^^
@@ -124,7 +131,7 @@ barebox supports generating signed images, signed USB images suitable for
*imx-usb-loader* and encrypted images.
In contrast to normal (unsigned) images booting signed images via
-imx-usb-loader requires special images:
+imx-usb-loader on i.MX6 (but not in i.MX8M) requires special images:
DCD data is invalidated (DCD pointer set to zero), the image is then signed and
afterwards the DCD pointer is set to the DCD data again (practically making
the signature invalid).
@@ -143,7 +150,7 @@ Unlike the typical ``imximg`` file extension the following ones are used for
these cases:
* ``simximg``: generate signed image
-* ``usimximg``: generate signed USB image
+* ``usimximg``: generate signed USB image (i.MX6-specific)
* ``esimximg``: generate encrypted and signed image
The imx-image tool is then automatically called with the appropriate flags
@@ -161,16 +168,63 @@ keys/certificates are expected in these config variables (assuming HABv4):
CONFIG_HABV4_IMG_CRT_PEM
A CSF template is located in
-``arch/arm/mach-imx/include/mach/habv4-imx6-gencsf.h`` which is preprocessed
+``include/mach/imx/habv4-imx*-gencsf.h`` which is preprocessed
by barebox.
-It must be included in the board's flash header:
+It must be included in the board's flash header, e.g. for i.MX6:
.. code-block:: none
- #include <mach/habv4-imx6-gencsf.h>
+ #include <mach/imx/habv4-imx6-gencsf.h>
Analogous to HABv4 options and a template exist for HABv3.
+To verify HAB working as intended, install the ``barebox-*-s.img`` onto the
+boot medium and trigger a power-on reset. barebox will read the HAB log on
+startup and report any errors it finds. A good unfused boot looks like this::
+
+ HABv4: Status: Operation completed successfully (0xf0)
+ HABv4: Config: Non-secure IC (0xf0)
+ HABv4: State: Non-secure state (0x66)
+ HABv4: No HAB Failure Events Found!
+
+To have the bootrom verify the barebox binary, the SRK hash needs to be burnt
+into the fuses. As fuses can't be unburnt, the ``hab`` command should be used
+instead of direct device access to not risk writing unrelated fuses::
+
+ barebox$ hab -p -s SRK_1_2_3_4_fuse.bin
+
+Afterwards, images signed with a different key will trigger errors at barebox
+startup, but system will still be able to boot to shell.
+
+To have the BootROM refuse booting differently signed images, the ``SRK_LOCK``
+fuse needs to be burnt::
+
+ barebox$ hab -p -l
+
+On next startup, barebox will report that the system is now locked::
+
+ HABv4: Status: Operation completed successfully (0xf0)
+ HABv4: Config: Secure IC (0xcc)
+ HABv4: State: Trusted state (0x99)
+ HABv4: No HAB Failure Events Found!
+
+This can also be seen with the ``hab -i`` command::
+
+ Current SRK hash: <some non-zero value>
+ secure mode
+
+Similarly, on supported SoCs, the ``bootrom -l`` command will indicate that
+device is closed. Example output after booting via ``imx-usb-loader``::
+
+
+ [e0] Internal use
+ [11] Boot mode is Boot from Serial Download
+ [23] Secure config is Closed
+ [41] FUSE_SEL_VALUE Fuse is blown
+ [d0] Enters serial download processing
+ [a0] Image authentication result: PASS (0x000000f0) @3506438144 ticks
+ [00] End of list
+
Secure Boot on i.MX6
~~~~~~~~~~~~~~~~~~~~
@@ -340,6 +394,86 @@ with only the image name as argument:
scripts/imx/imx-usb-loader images/barebox-freescale-imx51-babbage.img
+FlexSPI Boot
+^^^^^^^^^^^^
+
+FlexSPI boot is currently supported on: i.MX8MM, i.MX8MN and i.MX8MP.
+
+To generate FlexSPI/QSPI image(s) the board flash header file must specify:
+``flexspi_ivtofs`` and ``flexspi_fcfbofs``.
+
+It is recommended to do this via the ``include/mach/imx/flexspi-imx8m*-cfg.h``
+header files.
+
+.. code-block:: none
+
+ #include <mach/imx/flexspi-imx8mp-cfg.h>
+
+There are two different headers, one for the i.MX8MM and one for the i.MX8MP/N.
+It's important to use the correct one because the BootROM expects the IVT and
+flash configuration block (FCB) on different offsets.
+
+Barebox doesn't generate a separate FlexSPI image instead the same image used
+for SD/MMC/USB is extended to support FlexSPI boot. This is done by adding a 2nd
+IVT header and the required FCB at the required boot offsets.
+
+Barebox also support `High Assurance Boot`_ images for QSPI boot mediums. This
+feature must be enabled via the ``CONFIG_HABV4_QSPI`` option. The below figures
+show a fully featured MMC/SD/USB/FlexSPI image with enabled HAB support for the
+i.MX8M family.
+
+i.MX8MM layout::
+
+ 0x0 +------------------------------------------+
+ | Barebox Header |
+ header_gap +------------------------------------------+
+ | FlexSPI Flash Configuration Block (FCFB) |
+ header_gap + 0x400 +------------------------------------------+ ---
+ | i.MX MMC/SD/USB IVT Header | |
+ | Boot Data +--. |
+ | CSF Pointer +--|--. |
+ header_gap + 0x1000 +------------------------------------------+ | | --- |
+ | i.MX FlexSPI IVT Header | | | | | Signed Area
+ | Boot Data +--+ | | | MMC/SD/
+ | CSF Pointer +--|--|--. | Signed Area | USB
+ header_gap + 0x2000 +------------------------------------------+ | | | | FlexSPI |
+ | Barebox Prebootloader (PBL) |<-´ | | | |
+ | Piggydata Hash (SHA256) | | | | |
+ +------------------------------------------+ | | --- ---
+ | Command Sequence File (CSF) Slot-0 |<----´ |
+ +------------------------------------------+ |
+ | Command Sequence File (CSF) Slot-1 |<-------´
+ +------------------------------------------+ ---
+ | Piggydata (Main Barebox Binary) | | Hashed Area
+ +------------------------------------------+ ---
+
+i.MX8MP/N layout::
+
+ 0x0 +------------------------------------------+
+ | Barebox Header |
+ header_gap +------------------------------------------+ ---
+ | i.MX MMC/SD/USB IVT Header | |
+ | Boot Data +--. |
+ | CSF Pointer +--|--. |
+ header_gap + 0x400 +------------------------------------------+ | | |
+ | FlexSPI Flash Configuration Block (FCFB) | | | | Signed Area
+ header_gap + 0x1000 +------------------------------------------+ | | --- | MMC/SD/
+ | i.MX FlexSPI IVT Header | | | | | USB
+ | Boot Data +--+ | | |
+ | CSF Pointer +--|--|--. | Signed Area |
+ header_gap + 0x2000 +------------------------------------------+ | | | | FlexSPI |
+ | Barebox Prebootloader (PBL) |<-´ | | | |
+ | Piggydata Hash (SHA256) | | | | |
+ +------------------------------------------+ | | --- ---
+ | Command Sequence File (CSF) Slot-0 |<----´ |
+ +------------------------------------------+ |
+ | Command Sequence File (CSF) Slot-1 |<-------´
+ +------------------------------------------+ ---
+ | Piggydata (Main Barebox Binary) | | Hashed Area
+ +------------------------------------------+ ---
+
+At the moment ``header_gap`` is always 32K for all supported devices.
+
External Boot Mode
------------------
@@ -373,7 +507,7 @@ i.MX boards
Not all supported boards have a description here. Many newer boards also do
not have individual defconfig files, they are covered by ``imx_v7_defconfig``
-or ``imx_defconfig`` instead.
+or ``multi_v5_v6_defconfig`` instead.
.. toctree::
:glob: