blob: 4ea4454b9f97264fabc39d48f533027d845c96d1 [file] [log] [blame]
Fabio Estevam54d63bb2017-05-18 08:15:04 -03001How to use and build U-Boot on mx6sabresd
Breno Limace2f9de2017-04-10 09:45:29 -03002-----------------------------------------
Diego Dorta9cc3ad62016-10-11 11:09:28 -03003
Fabio Estevam54d63bb2017-05-18 08:15:04 -03004The following methods can be used for booting mx6sabresd boards:
Diego Dorta9cc3ad62016-10-11 11:09:28 -03005
Fabio Estevam54d63bb2017-05-18 08:15:04 -030061. Booting from SD card
Diego Dorta9cc3ad62016-10-11 11:09:28 -03007
Fabio Estevam54d63bb2017-05-18 08:15:04 -030082. Booting from eMMC
9
103. Booting via Falcon mode (SPL launches the kernel directly)
11
12
131. Booting from SD card via SPL
14-------------------------------
15
16mx6sabresd_defconfig target supports mx6q/mx6dl/mx6qp sabresd variants.
17
18In order to build it:
19
20$ make mx6sabresd_defconfig
Diego Dorta9cc3ad62016-10-11 11:09:28 -030021
22$ make
23
Fabio Estevam6e2025b2019-02-26 09:36:06 -030024This will generate the SPL and u-boot-dtb.img binaries.
Diego Dorta9cc3ad62016-10-11 11:09:28 -030025
Fabio Estevam54d63bb2017-05-18 08:15:04 -030026- Flash the SPL binary into the SD card:
Diego Dorta9cc3ad62016-10-11 11:09:28 -030027
Fabio Estevam54d63bb2017-05-18 08:15:04 -030028$ sudo dd if=SPL of=/dev/sdX bs=1K seek=1 && sync
29
Fabio Estevam6e2025b2019-02-26 09:36:06 -030030- Flash the u-boot-dtb.img binary into the SD card:
Fabio Estevam54d63bb2017-05-18 08:15:04 -030031
Fabio Estevam6e2025b2019-02-26 09:36:06 -030032$ sudo dd if=u-boot-dtb.img of=/dev/sdX bs=1K seek=69 && sync
Diego Dorta9cc3ad62016-10-11 11:09:28 -030033
34
Fabio Estevam54d63bb2017-05-18 08:15:04 -0300352. Booting from eMMC
36--------------------
Breno Limace2f9de2017-04-10 09:45:29 -030037
Fabio Estevam54d63bb2017-05-18 08:15:04 -030038$ make mx6sabresd_defconfig
Breno Limace2f9de2017-04-10 09:45:29 -030039
40$ make
41
Fabio Estevam6e2025b2019-02-26 09:36:06 -030042This will generate the SPL and u-boot-dtb.img binaries.
Breno Limace2f9de2017-04-10 09:45:29 -030043
Fabio Estevam54d63bb2017-05-18 08:15:04 -030044- Boot first from SD card as shown in the previous section
Breno Limace2f9de2017-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 Estevam6e2025b2019-02-26 09:36:06 -030054- Flash SPL and u-boot-dtb.img binaries into the eMMC:
Breno Limace2f9de2017-04-10 09:45:29 -030055
Fabio Estevam54d63bb2017-05-18 08:15:04 -030056$ sudo dd if=SPL of=/dev/sdX bs=1K seek=1 && sync
Fabio Estevam6e2025b2019-02-26 09:36:06 -030057$ sudo dd if=u-boot-dtb.img of=/dev/sdX bs=1K seek=69 && sync
Breno Limace2f9de2017-04-10 09:45:29 -030058
59Set SW6 to eMMC 8-bit boot: 11010110
60
61
Fabio Estevam54d63bb2017-05-18 08:15:04 -0300623. Booting via Falcon mode
Diego Dorta9cc3ad62016-10-11 11:09:28 -030063--------------------------
64
Fabio Estevam54d63bb2017-05-18 08:15:04 -030065$ make mx6sabresd_defconfig
Diego Dorta9cc3ad62016-10-11 11:09:28 -030066$ make
67
Fabio Estevam6e2025b2019-02-26 09:36:06 -030068This will generate the SPL image called SPL and the u-boot-dtb.img.
Diego Dorta9cc3ad62016-10-11 11:09:28 -030069
70- Flash the SPL image into the SD card:
71
Fabio Estevam54d63bb2017-05-18 08:15:04 -030072$ sudo dd if=SPL of=/dev/sdX bs=1K seek=1 oflag=sync status=none && sync
Diego Dorta9cc3ad62016-10-11 11:09:28 -030073
Fabio Estevam6e2025b2019-02-26 09:36:06 -030074- Flash the u-boot-dtb.img image into the SD card:
Diego Dorta9cc3ad62016-10-11 11:09:28 -030075
Fabio Estevam6e2025b2019-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 Dorta9cc3ad62016-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.