blob: 4ea4454b9f97264fabc39d48f533027d845c96d1 [file] [log] [blame]
Fabio Estevamdcb43ac2017-05-18 08:15:04 -03001How to use and build U-Boot on mx6sabresd
2-----------------------------------------
Diego Dorta20af96a2016-10-11 11:09:28 -03003
Fabio Estevamdcb43ac2017-05-18 08:15:04 -03004The following methods can be used for booting mx6sabresd boards:
Diego Dorta20af96a2016-10-11 11:09:28 -03005
Fabio Estevamdcb43ac2017-05-18 08:15:04 -030061. Booting from SD card
Diego Dorta20af96a2016-10-11 11:09:28 -03007
Fabio Estevamdcb43ac2017-05-18 08:15:04 -030082. Booting from eMMC
Diego Dorta20af96a2016-10-11 11:09:28 -03009
Fabio Estevamdcb43ac2017-05-18 08:15:04 -0300103. Booting via Falcon mode (SPL launches the kernel directly)
Diego Dorta20af96a2016-10-11 11:09:28 -030011
Breno Lima0d0dc392017-04-10 09:45:29 -030012
Fabio Estevamdcb43ac2017-05-18 08:15:04 -0300131. Booting from SD card via SPL
14-------------------------------
Diego Dorta20af96a2016-10-11 11:09:28 -030015
Fabio Estevamdcb43ac2017-05-18 08:15:04 -030016mx6sabresd_defconfig target supports mx6q/mx6dl/mx6qp sabresd variants.
Diego Dorta20af96a2016-10-11 11:09:28 -030017
Fabio Estevamdcb43ac2017-05-18 08:15:04 -030018In order to build it:
Diego Dorta20af96a2016-10-11 11:09:28 -030019
Fabio Estevamdcb43ac2017-05-18 08:15:04 -030020$ make mx6sabresd_defconfig
Diego Dorta20af96a2016-10-11 11:09:28 -030021
22$ make
23
Fabio Estevam29650952019-02-26 09:36:06 -030024This will generate the SPL and u-boot-dtb.img binaries.
Diego Dorta20af96a2016-10-11 11:09:28 -030025
Fabio Estevamdcb43ac2017-05-18 08:15:04 -030026- Flash the SPL binary into the SD card:
Diego Dorta20af96a2016-10-11 11:09:28 -030027
Fabio Estevamdcb43ac2017-05-18 08:15:04 -030028$ sudo dd if=SPL of=/dev/sdX bs=1K seek=1 && sync
Diego Dorta20af96a2016-10-11 11:09:28 -030029
Fabio Estevam29650952019-02-26 09:36:06 -030030- Flash the u-boot-dtb.img binary into the SD card:
Diego Dorta20af96a2016-10-11 11:09:28 -030031
Fabio Estevam29650952019-02-26 09:36:06 -030032$ sudo dd if=u-boot-dtb.img of=/dev/sdX bs=1K seek=69 && sync
Breno Lima0d0dc392017-04-10 09:45:29 -030033
Breno Lima0d0dc392017-04-10 09:45:29 -030034
Fabio Estevamdcb43ac2017-05-18 08:15:04 -0300352. Booting from eMMC
36--------------------
Breno Lima0d0dc392017-04-10 09:45:29 -030037
Fabio Estevamdcb43ac2017-05-18 08:15:04 -030038$ make mx6sabresd_defconfig
Breno Lima0d0dc392017-04-10 09:45:29 -030039
40$ make
41
Fabio Estevam29650952019-02-26 09:36:06 -030042This will generate the SPL and u-boot-dtb.img binaries.
Breno Lima0d0dc392017-04-10 09:45:29 -030043
Fabio Estevamdcb43ac2017-05-18 08:15:04 -030044- Boot first from SD card as shown in the previous section
Breno Lima0d0dc392017-04-10 09:45:29 -030045
46In U-boot change the eMMC partition config:
47
48=> mmc partconf 2 1 0 0
49
50Mount the eMMC in the host PC:
51
52=> ums 0 mmc 2
53
Fabio Estevam29650952019-02-26 09:36:06 -030054- Flash SPL and u-boot-dtb.img binaries into the eMMC:
Breno Lima0d0dc392017-04-10 09:45:29 -030055
Fabio Estevamdcb43ac2017-05-18 08:15:04 -030056$ sudo dd if=SPL of=/dev/sdX bs=1K seek=1 && sync
Fabio Estevam29650952019-02-26 09:36:06 -030057$ sudo dd if=u-boot-dtb.img of=/dev/sdX bs=1K seek=69 && sync
Breno Lima0d0dc392017-04-10 09:45:29 -030058
59Set SW6 to eMMC 8-bit boot: 11010110
60
61
Fabio Estevamdcb43ac2017-05-18 08:15:04 -0300623. Booting via Falcon mode
Diego Dorta20af96a2016-10-11 11:09:28 -030063--------------------------
64
Fabio Estevamdcb43ac2017-05-18 08:15:04 -030065$ make mx6sabresd_defconfig
Diego Dorta20af96a2016-10-11 11:09:28 -030066$ make
67
Fabio Estevam29650952019-02-26 09:36:06 -030068This will generate the SPL image called SPL and the u-boot-dtb.img.
Diego Dorta20af96a2016-10-11 11:09:28 -030069
70- Flash the SPL image into the SD card:
71
Fabio Estevamdcb43ac2017-05-18 08:15:04 -030072$ sudo dd if=SPL of=/dev/sdX bs=1K seek=1 oflag=sync status=none && sync
Diego Dorta20af96a2016-10-11 11:09:28 -030073
Fabio Estevam29650952019-02-26 09:36:06 -030074- Flash the u-boot-dtb.img image into the SD card:
Diego Dorta20af96a2016-10-11 11:09:28 -030075
Fabio Estevam29650952019-02-26 09:36:06 -030076$ sudo dd if=u-boot-dtb.img of=/dev/sdX bs=1K seek=69 oflag=sync status=none && sync
Diego Dorta20af96a2016-10-11 11:09:28 -030077
78Create a partition for root file system and extract it there:
79
80$ sudo tar xvf rootfs.tar.gz -C /media/root
81
82The SD card must have enough space for raw "args" and "kernel".
83To configure Falcon mode for the first time, on U-Boot do the following commands:
84
85- Setup the IP server:
86
87# setenv serverip <server_ip_address>
88
89- Download dtb file:
90
91# dhcp ${fdt_addr} imx6q-sabresd.dtb
92
93- Download kernel image:
94
95# dhcp ${loadaddr} uImage
96
97- Write kernel at 2MB offset:
98
99# mmc write ${loadaddr} 0x1000 0x4000
100
101- Setup kernel bootargs:
102
103# setenv bootargs "console=ttymxc0,115200 root=/dev/mmcblk1p1 rootfstype=ext4 rootwait quiet rw"
104
105- Prepare args:
106
107# spl export fdt ${loadaddr} - ${fdt_addr}
108
109- Write args 1MB data (0x800 sectors) to 1MB offset (0x800 sectors)
110
111# mmc write 18000000 0x800 0x800
112
113- Press KEY_VOL_UP key, power up the board and then SPL binary will
114launch the kernel directly.