Tom Rini | 5d32dbd | 2013-07-08 12:15:18 -0400 | [diff] [blame] | 1 | Summary |
| 2 | ======= |
| 3 | |
| 4 | This document covers various features of the 'am335x_evm' build, and some of |
| 5 | the related build targets (am335x_evm_uartN, etc). |
| 6 | |
| 7 | Hardware |
| 8 | ======== |
| 9 | |
| 10 | The binary produced by this board supports, based on parsing of the EEPROM |
| 11 | documented in TI's reference designs: |
| 12 | - AM335x GP EVM |
| 13 | - AM335x EVM SK |
| 14 | - Beaglebone White |
| 15 | - Beaglebone Black |
Tom Rini | 9e6cff3 | 2013-07-17 12:24:30 -0400 | [diff] [blame] | 16 | ' |
| 17 | NAND |
| 18 | ==== |
| 19 | |
| 20 | The AM335x GP EVM ships with a 256MiB NAND available in most profiles. In |
| 21 | this example to program the NAND we assume that an SD card has been |
| 22 | inserted with the files to write in the first SD slot and that mtdparts |
| 23 | have been configured correctly for the board. As a time saving measure we |
| 24 | load MLO into memory in one location, copy it into the three locatations |
| 25 | that the ROM checks for additional valid copies, then load U-Boot into |
| 26 | memory. We then write that whole section of memory to NAND. |
| 27 | |
| 28 | U-Boot # mmc rescan |
| 29 | U-Boot # env default -f -a |
| 30 | U-Boot # nand erase.chip |
| 31 | U-Boot # saveenv |
| 32 | U-Boot # load mmc 0 81000000 MLO |
| 33 | U-Boot # cp.b 81000000 81020000 20000 |
| 34 | U-Boot # cp.b 81000000 81040000 20000 |
| 35 | U-Boot # cp.b 81000000 81060000 20000 |
| 36 | U-Boot # load mmc 0 81080000 u-boot.img |
| 37 | U-Boot # nand write 81000000 0 260000 |
| 38 | U-Boot # load mmc 0 ${loadaddr} uImage |
| 39 | U-Boot # nand write ${loadaddr} kernel 500000 |
Tom Rini | 5d32dbd | 2013-07-08 12:15:18 -0400 | [diff] [blame] | 40 | |
Tom Rini | 9fe5cea | 2013-07-18 15:13:05 -0400 | [diff] [blame] | 41 | NOR |
| 42 | === |
| 43 | |
| 44 | The Beaglebone White can be equiped with a "memory cape" that in turn can |
| 45 | have a NOR module plugged into it. In this case it is then possible to |
| 46 | program and boot from NOR. Note that due to how U-Boot is architectured we |
| 47 | must build a specific version of U-Boot that knows we have NOR flash. This |
| 48 | build is named 'am335x_evm_nor'. Further, we have a 'am335x_evm_norboot' |
| 49 | build that will assume that the environment is on NOR rather than NAND. In |
| 50 | the following example we assume that and SD card has been populated with |
| 51 | MLO and u-boot.img from a 'am335x_evm_nor' build and also contains the |
| 52 | 'u-boot.bin' from a 'am335x_evm_norboot' build. When booting from NOR, a |
| 53 | binary must be written to the start of NOR, with no header or similar |
| 54 | prepended. In the following example we use a size of 512KiB (0x80000) |
| 55 | as that is how much space we set aside before the environment, as per |
| 56 | the config file. |
| 57 | |
| 58 | U-Boot # mmc rescan |
| 59 | U-Boot # load mmc 0 ${loadaddr} u-boot.bin |
| 60 | U-Boot # protect off 08000000 +80000 |
| 61 | U-Boot # erase 08000000 +80000 |
| 62 | U-Boot # cp.b ${loadaddr} 08000000 ${filesize} |
| 63 | |
Tom Rini | 5d32dbd | 2013-07-08 12:15:18 -0400 | [diff] [blame] | 64 | Falcon Mode |
| 65 | =========== |
| 66 | |
| 67 | The default build includes "Falcon Mode" (see doc/README.falcon) via NAND, |
| 68 | eMMC (or raw SD cards) and FAT SD cards. Our default behavior currently is |
| 69 | to read a 'c' on the console while in SPL at any point prior to loading the |
| 70 | OS payload (so as soon as possible) to opt to booting full U-Boot. Also |
| 71 | note that while one can program Falcon Mode "in place" great care needs to |
| 72 | be taken by the user to not 'brick' their setup. As these are all eval |
| 73 | boards with multiple boot methods, recovery should not be an issue in this |
| 74 | worst-case however. |
| 75 | |
| 76 | Falcon Mode: eMMC |
| 77 | ================= |
| 78 | |
| 79 | The recommended layout in this case is: |
| 80 | |
| 81 | MMC BLOCKS |--------------------------------| LOCATION IN BYTES |
| 82 | 0x0000 - 0x007F : MBR or GPT table : 0x000000 - 0x020000 |
| 83 | 0x0080 - 0x00FF : ARGS or FDT file : 0x010000 - 0x020000 |
| 84 | 0x0100 - 0x01FF : SPL.backup1 (first copy used) : 0x020000 - 0x040000 |
| 85 | 0x0200 - 0x02FF : SPL.backup2 (second copy used) : 0x040000 - 0x060000 |
| 86 | 0x0300 - 0x06FF : U-Boot : 0x060000 - 0x0e0000 |
| 87 | 0x0700 - 0x08FF : U-Boot Env + Redundant : 0x0e0000 - 0x120000 |
| 88 | 0x0900 - 0x28FF : Kernel : 0x120000 - 0x520000 |
| 89 | |
| 90 | Note that when we run 'spl export' it will prepare to boot the kernel. |
| 91 | This includes relocation of the uImage from where we loaded it to the entry |
| 92 | point defined in the header. As these locations overlap by default, it |
| 93 | would leave us with an image that if written to MMC will not boot, so |
| 94 | instead of using the loadaddr variable we use 0x81000000 in the following |
| 95 | example. In this example we are loading from the network, for simplicity, |
| 96 | and assume a valid partition table already exists and 'mmc dev' has already |
| 97 | been run to select the correct device. Also note that if you previously |
| 98 | had a FAT partition (such as on a Beaglebone Black) it is not enough to |
| 99 | write garbage into the area, you must delete it from the partition table |
| 100 | first. |
| 101 | |
| 102 | # Ensure we are able to talk with this mmc device |
| 103 | U-Boot # mmc rescan |
| 104 | U-Boot # tftp 81000000 am335x/MLO |
| 105 | # Write to two of the backup locations ROM uses |
| 106 | U-Boot # mmc write 81000000 100 100 |
| 107 | U-Boot # mmc write 81000000 200 100 |
| 108 | # Write U-Boot to the location set in the config |
| 109 | U-Boot # tftp 81000000 am335x/u-boot.img |
| 110 | U-Boot # mmc write 81000000 300 400 |
| 111 | # Load kernel and device tree into memory, perform export |
| 112 | U-Boot # tftp 81000000 am335x/uImage |
| 113 | U-Boot # run findfdt |
| 114 | U-Boot # tftp ${fdtaddr} am335x/${fdtfile} |
| 115 | U-Boot # run mmcargs |
| 116 | U-Boot # spl export fdt 81000000 - ${fdtaddr} |
| 117 | # Write the updated device tree to MMC |
| 118 | U-Boot # mmc write ${fdtaddr} 80 80 |
| 119 | # Write the uImage to MMC |
| 120 | U-Boot # mmc write 81000000 900 2000 |
| 121 | |
| 122 | Falcon Mode: FAT SD cards |
| 123 | ========================= |
| 124 | |
| 125 | In this case the additional file is written to the filesystem. In this |
| 126 | example we assume that the uImage and device tree to be used are already on |
| 127 | the FAT filesystem (only the uImage MUST be for this to function |
| 128 | afterwards) along with a Falcon Mode aware MLO and the FAT partition has |
| 129 | already been created and marked bootable: |
| 130 | |
| 131 | U-Boot # mmc rescan |
| 132 | # Load kernel and device tree into memory, perform export |
| 133 | U-Boot # load mmc 0:1 ${loadaddr} uImage |
| 134 | U-Boot # run findfdt |
| 135 | U-Boot # load mmc 0:1 ${fdtaddr} ${fdtfile} |
| 136 | U-Boot # run mmcargs |
| 137 | U-Boot # spl export fdt ${loadaddr} - ${fdtaddr} |
| 138 | |
| 139 | This will print a number of lines and then end with something like: |
| 140 | Using Device Tree in place at 80f80000, end 80f85928 |
| 141 | Using Device Tree in place at 80f80000, end 80f88928 |
| 142 | So then you: |
| 143 | |
| 144 | U-Boot # fatwrite mmc 0:1 0x80f80000 args 8928 |
| 145 | |
| 146 | Falcon Mode: NAND |
| 147 | ================= |
| 148 | |
| 149 | In this case the additional data is written to another partition of the |
| 150 | NAND. In this example we assume that the uImage and device tree to be are |
| 151 | already located on the NAND somewhere (such as fileystem or mtd partition) |
| 152 | along with a Falcon Mode aware MLO written to the correct locations for |
| 153 | booting and mtdparts have been configured correctly for the board: |
| 154 | |
| 155 | U-Boot # nand read ${loadaddr} kernel |
| 156 | U-Boot # load nand rootfs ${fdtaddr} /boot/am335x-evm.dtb |
| 157 | U-Boot # run nandargs |
| 158 | U-Boot # spl export fdt ${loadaddr} - ${fdtaddr} |
| 159 | U-Boot # nand erase.part u-boot-spl-os |
| 160 | U-Boot # nand write ${fdtaddr} u-boot-spl-os |