summaryrefslogtreecommitdiffstats
path: root/docs/README.booting.flash.md
diff options
context:
space:
mode:
authorSandeep Gundlupet Raju <sandeep.gundlupet-raju@amd.com>2023-02-26 23:12:20 -0700
committerMark Hatle <mark.hatle@amd.com>2023-04-10 09:03:22 -0700
commit757705bb7d825f9b05ccc25e5dcef4de35316b17 (patch)
treee1cac167d1a8bf968cfd21e597ed8e3f2123f4fc /docs/README.booting.flash.md
parenta7e29ded2e51ee48dcafd07e365e1b93c63a3a74 (diff)
downloadmeta-xilinx-757705bb7d825f9b05ccc25e5dcef4de35316b17.tar.gz
docs: Add README for booting instructions for all devices
Add README for booting instructions for all devices with supported boot mediums. Signed-off-by: Sandeep Gundlupet Raju <sandeep.gundlupet-raju@amd.com> Signed-off-by: Mark Hatle <mark.hatle@amd.com>
Diffstat (limited to 'docs/README.booting.flash.md')
-rw-r--r--docs/README.booting.flash.md133
1 files changed, 133 insertions, 0 deletions
diff --git a/docs/README.booting.flash.md b/docs/README.booting.flash.md
new file mode 100644
index 00000000..3bc39882
--- /dev/null
+++ b/docs/README.booting.flash.md
@@ -0,0 +1,133 @@
1# Booting OS Images from Flash Device
2
3Booting OS Images from flash devices such as QSPI/NOR/NAND/OSPI.
4
5* [U-boot boot scripts configurations](#u-boot-boot-scripts-configurations)
6* [Booting from QSPI or NOR or OSPI](#booting-from-qspi-or-nor-or-ospi)
7
8## U-boot boot scripts configurations
9
101. In QSPI/OSPI/NAND boot modes the boot.scr partition offset is fixed for all the
11 platforms by default in u-boot, and you can change by updating
12 CONFIG_BOOT_SCRIPT_OFFSET in u-boot config. Default boot script size is
13 512KB(script_size_f=0x80000).
142. Below table describes boot.scr partition offset and load address for all the
15 platforms.
16
17| Device | Partition Offset address for boot.scr | Load address of boot.scr in DDR |
18|------------|---------------------------------------|----------------------------------------|
19| MicroBlaze | 0x1F00000 | DDR base address + DDR Size - 0xe00000 |
20| Zynq-7000 | 0xFC0000 | DDR base address + 0x3000000 |
21| ZynqMP | 0x3E80000 | DDR base address + 0x20000000 |
22| Versal | 0x7F80000 | DDR base address + 0x20000000 |
23
24## Booting from QSPI or NOR or OSPI
25
26This section demonstrates the booting OS images from QSPI boot mode. For this,
27you need to make sure you have QSPI interface on board or a QSPI daughter card.
28
29> **Note:** Instructions are same for QSPI or NOR and OSPI flash.
30
311. For example we'll assume QSPI flash size is 128MB and default CONFIG_BOOT_SCRIPT_OFFSET
32 defined in u-boot.
33
34| Flash Partition Name | Partition Offset | Partition Size |
35|----------------------|------------------|----------------|
36| boot.bin | 0x0 | 30MB |
37| bootenv | 0x1E00000 | 256Kb |
38| kernel | 0x1E40000 | 33MB |
39| bootscr | 0x3E80000 | 1.5MB |
40| rootfs | 0x4000000 | 64MB |
41
422. Create a flash partition device-tree nodes depending on your flash size. ex:
43```
44&qspi {
45 #address-cells = <1>;
46 #size-cells = <0>;
47 flash0: flash@0 {
48 spi-tx-bus-width=<4>;
49 spi-rx-bus-width=<4>;
50 partition@0 {
51 label = "boot";
52 reg = <0x00000000 0x01e00000>;
53 };
54 partition@1 {
55 label = "bootenv";
56 reg = <0x01e00000 0x00040000>;
57 };
58 partition@2 {
59 label = "kernel";
60 reg = <0x01e40000 0x02040000>;
61 };
62 partition@3 {
63 label = "bootscr";
64 reg = <0x03e80000 0x01800000>;
65 };
66 partition@4 {
67 label = "rootfs";
68 reg = <0x04000000 0x04000000>;
69 };
70 };
71};
72```
733. Set the U-boot boot script variables to match the flash partition offsets in
74 local.conf
75```
76QSPI_KERNEL_OFFSET = "0x1E40000"
77QSPI_KERNEL_SIZE = "0x2040000"
78QSPI_RAMDISK_OFFSET = "0x4000000"
79QSPI_RAMDISK_SIZE = "0x4000000"
80```
814. Build the images and make sure images are copied to tftp directory.
825. Once images are built, to ensure taget is booted using JTAG or SD boot modes.
836. Also have boot.bin copied to DDR location using XSCT `dow` or `tftpboot` or
84 `fatload` command.
857. Halt at U-Boot then run the following commands to flash the images on the
86 QSPI flash.
87```
88# check QSPI is available or not
89U-Boot> sf probe 0 0 0
90
91# Erase the boot partition
92U-Boot> sf erase 0x0 0x1E00000
93
94# Copy the boot.bin to DDR location using tftpboot
95U-Boot> tftpboot 0x10000000 ${TFTPDIR}/boot.bin
96
97# Write boot.bin file image to flash partition
98U-Boot> sf write 0x10000000 0x0 ${filesize}
99
100# Erase the bootenv partition for env storage (saveenv).
101U-Boot> sf erase 0x1E00000 0x1E40000
102
103# Erase the kernel partition
104U-Boot> sf erase 0x1E40000 0x2040000
105
106# Copy the Image file to DDR location using tftpboot
107U-Boot> tftpboot 0x10000000 ${TFTPDIR}/Image
108
109# Write kernel image to flash partition
110U-Boot> sf write 0x10000000 0x1E40000 ${filesize}
111
112# Erase the bootscr partition
113U-Boot> sf erase 0x3E80000 0x1800000
114
115# Copy the boot.scr file to DDR location using tftpboot
116U-Boot> tftpboot 0x10000000 ${TFTPDIR}/boot.scr
117
118# Write boot.scr file to flash partition
119U-Boot> sf write 0x10000000 0x3E80000 ${filesize}
120
121# Erase the rootfs partition
122U-Boot> sf erase 0x4000000 0x4000000
123
124# Copy the rootfs.cpio.gz.u-boot file to DDR location using tftpboot
125U-Boot> tftpboot 0x10000000 ${TFTPDIR}/rootfs.cpio.gz.u-boot
126
127# Write rootfs image to flash partition
128U-Boot> sf write 0x10000000 0x4000000 ${filesize}
129```
1308. After flashing the images, turn off the board and change the boot mode pin
131 settings to QSPI boot mode.
1329. Power cycle the board. The board now boots up using the images in the QSPI
133 flash.