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