xref: /OK3568_Linux_fs/u-boot/board/freescale/mx6sabresd/README (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593SmuzhiyunHow to use and build U-Boot on mx6sabresd
2*4882a593Smuzhiyun-----------------------------------------
3*4882a593Smuzhiyun
4*4882a593SmuzhiyunThe following methods can be used for booting mx6sabresd boards:
5*4882a593Smuzhiyun
6*4882a593Smuzhiyun1. Booting from SD card
7*4882a593Smuzhiyun
8*4882a593Smuzhiyun2. Booting from eMMC
9*4882a593Smuzhiyun
10*4882a593Smuzhiyun3. Booting via Falcon mode (SPL launches the kernel directly)
11*4882a593Smuzhiyun
12*4882a593Smuzhiyun
13*4882a593Smuzhiyun1. Booting from SD card via SPL
14*4882a593Smuzhiyun-------------------------------
15*4882a593Smuzhiyun
16*4882a593Smuzhiyunmx6sabresd_defconfig target supports mx6q/mx6dl/mx6qp sabresd variants.
17*4882a593Smuzhiyun
18*4882a593SmuzhiyunIn order to build it:
19*4882a593Smuzhiyun
20*4882a593Smuzhiyun$ make mx6sabresd_defconfig
21*4882a593Smuzhiyun
22*4882a593Smuzhiyun$ make
23*4882a593Smuzhiyun
24*4882a593SmuzhiyunThis will generate the SPL and u-boot.img binaries.
25*4882a593Smuzhiyun
26*4882a593Smuzhiyun- Flash the SPL binary into the SD card:
27*4882a593Smuzhiyun
28*4882a593Smuzhiyun$ sudo dd if=SPL of=/dev/sdX bs=1K seek=1 && sync
29*4882a593Smuzhiyun
30*4882a593Smuzhiyun- Flash the u-boot.img binary into the SD card:
31*4882a593Smuzhiyun
32*4882a593Smuzhiyun$ sudo dd if=u-boot.img of=/dev/sdX bs=1K seek=69 && sync
33*4882a593Smuzhiyun
34*4882a593Smuzhiyun
35*4882a593Smuzhiyun2. Booting from eMMC
36*4882a593Smuzhiyun--------------------
37*4882a593Smuzhiyun
38*4882a593Smuzhiyun$ make mx6sabresd_defconfig
39*4882a593Smuzhiyun
40*4882a593Smuzhiyun$ make
41*4882a593Smuzhiyun
42*4882a593SmuzhiyunThis will generate the SPL and u-boot.img binaries.
43*4882a593Smuzhiyun
44*4882a593Smuzhiyun- Boot first from SD card as shown in the previous section
45*4882a593Smuzhiyun
46*4882a593SmuzhiyunIn U-boot change the eMMC partition config:
47*4882a593Smuzhiyun
48*4882a593Smuzhiyun=> mmc partconf 2 1 0 0
49*4882a593Smuzhiyun
50*4882a593SmuzhiyunMount the eMMC in the host PC:
51*4882a593Smuzhiyun
52*4882a593Smuzhiyun=> ums 0 mmc 2
53*4882a593Smuzhiyun
54*4882a593Smuzhiyun- Flash SPL and u-boot.img binaries into the eMMC:
55*4882a593Smuzhiyun
56*4882a593Smuzhiyun$ sudo dd if=SPL of=/dev/sdX bs=1K seek=1 && sync
57*4882a593Smuzhiyun$ sudo dd if=u-boot.img of=/dev/sdX bs=1K seek=69 && sync
58*4882a593Smuzhiyun
59*4882a593SmuzhiyunSet SW6 to eMMC 8-bit boot: 11010110
60*4882a593Smuzhiyun
61*4882a593Smuzhiyun
62*4882a593Smuzhiyun3. Booting via Falcon mode
63*4882a593Smuzhiyun--------------------------
64*4882a593Smuzhiyun
65*4882a593Smuzhiyun$ make mx6sabresd_defconfig
66*4882a593Smuzhiyun$ make
67*4882a593Smuzhiyun
68*4882a593SmuzhiyunThis will generate the SPL image called SPL and the u-boot.img.
69*4882a593Smuzhiyun
70*4882a593Smuzhiyun- Flash the SPL image into the SD card:
71*4882a593Smuzhiyun
72*4882a593Smuzhiyun$ sudo dd if=SPL of=/dev/sdX bs=1K seek=1 oflag=sync status=none && sync
73*4882a593Smuzhiyun
74*4882a593Smuzhiyun- Flash the u-boot.img image into the SD card:
75*4882a593Smuzhiyun
76*4882a593Smuzhiyun$ sudo dd if=u-boot.img of=/dev/sdX bs=1K seek=69 oflag=sync status=none && sync
77*4882a593Smuzhiyun
78*4882a593SmuzhiyunCreate a partition for root file system and extract it there:
79*4882a593Smuzhiyun
80*4882a593Smuzhiyun$ sudo tar xvf rootfs.tar.gz -C /media/root
81*4882a593Smuzhiyun
82*4882a593SmuzhiyunThe SD card must have enough space for raw "args" and "kernel".
83*4882a593SmuzhiyunTo configure Falcon mode for the first time, on U-Boot do the following commands:
84*4882a593Smuzhiyun
85*4882a593Smuzhiyun- Setup the IP server:
86*4882a593Smuzhiyun
87*4882a593Smuzhiyun# setenv serverip <server_ip_address>
88*4882a593Smuzhiyun
89*4882a593Smuzhiyun- Download dtb file:
90*4882a593Smuzhiyun
91*4882a593Smuzhiyun# dhcp ${fdt_addr} imx6q-sabresd.dtb
92*4882a593Smuzhiyun
93*4882a593Smuzhiyun- Download kernel image:
94*4882a593Smuzhiyun
95*4882a593Smuzhiyun# dhcp ${loadaddr} uImage
96*4882a593Smuzhiyun
97*4882a593Smuzhiyun- Write kernel at 2MB offset:
98*4882a593Smuzhiyun
99*4882a593Smuzhiyun# mmc write ${loadaddr} 0x1000 0x4000
100*4882a593Smuzhiyun
101*4882a593Smuzhiyun- Setup kernel bootargs:
102*4882a593Smuzhiyun
103*4882a593Smuzhiyun# setenv bootargs "console=ttymxc0,115200 root=/dev/mmcblk1p1 rootfstype=ext4 rootwait quiet rw"
104*4882a593Smuzhiyun
105*4882a593Smuzhiyun- Prepare args:
106*4882a593Smuzhiyun
107*4882a593Smuzhiyun# spl export fdt ${loadaddr} - ${fdt_addr}
108*4882a593Smuzhiyun
109*4882a593Smuzhiyun- Write args 1MB data (0x800 sectors) to 1MB offset (0x800 sectors)
110*4882a593Smuzhiyun
111*4882a593Smuzhiyun# mmc write 18000000 0x800 0x800
112*4882a593Smuzhiyun
113*4882a593Smuzhiyun- Press KEY_VOL_UP key, power up the board and then SPL binary will
114*4882a593Smuzhiyunlaunch the kernel directly.
115