Tom Rini | 8b0c8a1 | 2018-05-06 18:27:01 -0400 | [diff] [blame] | 1 | SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause |
Patrick Delaunay | 8eb3b1e | 2018-03-12 10:46:18 +0100 | [diff] [blame] | 2 | # |
| 3 | # Copyright (C) 2018 STMicroelectronics - All Rights Reserved |
| 4 | # |
Patrick Delaunay | 8eb3b1e | 2018-03-12 10:46:18 +0100 | [diff] [blame] | 5 | |
| 6 | U-Boot on STMicroelectronics STM32MP1 |
| 7 | ====================================== |
| 8 | |
| 9 | 1. Summary |
| 10 | ========== |
| 11 | This is a quick instruction for setup stm32mp1 boards. |
| 12 | |
| 13 | 2. Supported devices |
| 14 | ==================== |
| 15 | U-Boot supports one STMP32MP1 SoCs: STM32MP157 |
| 16 | |
| 17 | The STM32MP157 is a Cortex-A MPU aimed at various applications. |
| 18 | It features: |
| 19 | - Dual core Cortex-A7 application core |
| 20 | - 2D/3D image composition with GPU |
| 21 | - Standard memories interface support |
| 22 | - Standard connectivity, widely inherited from the STM32 MCU family |
| 23 | - Comprehensive security support |
| 24 | |
| 25 | Everything is supported in Linux but U-Boot is limited to: |
| 26 | 1. UART |
| 27 | 2. SDCard/MMC controller (SDMMC) |
Patrick Delaunay | 72e80f5 | 2019-07-05 17:20:18 +0200 | [diff] [blame] | 28 | 3. NAND controller (FMC) |
| 29 | 4. NOR controller (QSPI) |
| 30 | 5. USB controller (OTG DWC2) |
| 31 | 6. Ethernet controller |
Patrick Delaunay | 8eb3b1e | 2018-03-12 10:46:18 +0100 | [diff] [blame] | 32 | |
| 33 | And the necessary drivers |
| 34 | 1. I2C |
Patrick Delaunay | d79218f | 2019-02-04 11:26:17 +0100 | [diff] [blame] | 35 | 2. STPMIC1 (PMIC and regulator) |
Patrick Delaunay | e7f435d | 2018-07-09 15:17:22 +0200 | [diff] [blame] | 36 | 3. Clock, Reset, Sysreset |
| 37 | 4. Fuse |
Patrick Delaunay | 8eb3b1e | 2018-03-12 10:46:18 +0100 | [diff] [blame] | 38 | |
| 39 | Currently the following boards are supported: |
Patrick Delaunay | e7f435d | 2018-07-09 15:17:22 +0200 | [diff] [blame] | 40 | + stm32mp157c-ev1 |
Patrick Delaunay | 8eb3b1e | 2018-03-12 10:46:18 +0100 | [diff] [blame] | 41 | + stm32mp157c-ed1 |
Patrice Chotard | fe5b539 | 2019-02-12 16:50:39 +0100 | [diff] [blame] | 42 | + stm32mp157a-dk1 |
| 43 | + stm32mp157c-dk2 |
Manivannan Sadhasivam | d156407 | 2019-05-02 13:26:44 +0530 | [diff] [blame] | 44 | + stm32mp157a-avenger96 |
Patrick Delaunay | 8eb3b1e | 2018-03-12 10:46:18 +0100 | [diff] [blame] | 45 | |
| 46 | 3. Boot Sequences |
| 47 | ================= |
| 48 | |
| 49 | BootRom => FSBL in SYSRAM => SSBL in DDR => OS (Linux Kernel) |
| 50 | |
| 51 | with FSBL = First Stage Bootloader |
| 52 | SSBL = Second Stage Bootloader |
| 53 | |
Patrick Delaunay | ff215a4 | 2019-07-02 13:26:06 +0200 | [diff] [blame^] | 54 | 3 boot configurations are supported: |
Patrick Delaunay | 8eb3b1e | 2018-03-12 10:46:18 +0100 | [diff] [blame] | 55 | |
Patrick Delaunay | 5d06141 | 2019-02-12 11:44:39 +0100 | [diff] [blame] | 56 | 1) The "Trusted" boot chain (defconfig_file : stm32mp15_trusted_defconfig) |
| 57 | BootRom => FSBL = Trusted Firmware-A (TF-A) => SSBL = U-Boot |
| 58 | TF-A performs a full initialization of Secure peripherals and installs a |
| 59 | secure monitor. |
| 60 | U-Boot is running in normal world and uses TF-A monitor |
Patrick Delaunay | 72e80f5 | 2019-07-05 17:20:18 +0200 | [diff] [blame] | 61 | to access to secure resources. |
Patrick Delaunay | 5d06141 | 2019-02-12 11:44:39 +0100 | [diff] [blame] | 62 | |
Patrick Delaunay | ff215a4 | 2019-07-02 13:26:06 +0200 | [diff] [blame^] | 63 | 2) The "Trusted" boot chain with OP-TEE |
| 64 | (defconfig_file : stm32mp15_optee_defconfig) |
| 65 | BootRom => FSBL = Trusted Firmware-A (TF-A) => SSBL = U-Boot |
| 66 | TF-A performs a full initialization of Secure peripherals and installs OP-TEE |
| 67 | from specific partitions (teeh, teed, teex). |
| 68 | U-Boot is running in normal world and uses OP-TEE monitor to access |
| 69 | to secure resources. |
| 70 | |
| 71 | 3) The "Basic" boot chain (defconfig_file : stm32mp15_basic_defconfig) |
Patrick Delaunay | 8eb3b1e | 2018-03-12 10:46:18 +0100 | [diff] [blame] | 72 | BootRom => FSBL = U-Boot SPL => SSBL = U-Boot |
| 73 | SPL has limited security initialisation |
| 74 | U-Boot is running in secure mode and provide a secure monitor to the kernel |
Patrick Delaunay | 72e80f5 | 2019-07-05 17:20:18 +0200 | [diff] [blame] | 75 | with only PSCI support (Power State Coordination Interface defined by ARM). |
Patrick Delaunay | 8eb3b1e | 2018-03-12 10:46:18 +0100 | [diff] [blame] | 76 | |
Patrick Delaunay | 5d06141 | 2019-02-12 11:44:39 +0100 | [diff] [blame] | 77 | All the STM32MP1 boards supported by U-Boot use the same generic board |
Patrick Delaunay | 8eb3b1e | 2018-03-12 10:46:18 +0100 | [diff] [blame] | 78 | stm32mp1 which support all the bootable devices. |
| 79 | |
| 80 | Each board is configurated only with the associated device tree. |
| 81 | |
| 82 | 4. Device Tree Selection |
| 83 | ======================== |
| 84 | |
| 85 | You need to select the appropriate device tree for your board, |
| 86 | the supported device trees for stm32mp157 are: |
| 87 | |
Patrick Delaunay | d79218f | 2019-02-04 11:26:17 +0100 | [diff] [blame] | 88 | + ev1: eval board with pmic stpmic1 (ev1 = mother board + daughter ed1) |
Patrick Delaunay | e7f435d | 2018-07-09 15:17:22 +0200 | [diff] [blame] | 89 | dts: stm32mp157c-ev1 |
| 90 | |
Patrick Delaunay | d79218f | 2019-02-04 11:26:17 +0100 | [diff] [blame] | 91 | + ed1: daughter board with pmic stpmic1 |
Patrick Delaunay | 8eb3b1e | 2018-03-12 10:46:18 +0100 | [diff] [blame] | 92 | dts: stm32mp157c-ed1 |
| 93 | |
Patrice Chotard | fe5b539 | 2019-02-12 16:50:39 +0100 | [diff] [blame] | 94 | + dk1: Discovery board |
| 95 | dts: stm32mp157a-dk1 |
| 96 | |
| 97 | + dk2: Discovery board = dk1 with a BT/WiFI combo and a DSI panel |
| 98 | dts: stm32mp157c-dk2 |
| 99 | |
Manivannan Sadhasivam | d156407 | 2019-05-02 13:26:44 +0530 | [diff] [blame] | 100 | + avenger96: Avenger96 board from Arrow Electronics |
| 101 | dts: stm32mp157a-avenger96 |
| 102 | |
Patrick Delaunay | 8eb3b1e | 2018-03-12 10:46:18 +0100 | [diff] [blame] | 103 | 5. Build Procedure |
| 104 | ================== |
| 105 | |
| 106 | 1. Install required tools for U-Boot |
| 107 | |
| 108 | + install package needed in U-Boot makefile |
| 109 | (libssl-dev, swig, libpython-dev...) |
| 110 | + install ARMv7 toolchain for 32bit Cortex-A (from Linaro, |
| 111 | from SDK for STM32MP1, or any crosstoolchains from your distribution) |
| 112 | |
| 113 | 2. Set the cross compiler: |
| 114 | |
| 115 | # export CROSS_COMPILE=/path/to/toolchain/arm-linux-gnueabi- |
| 116 | (you can use any gcc cross compiler compatible with U-Boot) |
| 117 | |
| 118 | 3. Select the output directory (optional) |
| 119 | |
| 120 | # export KBUILD_OUTPUT=/path/to/output |
| 121 | |
| 122 | for example: use one output directory for each configuration |
Patrick Delaunay | 5d06141 | 2019-02-12 11:44:39 +0100 | [diff] [blame] | 123 | # export KBUILD_OUTPUT=stm32mp15_trusted |
Patrick Delaunay | ff215a4 | 2019-07-02 13:26:06 +0200 | [diff] [blame^] | 124 | # export KBUILD_OUTPUT=stm32mp15_optee |
Patrick Delaunay | 8eb3b1e | 2018-03-12 10:46:18 +0100 | [diff] [blame] | 125 | # export KBUILD_OUTPUT=stm32mp15_basic |
| 126 | |
Patrick Delaunay | 72e80f5 | 2019-07-05 17:20:18 +0200 | [diff] [blame] | 127 | you can build outside of code directory: |
| 128 | # export KBUILD_OUTPUT=../build/stm32mp15_trusted |
| 129 | |
Patrick Delaunay | 5d06141 | 2019-02-12 11:44:39 +0100 | [diff] [blame] | 130 | 4. Configure U-Boot: |
Patrick Delaunay | 8eb3b1e | 2018-03-12 10:46:18 +0100 | [diff] [blame] | 131 | |
| 132 | # make <defconfig_file> |
| 133 | |
Patrick Delaunay | 5d06141 | 2019-02-12 11:44:39 +0100 | [diff] [blame] | 134 | - For trusted boot mode : "stm32mp15_trusted_defconfig" |
Patrick Delaunay | ff215a4 | 2019-07-02 13:26:06 +0200 | [diff] [blame^] | 135 | - For trusted with OP-TEE boot mode : "stm32mp15_optee_defconfig" |
Patrick Delaunay | 8eb3b1e | 2018-03-12 10:46:18 +0100 | [diff] [blame] | 136 | - For basic boot mode: "stm32mp15_basic_defconfig" |
| 137 | |
| 138 | 5. Configure the device-tree and build the U-Boot image: |
| 139 | |
| 140 | # make DEVICE_TREE=<name> all |
| 141 | |
| 142 | |
| 143 | example: |
Patrick Delaunay | 5d06141 | 2019-02-12 11:44:39 +0100 | [diff] [blame] | 144 | a) trusted boot on ev1 |
| 145 | # export KBUILD_OUTPUT=stm32mp15_trusted |
| 146 | # make stm32mp15_trusted_defconfig |
| 147 | # make DEVICE_TREE=stm32mp157c-ev1 all |
| 148 | |
Patrick Delaunay | ff215a4 | 2019-07-02 13:26:06 +0200 | [diff] [blame^] | 149 | b) trusted with OP-TEE boot on dk2 |
| 150 | # export KBUILD_OUTPUT=stm32mp15_optee |
| 151 | # make stm32mp15_optee_defconfig |
| 152 | # make DEVICE_TREE=stm32mp157c-dk2 all |
| 153 | |
| 154 | c) basic boot on ev1 |
Patrick Delaunay | e7f435d | 2018-07-09 15:17:22 +0200 | [diff] [blame] | 155 | # export KBUILD_OUTPUT=stm32mp15_basic |
| 156 | # make stm32mp15_basic_defconfig |
| 157 | # make DEVICE_TREE=stm32mp157c-ev1 all |
| 158 | |
Patrick Delaunay | ff215a4 | 2019-07-02 13:26:06 +0200 | [diff] [blame^] | 159 | d) basic boot on ed1 |
Patrick Delaunay | 8eb3b1e | 2018-03-12 10:46:18 +0100 | [diff] [blame] | 160 | # export KBUILD_OUTPUT=stm32mp15_basic |
| 161 | # make stm32mp15_basic_defconfig |
| 162 | # make DEVICE_TREE=stm32mp157c-ed1 all |
| 163 | |
Patrick Delaunay | ff215a4 | 2019-07-02 13:26:06 +0200 | [diff] [blame^] | 164 | e) basic boot on dk1 |
Patrice Chotard | fe5b539 | 2019-02-12 16:50:39 +0100 | [diff] [blame] | 165 | # export KBUILD_OUTPUT=stm32mp15_basic |
| 166 | # make stm32mp15_basic_defconfig |
Patrick Delaunay | ff215a4 | 2019-07-02 13:26:06 +0200 | [diff] [blame^] | 167 | # make DEVICE_TREE=stm32mp157a-dk1 all |
Patrice Chotard | fe5b539 | 2019-02-12 16:50:39 +0100 | [diff] [blame] | 168 | |
Patrick Delaunay | ff215a4 | 2019-07-02 13:26:06 +0200 | [diff] [blame^] | 169 | f) basic boot on avenger96 |
Manivannan Sadhasivam | d156407 | 2019-05-02 13:26:44 +0530 | [diff] [blame] | 170 | # export KBUILD_OUTPUT=stm32mp15_basic |
| 171 | # make stm32mp15_basic_defconfig |
| 172 | # make DEVICE_TREE=stm32mp157a-avenger96 all |
| 173 | |
Patrick Delaunay | 8eb3b1e | 2018-03-12 10:46:18 +0100 | [diff] [blame] | 174 | 6. Output files |
| 175 | |
Patrick Delaunay | e7f435d | 2018-07-09 15:17:22 +0200 | [diff] [blame] | 176 | BootRom and TF-A expect binaries with STM32 image header |
Patrick Delaunay | 8eb3b1e | 2018-03-12 10:46:18 +0100 | [diff] [blame] | 177 | SPL expects file with U-Boot uImage header |
| 178 | |
| 179 | So in the output directory (selected by KBUILD_OUTPUT), |
| 180 | you can found the needed files: |
| 181 | |
Patrick Delaunay | ff215a4 | 2019-07-02 13:26:06 +0200 | [diff] [blame^] | 182 | a) For Trusted boot (with or without OP-TEE) |
Patrick Delaunay | 5d06141 | 2019-02-12 11:44:39 +0100 | [diff] [blame] | 183 | + FSBL = tf-a.stm32 (provided by TF-A compilation) |
| 184 | + SSBL = u-boot.stm32 |
| 185 | |
| 186 | b) For Basic boot |
Patrick Delaunay | 8eb3b1e | 2018-03-12 10:46:18 +0100 | [diff] [blame] | 187 | + FSBL = spl/u-boot-spl.stm32 |
| 188 | + SSBL = u-boot.img |
| 189 | |
Patrick Delaunay | 8d05010 | 2018-03-20 10:54:52 +0100 | [diff] [blame] | 190 | 6. Switch Setting for Boot Mode |
| 191 | =============================== |
| 192 | |
| 193 | You can select the boot mode, on the board ed1 with the switch SW1 |
| 194 | |
Patrick Delaunay | 72e80f5 | 2019-07-05 17:20:18 +0200 | [diff] [blame] | 195 | - on the daugther board ed1 with the switch SW1 : BOOT0, BOOT1, BOOT2 |
| 196 | |
Patrick Delaunay | 8d05010 | 2018-03-20 10:54:52 +0100 | [diff] [blame] | 197 | ----------------------------------- |
| 198 | Boot Mode BOOT2 BOOT1 BOOT0 |
| 199 | ----------------------------------- |
| 200 | Reserved 0 0 0 |
| 201 | NOR 0 0 1 |
Patrick Delaunay | 8d05010 | 2018-03-20 10:54:52 +0100 | [diff] [blame] | 202 | SD-Card 1 0 1 |
| 203 | eMMC 0 1 0 |
| 204 | NAND 0 1 1 |
| 205 | Recovery 1 1 0 |
| 206 | Recovery 0 0 0 |
| 207 | |
Patrice Chotard | fe5b539 | 2019-02-12 16:50:39 +0100 | [diff] [blame] | 208 | - on board DK1/DK2 with the switch SW1 : BOOT0, BOOT2 |
| 209 | (BOOT1 forced to 0, NOR not supported) |
| 210 | |
| 211 | -------------------------- |
| 212 | Boot Mode BOOT2 BOOT0 |
| 213 | -------------------------- |
| 214 | Reserved 1 0 |
| 215 | SD-Card 1 1 |
| 216 | Recovery 0 0 |
| 217 | |
Manivannan Sadhasivam | d156407 | 2019-05-02 13:26:44 +0530 | [diff] [blame] | 218 | - Boot mode of Avenger96 can be selected using switch S3 |
| 219 | |
| 220 | ----------------------------------- |
| 221 | Boot Mode BOOT2 BOOT1 BOOT0 |
| 222 | ----------------------------------- |
| 223 | Recovery 0 0 0 |
| 224 | NOR 0 0 1 |
| 225 | SD-Card 1 0 1 |
| 226 | eMMC 0 1 0 |
| 227 | NAND 0 1 1 |
| 228 | Reserved 1 0 0 |
| 229 | Recovery 1 1 0 |
| 230 | SD-Card 1 1 1 |
| 231 | |
Patrick Delaunay | 8d05010 | 2018-03-20 10:54:52 +0100 | [diff] [blame] | 232 | Recovery is a boot from serial link (UART/USB) and it is used with |
| 233 | STM32CubeProgrammer tool to load executable in RAM and to update the flash |
| 234 | devices available on the board (NOR/NAND/eMMC/SDCARD). |
| 235 | The communication between HOST and board is based on |
| 236 | - for UARTs : the uart protocol used with all MCU STM32 |
| 237 | - for USB : based on USB DFU 1.1 (without the ST extensions used on MCU STM32) |
| 238 | |
| 239 | 7. Prepare an SDCard |
Patrick Delaunay | 8eb3b1e | 2018-03-12 10:46:18 +0100 | [diff] [blame] | 240 | =================== |
| 241 | |
| 242 | The minimal requirements for STMP32MP1 boot up to U-Boot are: |
| 243 | - GPT partitioning (with gdisk or with sgdisk) |
| 244 | - 2 fsbl partitions, named fsbl1 and fsbl2, size at least 256KiB |
| 245 | - one ssbl partition for U-Boot |
| 246 | |
| 247 | Then the minimal GPT partition is: |
Patrick Delaunay | 5d06141 | 2019-02-12 11:44:39 +0100 | [diff] [blame] | 248 | ----- ------- --------- -------------- |
| 249 | | Num | Name | Size | Content | |
| 250 | ----- ------- -------- --------------- |
Patrick Delaunay | e7f435d | 2018-07-09 15:17:22 +0200 | [diff] [blame] | 251 | | 1 | fsbl1 | 256 KiB | TF-A or SPL | |
| 252 | | 2 | fsbl2 | 256 KiB | TF-A or SPL | |
Patrick Delaunay | 5d06141 | 2019-02-12 11:44:39 +0100 | [diff] [blame] | 253 | | 3 | ssbl | enought | U-Boot | |
| 254 | | * | - | - | Boot/Rootfs | |
| 255 | ----- ------- --------- -------------- |
Patrick Delaunay | 8eb3b1e | 2018-03-12 10:46:18 +0100 | [diff] [blame] | 256 | |
| 257 | (*) add bootable partition for extlinux.conf |
| 258 | following Generic Distribution |
| 259 | (doc/README.distro for use) |
| 260 | |
| 261 | according the used card reader select the block device |
| 262 | (/dev/sdx or /dev/mmcblk0) |
| 263 | in the next example I use /dev/mmcblk0 |
| 264 | |
| 265 | for example: with gpt table with 128 entries |
| 266 | |
| 267 | a) remove previous formatting |
| 268 | # sgdisk -o /dev/<SDCard dev> |
| 269 | |
| 270 | b) create minimal image |
Patrick Delaunay | 8d05010 | 2018-03-20 10:54:52 +0100 | [diff] [blame] | 271 | # sgdisk --resize-table=128 -a 1 \ |
Patrick Delaunay | 8eb3b1e | 2018-03-12 10:46:18 +0100 | [diff] [blame] | 272 | -n 1:34:545 -c 1:fsbl1 \ |
| 273 | -n 2:546:1057 -c 2:fsbl2 \ |
| 274 | -n 3:1058:5153 -c 3:ssbl \ |
| 275 | -p /dev/<SDCard dev> |
| 276 | |
Patrick Delaunay | e7f435d | 2018-07-09 15:17:22 +0200 | [diff] [blame] | 277 | you can add other partitions for kernel |
| 278 | one partition rootfs for example: |
Patrick Delaunay | 5d06141 | 2019-02-12 11:44:39 +0100 | [diff] [blame] | 279 | -n 4:5154: -c 4:rootfs \ |
Patrick Delaunay | 8eb3b1e | 2018-03-12 10:46:18 +0100 | [diff] [blame] | 280 | |
| 281 | c) copy the FSBL (2 times) and SSBL file on the correct partition. |
| 282 | in this example in partition 1 to 3 |
| 283 | |
| 284 | for basic boot mode : <SDCard dev> = /dev/mmcblk0 |
| 285 | # dd if=u-boot-spl.stm32 of=/dev/mmcblk0p1 |
| 286 | # dd if=u-boot-spl.stm32 of=/dev/mmcblk0p2 |
| 287 | # dd if=u-boot.img of=/dev/mmcblk0p3 |
| 288 | |
Patrick Delaunay | 5d06141 | 2019-02-12 11:44:39 +0100 | [diff] [blame] | 289 | for trusted boot mode : |
| 290 | # dd if=tf-a.stm32 of=/dev/mmcblk0p1 |
| 291 | # dd if=tf-a.stm32 of=/dev/mmcblk0p2 |
| 292 | # dd if=u-boot.stm32 of=/dev/mmcblk0p3 |
| 293 | |
Patrick Delaunay | 72e80f5 | 2019-07-05 17:20:18 +0200 | [diff] [blame] | 294 | To boot from SDCard, select BootPinMode = 1 0 1 and reset. |
Patrick Delaunay | 8eb3b1e | 2018-03-12 10:46:18 +0100 | [diff] [blame] | 295 | |
Patrick Delaunay | 8d05010 | 2018-03-20 10:54:52 +0100 | [diff] [blame] | 296 | 8. Prepare eMMC |
| 297 | =============== |
| 298 | You can use U-Boot to copy binary in eMMC. |
Patrick Delaunay | 8eb3b1e | 2018-03-12 10:46:18 +0100 | [diff] [blame] | 299 | |
Patrick Delaunay | 8d05010 | 2018-03-20 10:54:52 +0100 | [diff] [blame] | 300 | In the next example, you need to boot from SDCARD and the images (u-boot-spl.stm32, u-boot.img) |
| 301 | are presents on SDCARD (mmc 0) in ext4 partition 4 (bootfs). |
Patrick Delaunay | 8eb3b1e | 2018-03-12 10:46:18 +0100 | [diff] [blame] | 302 | |
Patrick Delaunay | 5d06141 | 2019-02-12 11:44:39 +0100 | [diff] [blame] | 303 | To boot from SDCard, select BootPinMode = 1 0 1 and reset. |
Patrick Delaunay | 8eb3b1e | 2018-03-12 10:46:18 +0100 | [diff] [blame] | 304 | |
Patrick Delaunay | 8d05010 | 2018-03-20 10:54:52 +0100 | [diff] [blame] | 305 | Then you update the eMMC with the next U-Boot command : |
| 306 | |
| 307 | a) prepare GPT on eMMC, |
| 308 | example with 2 partitions, bootfs and roots: |
| 309 | |
| 310 | # setenv emmc_part "name=ssbl,size=2MiB;name=bootfs,type=linux,bootable,size=64MiB;name=rootfs,type=linux,size=512" |
| 311 | # gpt write mmc 1 ${emmc_part} |
| 312 | |
| 313 | b) copy SPL on eMMC on firts boot partition |
| 314 | (SPL max size is 256kB, with LBA 512, 0x200) |
| 315 | |
| 316 | # ext4load mmc 0:4 0xC0000000 u-boot-spl.stm32 |
| 317 | # mmc dev 1 |
| 318 | # mmc partconf 1 1 1 1 |
| 319 | # mmc write ${fileaddr} 0 200 |
| 320 | # mmc partconf 1 1 1 0 |
| 321 | |
Patrick Delaunay | 5d06141 | 2019-02-12 11:44:39 +0100 | [diff] [blame] | 322 | c) copy U-Boot in first GPT partition of eMMC |
Patrick Delaunay | 8d05010 | 2018-03-20 10:54:52 +0100 | [diff] [blame] | 323 | |
| 324 | # ext4load mmc 0:4 0xC0000000 u-boot.img |
| 325 | # mmc dev 1 |
| 326 | # part start mmc 1 1 partstart |
| 327 | # part size mmc 1 1 partsize |
| 328 | # mmc write ${fileaddr} ${partstart} ${partsize} |
| 329 | |
| 330 | To boot from eMMC, select BootPinMode = 0 1 0 and reset. |
Patrick Delaunay | e7f435d | 2018-07-09 15:17:22 +0200 | [diff] [blame] | 331 | |
| 332 | 9. MAC Address |
| 333 | ============== |
| 334 | |
| 335 | Please read doc/README.enetaddr for the implementation guidelines for mac id |
| 336 | usage. Basically, environment has precedence over board specific storage. |
| 337 | |
| 338 | Mac id storage and retrieval in stm32mp otp : |
| 339 | - OTP_57[31:0] = MAC_ADDR[31:0] |
| 340 | - OTP_58[15:0] = MAC_ADDR[47:32] |
| 341 | |
| 342 | To program a MAC address on virgin OTP words above, you can use the fuse command |
| 343 | on bank 0 to access to internal OTP: |
| 344 | |
| 345 | example to set mac address "12:34:56:78:9a:bc" |
| 346 | |
| 347 | 1- Write OTP |
| 348 | STM32MP> fuse prog -y 0 57 0x78563412 0x0000bc9a |
| 349 | |
| 350 | 2- Read OTP |
| 351 | STM32MP> fuse sense 0 57 2 |
| 352 | Sensing bank 0: |
| 353 | Word 0x00000039: 78563412 0000bc9a |
| 354 | |
| 355 | 3- next REBOOT : |
| 356 | ### Setting environment from OTP MAC address = "12:34:56:78:9a:bc" |
| 357 | |
| 358 | 4 check env update |
| 359 | STM32MP> print ethaddr |
| 360 | ethaddr=12:34:56:78:9a:bc |