Tom Rini | 0b9b95a | 2021-09-11 08:57:31 -0400 | [diff] [blame] | 1 | .. SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause |
| 2 | .. sectionauthor:: Tom Rini <trini@konsulko.com> |
| 3 | |
Bryan Brattlof | 10d3f17 | 2022-12-19 14:29:49 -0600 | [diff] [blame] | 4 | AM335x Generation |
| 5 | ================= |
| 6 | |
Tom Rini | 5d32dbd | 2013-07-08 12:15:18 -0400 | [diff] [blame] | 7 | Summary |
Bryan Brattlof | 10d3f17 | 2022-12-19 14:29:49 -0600 | [diff] [blame] | 8 | ------- |
Tom Rini | 5d32dbd | 2013-07-08 12:15:18 -0400 | [diff] [blame] | 9 | |
Tom Rini | 90b24ff | 2021-09-11 08:57:32 -0400 | [diff] [blame] | 10 | This document covers various features of the `am335x_evm` default |
| 11 | configuration, some of the related defconfigs, and how to enable hardware |
| 12 | features not present by default in the defconfigs. |
Tom Rini | 5d32dbd | 2013-07-08 12:15:18 -0400 | [diff] [blame] | 13 | |
| 14 | Hardware |
Tom Rini | 0b9b95a | 2021-09-11 08:57:31 -0400 | [diff] [blame] | 15 | -------- |
Tom Rini | 5d32dbd | 2013-07-08 12:15:18 -0400 | [diff] [blame] | 16 | |
| 17 | The binary produced by this board supports, based on parsing of the EEPROM |
| 18 | documented in TI's reference designs: |
Tom Rini | 0b9b95a | 2021-09-11 08:57:31 -0400 | [diff] [blame] | 19 | * AM335x GP EVM |
| 20 | * AM335x EVM SK |
Tom Rini | 90b24ff | 2021-09-11 08:57:32 -0400 | [diff] [blame] | 21 | * The Beaglebone family of designs |
Tom Rini | 50bbca7 | 2013-08-20 08:53:50 -0400 | [diff] [blame] | 22 | |
| 23 | Customization |
Tom Rini | 0b9b95a | 2021-09-11 08:57:31 -0400 | [diff] [blame] | 24 | ------------- |
Tom Rini | 50bbca7 | 2013-08-20 08:53:50 -0400 | [diff] [blame] | 25 | |
| 26 | Given that all of the above boards are reference platforms (and the |
| 27 | Beaglebone platforms are OSHA), it is likely that this platform code and |
| 28 | configuration will be used as the basis of a custom platform. It is |
| 29 | worth noting that aside from things such as NAND or MMC only being |
| 30 | required if a custom platform makes use of these blocks, the following |
| 31 | are required, depending on design: |
| 32 | |
Tom Rini | 0b9b95a | 2021-09-11 08:57:31 -0400 | [diff] [blame] | 33 | * GPIO is only required if DDR3 power is controlled in a way similar to EVM SK |
| 34 | * SPI is only required for SPI flash, or exposing the SPI bus. |
Tom Rini | 50bbca7 | 2013-08-20 08:53:50 -0400 | [diff] [blame] | 35 | |
| 36 | The following blocks are required: |
Tom Rini | 0b9b95a | 2021-09-11 08:57:31 -0400 | [diff] [blame] | 37 | |
| 38 | * I2C, to talk with the PMIC and ensure that we do not run afoul of |
Tom Rini | 50bbca7 | 2013-08-20 08:53:50 -0400 | [diff] [blame] | 39 | errata 1.0.24. |
| 40 | |
Tom Rini | 90b24ff | 2021-09-11 08:57:32 -0400 | [diff] [blame] | 41 | When removing options as part of customization, note that you will likely need |
| 42 | to look at both `include/configs/am335x_evm.h`, |
| 43 | `include/configs/ti_am335x_common.h` and `include/configs/am335x_evm.h` as the |
| 44 | migration to Kconfig is not yet complete. |
Tom Rini | 50bbca7 | 2013-08-20 08:53:50 -0400 | [diff] [blame] | 45 | |
Neha Malcom Francis | b61ad15 | 2023-09-08 15:06:16 +0530 | [diff] [blame] | 46 | Secure Boot |
| 47 | ----------- |
| 48 | |
| 49 | .. secure_boot_include_start_config_ti_secure_device |
| 50 | |
| 51 | Secure TI devices require a boot image that is authenticated by ROM |
| 52 | code to function. Without this, even JTAG remains locked and the |
| 53 | device is essentially useless. In order to create a valid boot image for |
| 54 | a secure device from TI, the initial public software image must be signed |
| 55 | and combined with various headers, certificates, and other binary images. |
| 56 | |
| 57 | Information on the details on the complete boot image format can be obtained |
| 58 | from Texas Instruments. The tools used to generate boot images for secure |
| 59 | devices are part of a secure development package (SECDEV) that can be |
| 60 | downloaded from: |
| 61 | |
Nishanth Menon | eaa39c6 | 2023-11-01 15:56:03 -0500 | [diff] [blame] | 62 | https://www.ti.com/mysecuresoftware (login required) |
Neha Malcom Francis | b61ad15 | 2023-09-08 15:06:16 +0530 | [diff] [blame] | 63 | |
| 64 | The secure development package is access controlled due to NDA and export |
| 65 | control restrictions. Access must be requested and granted by TI before the |
| 66 | package is viewable and downloadable. Contact TI, either online or by way |
| 67 | of a local TI representative, to request access. |
| 68 | |
| 69 | .. secure_boot_include_end_config_ti_secure_device |
| 70 | |
| 71 | .. secure_boot_include_start_spl_boot |
| 72 | |
| 73 | 1. Booting of U-Boot SPL |
| 74 | ^^^^^^^^^^^^^^^^^^^^^^^^ |
| 75 | |
| 76 | When CONFIG_TI_SECURE_DEVICE is set, the U-Boot SPL build process |
| 77 | requires the presence and use of these tools in order to create a |
| 78 | viable boot image. The build process will look for the environment |
| 79 | variable TI_SECURE_DEV_PKG, which should be the path of the installed |
| 80 | SECDEV package. If the TI_SECURE_DEV_PKG variable is not defined or |
| 81 | if it is defined but doesn't point to a valid SECDEV package, a |
| 82 | warning is issued during the build to indicate that a final secure |
| 83 | bootable image was not created. |
| 84 | |
| 85 | Within the SECDEV package exists an image creation script: |
| 86 | |
Nishanth Menon | 740c41c | 2023-11-02 23:40:25 -0500 | [diff] [blame] | 87 | .. prompt:: bash $ |
Neha Malcom Francis | b61ad15 | 2023-09-08 15:06:16 +0530 | [diff] [blame] | 88 | |
| 89 | ${TI_SECURE_DEV_PKG}/scripts/create-boot-image.sh |
| 90 | |
| 91 | This is called as part of the SPL/u-boot build process. As the secure |
| 92 | boot image formats and requirements differ between secure SOC from TI, |
| 93 | the purpose of this script is to abstract these details as much as |
| 94 | possible. |
| 95 | |
| 96 | The script is basically the only required interface to the TI SECDEV |
| 97 | package for creating a bootable SPL image for secure TI devices. |
| 98 | |
Nishanth Menon | 740c41c | 2023-11-02 23:40:25 -0500 | [diff] [blame] | 99 | .. prompt:: bash $ |
Neha Malcom Francis | b61ad15 | 2023-09-08 15:06:16 +0530 | [diff] [blame] | 100 | |
| 101 | create-boot-image.sh \ |
| 102 | <IMAGE_FLAG> <INPUT_FILE> <OUTPUT_FILE> <SPL_LOAD_ADDR> |
| 103 | |
| 104 | .. secure_boot_include_end_spl_boot |
| 105 | |
| 106 | <IMAGE_FLAG> is a value that specifies the type of the image to |
| 107 | generate OR the action the image generation tool will take. Valid |
| 108 | values are: |
| 109 | |
| 110 | .. list-table:: |
| 111 | :widths: 25 25 |
| 112 | :header-rows: 0 |
| 113 | |
| 114 | * - PI_X-LOADER |
| 115 | - Generates an image for SPI flash (byte swapped) |
| 116 | * - X-LOADER |
| 117 | - Generates an image for non-XIP flash |
| 118 | * - MLO |
| 119 | - Generates an image for SD/MMC/eMMC media |
| 120 | * - 2ND |
| 121 | - Generates an image for USB, UART and Ethernet |
| 122 | * - XIP_X-LOADER |
| 123 | - Generates a single stage u-boot for NOR/QSPI XiP |
| 124 | |
| 125 | <INPUT_FILE> is the full path and filename of the public world boot |
| 126 | loaderbinary file (depending on the boot media, this is usually |
| 127 | either u-boot-spl.bin or u-boot.bin). |
| 128 | |
| 129 | <OUTPUT_FILE> is the full path and filename of the final secure |
| 130 | image. The output binary images should be used in place of the standard |
| 131 | non-secure binary images (see the platform-specific user's guides and |
| 132 | releases notes for how the non-secure images are typically used) |
| 133 | |
| 134 | .. list-table:: |
| 135 | :widths: 25 25 |
| 136 | :header-rows: 0 |
| 137 | |
| 138 | * - u-boot-spl_HS_SPI_X-LOADER |
| 139 | - byte swapped boot image for SPI flash |
| 140 | * - u-boot-spl_HS_X-LOADER |
| 141 | - boot image for NAND or SD/MMC/eMMC rawmode |
| 142 | * - u-boot-spl_HS_MLO |
| 143 | - boot image for SD/MMC/eMMC media |
| 144 | * - u-boot-spl_HS_2ND |
| 145 | - boot image for USB, UART and Ethernet |
| 146 | * - u-boot_HS_XIP_X-LOADER |
| 147 | - boot image for NOR or QSPI Xip flash |
| 148 | |
| 149 | <SPL_LOAD_ADDR> is the address at which SOC ROM should load the |
| 150 | <INPUT_FILE> |
| 151 | |
| 152 | .. secure_boot_include_start_primary_u_boot |
| 153 | |
| 154 | 2. Booting of Primary U-Boot (u-boot.img) |
| 155 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 156 | |
| 157 | The SPL image is responsible for loading the next stage boot loader, |
| 158 | which is the main u-boot image. For secure TI devices, the SPL will |
| 159 | be authenticated, as described above, as part of the particular |
| 160 | device's ROM boot process. In order to continue the secure boot |
| 161 | process, the authenticated SPL must authenticate the main u-boot |
| 162 | image that it loads. |
| 163 | |
| 164 | The configurations for secure TI platforms are written to make the boot |
| 165 | process use the FIT image format for the u-boot.img (CONFIG_SPL_FRAMEWORK |
| 166 | and CONFIG_SPL_LOAD_FIT). With these configurations the binary |
| 167 | components that the SPL loads include a specific DTB image and u-boot |
| 168 | image. These DTB image may be one of many available to the boot |
| 169 | process. In order to secure these components so that they can be |
| 170 | authenticated by the SPL as they are loaded from the FIT image, the |
| 171 | build procedure for secure TI devices will secure these images before |
| 172 | they are integrated into the FIT image. When those images are extracted |
| 173 | from the FIT image at boot time, they are post-processed to verify that |
| 174 | they are still secure. The outlined security-related SPL post-processing |
| 175 | is enabled through the CONFIG_SPL_FIT_IMAGE_POST_PROCESS option which |
| 176 | must be enabled for the secure boot scheme to work. In order to allow |
| 177 | verifying proper operation of the secure boot chain in case of successful |
| 178 | authentication messages like "Authentication passed" are output by the |
| 179 | SPL to the console for each blob that got extracted from the FIT image. |
| 180 | |
| 181 | The exact details of the how the images are secured is handled by the |
| 182 | SECDEV package. Within the SECDEV package exists a script to process |
| 183 | an input binary image: |
| 184 | |
Nishanth Menon | 740c41c | 2023-11-02 23:40:25 -0500 | [diff] [blame] | 185 | .. prompt:: bash $ |
Neha Malcom Francis | b61ad15 | 2023-09-08 15:06:16 +0530 | [diff] [blame] | 186 | |
| 187 | ${TI_SECURE_DEV_PKG}/scripts/secure-binary-image.sh |
| 188 | |
| 189 | This is called as part of the u-boot build process. As the secure |
| 190 | image formats and requirements can differ between the various secure |
| 191 | SOCs from TI, this script in the SECDEV package abstracts these |
| 192 | details. This script is essentially the only required interface to the |
| 193 | TI SECDEV package for creating a u-boot.img image for secure TI |
| 194 | devices. |
| 195 | |
| 196 | The SPL/u-boot code contains calls to dedicated secure ROM functions |
| 197 | to perform the validation on the secured images. The details of the |
| 198 | interface to those functions is shown in the code. The summary |
| 199 | is that they are accessed by invoking an ARM secure monitor call to |
| 200 | the device's secure ROM (fixed read-only-memory that is secure and |
| 201 | only accessible when the ARM core is operating in the secure mode). |
| 202 | |
| 203 | Invoking the secure-binary-image script for Secure Devices |
| 204 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 205 | |
Nishanth Menon | 740c41c | 2023-11-02 23:40:25 -0500 | [diff] [blame] | 206 | .. prompt:: bash $ |
Neha Malcom Francis | b61ad15 | 2023-09-08 15:06:16 +0530 | [diff] [blame] | 207 | |
| 208 | secure-binary-image.sh <INPUT_FILE> <OUTPUT_FILE> |
| 209 | |
| 210 | <INPUT_FILE> is the full path and filename of the input binary image |
| 211 | |
| 212 | <OUTPUT_FILE> is the full path and filename of the output secure image. |
| 213 | |
| 214 | .. secure_boot_include_end_primary_u_boot |
| 215 | |
Tom Rini | 9e6cff3 | 2013-07-17 12:24:30 -0400 | [diff] [blame] | 216 | NAND |
Tom Rini | 0b9b95a | 2021-09-11 08:57:31 -0400 | [diff] [blame] | 217 | ---- |
Tom Rini | 9e6cff3 | 2013-07-17 12:24:30 -0400 | [diff] [blame] | 218 | |
| 219 | The AM335x GP EVM ships with a 256MiB NAND available in most profiles. In |
| 220 | this example to program the NAND we assume that an SD card has been |
| 221 | inserted with the files to write in the first SD slot and that mtdparts |
pekon gupta | b770903 | 2013-11-19 11:02:18 +0530 | [diff] [blame] | 222 | have been configured correctly for the board. All images are first loaded |
| 223 | into memory, then written to NAND. |
| 224 | |
Neha Malcom Francis | b61ad15 | 2023-09-08 15:06:16 +0530 | [diff] [blame] | 225 | 1. Building u-boot for NAND boot |
pekon gupta | b770903 | 2013-11-19 11:02:18 +0530 | [diff] [blame] | 226 | |
Neha Malcom Francis | b61ad15 | 2023-09-08 15:06:16 +0530 | [diff] [blame] | 227 | .. list-table:: CONFIGxx options for NAND device |
| 228 | :widths: 25 25 |
| 229 | :header-rows: 1 |
Tom Rini | 0b9b95a | 2021-09-11 08:57:31 -0400 | [diff] [blame] | 230 | |
Neha Malcom Francis | b61ad15 | 2023-09-08 15:06:16 +0530 | [diff] [blame] | 231 | * - Config |
| 232 | - Description |
| 233 | * - CONFIG_SYS_NAND_PAGE_SIZE |
| 234 | - number of main bytes in NAND page |
| 235 | * - CONFIG_SYS_NAND_OOBSIZE |
| 236 | - number of OOB bytes in NAND page |
| 237 | * - CONFIG_SYS_NAND_BLOCK_SIZE |
| 238 | - number of bytes in NAND erase-block |
| 239 | * - CFG_SYS_NAND_ECCPOS |
| 240 | - ECC map for NAND page |
| 241 | * - CONFIG_NAND_OMAP_ECCSCHEME |
| 242 | - (refer doc/README.nand) |
Tom Rini | 0b9b95a | 2021-09-11 08:57:31 -0400 | [diff] [blame] | 243 | |
Neha Malcom Francis | b61ad15 | 2023-09-08 15:06:16 +0530 | [diff] [blame] | 244 | 2. Flashing NAND via MMC/SD |
Tom Rini | 9e6cff3 | 2013-07-17 12:24:30 -0400 | [diff] [blame] | 245 | |
Nishanth Menon | 740c41c | 2023-11-02 23:40:25 -0500 | [diff] [blame] | 246 | .. prompt:: bash => |
Neha Malcom Francis | b61ad15 | 2023-09-08 15:06:16 +0530 | [diff] [blame] | 247 | |
| 248 | # select BOOTSEL to MMC/SD boot and boot from MMC/SD card |
| 249 | mmc rescan |
| 250 | # erase flash |
| 251 | nand erase.chip |
| 252 | env default -f -a |
| 253 | saveenv |
| 254 | # flash MLO. Redundant copies of MLO are kept for failsafe |
| 255 | load mmc 0 0x82000000 MLO |
| 256 | nand write 0x82000000 0x00000 0x20000 |
| 257 | nand write 0x82000000 0x20000 0x20000 |
| 258 | nand write 0x82000000 0x40000 0x20000 |
| 259 | nand write 0x82000000 0x60000 0x20000 |
| 260 | # flash u-boot.img |
| 261 | load mmc 0 0x82000000 u-boot.img |
| 262 | nand write 0x82000000 0x80000 0x60000 |
| 263 | # flash kernel image |
| 264 | load mmc 0 0x82000000 uImage |
| 265 | nand write 0x82000000 ${nandsrcaddr} ${nandimgsize} |
| 266 | # flash filesystem image |
| 267 | load mmc 0 0x82000000 filesystem.img |
| 268 | nand write 0x82000000 ${loadaddress} 0x300000 |
| 269 | |
| 270 | 3. Set BOOTSEL pin to select NAND boot, and POR the device. |
pekon gupta | b770903 | 2013-11-19 11:02:18 +0530 | [diff] [blame] | 271 | The device should boot from images flashed on NAND device. |
Tom Rini | 5d32dbd | 2013-07-08 12:15:18 -0400 | [diff] [blame] | 272 | |
Tom Rini | 9fe5cea | 2013-07-18 15:13:05 -0400 | [diff] [blame] | 273 | |
Tom Rini | 5d32dbd | 2013-07-08 12:15:18 -0400 | [diff] [blame] | 274 | Falcon Mode |
Tom Rini | 0b9b95a | 2021-09-11 08:57:31 -0400 | [diff] [blame] | 275 | ----------- |
Tom Rini | 5d32dbd | 2013-07-08 12:15:18 -0400 | [diff] [blame] | 276 | |
| 277 | The default build includes "Falcon Mode" (see doc/README.falcon) via NAND, |
| 278 | eMMC (or raw SD cards) and FAT SD cards. Our default behavior currently is |
| 279 | to read a 'c' on the console while in SPL at any point prior to loading the |
| 280 | OS payload (so as soon as possible) to opt to booting full U-Boot. Also |
| 281 | note that while one can program Falcon Mode "in place" great care needs to |
| 282 | be taken by the user to not 'brick' their setup. As these are all eval |
| 283 | boards with multiple boot methods, recovery should not be an issue in this |
| 284 | worst-case however. |
| 285 | |
| 286 | Falcon Mode: eMMC |
Tom Rini | 0b9b95a | 2021-09-11 08:57:31 -0400 | [diff] [blame] | 287 | ----------------- |
Tom Rini | 5d32dbd | 2013-07-08 12:15:18 -0400 | [diff] [blame] | 288 | |
| 289 | The recommended layout in this case is: |
| 290 | |
Neha Malcom Francis | b61ad15 | 2023-09-08 15:06:16 +0530 | [diff] [blame] | 291 | .. list-table:: eMMC Recommended Layout |
| 292 | :widths: 25 25 50 |
| 293 | :header-rows: 1 |
Tom Rini | 0b9b95a | 2021-09-11 08:57:31 -0400 | [diff] [blame] | 294 | |
Neha Malcom Francis | b61ad15 | 2023-09-08 15:06:16 +0530 | [diff] [blame] | 295 | * - MMC Blocks |
| 296 | - Description |
| 297 | - Location in bytes |
| 298 | * - 0x0000 - 0x007F |
| 299 | - MBR or GPT table |
| 300 | - 0x000000 - 0x020000 |
| 301 | * - 0x0080 - 0x00FF |
| 302 | - ARGS or FDT file |
| 303 | - 0x010000 - 0x020000 |
| 304 | * - 0x0100 - 0x01FF |
| 305 | - SPL.backup1 (first copy used) |
| 306 | - 0x020000 - 0x040000 |
| 307 | * - 0x0200 - 0x02FF |
| 308 | - SPL.backup2 (second copy used) |
| 309 | - 0x040000 - 0x060000 |
| 310 | * - 0x0300 - 0x06FF |
| 311 | - U-Boot |
| 312 | - 0x060000 - 0x0e0000 |
| 313 | * - 0x0700 - 0x08FF |
| 314 | - U-Boot Env + Redundant |
| 315 | - 0x0e0000 - 0x120000 |
| 316 | * - 0x0900 - 0x28FF |
| 317 | - Kernel |
| 318 | - 0x120000 - 0x520000 |
Tom Rini | 5d32dbd | 2013-07-08 12:15:18 -0400 | [diff] [blame] | 319 | |
| 320 | Note that when we run 'spl export' it will prepare to boot the kernel. |
| 321 | This includes relocation of the uImage from where we loaded it to the entry |
| 322 | point defined in the header. As these locations overlap by default, it |
| 323 | would leave us with an image that if written to MMC will not boot, so |
| 324 | instead of using the loadaddr variable we use 0x81000000 in the following |
| 325 | example. In this example we are loading from the network, for simplicity, |
| 326 | and assume a valid partition table already exists and 'mmc dev' has already |
| 327 | been run to select the correct device. Also note that if you previously |
| 328 | had a FAT partition (such as on a Beaglebone Black) it is not enough to |
| 329 | write garbage into the area, you must delete it from the partition table |
| 330 | first. |
| 331 | |
Nishanth Menon | 740c41c | 2023-11-02 23:40:25 -0500 | [diff] [blame] | 332 | .. prompt:: bash => |
Tom Rini | 0b9b95a | 2021-09-11 08:57:31 -0400 | [diff] [blame] | 333 | |
Neha Malcom Francis | b61ad15 | 2023-09-08 15:06:16 +0530 | [diff] [blame] | 334 | # Ensure we are able to talk with this mmc device |
| 335 | mmc rescan |
| 336 | tftp 81000000 am335x/MLO |
| 337 | # Write to two of the backup locations ROM uses |
| 338 | mmc write 81000000 100 100 |
| 339 | mmc write 81000000 200 100 |
| 340 | # Write U-Boot to the location set in the config |
| 341 | tftp 81000000 am335x/u-boot.img |
| 342 | mmc write 81000000 300 400 |
| 343 | # Load kernel and device tree into memory, perform export |
| 344 | tftp 81000000 am335x/uImage |
| 345 | run findfdt |
| 346 | tftp ${fdtaddr} am335x/${fdtfile} |
| 347 | run mmcargs |
| 348 | spl export fdt 81000000 - ${fdtaddr} |
| 349 | # Write the updated device tree to MMC |
| 350 | mmc write ${fdtaddr} 80 80 |
| 351 | # Write the uImage to MMC |
| 352 | mmc write 81000000 900 2000 |
Tom Rini | 5d32dbd | 2013-07-08 12:15:18 -0400 | [diff] [blame] | 353 | |
| 354 | Falcon Mode: FAT SD cards |
Tom Rini | 0b9b95a | 2021-09-11 08:57:31 -0400 | [diff] [blame] | 355 | ------------------------- |
Tom Rini | 5d32dbd | 2013-07-08 12:15:18 -0400 | [diff] [blame] | 356 | |
| 357 | In this case the additional file is written to the filesystem. In this |
| 358 | example we assume that the uImage and device tree to be used are already on |
| 359 | the FAT filesystem (only the uImage MUST be for this to function |
| 360 | afterwards) along with a Falcon Mode aware MLO and the FAT partition has |
| 361 | already been created and marked bootable: |
| 362 | |
Nishanth Menon | 740c41c | 2023-11-02 23:40:25 -0500 | [diff] [blame] | 363 | .. prompt:: bash => |
Tom Rini | 0b9b95a | 2021-09-11 08:57:31 -0400 | [diff] [blame] | 364 | |
Neha Malcom Francis | b61ad15 | 2023-09-08 15:06:16 +0530 | [diff] [blame] | 365 | mmc rescan |
| 366 | # Load kernel and device tree into memory, perform export |
| 367 | load mmc 0:1 ${loadaddr} uImage |
| 368 | run findfdt |
| 369 | load mmc 0:1 ${fdtaddr} ${fdtfile} |
| 370 | run mmcargs |
| 371 | spl export fdt ${loadaddr} - ${fdtaddr} |
Tom Rini | 5d32dbd | 2013-07-08 12:15:18 -0400 | [diff] [blame] | 372 | |
| 373 | This will print a number of lines and then end with something like: |
Tom Rini | 0b9b95a | 2021-09-11 08:57:31 -0400 | [diff] [blame] | 374 | |
Neha Malcom Francis | b61ad15 | 2023-09-08 15:06:16 +0530 | [diff] [blame] | 375 | .. code-block:: bash |
Tom Rini | 0b9b95a | 2021-09-11 08:57:31 -0400 | [diff] [blame] | 376 | |
Neha Malcom Francis | b61ad15 | 2023-09-08 15:06:16 +0530 | [diff] [blame] | 377 | Using Device Tree in place at 80f80000, end 80f85928 |
| 378 | Using Device Tree in place at 80f80000, end 80f88928 |
Tom Rini | 0b9b95a | 2021-09-11 08:57:31 -0400 | [diff] [blame] | 379 | |
Tom Rini | 5d32dbd | 2013-07-08 12:15:18 -0400 | [diff] [blame] | 380 | So then you: |
| 381 | |
Nishanth Menon | 740c41c | 2023-11-02 23:40:25 -0500 | [diff] [blame] | 382 | .. prompt:: bash => |
Tom Rini | 0b9b95a | 2021-09-11 08:57:31 -0400 | [diff] [blame] | 383 | |
Neha Malcom Francis | b61ad15 | 2023-09-08 15:06:16 +0530 | [diff] [blame] | 384 | fatwrite mmc 0:1 0x80f80000 args 8928 |
Tom Rini | 5d32dbd | 2013-07-08 12:15:18 -0400 | [diff] [blame] | 385 | |
| 386 | Falcon Mode: NAND |
Tom Rini | 0b9b95a | 2021-09-11 08:57:31 -0400 | [diff] [blame] | 387 | ----------------- |
Tom Rini | 5d32dbd | 2013-07-08 12:15:18 -0400 | [diff] [blame] | 388 | |
| 389 | In this case the additional data is written to another partition of the |
| 390 | NAND. In this example we assume that the uImage and device tree to be are |
Jeremiah Mahler | bec3d9d | 2015-01-06 16:40:28 -0800 | [diff] [blame] | 391 | already located on the NAND somewhere (such as filesystem or mtd partition) |
Tom Rini | 5d32dbd | 2013-07-08 12:15:18 -0400 | [diff] [blame] | 392 | along with a Falcon Mode aware MLO written to the correct locations for |
| 393 | booting and mtdparts have been configured correctly for the board: |
| 394 | |
Nishanth Menon | 740c41c | 2023-11-02 23:40:25 -0500 | [diff] [blame] | 395 | .. prompt:: bash => |
Tom Rini | 0b9b95a | 2021-09-11 08:57:31 -0400 | [diff] [blame] | 396 | |
Neha Malcom Francis | b61ad15 | 2023-09-08 15:06:16 +0530 | [diff] [blame] | 397 | nand read ${loadaddr} kernel |
| 398 | load nand rootfs ${fdtaddr} /boot/am335x-evm.dtb |
| 399 | run nandargs |
| 400 | spl export fdt ${loadaddr} - ${fdtaddr} |
| 401 | nand erase.part u-boot-spl-os |
| 402 | nand write ${fdtaddr} u-boot-spl-os |
Miquel Raynal | 1b9d2a0 | 2023-08-07 08:42:41 +0200 | [diff] [blame] | 403 | |
| 404 | USB device |
| 405 | ---------- |
| 406 | |
| 407 | The platform code for am33xx based designs is legacy in the sense that |
| 408 | it is not fully compliant with the driver model in its management of the |
| 409 | various resources. This is particularly true for the USB Ethernet gadget |
| 410 | which will automatically be bound to the first USB Device Controller |
| 411 | (UDC). This make the USB Ethernet gadget work out of the box on common |
| 412 | boards like the Beagle Bone Blacks and by default will prevents other |
| 413 | gadgets to be used. |
| 414 | |
| 415 | The output of the 'dm tree' command shows which driver is bound to which |
| 416 | device, so the user can easily configure their platform differently from |
| 417 | the command line: |
| 418 | |
Nishanth Menon | 740c41c | 2023-11-02 23:40:25 -0500 | [diff] [blame] | 419 | .. prompt:: bash => |
Neha Malcom Francis | b61ad15 | 2023-09-08 15:06:16 +0530 | [diff] [blame] | 420 | |
| 421 | dm tree |
| 422 | |
Miquel Raynal | 1b9d2a0 | 2023-08-07 08:42:41 +0200 | [diff] [blame] | 423 | .. code-block:: text |
| 424 | |
Neha Malcom Francis | b61ad15 | 2023-09-08 15:06:16 +0530 | [diff] [blame] | 425 | Class Index Probed Driver Name |
| 426 | ----------------------------------------------------------- |
| 427 | [...] |
| 428 | misc 0 [ + ] ti-musb-wrapper | |-- usb@47400000 |
| 429 | usb 0 [ + ] ti-musb-peripheral | | |-- usb@47401000 |
| 430 | ethernet 1 [ + ] usb_ether | | | `-- usb_ether |
| 431 | bootdev 3 [ ] eth_bootdev | | | `-- usb_ether.bootdev |
| 432 | usb 0 [ ] ti-musb-host | | `-- usb@47401800 |
Miquel Raynal | 1b9d2a0 | 2023-08-07 08:42:41 +0200 | [diff] [blame] | 433 | |
| 434 | Typically here any network command performed using the usb_ether |
| 435 | interface would work, while using other gadgets would fail: |
| 436 | |
Nishanth Menon | 740c41c | 2023-11-02 23:40:25 -0500 | [diff] [blame] | 437 | .. prompt:: bash => |
Neha Malcom Francis | b61ad15 | 2023-09-08 15:06:16 +0530 | [diff] [blame] | 438 | |
| 439 | fastboot usb 0 |
| 440 | |
Miquel Raynal | 1b9d2a0 | 2023-08-07 08:42:41 +0200 | [diff] [blame] | 441 | .. code-block:: text |
| 442 | |
Neha Malcom Francis | b61ad15 | 2023-09-08 15:06:16 +0530 | [diff] [blame] | 443 | All UDC in use (1 available), use the unbind command |
| 444 | g_dnl_register: failed!, error: -19 |
| 445 | exit not allowed from main input shell. |
Miquel Raynal | 1b9d2a0 | 2023-08-07 08:42:41 +0200 | [diff] [blame] | 446 | |
| 447 | As hinted by the primary error message, the only controller available |
| 448 | (usb@47401000) is currently bound to the usb_ether driver, which makes |
| 449 | it impossible for the fastboot command to bind with this device (at |
| 450 | least from a bootloader point of view). The solution here would be to |
| 451 | use the unbind command specifying the class and index parameters (as |
| 452 | shown above in the 'dm tree' output) to target the driver to unbind: |
| 453 | |
Nishanth Menon | 740c41c | 2023-11-02 23:40:25 -0500 | [diff] [blame] | 454 | .. prompt:: bash => |
Miquel Raynal | 1b9d2a0 | 2023-08-07 08:42:41 +0200 | [diff] [blame] | 455 | |
Neha Malcom Francis | b61ad15 | 2023-09-08 15:06:16 +0530 | [diff] [blame] | 456 | unbind ethernet 1 |
Miquel Raynal | 1b9d2a0 | 2023-08-07 08:42:41 +0200 | [diff] [blame] | 457 | |
| 458 | The output of the 'dm tree' command now shows the availability of the |
| 459 | first USB device controller, the fastboot gadget will now be able to |
| 460 | bind with it: |
| 461 | |
Nishanth Menon | 740c41c | 2023-11-02 23:40:25 -0500 | [diff] [blame] | 462 | .. prompt:: bash => |
Neha Malcom Francis | b61ad15 | 2023-09-08 15:06:16 +0530 | [diff] [blame] | 463 | |
| 464 | dm tree |
| 465 | |
Miquel Raynal | 1b9d2a0 | 2023-08-07 08:42:41 +0200 | [diff] [blame] | 466 | .. code-block:: text |
| 467 | |
Neha Malcom Francis | b61ad15 | 2023-09-08 15:06:16 +0530 | [diff] [blame] | 468 | Class Index Probed Driver Name |
| 469 | ----------------------------------------------------------- |
| 470 | [...] |
| 471 | misc 0 [ + ] ti-musb-wrapper | |-- usb@47400000 |
| 472 | usb 0 [ ] ti-musb-peripheral | | |-- usb@47401000 |
| 473 | usb 0 [ ] ti-musb-host | | `-- usb@47401800 |