xref: /openbmc/u-boot/board/freescale/mx6sabresd/README (revision 54d63bb1ad4fbf95e7136a4fef819e4631adbc39)
1*54d63bb1SFabio EstevamHow to use and build U-Boot on mx6sabresd
2ce2f9defSBreno Lima-----------------------------------------
39cc3ad6cSDiego Dorta
4*54d63bb1SFabio EstevamThe following methods can be used for booting mx6sabresd boards:
59cc3ad6cSDiego Dorta
6*54d63bb1SFabio Estevam1. Booting from SD card
79cc3ad6cSDiego Dorta
8*54d63bb1SFabio Estevam2. Booting from eMMC
9*54d63bb1SFabio Estevam
10*54d63bb1SFabio Estevam3. Booting via Falcon mode (SPL launches the kernel directly)
11*54d63bb1SFabio Estevam
12*54d63bb1SFabio Estevam
13*54d63bb1SFabio Estevam1. Booting from SD card via SPL
14*54d63bb1SFabio Estevam-------------------------------
15*54d63bb1SFabio Estevam
16*54d63bb1SFabio Estevammx6sabresd_defconfig target supports mx6q/mx6dl/mx6qp sabresd variants.
17*54d63bb1SFabio Estevam
18*54d63bb1SFabio EstevamIn order to build it:
19*54d63bb1SFabio Estevam
20*54d63bb1SFabio Estevam$ make mx6sabresd_defconfig
219cc3ad6cSDiego Dorta
229cc3ad6cSDiego Dorta$ make
239cc3ad6cSDiego Dorta
24*54d63bb1SFabio EstevamThis will generate the SPL and u-boot.img binaries.
259cc3ad6cSDiego Dorta
26*54d63bb1SFabio Estevam- Flash the SPL binary into the SD card:
279cc3ad6cSDiego Dorta
28*54d63bb1SFabio Estevam$ sudo dd if=SPL of=/dev/sdX bs=1K seek=1 && sync
29*54d63bb1SFabio Estevam
30*54d63bb1SFabio Estevam- Flash the u-boot.img binary into the SD card:
31*54d63bb1SFabio Estevam
32*54d63bb1SFabio Estevam$ sudo dd if=u-boot.img of=/dev/sdX bs=1K seek=69 && sync
339cc3ad6cSDiego Dorta
349cc3ad6cSDiego Dorta
35*54d63bb1SFabio Estevam2. Booting from eMMC
36*54d63bb1SFabio Estevam--------------------
37ce2f9defSBreno Lima
38*54d63bb1SFabio Estevam$ make mx6sabresd_defconfig
39ce2f9defSBreno Lima
40ce2f9defSBreno Lima$ make
41ce2f9defSBreno Lima
42*54d63bb1SFabio EstevamThis will generate the SPL and u-boot.img binaries.
43ce2f9defSBreno Lima
44*54d63bb1SFabio 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*54d63bb1SFabio Estevam- Flash SPL and u-boot.img binaries into the eMMC:
55ce2f9defSBreno Lima
56*54d63bb1SFabio Estevam$ sudo dd if=SPL of=/dev/sdX bs=1K seek=1 && sync
57*54d63bb1SFabio Estevam$ sudo dd if=u-boot.img of=/dev/sdX bs=1K seek=69 && sync
58ce2f9defSBreno Lima
59ce2f9defSBreno LimaSet SW6 to eMMC 8-bit boot: 11010110
60ce2f9defSBreno Lima
61ce2f9defSBreno Lima
62*54d63bb1SFabio Estevam3. Booting via Falcon mode
639cc3ad6cSDiego Dorta--------------------------
649cc3ad6cSDiego Dorta
65*54d63bb1SFabio Estevam$ make mx6sabresd_defconfig
669cc3ad6cSDiego Dorta$ make
679cc3ad6cSDiego Dorta
689cc3ad6cSDiego DortaThis will generate the SPL image called SPL and the u-boot.img.
699cc3ad6cSDiego Dorta
709cc3ad6cSDiego Dorta- Flash the SPL image into the SD card:
719cc3ad6cSDiego Dorta
72*54d63bb1SFabio Estevam$ sudo dd if=SPL of=/dev/sdX bs=1K seek=1 oflag=sync status=none && sync
739cc3ad6cSDiego Dorta
749cc3ad6cSDiego Dorta- Flash the u-boot.img image into the SD card:
759cc3ad6cSDiego Dorta
76*54d63bb1SFabio Estevam$ sudo dd if=u-boot.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