diff options
Diffstat (limited to 'doc/board/nxp')
-rw-r--r-- | doc/board/nxp/imx8mm_evk.rst | 57 | ||||
-rw-r--r-- | doc/board/nxp/imx8mn_evk.rst | 58 | ||||
-rw-r--r-- | doc/board/nxp/imx8mp_evk.rst | 61 | ||||
-rw-r--r-- | doc/board/nxp/imx8mq_evk.rst | 56 | ||||
-rw-r--r-- | doc/board/nxp/imx8qxp_mek.rst | 66 | ||||
-rw-r--r-- | doc/board/nxp/imxrt1020-evk.rst | 41 | ||||
-rw-r--r-- | doc/board/nxp/imxrt1050-evk.rst | 41 | ||||
-rw-r--r-- | doc/board/nxp/index.rst | 20 | ||||
-rw-r--r-- | doc/board/nxp/mx6sabreauto.rst | 100 | ||||
-rw-r--r-- | doc/board/nxp/mx6sabresd.rst | 132 | ||||
-rw-r--r-- | doc/board/nxp/mx6ul_14x14_evk.rst | 98 | ||||
-rw-r--r-- | doc/board/nxp/mx6ullevk.rst | 47 | ||||
-rw-r--r-- | doc/board/nxp/psb.rst | 174 |
13 files changed, 951 insertions, 0 deletions
diff --git a/doc/board/nxp/imx8mm_evk.rst b/doc/board/nxp/imx8mm_evk.rst new file mode 100644 index 0000000000..7fd3d72564 --- /dev/null +++ b/doc/board/nxp/imx8mm_evk.rst @@ -0,0 +1,57 @@ +.. SPDX-License-Identifier: GPL-2.0+ + +imx8mm_evk +========== + +U-Boot for the NXP i.MX8MM EVK board + +Quick Start +----------- + +- Build the ARM Trusted firmware binary +- Get ddr firmware +- Build U-Boot +- Boot + +Get and Build the ARM Trusted firmware +-------------------------------------- + +Note: builddir is U-Boot build directory (source directory for in-tree builds) +Get ATF from: https://source.codeaurora.org/external/imx/imx-atf +branch: imx_5.4.47_2.2.0 + +.. code-block:: bash + + $ make PLAT=imx8mm bl31 + $ cp build/imx8mm/release/bl31.bin $(builddir) + +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 + $ cp firmware-imx-8.9/firmware/ddr/synopsys/lpddr4*.bin $(builddir) + +Build U-Boot +------------ + +.. code-block:: bash + + $ export CROSS_COMPILE=aarch64-poky-linux- + $ make imx8mm_evk_defconfig + $ export ATF_LOAD_ADDR=0x920000 + $ make + +Burn the flash.bin to MicroSD card offset 33KB: + +.. code-block:: bash + + $sudo dd if=flash.bin of=/dev/sd[x] bs=1024 seek=33 conv=notrunc + $sudo dd if=u-boot.itb of=/dev/sdc bs=1024 seek=384 conv=sync + +Boot +---- +Set Boot switch to SD boot diff --git a/doc/board/nxp/imx8mn_evk.rst b/doc/board/nxp/imx8mn_evk.rst new file mode 100644 index 0000000000..9fbb947032 --- /dev/null +++ b/doc/board/nxp/imx8mn_evk.rst @@ -0,0 +1,58 @@ +.. SPDX-License-Identifier: GPL-2.0+ + +imx8mn_evk +========== + +U-Boot for the NXP i.MX8MN EVK board + +Quick Start +----------- + +- Build the ARM Trusted firmware binary +- Get firmware-imx package +- Build U-Boot +- Boot + +Get and Build the ARM Trusted firmware +-------------------------------------- + +Note: srctree is U-Boot source directory +Get ATF from: https://source.codeaurora.org/external/imx/imx-atf +branch: imx_5.4.47_2.2.0 + +.. code-block:: bash + + $ make PLAT=imx8mn bl31 + $ cp build/imx8mn/release/bl31.bin $(srctree) + +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 + $ cp firmware-imx-8.9/firmware/ddr/synopsys/ddr4*.bin $(srctree) + +Build U-Boot +------------ + +.. code-block:: bash + + $ export CROSS_COMPILE=aarch64-poky-linux- + $ make imx8mn_ddr4_evk_defconfig + $ export ATF_LOAD_ADDR=0x960000 + $ make + +Burn the flash.bin to MicroSD card offset 32KB: + +.. code-block:: bash + + $sudo dd if=flash.bin of=/dev/sd[x] bs=1024 seek=32 conv=notrunc + $sudo dd if=u-boot.itb of=/dev/sd[x] bs=1024 seek=384 conv=notrunc + +Boot +---- + +Set Boot switch to SD boot diff --git a/doc/board/nxp/imx8mp_evk.rst b/doc/board/nxp/imx8mp_evk.rst new file mode 100644 index 0000000000..609a29f3eb --- /dev/null +++ b/doc/board/nxp/imx8mp_evk.rst @@ -0,0 +1,61 @@ +.. SPDX-License-Identifier: GPL-2.0+ + +imx8mp_evk +========== + +U-Boot for the NXP i.MX8MP EVK board + +Quick Start +----------- + +- Build the ARM Trusted firmware binary +- Get the firmware-imx package +- Build U-Boot +- Boot + +Get and Build the ARM Trusted firmware +-------------------------------------- + +Get ATF from: https://source.codeaurora.org/external/imx/imx-atf +branch: imx_5.4.70_2.3.0 + +.. code-block:: bash + + $ make PLAT=imx8mp bl31 + +Get the ddr firmware +-------------------- + +.. code-block:: bash + + $ wget https://www.nxp.com/lgfiles/NMG/MAD/YOCTO/firmware-imx-8.10.bin + $ chmod +x firmware-imx-8.10.bin + $ ./firmware-imx-8.10.bin + +Build U-Boot +------------ + +.. code-block:: bash + + $ export CROSS_COMPILE=aarch64-poky-linux- + $ make O=build imx8mp_evk_defconfig + $ cp ../imx-atf/build/imx8mp/release/bl31.bin ./build/bl31.bin + $ cp ../firmware-imx-8.10/firmware/ddr/synopsys/lpddr4_pmu_train_1d_dmem_202006.bin ./build/ + $ cp ../firmware-imx-8.10/firmware/ddr/synopsys/lpddr4_pmu_train_1d_imem_202006.bin ./build/ + $ cp ../firmware-imx-8.10/firmware/ddr/synopsys/lpddr4_pmu_train_2d_dmem_202006.bin ./build/ + $ cp ../firmware-imx-8.10/firmware/ddr/synopsys/lpddr4_pmu_train_2d_imem_202006.bin ./build/ + $ export ATF_LOAD_ADDR=0x970000 + $ make O=build + +Burn the flash.bin to the MicroSD card at offset 32KB: + +.. code-block:: bash + + $sudo dd if=build/flash.bin of=/dev/sd[x] bs=1K seek=32 conv=notrunc; sync + $sudo dd if=build/u-boot.itb of=/dev/sd[x] bs=1K seek=384 conv=notrunc; sync + +Boot +---- + +Set Boot switch to SD boot +Use /dev/ttyUSB2 for U-Boot console diff --git a/doc/board/nxp/imx8mq_evk.rst b/doc/board/nxp/imx8mq_evk.rst new file mode 100644 index 0000000000..c269fdebe3 --- /dev/null +++ b/doc/board/nxp/imx8mq_evk.rst @@ -0,0 +1,56 @@ +.. SPDX-License-Identifier: GPL-2.0+ + +imx8mq_evk +========== + +U-Boot for the NXP i.MX8MQ EVK board + +Quick Start +----------- + +- Build the ARM Trusted firmware binary +- Get ddr and hdmi fimware +- Build U-Boot +- Boot + +Get and Build the ARM Trusted firmware +-------------------------------------- + +Note: srctree is U-Boot source directory +Get ATF from: https://source.codeaurora.org/external/imx/imx-atf +branch: imx_5.4.47_2.2.0 + +.. code-block:: bash + + $ make PLAT=imx8mq bl31 + $ cp build/imx8mq/release/bl31.bin $(builddir) + +Get the ddr and hdmi 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/hdmi/cadence/signed_hdmi_imx8m.bin $(builddir) + $ cp firmware-imx-8.9/firmware/ddr/synopsys/lpddr4*.bin $(builddir) + +Build U-Boot +------------ + +.. code-block:: bash + + $ export CROSS_COMPILE=aarch64-poky-linux- + $ make imx8mq_evk_defconfig + $ make flash.bin + +Burn the flash.bin to MicroSD card offset 33KB: + +.. code-block:: bash + + $sudo dd if=flash.bin of=/dev/sd[x] bs=1024 seek=33 conv=notrunc + +Boot +---- +Set Boot switch SW801: 1100 and Bmode: 10 to boot from Micro SD. diff --git a/doc/board/nxp/imx8qxp_mek.rst b/doc/board/nxp/imx8qxp_mek.rst new file mode 100644 index 0000000000..215627cfa6 --- /dev/null +++ b/doc/board/nxp/imx8qxp_mek.rst @@ -0,0 +1,66 @@ +.. SPDX-License-Identifier: GPL-2.0+ + +imx8qxp_mek +=========== + +U-Boot for the NXP i.MX8QXP EVK board + +Quick Start +----------- + +- Build the ARM Trusted firmware binary +- Get scfw_tcm.bin and ahab-container.img +- Build U-Boot +- Flash the binary into the SD card +- Boot + +Get and Build the ARM Trusted firmware +-------------------------------------- + +.. code-block:: bash + + $ git clone https://source.codeaurora.org/external/imx/imx-atf + $ cd imx-atf/ + $ git checkout origin/imx_4.19.35_1.1.0 -b imx_4.19.35_1.1.0 + $ make PLAT=imx8qx bl31 + +Get scfw_tcm.bin and ahab-container.img +--------------------------------------- + +.. code-block:: bash + + $ wget https://www.nxp.com/lgfiles/NMG/MAD/YOCTO/imx-sc-firmware-1.2.7.1.bin + $ chmod +x imx-sc-firmware-1.2.7.1.bin + $ ./imx-sc-firmware-1.2.7.1.bin + $ wget https://www.nxp.com/lgfiles/NMG/MAD/YOCTO/imx-seco-2.3.1.bin + $ chmod +x imx-seco-2.3.1.bin + $ ./imx-seco-2.3.1.bin + +Copy the following binaries to U-Boot folder: + +.. code-block:: bash + + $ cp imx-atf/build/imx8qx/release/bl31.bin . + $ cp imx-seco-2.3.1/firmware/seco/mx8qx-ahab-container.img ./ahab-container.img + $ cp imx-sc-firmware-1.2.7.1/mx8qx-mek-scfw-tcm.bin . + +Build U-Boot +------------ + +.. code-block:: bash + + $ make imx8qxp_mek_defconfig + $ make flash.bin + +Flash the binary into the SD card +--------------------------------- + +Burn the flash.bin binary to SD card offset 32KB: + +.. code-block:: bash + + $ sudo dd if=flash.bin of=/dev/sd[x] bs=1024 seek=32 conv=notrunc + +Boot +---- +Set Boot switch SW2: 1100. diff --git a/doc/board/nxp/imxrt1020-evk.rst b/doc/board/nxp/imxrt1020-evk.rst new file mode 100644 index 0000000000..267f80c517 --- /dev/null +++ b/doc/board/nxp/imxrt1020-evk.rst @@ -0,0 +1,41 @@ +.. SPDX-License-Identifier: GPL-2.0+ + +imxrt1020-evk +============= + +How to use U-Boot on NXP i.MXRT1020 EVK +--------------------------------------- + +- Build U-Boot for i.MXRT1020 EVK: + +.. code-block:: bash + + $ make mrproper + $ make imxrt1020-evk_defconfig + $ make + +This will generate the SPL image called SPL and the u-boot.img. + +- Flash the SPL image into the micro SD card: + +.. code-block:: bash + + $sudo dd if=SPL of=/dev/sdX bs=1k seek=1 conv=notrunc; sync + +- Flash the u-boot.img image into the micro SD card: + +.. code-block:: bash + + $sudo dd if=u-boot.img of=/dev/sdX bs=1k seek=128 conv=notrunc; sync + +- Jumper settings:: + + SW8: 0 1 1 0 + +where 0 means bottom position and 1 means top position (from the +switch label numbers reference). + +- Connect the USB cable between the EVK and the PC for the console. + The USB console connector is the one close the ethernet connector + +- Insert the micro SD card in the board, power it up and U-Boot messages should come up. diff --git a/doc/board/nxp/imxrt1050-evk.rst b/doc/board/nxp/imxrt1050-evk.rst new file mode 100644 index 0000000000..c1fb48f0cd --- /dev/null +++ b/doc/board/nxp/imxrt1050-evk.rst @@ -0,0 +1,41 @@ +.. SPDX-License-Identifier: GPL-2.0+ + +imxrt1050-evk +============= + +How to use U-Boot on NXP i.MXRT1050 EVK +--------------------------------------- + +- Build U-Boot for i.MXRT1050 EVK: + +.. code-block:: bash + + $ make mrproper + $ make imxrt1050-evk_defconfig + $ make + +This will generate the SPL image called SPL and the u-boot.img. + +- Flash the SPL image into the micro SD card: + +.. code-block:: bash + + $sudo dd if=SPL of=/dev/sdX bs=1k seek=1 conv=notrunc; sync + +- Flash the u-boot.img image into the micro SD card: + +.. code-block:: bash + + $sudo dd if=u-boot.img of=/dev/sdX bs=1k seek=128 conv=notrunc; sync + +- Jumper settings:: + + SW7: 1 0 1 0 + +where 0 means bottom position and 1 means top position (from the +switch label numbers reference). + +- Connect the USB cable between the EVK and the PC for the console. + The USB console connector is the one close the ethernet connector + +- Insert the micro SD card in the board, power it up and U-Boot messages should come up. diff --git a/doc/board/nxp/index.rst b/doc/board/nxp/index.rst new file mode 100644 index 0000000000..63956287c5 --- /dev/null +++ b/doc/board/nxp/index.rst @@ -0,0 +1,20 @@ +.. SPDX-License-Identifier: GPL-2.0+ + +NXP Semiconductors +================== + +.. toctree:: + :maxdepth: 2 + + imx8mm_evk + imx8mn_evk + imx8mp_evk + imx8mq_evk + imx8qxp_mek + imxrt1020-evk + imxrt1050-evk + mx6sabreauto + mx6sabresd + mx6ul_14x14_evk + mx6ullevk + psb diff --git a/doc/board/nxp/mx6sabreauto.rst b/doc/board/nxp/mx6sabreauto.rst new file mode 100644 index 0000000000..fe4cd9d214 --- /dev/null +++ b/doc/board/nxp/mx6sabreauto.rst @@ -0,0 +1,100 @@ +.. SPDX-License-Identifier: GPL-2.0+ + +mx6sabreauto +============ + +How to use and build U-Boot on mx6sabreauto +------------------------------------------- + +mx6sabreauto_defconfig target supports mx6q/mx6dl/mx6qp sabreauto variants. + +In order to build it: + +.. code-block:: bash + + $ make mx6sabreauto_defconfig + $ make + +This will generate the SPL and u-boot-dtb.img binaries. + +- Flash the SPL binary into the SD card: + +.. code-block:: bash + + $ sudo dd if=SPL of=/dev/sdX bs=1K seek=1 conv=notrunc && sync + +- Flash the u-boot-dtb.img binary into the SD card: + +.. code-block:: bash + + $ sudo dd if=u-boot-dtb.img of=/dev/sdX bs=1K seek=69 conv=notrunc && sync + +Booting via Falcon mode +----------------------- + +Write in mx6sabreauto_defconfig the following define below: + +CONFIG_SPL_OS_BOOT=y + +In order to build it: + +.. code-block:: bash + + $ make mx6sabreauto_defconfig + $ make + +This will generate the SPL image called SPL and the u-boot-dtb.img. + +- Flash the SPL image into the SD card: + +.. code-block:: bash + + $ sudo dd if=SPL of=/dev/sdb bs=1K seek=1 conv=notrunc && sync + +- Flash the u-boot-dtb.img image into the SD card: + +.. code-block:: bash + + $ sudo dd if=u-boot-dtb.img of=/dev/sdb bs=1K seek=69 conv=notrunc && sync + +Create a FAT16 boot partition to store uImage and the dtb file, then copy the files there: + +.. code-block:: bash + + $ sudo cp uImage /media/boot + $ sudo cp imx6dl-sabreauto.dtb /media/boot + +Create a partition for root file system and extract it there: + +.. code-block:: bash + + $ sudo tar xvf rootfs.tar.gz -C /media/root + +The SD card must have enough space for raw "args" and "kernel". +To configure Falcon mode for the first time, on U-Boot do the following commands: + +- Load dtb file from boot partition:: + + # load mmc 0:1 ${fdt_addr} imx6dl-sabreauto.dtb + +- Load kernel image from boot partition:: + + # load mmc 0:1 ${loadaddr} uImage + +- Write kernel at 2MB offset:: + + # mmc write ${loadaddr} 0x1000 0x4000 + +- Setup kernel bootargs:: + + # setenv bootargs "console=ttymxc3,115200 root=/dev/mmcblk0p1 rootfstype=ext4 rootwait quiet rw" + +- Prepare args:: + + # spl export fdt ${loadaddr} - ${fdt_addr} + +- Write args 1MB data (0x800 sectors) to 1MB offset (0x800 sectors):: + + # mmc write 18000000 0x800 0x800 + +- Restart the board and then SPL binary will launch the kernel directly. diff --git a/doc/board/nxp/mx6sabresd.rst b/doc/board/nxp/mx6sabresd.rst new file mode 100644 index 0000000000..fe15ba7b79 --- /dev/null +++ b/doc/board/nxp/mx6sabresd.rst @@ -0,0 +1,132 @@ +.. SPDX-License-Identifier: GPL-2.0+ + +mx6sabresd +========== + +How to use and build U-Boot on mx6sabresd +----------------------------------------- + +The following methods can be used for booting mx6sabresd boards: + +1. Booting from SD card + +2. Booting from eMMC + +3. Booting via Falcon mode (SPL launches the kernel directly) + + +1. Booting from SD card via SPL +------------------------------- + +mx6sabresd_defconfig target supports mx6q/mx6dl/mx6qp sabresd variants. + +In order to build it: + +.. code-block:: bash + + $ make mx6sabresd_defconfig + $ make + +This will generate the SPL and u-boot-dtb.img binaries. + +- Flash the SPL binary into the SD card: + +.. code-block:: bash + + $ sudo dd if=SPL of=/dev/sdX bs=1K seek=1 conv=notrunc && sync + +- Flash the u-boot-dtb.img binary into the SD card: + +.. code-block:: bash + + $ sudo dd if=u-boot-dtb.img of=/dev/sdX bs=1K seek=69 conv=notrunc && sync + +2. Booting from eMMC +-------------------- + +.. code-block:: bash + + $ make mx6sabresd_defconfig + $ make + +This will generate the SPL and u-boot-dtb.img binaries. + +- Boot first from SD card as shown in the previous section + +In U-boot change the eMMC partition config:: + + => mmc partconf 2 1 0 0 + +Mount the eMMC in the host PC:: + + => ums 0 mmc 2 + +- Flash SPL and u-boot-dtb.img binaries into the eMMC: + +.. code-block:: bash + + $ sudo dd if=SPL of=/dev/sdX bs=1K seek=1 conv=notrunc && sync + $ sudo dd if=u-boot-dtb.img of=/dev/sdX bs=1K seek=69 conv=notrunc && sync + +Set SW6 to eMMC 8-bit boot: 11010110 + +3. Booting via Falcon mode +-------------------------- + +.. code-block:: bash + + $ make mx6sabresd_defconfig + $ make + +This will generate the SPL image called SPL and the u-boot-dtb.img. + +- Flash the SPL image into the SD card + +.. code-block:: bash + + $ sudo dd if=SPL of=/dev/sdX bs=1K seek=1 oflag=sync status=none conv=notrunc && sync + +- Flash the u-boot-dtb.img image into the SD card + +.. code-block:: bash + + $ sudo dd if=u-boot-dtb.img of=/dev/sdX bs=1K seek=69 oflag=sync status=none conv=notrunc && sync + +Create a partition for root file system and extract it there + +.. code-block:: bash + + $ sudo tar xvf rootfs.tar.gz -C /media/root + +The SD card must have enough space for raw "args" and "kernel". +To configure Falcon mode for the first time, on U-Boot do the following commands: + +- Setup the IP server:: + + # setenv serverip <server_ip_address> + +- Download dtb file:: + + # dhcp ${fdt_addr} imx6q-sabresd.dtb + +- Download kernel image:: + + # dhcp ${loadaddr} uImage + +- Write kernel at 2MB offset:: + + # mmc write ${loadaddr} 0x1000 0x4000 + +- Setup kernel bootargs:: + + # setenv bootargs "console=ttymxc0,115200 root=/dev/mmcblk1p1 rootfstype=ext4 rootwait quiet rw" + +- Prepare args:: + + # spl export fdt ${loadaddr} - ${fdt_addr} + +- Write args 1MB data (0x800 sectors) to 1MB offset (0x800 sectors):: + + # mmc write 18000000 0x800 0x800 + +- Press KEY_VOL_UP key, power up the board and then SPL binary will launch the kernel directly. diff --git a/doc/board/nxp/mx6ul_14x14_evk.rst b/doc/board/nxp/mx6ul_14x14_evk.rst new file mode 100644 index 0000000000..8298bf8e1e --- /dev/null +++ b/doc/board/nxp/mx6ul_14x14_evk.rst @@ -0,0 +1,98 @@ +.. SPDX-License-Identifier: GPL-2.0+ + +mx6ul_14x14_evk +=============== + +How to use U-Boot on Freescale MX6UL 14x14 EVK +----------------------------------------------- + +- Build U-Boot for MX6UL 14x14 EVK: + +.. code-block:: bash + + $ make mrproper + $ make mx6ul_14x14_evk_defconfig + $ make + +This will generate the SPL image called SPL and the u-boot.img. + +1. Booting via SDCard +--------------------- + +- Flash the SPL image into the micro SD card: + +.. code-block:: bash + + sudo dd if=SPL of=/dev/mmcblk0 bs=1k seek=1 conv=notrunc; sync + +- Flash the u-boot.img image into the micro SD card: + +.. code-block:: bash + + sudo dd if=u-boot.img of=/dev/mmcblk0 bs=1k seek=69 conv=notrunc; sync + +- Jumper settings:: + + SW601: 0 0 1 0 + Sw602: 1 0 + +where 0 means bottom position and 1 means top position (from the +switch label numbers reference). + +- Connect the USB cable between the EVK and the PC for the console. + The USB console connector is the one close the push buttons + +- Insert the micro SD card in the board, power it up and U-Boot messages should come up. + +2. Booting via Serial Download Protocol (SDP) +--------------------------------------------- + +The mx6ulevk board can boot from USB OTG port using the SDP, target will +enter in SDP mode in case an SD Card is not connect or boot switches are +set as below:: + + Sw602: 0 1 + SW601: x x x x + +The following tools can be used to boot via SDP, for both tools you must +connect an USB cable in USB OTG port. + +- Method 1: Universal Update Utility (uuu) + +The UUU binary can be downloaded in release tab from link below: +https://github.com/NXPmicro/mfgtools + +The following script should be created to boot SPL + u-boot-dtb.img binaries: + +.. code-block:: bash + + $ cat uuu_script + uuu_version 1.1.4 + + SDP: boot -f SPL + SDPU: write -f u-boot-dtb.img -addr 0x877fffc0 + SDPU: jump -addr 0x877fffc0 + SDPU: done + +Please note that the address above is calculated based on SYS_TEXT_BASE address: + +0x877fffc0 = 0x87800000 (SYS_TEXT_BASE) - 0x40 (U-Boot proper Header size) + +Power on the target and run the following command from U-Boot root directory: + +.. code-block:: bash + + $ sudo ./uuu uuu_script + +- Method 2: imx usb loader tool (imx_usb): + +The imx_usb_loader tool can be downloaded in link below: +https://github.com/boundarydevices/imx_usb_loader + +Build the source code and run the following commands from U-Boot root +directory: + +.. code-block:: bash + + $ sudo ./imx_usb SPL + $ sudo ./imx_usb u-boot-dtb.img diff --git a/doc/board/nxp/mx6ullevk.rst b/doc/board/nxp/mx6ullevk.rst new file mode 100644 index 0000000000..a26248a1e3 --- /dev/null +++ b/doc/board/nxp/mx6ullevk.rst @@ -0,0 +1,47 @@ +.. SPDX-License-Identifier: GPL-2.0+ + +mx6ullevk +========= + +How to use U-Boot on Freescale MX6ULL 14x14 EVK +----------------------------------------------- + +- First make sure you have installed the dtc package (device tree compiler): + +.. code-block:: bash + + $ sudo apt-get install device-tree-compiler + +- Build U-Boot for MX6ULL 14x14 EVK: + +.. code-block:: bash + + $ make mrproper + $ make mx6ull_14x14_evk_defconfig + $ make + +This generates the u-boot-dtb.imx image in the current directory. + +- Flash the u-boot-dtb.imx image into the micro SD card: + +.. code-block:: bash + + $ sudo dd if=u-boot-dtb.imx of=/dev/sdb bs=1K seek=1 conv=notrunc && sync + +- Jumper settings:: + + SW601: 0 0 1 0 + Sw602: 1 0 + +Where 0 means bottom position and 1 means top position (from the switch label +numbers reference). + +Connect the USB cable between the EVK and the PC for the console. +(The USB console connector is the one close the push buttons) + +Insert the micro SD card in the board, power it up and U-Boot messages should +come up. + +The link for the board: http://www.nxp.com/products/microcontrollers-and- \ +processors/arm-processors/i.mx-applications-processors/i.mx-6-processors/ \ +i.mx6qp/evaluation-kit-for-the-i.mx-6ull-applications-processor:MCIMX6ULL-EVK diff --git a/doc/board/nxp/psb.rst b/doc/board/nxp/psb.rst new file mode 100644 index 0000000000..71ac09fac8 --- /dev/null +++ b/doc/board/nxp/psb.rst @@ -0,0 +1,174 @@ +i.MX7D/i.MX8MM SRC_GPR10 PERSIST_SECONDARY_BOOT for bootloader A/B switching +============================================================================ + +Introduction +------------ +Since at least iMX53 until iMX8MM, it is possible to have two copies of +bootloader in SD/eMMC and switch between them. The switch is triggered +either by the BootROM in case the bootloader image is faulty OR can be +enforced by the user. + +Operation +--------- + #. Upon Power-On Reset (POR) + + - SRC_GPR10 bit PERSIST_SECONDARY_BOOT is set to 0 + - BootROM attempts to start bootloader A-copy + + - if A-copy valid + + - BootROM starts A-copy + - END + + - if A-copy NOT valid + + - BootROM sets SRC_GPR10 bit PERSIST_SECONDARY_BOOT to 1 + - BootROM triggers WARM reset, GOTO 1) + - END + + #. Upon COLD Reset + + - GOTO 1) + - END + + #. Upon WARM Reset + + - SRC_GPR10 bit PERSIST_SECONDARY_BOOT is retained + + - if SRC_GPR10 bit PERSIST_SECONDARY_BOOT is 0 + + - BootROM attempts to start bootloader A-copy + + - if A-copy valid + + - BootROM starts A-copy + - END + + - if A-copy NOT valid + + - BootROM sets SRC_GPR10 bit PERSIST_SECONDARY_BOOT to 1 + - BootROM triggers WARM reset. GOTO 1.3) + - END + + - if SRC_GPR10 bit PERSIST_SECONDARY_BOOT is 1 + + - BootROM attempts to start bootloader B-copy + + - if B-copy valid + + - BootROM starts B-copy + - END + + - if B-copy NOT valid + - System hangs + - END + +Setup +----- +The bootloader A-copy must be placed at predetermined offset in SD/eMMC. The +bootloader B-copy area offset is determined by an offset stored in Secondary +Image Table (SIT). The SIT must be placed at predetermined offset in SD/eMMC. + +The following table contains offset of SIT, bootloader A-copy and recommended +bootloader B-copy offset. The offsets are in 512 Byte sector units (that is +offset 0x1 means 512 Bytes from the start of SD/eMMC card data partition). +For details on the addition of two numbers in recommended B-copy offset, see +SIT format below. + ++----------+--------------------+-----------------------+-----------------------------+ +| SoC | SIT offset (fixed) | A-copy offset (fixed) | B-copy offset (recommended) | ++----------+--------------------+-----------------------+-----------------------------+ +| iMX7D | 0x1 | 0x2 | 0x800+0x2 | ++----------+--------------------+-----------------------+-----------------------------+ +| iMX8MM | 0x41 | 0x42 | 0x1000+0x42 | ++----------+--------------------+-----------------------+-----------------------------+ + +SIT format +~~~~~~~~~~ +SIT is a 20 byte long structure containing of 5 32-bit words. Those encode +bootloader B-copy area offset (called "firstSectorNumber"), magic value +(called "tag") that is always 0x00112233, and three unused words set to 0. +SIT is documented in [1]_ and [2]_. Example SIT are below:: + + $ hexdump -vC sit-mx7d.bin + 00000000 00 00 00 00 + 00000004 00 00 00 00 + 00000008 33 22 11 00 <--- This is the "tag" + 0000000c 00 08 00 00 <--- This is the "firstSectorNumber" + 00000010 00 00 00 00 + + $ hexdump -vC sit-mx8mm.bin + 00000000 00 00 00 00 + 00000004 00 00 00 00 + 00000008 33 22 11 00 <--- This is the "tag" + 0000000c 00 10 00 00 <--- This is the "firstSectorNumber" + 00000010 00 00 00 00 + +B-copy area offset ("firstSectorNumber") is offset, in units of 512 Byte +sectors, that is added to the start of boot media when switching between +A-copy and B-copy. For A-copy, this offset is 0x0. For B-copy, this offset +is determined by SIT (e.g. if firstSectorNumber is 0x1000 as it is above +in sit-mx8mm.bin, then the B-copy offset is 0x1000 sectors = 2 MiB). + +Bootloader A-copy (e.g. u-boot.imx or flash.bin) is placed at fixed offset +from A-copy area offset (e.g. 0x2 sectors from sector 0x0 for iMX7D, which +means u-boot.imx A-copy must be written to sector 0x2). + +The same applies to bootloader B-copy, which is placed at fixed offset from +B-copy area offset determined by SIT (e.g. 0x2 sectors from sector 0x800 [see +sit-mx7d.bin example above, this can be changed in SIT firstSectorNumber] for +iMX7D, which means u-boot.imx B-copy must be written to sector 0x802) + +**WARNING:** +B-copy area offset ("firstSectorNumber") is NOT equal to bootloader +(image, which is u-boot.imx or flash.bin) B-copy offset. + +To generate SIT, use for example the following bourne shell printf command:: + +$ printf '\x0\x0\x0\x0\x0\x0\x0\x0\x33\x22\x11\x00\x00\x08\x00\x00\x0\x0\x0\x0' > sit-mx7d.bin +$ printf '\x0\x0\x0\x0\x0\x0\x0\x0\x33\x22\x11\x00\x00\x10\x00\x00\x0\x0\x0\x0' > sit-mx8mm.bin + +Write bootloader A/B copy and SIT to SD/eMMC +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Examples of writing SIT and two copies of bootloader to SD or eMMC: + +- iMX8MM, SD card at /dev/sdX, Linux command line + :: + + $ dd if=sit-mx8mm.bin of=/dev/sdX bs=512 seek=65 + $ dd if=flash.bin of=/dev/sdX bs=512 seek=66 + $ dd if=flash.bin of=/dev/sdX bs=512 seek=4162 + +- iMX8MM, eMMC 1 data partition, U-Boot command line + :: + + => mmc partconf 1 0 0 0 + + => dhcp ${loadaddr} sit-mx8mm.bin + => mmc dev 1 + => mmc write ${loadaddr} 0x41 0x1 + + => dhcp ${loadaddr} flash.bin + => setexpr blkcnt ${filesize} + 0x1ff && setexpr blkcnt ${blkcnt} / 0x200 + => mmc dev 1 + => mmc write ${loadaddr} 0x42 ${blkcnt} + => mmc write ${loadaddr} 0x1042 ${blkcnt} + +WARM reset into B-copy using WDT +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +To perform a reboot into B-copy, the PERSIST_SECONDARY_BOOT must be set +in SRC_GPR0 register. Example on iMX8MM:: + + => mw 0x30390098 0x40000000 + +A WARM reset can be triggered using WDT as follows:: + + => mw.w 0x30280000 0x25 + +References +---------- + +.. [1] i.MX 7Dual Applications Processor Reference Manual, Rev. 1, 01/2018 ; section 6.6.5.3.5 Redundant boot support for expansion device +.. [2] i.MX 8M Mini Applications Processor Reference Manual, Rev. 3, 11/2020 ; section 6.1.5.4.5 Redundant boot support for expansion device |