Skip to contentSkip to conversation

Some documentation updates for Kontron i.MX8MM hardware

PATCH New Frieder Schrempf 1 participant 7 messages Jan 19, 2023

lore
Share & tools
lore
#0 lore raw

v2 cover Some documentation updates for Kontron i.MX8MM hardware

From: Frieder Schrempf <[email protected]>

This depends on Fabio's doc patch [1].

Changes in v2:
* Rebase onto Fabio's patch [1]
* Remove dot in subject line of patch 6

[1] https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/

Frieder Schrempf (6):
doc: sl-mx8mm: Mention OSM 1.1 support
doc: sl-mx8mm: Add note about using cross toolchain
doc: sl-mx8mm: Update the NXP TF-A source reference
doc: sl-mx8mm: Update references to latest DDR firmware 8.18
doc: sl-mx8mm: Add guide for copying the bootloader to SPI NOR
doc: sl-mx8mm: Add CROSS_COMPILE to U-Boot make call and improve
comment

 doc/board/kontron/sl-mx8mm.rst | 70 ++++++++++++++++++++++++++++------
 1 file changed, 58 insertions(+), 12 deletions(-)
Signature · 1 line
2.39.0
#1 lore raw

PATCH v2 1/6 doc: sl-mx8mm: Mention OSM 1.1 support

From: Frieder Schrempf <[email protected]>

The latest revision of the SoM is compliant to OSM 1.1.

---
 doc/board/kontron/sl-mx8mm.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
doc/board/kontron/sl-mx8mm.rst +1 -1
index 327466c536..75ca0f174a 100644
@@ -9,7 +9,7 @@ with an i.MX8M-Mini SoC, 1/2/4 GB LPDDR4 RAM, SPI NOR, eMMC and PMIC.
 The matching evaluation boards (Board-Line, BL) have two Ethernet ports,
 USB 2.0, HDMI/LVDS, SD card, CAN, RS485, RS232 and much more.
 
-The OSM-S i.MX8MM is compliant to the Open Standard Module (OSM) 1.0
+The OSM-S i.MX8MM is compliant to the Open Standard Module (OSM) 1.1
 specification, size S (https://sget.org/standards/osm).
 
 Quick Start
Signature · 1 line
2.39.0
#2 lore raw

PATCH v2 2/6 doc: sl-mx8mm: Add note about using cross toolchain

In reply to Frieder Schrempf

From: Frieder Schrempf <[email protected]>

This clarifies the usage of a cross toolchain to build U-Boot and TF-A.

---
 doc/board/kontron/sl-mx8mm.rst | 6 ++++++
 1 file changed, 6 insertions(+)
doc/board/kontron/sl-mx8mm.rst +6 -0
index 75ca0f174a..bcaf5de4e7 100644
@@ -20,6 +20,12 @@ Quick Start
 - Build U-Boot
 - Boot
 
+.. note::
+
+   To build on a x86-64 host machine, you need a GNU cross toolchain for the
+   target architecture (aarch64). Check your distros package manager or
+   download and install the necessary tools (``aarch64-linux-gnu-*``) manually.
+
 Get and Build the Trusted Firmware-A (TF-A)
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
Signature · 1 line
2.39.0
#3 lore raw

PATCH v2 3/6 doc: sl-mx8mm: Update the NXP TF-A source reference

In reply to Frieder Schrempf

From: Frieder Schrempf <[email protected]>

Use the latest version of the NXP TF-A code and add a note about quirks with GCC 12.

---
 doc/board/kontron/sl-mx8mm.rst | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)
doc/board/kontron/sl-mx8mm.rst +9 -4
index bcaf5de4e7..bb718f104c 100644
@@ -34,15 +34,20 @@ Note: builddir is U-Boot build directory (source directory for in-tree builds)
 There are two sources for the TF-A. Mainline and NXP. Get the one you prefer
 (support and features might differ).
 
+.. note::
+
+   If you are using GCC 12 and you get compiler/linker errors, try to add the
+   following arguments to your make command as workaround:
+   ``CFLAGS="-Wno-array-bounds" LDFLAGS="--no-warn-rwx-segments"``
+
 **NXP's imx-atf**
 
-1. Get TF-A from: https://github.com/nxp-imx/imx-atf, branch: imx_5.4.70_2.3.0
-2. Apply the patch to select the correct UART for the console, otherwise the TF-A will lock up during boot.
-3. Build
+1. Get TF-A from: https://github.com/nxp-imx/imx-atf, branch: lf_v2.6
+2. Build
 
   .. code-block:: bash
 
-     $ make PLAT=imx8mm bl31
+     $ make PLAT=imx8mm CROSS_COMPILE=aarch64-linux-gnu- IMX_BOOT_UART_BASE="0x30880000" bl31
      $ cp build/imx8mm/release/bl31.bin $(builddir)
 
 **Mainline TF-A**
