1This document explains how to set up a basic Buildroot system on
2various Atmel/Microchip boards. Additional details can also be found
3on the Linux4SAM website: http://www.linux4sam.org
4
5This guide covers the following configurations:
6 - at91sam9g45m10ek_defconfig
7 - at91sam9rlek_defconfig
8 - at91sam9x5ek_defconfig (at91sam9g15, at91sam9g25, at91sam9x25,
9 at91sam9g35 and at91sam9x35)
10 - atmel_sama5d3xek_defconfig (sama5d31, sama5d33, sama5d34, sama5d35,
11 sama5d36)
12 - atmel_sama5d3_xplained_defconfig
13 - atmel_sama5d3_xplained_dev_defconfig
14 - atmel_sama5d3_xplained_mmc_defconfig
15 - atmel_sama5d3_xplained_mmc_dev_defconfig
16 - atmel_sama5d4_xplained_defconfig
17 - atmel_sama5d4_xplained_dev_defconfig
18 - atmel_sama5d4_xplained_mmc_defconfig
19 - atmel_sama5d4_xplained_mmc_dev_defconfig
20 - atmel_sama5d2_xplained_mmc_defconfig
21 - atmel_sama5d2_xplained_mmc_dev_defconfig
22 - microchip_sama5d27_wlsom1_ek_mmc_defconfig
23 - microchip_sama5d27_wlsom1_ek_mmc_dev_defconfig
24 - microchip_sam9x60ek_mmc_defconfig
25 - microchip_sam9x60ek_mmc_dev_defconfig
26 - microchip_sama5d2_icp_mmc_defconfig
27 - microchip_sama5d2_icp_mmc_dev_defconfig
28
29These configurations will use AT91Bootstrap, u-boot and a linux kernel from
30the git trees maintained by Atmel.
31
32The configurations labeled as 'dev' provide a development rootfs with tools to
33tests the features of the SoC:
34- ALSA tools to test audio
35- FFMPEG to record video from the ISI/ISC
36- I2C, SPI, CAN, etc. tools
37- modetest for LCD screens, HDMI
38- Wilc1000/Wilc3000 firmware for the Atmel Wireless sdio module
39- SSH for convenience
40- GDB/GDB server for debug
41
42Configuring and building Buildroot
43==================================
44
45For the Xplained/Evaluation Kit boards, the Buildroot configuration is
46provided to boot from an SD card. Those configurations are labeled as
47'mmc'. In this case, after building Buildroot, follow the instructions
48in the "Preparing the SD card" section.
49
50For the other configurations listed above, the Buildroot configuration
51assumes the system will be flashed on NAND. In this case, after
52building Buildroot, follow the instructions in the "Flashing the NAND
53using SAM-BA" section below.
54
55To configure and build Buildroot, run:
56
57 make <board>_defconfig
58 make
59
60Flashing the NAND using SAM-BA
61==============================
62
63Flashing the board
64------------------
65
66Connect the board:
67 o at91sam9g45m10ek: DBGU: J10, USB sam-ba: J14
68 o at91sam9rlek: DBGU: J19, USB sam-ba: J21
69 o at91sam9x5ek: DBGU: J11, USB sam-ba: J20
70 o sama5d3xek: DBGU: J14, USB sam-ba: J20
71 o sama5d3 Xplained: DBGU: J23, USB sam-ba: J6
72 o sama5d4ek: DBGU: J22 or J24, USB sam-ba: J1
73 o sama5d4 Xplained: DBGU: J1, USB sam-ba: J11
74
75Start the board in RomBOOT:
76 o at91sam9g45m10ek:
77 1. open JP8, JP10 and JP12
78 2. start the board
79 3. close JP8, JP10 and JP12
80
81 o at91sam9rlek:
82 1. J11 on 1-2 (BMS=1), open J12 and J13
83 2. start the board
84 3. close J12 and J13
85
86 o at91sam9x5ek:
87 1. open JP9 and:
88 - Cogent: open *NCS jumper
89 - Embest: open SW1
90 - Ronetix: open J1 and J2
91 2. start the board
92 3. close JP9 and:
93 - Cogent: close *NCS jumper
94 - Embest: close SW1 (ON position)
95 - Ronetix: close J1 and J2
96
97 o sama5d3xek:
98 1. start the board
99 2. push BP4 and BP1
100 3. release BP1
101 4. release BP4
102
103 o sama5d3 Xplained:
104 1. open JP5 (NANDCS) and JP6 (SPICS)
105 2. start the board
106 3. close JP5 ans JP6
107
108 o sama5d4ek:
109 1. start the board
110 2. push BP3 and BP4
111 3. release BP4
112 4. release BP3
113
114 o sama5d4 Xplained:
115 1. close JP7 (BOOT_DIS)
116 2. start the board
117 3. open JP7
118
119"RomBOOT" should appear on your console (this should be ttyUSBx or ttyACMx)
120
121Now locate the USB sam-ba interface it should be ttyACMx, usually ttyACM0
122dmesg on your machine should give:
123usb 1-2.1.4: New USB device found, idVendor=03eb, idProduct=6124
124usb 1-2.1.4: New USB device strings: Mfr=0, Product=0, SerialNumber=0
125cdc_acm 1-2.1.4:1.0: ttyACM0: USB ACM device
126
127Look for idVendor=03eb, idProduct=6124, this is the interface you want to use.
128
129You can then flash the board using the provided flasher.sh script in board/atmel:
130
131board/atmel/flasher.sh <builddir_path> <interface> <board>
132
133For example, for an out of tree build made in
134/tmp/atmel_sama5d3_xplained/ for the sama5d3 Xplained, you would use:
135board/atmel/flasher.sh /tmp/atmel_sama5d3_xplained/ /dev/ttyACM0 sama5d3_xplained
136
137Reboot, the system should boot up to the buildroot login invite.
138
139Preparing the SD card
140=====================
141
142An image named sdcard.img is automatically generated. With this image,
143you no longer have to care about the creation of the partition and
144copying files to the SD card.
145
146You need at least a 1GB SD card. All the data on the SD card will be
147lost. To copy the image on the SD card:
148
149/!\ Caution be sure to do it on the right mmcblk device /!\
150
151dd if=output/images/sdcard.img of=/dev/mmcblk0
152
153Insert your SD card in your Xplained/Evaluation Kit board, and
154enjoy. The default U-Boot environment will load properly the kernel
155and Device Tree blob from the first partition of the SD card, so
156everything works automatically.
157
158By default a 16MB FAT partition is created. It contains at91bootstrap,
159u-boot, the kernel image and all dtb variants for your board. The dtb
160used is the basic one:
161
162U-Boot> print
163[...]
164bootcmd=fatload mmc 1:1 0x21000000 at91-sama5d2_xplained.dtb; fatload mmc 1:1 0x22000000 zImage; bootz 0x22000000 - 0x21000000
165[...]
166
167If you want to use a variant such as the _pda7 one, you will have to
168update your u-boot environment:
169
170U-Boot> setenv bootcmd 'fatload mmc 1:1 0x21000000 at91-sama5d2_xplained_pda7.dtb; fatload mmc 1:1 0x22000000 zImage; bootz 0x22000000 - 0x21000000'
171U-Boot> save
172Saving Environment to FAT...
173writing uboot.env
174done
175
176A 512MB ext4 partition is also created to store the rootfs generated.
177
178If you want to customize the size of the partitions and their content,
179take a look at the the genimage.cfg file in the board directory.
180