diff options
author | Manjukumar Matha <manjukumar.harthikote-matha@xilinx.com> | 2017-12-06 16:06:35 -0800 |
---|---|---|
committer | Manjukumar Matha <manjukumar.harthikote-matha@xilinx.com> | 2017-12-13 16:11:14 -0800 |
commit | a18947c20dba2c0c38db8bde1ad4684995df4bbd (patch) | |
tree | 917bf2abbe439a6f99ede8cfafb25812dca54a9a /meta-xilinx-bsp/README.booting.md | |
parent | 6ddc5873b0ede30e6542f0ab151a6236acc37944 (diff) | |
download | meta-xilinx-a18947c20dba2c0c38db8bde1ad4684995df4bbd.tar.gz |
meta-xilinx: Restructuring meta-xilinx to support multiple layers
As discussed previously on mailing list, we are proceeding with layer
restructuring. For rocko release we will have the following layers
meta-xilinx
->meta-xilinx-bsp (current meta-xilinx)
->meta-xilinx-contrib
In the subsequent releases we will add other layers from Xilinx
meta-xilinx
->meta-xilinx-bsp (current meta-xilinx)
->meta-petalinux
->meta-xilinx-tools
->meta-xilinx-contrib
This will provide one clone to get all the required meta layers from
Xilinx for a complete solution, and the users can blacklist any layer
which they don't want to use using bblayer.conf.
This will enables us to help our vendors/partners to add their reference
designs, board definitions etc.
Recipe changes :
* Move reference design zybo-linux-bd.bb to meta-xilinx-contrib
* Move kernel patches realted to zybo-linux-bd-zynq7 board to
meta-xilinx-contrib
* Update README
Signed-off-by: Manjukumar Matha <manjukumar.harthikote-matha@xilinx.com>
Diffstat (limited to 'meta-xilinx-bsp/README.booting.md')
-rw-r--r-- | meta-xilinx-bsp/README.booting.md | 244 |
1 files changed, 244 insertions, 0 deletions
diff --git a/meta-xilinx-bsp/README.booting.md b/meta-xilinx-bsp/README.booting.md new file mode 100644 index 00000000..04c32c51 --- /dev/null +++ b/meta-xilinx-bsp/README.booting.md | |||
@@ -0,0 +1,244 @@ | |||
1 | Booting meta-xilinx boards | ||
2 | ========================== | ||
3 | |||
4 | Contents | ||
5 | -------- | ||
6 | |||
7 | * [Loading via JTAG](#loading-via-jtag) | ||
8 | * [XSDB](#xsdb) | ||
9 | * [Load Bitstream](#load-bitstream) | ||
10 | * [Load U-Boot (MicroBlaze)](#load-u-boot-microblaze) | ||
11 | * [Load U-Boot (Zynq)](#load-u-boot-zynq) | ||
12 | * [U-Boot Console](#u-boot-console) | ||
13 | * [Kernel, Root Filesystem and Device Tree](#kernel-root-filesystem-and-device-tree) | ||
14 | * [Booting via U-Boot](#booting-via-u-boot) | ||
15 | * [Loading via SD](#loading-via-sd) | ||
16 | * [Preparing SD/MMC](#preparing-sdmmc) | ||
17 | * [Installing U-Boot](#installing-u-boot) | ||
18 | * [Installing Kernel and Device Tree](#installing-kernel-and-device-tree) | ||
19 | * [Installing Root Filesystem](#installing-root-filesystem) | ||
20 | * [U-Boot Configuration File](#u-boot-configuration-file) | ||
21 | * [Booting](#booting) | ||
22 | * [Loading via TFTP](#loading-via-tftp) | ||
23 | * [Kernel, Root Filesystem and Device Tree](#kernel-root-filesystem-and-device-tree-1) | ||
24 | * [Booting via U-Boot](#booting-via-u-boot-1) | ||
25 | |||
26 | |||
27 | Loading via JTAG | ||
28 | ---------------- | ||
29 | This boot flow requires the use of the Xilinx tools, specifically XSDB and the | ||
30 | associated JTAG device drivers. This also requires access to the JTAG interface | ||
31 | on the board, a number of Xilinx and third-party boards come with on-board JTAG | ||
32 | modules. | ||
33 | |||
34 | ### XSDB | ||
35 | Start `xsdb` and connect. Ensure that the target chip is visible. | ||
36 | |||
37 | $ xsdb | ||
38 | xsdb% connect | ||
39 | xsdb% targets | ||
40 | |||
41 | ### Load Bitstream | ||
42 | **(Note: This step is only required for platforms which have a bitstream e.g. | ||
43 | MicroBlaze.)** | ||
44 | |||
45 | Download the bitstream for the system using XSDB with the `fpga -f` command. If | ||
46 | a bitstream is available from meta-xilinx is will be located in the | ||
47 | `deploy/images/<machine-name>/` directory. | ||
48 | |||
49 | xsdb% fpga -f download.bit | ||
50 | |||
51 | ### Load U-Boot (MicroBlaze) | ||
52 | Download `u-boot.elf` to the target CPU via the use of XSDB. | ||
53 | |||
54 | xsdb% targets -set -filter {name =~ "MicroBlaze*"} | ||
55 | xsdb% rst | ||
56 | xsdb% dow u-boot.elf | ||
57 | xsdb% con | ||
58 | |||
59 | ### Load U-Boot (Zynq) | ||
60 | Ensure the board is configured to boot from JTAG. The Zynq platform requires the | ||
61 | loading of SPL first, this can be done by loading the `u-boot-spl.bin` and | ||
62 | executing it at location `0x0`. `u-boot-spl.bin` is not output to the deploy | ||
63 | directory by default, it can be obtained from the work directory for U-Boot | ||
64 | (`git/spl/u-boot-spl.bin`) or can be extracted from `boot.bin` using | ||
65 | `dd if=boot.bin of=u-boot-spl.bin bs=1 skip=2240`. | ||
66 | |||
67 | xsdb% targets -set -filter {name =~ "ARM*#0"} | ||
68 | xsdb% dow -data u-boot-spl.bin 0x0 | ||
69 | xsdb% rwr pc 0x0 | ||
70 | xsdb% con | ||
71 | |||
72 | On the UART console the following should appear, indicating SPL was loaded. | ||
73 | |||
74 | U-Boot SPL 2016.01 | ||
75 | Trying to boot from unknown boot device | ||
76 | SPL: Unsupported Boot Device! | ||
77 | SPL: failed to boot from all boot devices | ||
78 | ### ERROR ### Please RESET the board ### | ||
79 | |||
80 | Once SPL has loaded U-Boot can now be loaded into memory and executed. Download | ||
81 | `u-boot.elf` to the target. | ||
82 | |||
83 | xsdb% stop | ||
84 | xsdb% dow u-boot.elf | ||
85 | xsdb% con | ||
86 | |||
87 | ### U-Boot Console | ||
88 | U-Boot will load and the console will be available on the UART interface. | ||
89 | |||
90 | ... | ||
91 | Hit any key to stop autoboot: 0 | ||
92 | U-Boot> | ||
93 | |||
94 | ### Kernel, Root Filesystem and Device Tree | ||
95 | Whilst it is possible to load the images via JTAG this connection is slow and | ||
96 | this process can take a long time to execute (more than 10 minutes). If your | ||
97 | system has ethernet it is recommended that you use TFTP to load these images | ||
98 | using U-Boot. | ||
99 | |||
100 | Once U-Boot has been loaded, pause the execution using XSDB and use the `dow` | ||
101 | command to load the images into the targets memory. Once the images are loaded | ||
102 | continue the execution and return to the U-Boot console. | ||
103 | |||
104 | MicroBlaze (kc705-microblazeel): | ||
105 | |||
106 | xsdb% stop | ||
107 | xsdb% dow -data linux.bin.ub 0x85000000 | ||
108 | xsdb% dow -data core-image-minimal-kc705-microblazeel.cpio.gz.u-boot 0x86000000 | ||
109 | xsdb% dow -data kc705-microblazeel.dtb 0x84000000 | ||
110 | xsdb% con | ||
111 | |||
112 | Zynq: | ||
113 | |||
114 | xsdb% stop | ||
115 | xsdb% dow -data uImage 0x2000000 | ||
116 | xsdb% dow -data core-image-minimal-<machine name>.cpio.gz.u-boot 0x3000000 | ||
117 | xsdb% dow -data <machine name>.dtb 0x2A00000 | ||
118 | xsdb% con | ||
119 | |||
120 | ### Booting via U-Boot | ||
121 | At the U-Boot console use the `bootm` command to execute the kernel. | ||
122 | |||
123 | MicroBlaze (kc705-microblazeel): | ||
124 | |||
125 | U-Boot> bootm 0x85000000 0x86000000 0x84000000 | ||
126 | |||
127 | Zynq: | ||
128 | |||
129 | U-Boot> bootm 0x2000000 0x3000000 0x2A00000 | ||
130 | |||
131 | |||
132 | Loading via SD | ||
133 | --------------------- | ||
134 | **(Note: This section only applies to Zynq.)** | ||
135 | |||
136 | ### Preparing SD/MMC | ||
137 | Setup the card with the first partition formatted as FAT16. If you intend to | ||
138 | boot with the root filesystem located on the SD card, also create a second | ||
139 | partition formatted as EXT4. | ||
140 | |||
141 | It is recommended that the first partition be at least 64MB in size, however | ||
142 | this value will depend on whether using a ramdisk for the root filesystem and | ||
143 | how large the ramdisk is. | ||
144 | |||
145 | This section describes how to manually prepare and populate an SD card image. | ||
146 | There are automation tools in OpenEmbedded that can generate disk images already | ||
147 | formatted and prepared such that they can be written directly to a disk. Refer | ||
148 | to the Yocto Project Development Manual for more details: | ||
149 | http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#creating-partitioned-images | ||
150 | |||
151 | ### Installing U-Boot | ||
152 | Add the following files to the first partition: | ||
153 | |||
154 | * `boot.bin` | ||
155 | * `u-boot.img` | ||
156 | |||
157 | ### Installing Kernel and Device Tree | ||
158 | Add the following files to the first partition: | ||
159 | |||
160 | * `uImage` | ||
161 | * `<machine name>.dtb` | ||
162 | |||
163 | ### Installing Root Filesystem | ||
164 | If using a ramdisk also add the `.cpio.gz.u-boot` type of root filesystem image | ||
165 | to the first partition. | ||
166 | |||
167 | * `core-image-minimal-<machine name>.cpio.gz.u-boot` | ||
168 | |||
169 | If using the SD card as the root filesystem, populate the second partition with | ||
170 | the content of the root filesystem. To install the root filesystem extract the | ||
171 | corresponding tarball into the root of the second partition (the following | ||
172 | command assumes that the second partition is mounted at /media/root). | ||
173 | |||
174 | tar x -C /media/root -f core-image-minimal-<machine name>.tar.gz | ||
175 | |||
176 | ### U-Boot Configuration File | ||
177 | Also create the file `uEnv.txt` on the first partition of the SD card partition, | ||
178 | with the following contents. Replacing the names of files where appropriate. | ||
179 | |||
180 | kernel_image=uImage | ||
181 | devicetree_image=<machine name>.dtb | ||
182 | |||
183 | If using a ramdisk root filesystem setup the `ramdisk_image` variable. | ||
184 | |||
185 | ramdisk_image=core-image-minimal-<machine name>.cpio.gz.u-boot | ||
186 | |||
187 | If using the SD card as the root filesystem setup the kernel boot args, and | ||
188 | `uenvcmd` variable. | ||
189 | |||
190 | bootargs=root=/dev/mmcblk0p2 rw rootwait | ||
191 | uenvcmd=fatload mmc 0 0x3000000 ${kernel_image} && fatload mmc 0 0x2A00000 ${devicetree_image} && bootm 0x3000000 - 0x2A00000 | ||
192 | |||
193 | ### Booting | ||
194 | Insert the SD card and connect UART to a terminal program and power on the | ||
195 | board. (For boards that have configurable boot jumper/switches ensure the board | ||
196 | is configured for SD). | ||
197 | |||
198 | Initially U-Boot SPL will load, which will in turn load U-Boot. U-Boot will use | ||
199 | the `uEnv.txt` to automatically load and execute the kernel. | ||
200 | |||
201 | |||
202 | Loading via TFTP | ||
203 | ---------------- | ||
204 | **(Note: This boot flow requires ethernet on the baord and a TFTP server)** | ||
205 | |||
206 | Boot your system into U-Boot, using one of boot methods (e.g. JTAG, SD, QSPI). | ||
207 | |||
208 | ### Kernel, Root Filesystem and Device Tree | ||
209 | Place the following images into the root of the TFTP server directory: | ||
210 | |||
211 | * `core-image-minimal-<machine name>.cpio.gz.u-boot` | ||
212 | * `uImage` (Zynq) or `linux.bin.ub` (MicroBlaze) | ||
213 | * `<machine name>.dtb` | ||
214 | |||
215 | ### Booting via U-Boot | ||
216 | The serial console of the target board will display the U-Boot console. | ||
217 | Configure the `ipaddr` and `serverip` of the U-Boot environment. | ||
218 | |||
219 | U-Boot> set serverip <server ip> | ||
220 | U-Boot> set ipaddr <board ip> | ||
221 | |||
222 | Using the U-Boot console; load the Kernel, root filesystem and the DTB into | ||
223 | memory. And then boot Linux using the `bootm` command. (Note the load addresses | ||
224 | will be dependant on machine used) | ||
225 | |||
226 | MicroBlaze (kc705-microblazeel): | ||
227 | |||
228 | U-Boot> tftpboot 0x85000000 linux.bin.ub | ||
229 | U-Boot> tftpboot 0x86000000 core-image-minimal-kc705-microblazeel.cpio.gz.u-boot | ||
230 | U-Boot> tftpboot 0x84000000 kc705-microblazeel.dtb | ||
231 | U-Boot> bootm 0x85000000 0x86000000 0x84000000 | ||
232 | |||
233 | Zynq: | ||
234 | |||
235 | U-Boot> tftpboot 0x2000000 uImage | ||
236 | U-Boot> tftpboot 0x3000000 core-image-minimal-<machine name>.cpio.gz.u-boot | ||
237 | U-Boot> tftpboot 0x2A00000 <machine name>.dtb | ||
238 | U-Boot> bootm 0x2000000 0x3000000 0x2A00000 | ||
239 | |||
240 | U-Boot will prepare the Kernel for boot and then it will being to execute. | ||
241 | |||
242 | ... | ||
243 | Starting kernel... | ||
244 | |||