154d63bb1SFabio EstevamHow to use and build U-Boot on mx6sabresd 2ce2f9defSBreno Lima----------------------------------------- 39cc3ad6cSDiego Dorta 454d63bb1SFabio EstevamThe following methods can be used for booting mx6sabresd boards: 59cc3ad6cSDiego Dorta 654d63bb1SFabio Estevam1. Booting from SD card 79cc3ad6cSDiego Dorta 854d63bb1SFabio Estevam2. Booting from eMMC 954d63bb1SFabio Estevam 1054d63bb1SFabio Estevam3. Booting via Falcon mode (SPL launches the kernel directly) 1154d63bb1SFabio Estevam 1254d63bb1SFabio Estevam 1354d63bb1SFabio Estevam1. Booting from SD card via SPL 1454d63bb1SFabio Estevam------------------------------- 1554d63bb1SFabio Estevam 1654d63bb1SFabio Estevammx6sabresd_defconfig target supports mx6q/mx6dl/mx6qp sabresd variants. 1754d63bb1SFabio Estevam 1854d63bb1SFabio EstevamIn order to build it: 1954d63bb1SFabio Estevam 2054d63bb1SFabio Estevam$ make mx6sabresd_defconfig 219cc3ad6cSDiego Dorta 229cc3ad6cSDiego Dorta$ make 239cc3ad6cSDiego Dorta 24*6e2025b4SFabio EstevamThis will generate the SPL and u-boot-dtb.img binaries. 259cc3ad6cSDiego Dorta 2654d63bb1SFabio Estevam- Flash the SPL binary into the SD card: 279cc3ad6cSDiego Dorta 2854d63bb1SFabio Estevam$ sudo dd if=SPL of=/dev/sdX bs=1K seek=1 && sync 2954d63bb1SFabio Estevam 30*6e2025b4SFabio Estevam- Flash the u-boot-dtb.img binary into the SD card: 3154d63bb1SFabio Estevam 32*6e2025b4SFabio Estevam$ sudo dd if=u-boot-dtb.img of=/dev/sdX bs=1K seek=69 && sync 339cc3ad6cSDiego Dorta 349cc3ad6cSDiego Dorta 3554d63bb1SFabio Estevam2. Booting from eMMC 3654d63bb1SFabio Estevam-------------------- 37ce2f9defSBreno Lima 3854d63bb1SFabio Estevam$ make mx6sabresd_defconfig 39ce2f9defSBreno Lima 40ce2f9defSBreno Lima$ make 41ce2f9defSBreno Lima 42*6e2025b4SFabio EstevamThis will generate the SPL and u-boot-dtb.img binaries. 43ce2f9defSBreno Lima 4454d63bb1SFabio Estevam- Boot first from SD card as shown in the previous section 45ce2f9defSBreno Lima 46ce2f9defSBreno LimaIn U-boot change the eMMC partition config: 47ce2f9defSBreno Lima 48ce2f9defSBreno Lima=> mmc partconf 2 1 0 0 49ce2f9defSBreno Lima 50ce2f9defSBreno LimaMount the eMMC in the host PC: 51ce2f9defSBreno Lima 52ce2f9defSBreno Lima=> ums 0 mmc 2 53ce2f9defSBreno Lima 54*6e2025b4SFabio Estevam- Flash SPL and u-boot-dtb.img binaries into the eMMC: 55ce2f9defSBreno Lima 5654d63bb1SFabio Estevam$ sudo dd if=SPL of=/dev/sdX bs=1K seek=1 && sync 57*6e2025b4SFabio Estevam$ sudo dd if=u-boot-dtb.img of=/dev/sdX bs=1K seek=69 && sync 58ce2f9defSBreno Lima 59ce2f9defSBreno LimaSet SW6 to eMMC 8-bit boot: 11010110 60ce2f9defSBreno Lima 61ce2f9defSBreno Lima 6254d63bb1SFabio Estevam3. Booting via Falcon mode 639cc3ad6cSDiego Dorta-------------------------- 649cc3ad6cSDiego Dorta 6554d63bb1SFabio Estevam$ make mx6sabresd_defconfig 669cc3ad6cSDiego Dorta$ make 679cc3ad6cSDiego Dorta 68*6e2025b4SFabio EstevamThis will generate the SPL image called SPL and the u-boot-dtb.img. 699cc3ad6cSDiego Dorta 709cc3ad6cSDiego Dorta- Flash the SPL image into the SD card: 719cc3ad6cSDiego Dorta 7254d63bb1SFabio Estevam$ sudo dd if=SPL of=/dev/sdX bs=1K seek=1 oflag=sync status=none && sync 739cc3ad6cSDiego Dorta 74*6e2025b4SFabio Estevam- Flash the u-boot-dtb.img image into the SD card: 759cc3ad6cSDiego Dorta 76*6e2025b4SFabio Estevam$ sudo dd if=u-boot-dtb.img of=/dev/sdX bs=1K seek=69 oflag=sync status=none && sync 779cc3ad6cSDiego Dorta 789cc3ad6cSDiego DortaCreate a partition for root file system and extract it there: 799cc3ad6cSDiego Dorta 809cc3ad6cSDiego Dorta$ sudo tar xvf rootfs.tar.gz -C /media/root 819cc3ad6cSDiego Dorta 829cc3ad6cSDiego DortaThe SD card must have enough space for raw "args" and "kernel". 839cc3ad6cSDiego DortaTo configure Falcon mode for the first time, on U-Boot do the following commands: 849cc3ad6cSDiego Dorta 859cc3ad6cSDiego Dorta- Setup the IP server: 869cc3ad6cSDiego Dorta 879cc3ad6cSDiego Dorta# setenv serverip <server_ip_address> 889cc3ad6cSDiego Dorta 899cc3ad6cSDiego Dorta- Download dtb file: 909cc3ad6cSDiego Dorta 919cc3ad6cSDiego Dorta# dhcp ${fdt_addr} imx6q-sabresd.dtb 929cc3ad6cSDiego Dorta 939cc3ad6cSDiego Dorta- Download kernel image: 949cc3ad6cSDiego Dorta 959cc3ad6cSDiego Dorta# dhcp ${loadaddr} uImage 969cc3ad6cSDiego Dorta 979cc3ad6cSDiego Dorta- Write kernel at 2MB offset: 989cc3ad6cSDiego Dorta 999cc3ad6cSDiego Dorta# mmc write ${loadaddr} 0x1000 0x4000 1009cc3ad6cSDiego Dorta 1019cc3ad6cSDiego Dorta- Setup kernel bootargs: 1029cc3ad6cSDiego Dorta 1039cc3ad6cSDiego Dorta# setenv bootargs "console=ttymxc0,115200 root=/dev/mmcblk1p1 rootfstype=ext4 rootwait quiet rw" 1049cc3ad6cSDiego Dorta 1059cc3ad6cSDiego Dorta- Prepare args: 1069cc3ad6cSDiego Dorta 1079cc3ad6cSDiego Dorta# spl export fdt ${loadaddr} - ${fdt_addr} 1089cc3ad6cSDiego Dorta 1099cc3ad6cSDiego Dorta- Write args 1MB data (0x800 sectors) to 1MB offset (0x800 sectors) 1109cc3ad6cSDiego Dorta 1119cc3ad6cSDiego Dorta# mmc write 18000000 0x800 0x800 1129cc3ad6cSDiego Dorta 1139cc3ad6cSDiego Dorta- Press KEY_VOL_UP key, power up the board and then SPL binary will 1149cc3ad6cSDiego Dortalaunch the kernel directly. 115