Marcel Ziswiler | 813070a | 2023-08-29 00:01:53 +0200 | [diff] [blame] | 1 | .. SPDX-License-Identifier: GPL-2.0-or-later |
| 2 | .. sectionauthor:: Marcel Ziswiler <marcel.ziswiler@toradex.com> |
Igor Opaniuk | 7ecebb8 | 2020-02-12 17:14:30 +0200 | [diff] [blame] | 3 | |
Marcel Ziswiler | 813070a | 2023-08-29 00:01:53 +0200 | [diff] [blame] | 4 | Apalis iMX8 Module |
| 5 | ================== |
| 6 | |
| 7 | - SoM: https://www.toradex.com/computer-on-modules/apalis-arm-family/nxp-imx-8 |
| 8 | - Carrier board: https://www.toradex.com/products/carrier-board/apalis-evaluation-board |
Igor Opaniuk | 7ecebb8 | 2020-02-12 17:14:30 +0200 | [diff] [blame] | 9 | |
| 10 | Quick Start |
| 11 | ----------- |
| 12 | |
| 13 | - Build the ARM trusted firmware binary |
| 14 | - Get scfw_tcm.bin and ahab-container.img |
| 15 | - Build U-Boot |
| 16 | - Load U-Boot binary using uuu |
| 17 | - Flash U-Boot binary into the eMMC |
| 18 | - Boot |
| 19 | |
| 20 | Get and Build the ARM Trusted Firmware |
| 21 | -------------------------------------- |
| 22 | |
Hiago De Franco | ea6fc12 | 2024-03-15 18:56:57 -0300 | [diff] [blame] | 23 | Download the imx-atf repository: |
| 24 | |
| 25 | .. code-block:: bash |
| 26 | |
| 27 | $ git clone -b lf_v2.6 https://github.com/nxp-imx/imx-atf.git |
| 28 | |
| 29 | Compile it with an aarch64 toolchain: |
| 30 | |
Igor Opaniuk | 7ecebb8 | 2020-02-12 17:14:30 +0200 | [diff] [blame] | 31 | .. code-block:: bash |
| 32 | |
Igor Opaniuk | 7ecebb8 | 2020-02-12 17:14:30 +0200 | [diff] [blame] | 33 | $ cd imx-atf/ |
| 34 | $ make PLAT=imx8qm bl31 |
| 35 | |
| 36 | Get scfw_tcm.bin and ahab-container.img |
| 37 | --------------------------------------- |
| 38 | |
Hiago De Franco | ea6fc12 | 2024-03-15 18:56:57 -0300 | [diff] [blame] | 39 | Download imx-seco firmware and extract it: |
Igor Opaniuk | 7ecebb8 | 2020-02-12 17:14:30 +0200 | [diff] [blame] | 40 | |
| 41 | .. code-block:: bash |
| 42 | |
Hiago De Franco | ea6fc12 | 2024-03-15 18:56:57 -0300 | [diff] [blame] | 43 | $ wget https://www.nxp.com/lgfiles/NMG/MAD/YOCTO/imx-seco-5.8.7.bin |
| 44 | $ sh imx-seco-5.8.7.bin --auto-accept |
Igor Opaniuk | 7ecebb8 | 2020-02-12 17:14:30 +0200 | [diff] [blame] | 45 | |
Hiago De Franco | ea6fc12 | 2024-03-15 18:56:57 -0300 | [diff] [blame] | 46 | Copy the following binaries to the U-Boot folder: |
Igor Opaniuk | 7ecebb8 | 2020-02-12 17:14:30 +0200 | [diff] [blame] | 47 | |
| 48 | .. code-block:: bash |
| 49 | |
Hiago De Franco | ea6fc12 | 2024-03-15 18:56:57 -0300 | [diff] [blame] | 50 | $ wget https://github.com/toradex/i.MX-System-Controller-Firmware/raw/master/src/scfw_export_mx8qm_b0/build_mx8qm_b0/mx8qm-apalis-scfw-tcm.bin |
| 51 | $ cp ../imx-atf/build/imx8qm/release/bl31.bin . |
| 52 | $ cp ../imx-seco-5.8.7/firmware/seco/mx8qmb0-ahab-container.img mx8qm-ahab-container.img |
Igor Opaniuk | 7ecebb8 | 2020-02-12 17:14:30 +0200 | [diff] [blame] | 53 | |
| 54 | Build U-Boot |
| 55 | ------------ |
Marcel Ziswiler | 813070a | 2023-08-29 00:01:53 +0200 | [diff] [blame] | 56 | |
Igor Opaniuk | 7ecebb8 | 2020-02-12 17:14:30 +0200 | [diff] [blame] | 57 | .. code-block:: bash |
| 58 | |
Philippe Schenker | c314404 | 2020-08-28 21:08:06 +0300 | [diff] [blame] | 59 | $ make apalis-imx8_defconfig |
Igor Opaniuk | 7ecebb8 | 2020-02-12 17:14:30 +0200 | [diff] [blame] | 60 | $ make u-boot-dtb.imx |
| 61 | |
| 62 | Load the U-Boot Binary Using UUU |
| 63 | -------------------------------- |
| 64 | |
| 65 | Get the latest version of the universal update utility (uuu) aka ``mfgtools 3.0``: |
| 66 | |
Hiago De Franco | ea6fc12 | 2024-03-15 18:56:57 -0300 | [diff] [blame] | 67 | https://github.com/nxp-imx/mfgtools/releases |
Igor Opaniuk | 7ecebb8 | 2020-02-12 17:14:30 +0200 | [diff] [blame] | 68 | |
Marcel Ziswiler | 813070a | 2023-08-29 00:01:53 +0200 | [diff] [blame] | 69 | Put the module into USB recovery aka serial downloader mode, connect the USB |
| 70 | device to your host and execute ``uuu``: |
Igor Opaniuk | 7ecebb8 | 2020-02-12 17:14:30 +0200 | [diff] [blame] | 71 | |
| 72 | .. code-block:: bash |
| 73 | |
| 74 | sudo ./uuu u-boot/u-boot-dtb.imx |
| 75 | |
| 76 | Flash the U-Boot Binary into the eMMC |
| 77 | ------------------------------------- |
| 78 | |
| 79 | Burn the ``u-boot-dtb.imx`` binary to the primary eMMC hardware boot area |
| 80 | partition and boot: |
| 81 | |
| 82 | .. code-block:: bash |
| 83 | |
| 84 | load mmc 1:1 $loadaddr u-boot-dtb.imx |
| 85 | setexpr blkcnt ${filesize} + 0x1ff && setexpr blkcnt ${blkcnt} / 0x200 |
| 86 | mmc dev 0 1 |
| 87 | mmc write ${loadaddr} 0x0 ${blkcnt} |
Marcel Ziswiler | 813070a | 2023-08-29 00:01:53 +0200 | [diff] [blame] | 88 | |
| 89 | As a convenience, instead of the last three commands, one may also use the |
| 90 | update U-Boot wrapper: |
| 91 | |
| 92 | .. code-block:: bash |
| 93 | |
| 94 | > run update_uboot |