Signature · 1 line
2.39.0
#4 lore raw

PATCH v2 4/6 doc: sl-mx8mm: Update references to latest DDR firmware 8.18

In reply to Frieder Schrempf

From: Frieder Schrempf <[email protected]>

Use the latest firmware available from NXP.

---
 doc/board/kontron/sl-mx8mm.rst | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
doc/board/kontron/sl-mx8mm.rst +7 -4
index bb718f104c..76cc49f9d7 100644
@@ -65,10 +65,13 @@ Get the DDR firmware
 
 .. code-block:: bash
 
-   $ wget https://www.nxp.com/lgfiles/NMG/MAD/YOCTO/firmware-imx-8.9.bin
-   $ chmod +x firmware-imx-8.9.bin
-   $ ./firmware-imx-8.9.bin
-   $ cp firmware-imx-8.9/firmware/ddr/synopsys/lpddr4*.bin $(builddir)
+   $ wget https://www.nxp.com/lgfiles/NMG/MAD/YOCTO/firmware-imx-8.18.bin
+   $ chmod +x firmware-imx-8.18.bin
+   $ ./firmware-imx-8.18.bin
+   $ cp firmware-imx-8.18/firmware/ddr/synopsys/lpddr4_pmu_train_1d_imem.bin $(builddir)
+   $ cp firmware-imx-8.18/firmware/ddr/synopsys/lpddr4_pmu_train_1d_dmem.bin $(builddir)
+   $ cp firmware-imx-8.18/firmware/ddr/synopsys/lpddr4_pmu_train_2d_imem.bin $(builddir)
+   $ cp firmware-imx-8.18/firmware/ddr/synopsys/lpddr4_pmu_train_2d_dmem.bin $(builddir)
 
 Build U-Boot
 ^^^^^^^^^^^^
Signature · 1 line
2.39.0
#5 lore raw

PATCH v2 5/6 doc: sl-mx8mm: Add guide for copying the bootloader to SPI NOR

In reply to Frieder Schrempf

From: Frieder Schrempf <[email protected]>

This adds a guide for copying the raw bootloader image on the SD card to the SPI NOR using U-Boot itself.

---
 doc/board/kontron/sl-mx8mm.rst | 34 +++++++++++++++++++++++++++++++++-
 1 file changed, 33 insertions(+), 1 deletion(-)
doc/board/kontron/sl-mx8mm.rst +33 -1
index 76cc49f9d7..a8a3d5fc24 100644
@@ -90,7 +90,39 @@ Burn the flash.bin to SD card at an offset of 33 KiB:
 Boot
 ^^^^
 
-Put the SD card in the slot on the board and apply power.
+Put the SD card in the slot on the board and apply power. Check the serial
+console for output.
+
+Flash the Bootloader to SPI NOR
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+1. Determine and note the exact size of the ``flash.bin`` image in bytes (e.g.
+   by running ``ls -l flash.bin``)
+
+2. On the U-Boot CLI copy the bootloader from SD card to RAM:
+
+   .. code-block::
+
+      mmc dev 1
+      mmc read $loadaddr 0x42 0x1000
+
+3. Erase the SPI NOR flash:
+
+   .. code-block::
+
+      sf probe
+      sf erase 0x0 0x200000
+
+4. Copy the bootloader from RAM to SPI NOR. For the last parameter of the
+   command, use the size determined in step 1 in **hexadecimal notation**:
+
+   .. code-block::
+
+      sf write $loadaddr 0x400 0x13B6F0
+
+.. note::
+
+   To be able to boot from SPI NOR the OTP fuses need to be set accordingly.
 
 Further Information
 -------------------
Signature · 1 line
2.39.0
#6 lore raw

PATCH v2 6/6 doc: sl-mx8mm: Add CROSS_COMPILE to U-Boot make call and improve comment

In reply to Frieder Schrempf

From: Frieder Schrempf <[email protected]>

Add the CROSS_COMPILE flag as we assume we build in a cross environment. Also improve the comment about copying the binary to SD card.

---
 doc/board/kontron/sl-mx8mm.rst | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
doc/board/kontron/sl-mx8mm.rst +2 -2
index a8a3d5fc24..b7346d8cfb 100644
@@ -79,9 +79,9 @@ Build U-Boot
 .. code-block:: bash
 
    $ make kontron-sl-mx8mm_defconfig
-   $ make
+   $ make CROSS_COMPILE=aarch64-linux-gnu-
 
-Burn the flash.bin to SD card at an offset of 33 KiB:
+Copy the flash.bin to SD card at an offset of 33 KiB:
 
 .. code-block:: bash
 
Signature · 1 line
2.39.0