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