xref: /OK3568_Linux_fs/buildroot/board/kontron/smarc-sal28/readme.txt (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593SmuzhiyunKontron SMARC-sAL28
2*4882a593Smuzhiyun===================
3*4882a593Smuzhiyun
4*4882a593SmuzhiyunHow to build it
5*4882a593Smuzhiyun===============
6*4882a593Smuzhiyun
7*4882a593SmuzhiyunConfigure Buildroot:
8*4882a593Smuzhiyun
9*4882a593Smuzhiyun  $ make kontron_smarc_sal28_defconfig
10*4882a593Smuzhiyun
11*4882a593SmuzhiyunChange settings to fit your needs (optional):
12*4882a593Smuzhiyun
13*4882a593Smuzhiyun  $ make menuconfig
14*4882a593Smuzhiyun
15*4882a593SmuzhiyunCompile everything and build the rootfs image:
16*4882a593Smuzhiyun
17*4882a593Smuzhiyun  $ make
18*4882a593Smuzhiyun
19*4882a593SmuzhiyunCopying the image to a storage device
20*4882a593Smuzhiyun=====================================
21*4882a593Smuzhiyun
22*4882a593SmuzhiyunBuildroot builds an image which can be written to the internal eMMC
23*4882a593Smuzhiyunstorage, a SD card or an USB thumb drive. You can use the following
24*4882a593Smuzhiyuncommand on your host:
25*4882a593Smuzhiyun
26*4882a593Smuzhiyun  $ sudo dd if=output/images/sdcard-emmc.img of=/dev/sdx bs=1M
27*4882a593Smuzhiyun
28*4882a593SmuzhiyunWhere /dev/sdx is the corresponding block device of your SD card or USB
29*4882a593Smuzhiyunthumb drive. To flash it on your internal eMMC use the following command on
30*4882a593Smuzhiyunthe board:
31*4882a593Smuzhiyun
32*4882a593Smuzhiyun  # dd if=sdcard-emmc.img of=/dev/mmcblk1 bs=1M
33*4882a593Smuzhiyun
34*4882a593SmuzhiyunBe sure you have not booted from the internal eMMC in this case!
35*4882a593Smuzhiyun
36*4882a593SmuzhiyunBooting the board
37*4882a593Smuzhiyun=================
38*4882a593Smuzhiyun
39*4882a593SmuzhiyunBy default the bootloader will search for the first valid image, starting
40*4882a593Smuzhiyunwith the internal eMMC. Consult the vendor documentation on how to use the
41*4882a593SmuzhiyunDIP switches to select specific boot devices. To use the bootloader
42*4882a593Smuzhiyunenvironment set the boot_targets correspondingly. E.g.:
43*4882a593Smuzhiyun
44*4882a593Smuzhiyun  # setenv boot_targets usb0
45*4882a593Smuzhiyun
46*4882a593SmuzhiyunTo boot from an USB thumb drive.
47*4882a593Smuzhiyun
48*4882a593SmuzhiyunThe device tree is loaded according to the filename in fdtfile. The
49*4882a593Smuzhiyunfollowing command will set the default device tree, which works on almost
50*4882a593Smuzhiyunall variants (with less features of course):
51*4882a593Smuzhiyun
52*4882a593Smuzhiyun  # setenv fdtfile freescale/fsl-ls1028a-kontron-sl28.dtb
53*4882a593Smuzhiyun
54*4882a593SmuzhiyunSet this to a device tree which fits your board variant.
55*4882a593Smuzhiyun
56*4882a593SmuzhiyunConnect your serial cable to SER1 and open your favorite terminal emulation
57*4882a593Smuzhiyunprogram (baudrate 115200, 8n1). E.g.:
58*4882a593Smuzhiyun
59*4882a593Smuzhiyun  $ picocom -b 115200 /dev/ttyUSB0
60*4882a593Smuzhiyun
61*4882a593SmuzhiyunYou will get a warning reported by fdisk when you examine the SD card.
62*4882a593SmuzhiyunThis is because the genimage.cfg file doesn't specify the SD card size
63*4882a593Smuzhiyun(as people will naturally have different sized cards), so the
64*4882a593Smuzhiyunsecondary GPT header is placed after the rootfs rather than at the end
65*4882a593Smuzhiyunof the disk where it is expected to be.
66*4882a593Smuzhiyun
67*4882a593SmuzhiyunYou will see something like this at boot time:
68*4882a593Smuzhiyun
69*4882a593Smuzhiyun[    4.552797] GPT:Primary header thinks Alt. header is not at the end of the disk.
70*4882a593Smuzhiyun[    4.560237] GPT:266272 != 7864319
71*4882a593Smuzhiyun[    4.563565] GPT:Alternate GPT header not at the end of the disk.
72*4882a593Smuzhiyun[    4.569596] GPT:266272 != 7864319
73*4882a593Smuzhiyun[    4.572925] GPT: Use GNU Parted to correct GPT errors.
74*4882a593Smuzhiyun
75*4882a593SmuzhiyunUpdating the bootloader
76*4882a593Smuzhiyun=======================
77*4882a593Smuzhiyun
78*4882a593SmuzhiyunBuildroot will automatically build the u-boot bootloader. The resulting
79*4882a593Smuzhiyunimage is called u-boot.rom and you can find it in the images/ directory.
80*4882a593Smuzhiyun
81*4882a593SmuzhiyunTo update the bootloader on the board you could either copy it to an
82*4882a593SmuzhiyunUSB thumb drive or you could put it on a TFTP server. The following
83*4882a593Smuzhiyunexample assumes you have the bootloader image copied to the root of
84*4882a593Smuzhiyuna thumb drive:
85*4882a593Smuzhiyun
86*4882a593Smuzhiyun  # usb start
87*4882a593Smuzhiyun  # load usb 0:1 $loadaddr u-boot.rom
88*4882a593Smuzhiyun  # sf probe 0 && sf update $fileaddr 0x210000 $filesize
89