| 1 | [[Outline]] |
| 2 | |
| 3 | = IMX Serial Download Protocol (SDP) |
| 4 | The iMX processors internal boot ROM handles the first boot stage in order to be able to boot from a variety of devices (uSD, NAND, NOR, SPI, SATA, etc). One of the boot devices, referred to as the 'Serial Downloader Protocol' provides an API over USB OTG. Therefore an application can reside on a host PC that will can control the boot of the iMX as long as you can get the iMX to boot in this mode (referred to as 'BOOT_MODE0'). During the internal ROM's boot, a watchdog is used such that a corrupt or non-existent boot media will result in attempting to boot via SDP. This may be useful if you are working with a board that has an unprogrammed or misprogrammed FLASH device which also has access to USB OTG. |
| 5 | |
| 6 | === Booting Venice U-Boot over SDP with uuu |
| 7 | NXP provides 'uuu' (Universal Update Utility) which is an evolution of the old Freescale MFGtools. The most important update is that it is supported under Linux instead of Windows only. |
| 8 | |
| 9 | For i.MX SoC's we use a 2-stage boot firmware comprised of the Secondary Program Loader (SPL) (provided by U-Boot) as well as U-Boot proper. Each stage is loaded separately as seen below in the examples. While no special code support is needed for the SPL boot over SDP, in order for the SPL to implement SDP to boot to U-Boot proper you need to have the following enabled in U-Boot: |
| 10 | - CONFIG_SPL_USB_HOST_SUPPORT=y |
| 11 | - CONFIG_SPL_USB_GADGET=y |
| 12 | - CONFIG_SPL_USB_SDP_SUPPORT=y |
| 13 | - CONFIG_CMD_USB_SDP=y (only if you want the 'sdp' command in U-Boot' |
| 14 | |
| 15 | Linux Install: |
| 16 | {{{#!bash |
| 17 | wget https://github.com/NXPmicro/mfgtools/releases/download/uuu_1.4.69/uuu |
| 18 | chmod +x uuu |
| 19 | sudo mv uuu /usr/local/bin |
| 20 | }}} |
| 21 | |
| 22 | Examples: |
| 23 | * list SDP devices on the USB bus: |
| 24 | {{{#!bash |
| 25 | $ uuu -lsusb # list compatible devices on the USB bus in SDP mode |
| 26 | uuu (Universal Update Utility) for nxp imx chips -- libuuu_1.4.69-0-g63b1d3c |
| 27 | |
| 28 | Connected Known USB Devices |
| 29 | Path Chip Pro Vid Pid BcdVersion |
| 30 | ================================================== |
| 31 | 3:2 MX8MM SDP: 0x1FC9 0x0134 0x0101 |
| 32 | }}} |
| 33 | * Boot Venice U-Boot over SDP (using flash.bin and u-boot.itb): |
| 34 | - linux host: |
| 35 | {{{#!bash |
| 36 | $ sudo uuu flash.bin && sudo uuu SDPV: write -f u-boot.itb -addr 0x42000000 && sudo uuu SDPV: jump -addr 0x42000000 |
| 37 | uuu (Universal Update Utility) for nxp imx chips -- libuuu_1.4.139-0-g1a8f760 |
| 38 | |
| 39 | Success 1 Failure 0 |
| 40 | |
| 41 | |
| 42 | 2:13 2/ 2 [Done ] SDP: done |
| 43 | |
| 44 | |
| 45 | uuu (Universal Update Utility) for nxp imx chips -- libuuu_1.4.139-0-g1a8f760 |
| 46 | |
| 47 | Success 0 Failure 0 |
| 48 | |
| 49 | |
| 50 | 2:13 1/ 1 [=================100%=================] SDPV: write -f u-boot.itb |
| 51 | Okay |
| 52 | |
| 53 | |
| 54 | |
| 55 | uuu (Universal Update Utility) for nxp imx chips -- libuuu_1.4.139-0-g1a8f760 |
| 56 | |
| 57 | Success 0 Failure 0 |
| 58 | |
| 59 | |
| 60 | 2:13 1/ 1 [=================100%=================] SDPV: jump -addr 0x420000 |
| 61 | Okay |
| 62 | }}} |
| 63 | - target |
| 64 | {{{#!bash |
| 65 | U-Boot SPL 2021.07-00066-g7cc5a04f34ab (Dec 06 2021 - 14:56:21 -0800) |
| 66 | GSC : v61 0x1d6f RST:VIN Thermal Protection Disabled |
| 67 | Model : GW7211-00-CB |
| 68 | Serial : 852420 |
| 69 | MFGDate : 11-19-2021 |
| 70 | RTC : 1 |
| 71 | PMIC : MP5416 |
| 72 | DRAM : LPDDR4 1 GiB |
| 73 | WDT: Started with servicing (60s timeout) |
| 74 | Trying to boot from USB SDP |
| 75 | SDP: initialize... |
| 76 | SDP: handle requests... |
| 77 | Downloading file of size 968812 to 0x42000000... done |
| 78 | Jumping to header at 0x42000000 |
| 79 | Header Tag is not an IMX image |
| 80 | Found header at 0x42000000 |
| 81 | DTB : imx8mm-venice-gw72xx-0x |
| 82 | NOTICE: BL31: v2.4(release):f884ad7b0ba2 |
| 83 | NOTICE: BL31: Built : 13:06:09, Oct 20 2021 |
| 84 | |
| 85 | |
| 86 | U-Boot 2021.07-00066-g7cc5a04f34ab (Dec 06 2021 - 14:56:21 -0800) |
| 87 | |
| 88 | CPU: Freescale i.MX8MMQ rev1.0 1600 MHz (running at 1200 MHz) |
| 89 | CPU: Industrial temperature grade (-40C to 105C) at 31C |
| 90 | Reset cause: POR |
| 91 | Model: Gateworks Venice GW72xx-0x i.MX8MM Development Kit |
| 92 | DRAM: 1 GiB |
| 93 | temp : 23.6C |
| 94 | vdd_bat : 0.000V |
| 95 | vdd_vin : 16.932V |
| 96 | vdd_adc1: 0.000V |
| 97 | vdd_adc2: 0.000V |
| 98 | vdd_dram: 1.097V |
| 99 | vdd_1p2 : 1.192V |
| 100 | vdd_1p0 : 0.982V |
| 101 | vdd_2p5 : 2.470V |
| 102 | vdd_3p3 : 3.254V |
| 103 | vdd_0p95: 0.949V |
| 104 | vdd_1p8 : 1.801V |
| 105 | vdd_gsc : 2.942V |
| 106 | WDT: Started with servicing (60s timeout) |
| 107 | MMC: FSL_SDHC: 1, FSL_SDHC: 2 |
| 108 | Loading Environment from MMC... MMC Device 0 not found |
| 109 | *** Warning - No MMC card found, using default environment |
| 110 | |
| 111 | In: serial |
| 112 | Out: serial |
| 113 | Err: serial |
| 114 | Net: DP83867 eth0: ethernet@30be0000 [PRIME] |
| 115 | GSC : boot watchdog disabled |
| 116 | Hit any key to stop autoboot: 0 |
| 117 | u-boot=> |
| 118 | }}} |
| 119 | * invoke SDP while in U-Boot |
| 120 | {{{#!bash |
| 121 | u-boot=> sdp 0 |
| 122 | SDP: initialize... |
| 123 | SDP: handle requests... |
| 124 | }}} |
| 125 | |
| 126 | |
| 127 | Note in order to force booting from SDP you either need to drive BOOT_MODE0 high (with a special GSC firmware) or simply erase the emmc SPL code (ie 'mmc dev 2 && mmc erase 0 8000) |
| 128 | |