xref: /OK3568_Linux_fs/u-boot/board/freescale/mx6sabreauto/README (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593SmuzhiyunHow to use and build U-Boot on mx6sabreauto
2*4882a593Smuzhiyun-------------------------------------------
3*4882a593Smuzhiyun
4*4882a593Smuzhiyunmx6sabreauto_defconfig target supports mx6q/mx6dl/mx6qp sabreauto variants.
5*4882a593Smuzhiyun
6*4882a593SmuzhiyunIn order to build it:
7*4882a593Smuzhiyun
8*4882a593Smuzhiyun$ make mx6sabreauto_defconfig
9*4882a593Smuzhiyun
10*4882a593Smuzhiyun$ make
11*4882a593Smuzhiyun
12*4882a593SmuzhiyunThis will generate the SPL and u-boot.img binaries.
13*4882a593Smuzhiyun
14*4882a593Smuzhiyun- Flash the SPL binary into the SD card:
15*4882a593Smuzhiyun
16*4882a593Smuzhiyun$ sudo dd if=SPL of=/dev/sdX bs=1K seek=1 && sync
17*4882a593Smuzhiyun
18*4882a593Smuzhiyun- Flash the u-boot.img binary into the SD card:
19*4882a593Smuzhiyun
20*4882a593Smuzhiyun$ sudo dd if=u-boot.img of=/dev/sdX bs=1K seek=69 && sync
21*4882a593Smuzhiyun
22*4882a593SmuzhiyunBooting via Falcon mode
23*4882a593Smuzhiyun-----------------------
24*4882a593Smuzhiyun
25*4882a593SmuzhiyunWrite in mx6sabreauto_defconfig the following define below:
26*4882a593Smuzhiyun
27*4882a593SmuzhiyunCONFIG_SPL_OS_BOOT=y
28*4882a593Smuzhiyun
29*4882a593SmuzhiyunIn order to build it:
30*4882a593Smuzhiyun
31*4882a593Smuzhiyun$ make mx6sabreauto_defconfig
32*4882a593Smuzhiyun
33*4882a593Smuzhiyun$ make
34*4882a593Smuzhiyun
35*4882a593SmuzhiyunThis will generate the SPL image called SPL and the u-boot.img.
36*4882a593Smuzhiyun
37*4882a593Smuzhiyun- Flash the SPL image into the SD card:
38*4882a593Smuzhiyun
39*4882a593Smuzhiyun$ sudo dd if=SPL of=/dev/sdb bs=1K seek=1 && sync
40*4882a593Smuzhiyun
41*4882a593Smuzhiyun- Flash the u-boot.img image into the SD card:
42*4882a593Smuzhiyun
43*4882a593Smuzhiyun$ sudo dd if=u-boot.img of=/dev/sdb bs=1K seek=69 && sync
44*4882a593Smuzhiyun
45*4882a593SmuzhiyunCreate a FAT16 boot partition to store uImage and the dtb file, then copy the files there:
46*4882a593Smuzhiyun
47*4882a593Smuzhiyun$ sudo cp uImage /media/boot
48*4882a593Smuzhiyun
49*4882a593Smuzhiyun$ sudo cp imx6dl-sabreauto.dtb /media/boot
50*4882a593Smuzhiyun
51*4882a593SmuzhiyunCreate a partition for root file system and extract it there:
52*4882a593Smuzhiyun
53*4882a593Smuzhiyun$ sudo tar xvf rootfs.tar.gz -C /media/root
54*4882a593Smuzhiyun
55*4882a593SmuzhiyunThe SD card must have enough space for raw "args" and "kernel".
56*4882a593SmuzhiyunTo configure Falcon mode for the first time, on U-Boot do the following commands:
57*4882a593Smuzhiyun
58*4882a593Smuzhiyun- Load dtb file from boot partition:
59*4882a593Smuzhiyun
60*4882a593Smuzhiyun# load mmc 0:1 ${fdt_addr} imx6dl-sabreauto.dtb
61*4882a593Smuzhiyun
62*4882a593Smuzhiyun- Load kernel image from boot partition:
63*4882a593Smuzhiyun
64*4882a593Smuzhiyun# load mmc 0:1 ${loadaddr} uImage
65*4882a593Smuzhiyun
66*4882a593Smuzhiyun- Write kernel at 2MB offset:
67*4882a593Smuzhiyun
68*4882a593Smuzhiyun# mmc write ${loadaddr} 0x1000 0x4000
69*4882a593Smuzhiyun
70*4882a593Smuzhiyun- Setup kernel bootargs:
71*4882a593Smuzhiyun
72*4882a593Smuzhiyun# setenv bootargs "console=ttymxc3,115200 root=/dev/mmcblk0p1 rootfstype=ext4 rootwait quiet rw"
73*4882a593Smuzhiyun
74*4882a593Smuzhiyun- Prepare args:
75*4882a593Smuzhiyun
76*4882a593Smuzhiyun# spl export fdt ${loadaddr} - ${fdt_addr}
77*4882a593Smuzhiyun
78*4882a593Smuzhiyun- Write args 1MB data (0x800 sectors) to 1MB offset (0x800 sectors)
79*4882a593Smuzhiyun
80*4882a593Smuzhiyun# mmc write 18000000 0x800 0x800
81*4882a593Smuzhiyun
82*4882a593Smuzhiyun- Restart the board and then SPL binary will launch the kernel directly.
83