NAI Deos QSPI Flash Boot Guide
This guide stores a Deos image in the QSPI flash of an NAI Zynq UltraScale+ motherboard (68ARM2, NIU3A or NIU3E) and sets U-Boot to boot it from there. You can program the flash from U-Boot or from Linux. To build the images, see the NAI Deos Quick-Start Guide. To boot from a SATA drive instead, see the NAI Deos SATA Boot Guide.
Warning
QSPI flash also holds the board’s U-Boot, Linux, Xilinx FSBL and ATF firmware. Programming the wrong region can leave the motherboard unable to boot. Keep a UART connection to the board so you can recover from U-Boot.
NAI Flash Map
The Deos images go in these QSPI flash regions:
| Region | File | Offset | Size |
|---|---|---|---|
| Deos Boot | deosBoot.bin | 0x1800’0000 | 0x0010’0000 (1 MiB) |
| User Application Image | composite.darc | 0x1810’0000 | 0x07F0’0000 (127 MiB) |
The Deos regions end at 0x2000’0000, so the board needs 512 MiB of QSPI flash. Offsets must be 128 KiB aligned.
Using U-Boot
Required Tools (U-Boot)
- NAI Zynq UltraScale+ motherboard (68ARM2, NIU3A or NIU3E)
- Ethernet and UART connections to the board
- Deos images built in OpenArbor:
deosBoot.binandcomposite.darc - Terminal emulator (Tera Term, PuTTY, etc.) set up for 115200 baud, 8 data bits, 1 stop bit, no parity
- TFTP server running on the development machine (for example, Tftpd64.exe)
Configure Ethernet Settings (U-Boot)
In U-Boot, set the board’s IP address and the TFTP server’s IP address:
setenv ipaddr 192.168.1.16
setenv serverip 192.168.1.100
saveenvProgram the Deos Images Into Flash (U-Boot)
Start the TFTP server so that it serves deosBoot.bin from its root folder and
composite.darc from an output folder, then run these U-Boot commands:
Note
Some terminal emulators buffer pasted text and can truncate or corrupt long commands. If that happens, paste the five offset and size lines first, then paste the rest.
setenv dbootstart 0x18000000
setenv dbootsize 0x00100000
setenv deosapp 0x18100000
setenv deosappsize 0x07F00000
setenv clobstart 0x01000000
# Load deosBoot.bin and store its filesize
setenv tftp_deos_boot 'tftpboot ${clobstart} deosBoot.bin && setenv dbootfilesize ${filesize}'
# Install deosBoot.bin using saved filesize
setenv install_deos_boot 'sf probe 0 && sf erase ${dbootstart} +${dbootsize} && sf write ${clobstart} ${dbootstart} ${dbootfilesize}'
# Load composite.darc and store its filesize
setenv tftp_deos_app 'tftpboot ${clobstart} output/composite.darc && setenv deosappfilesize ${filesize}'
# Install composite.darc using saved filesize
setenv install_deos_app 'sf probe 0 && sf erase ${deosapp} +${deosappsize} && sf write ${clobstart} ${deosapp} ${deosappfilesize}'
# Complete flashing process
setenv flash_deos 'run tftp_deos_boot && run install_deos_boot && run tftp_deos_app && run install_deos_app'
run flash_deos
saveenvBoot From Flash (U-Boot)
By default, NAI’s instructions set U-Boot to load Deos from a TFTP server. To
boot from flash instead, add this variable. The ping initializes the network
controller before Deos starts. It doesn’t need a reply from the server.
setenv dbootQspi 'ping $serverip; sf probe 0 && sf read 0x0001B000 ${dbootstart} ${dbootfilesize} && sf read 0x20000000 ${deosapp} ${deosappfilesize} && dcache flush && dcache off && go 1b000 20000000'
saveenvNote
DDC-I’s BSP user guide loads
composite.darcat0x2B000. NAI boards load it at0x20000000instead. On the NIU3A and NIU3E, U-Boot loads the R5 firmware into DDR at0x40000000and the module calibration file at0x40400000, above the darc.
Set the Boot Command (U-Boot)
bootcmd is the U-Boot variable that runs when the board starts. To boot Deos
from QSPI flash every time, add a load_fw_deos_qspi variable for your board,
then point bootcmd at it. The boards need different steps before Deos
starts: the NIU3A and NIU3E load the R5 firmware and its calibration, and the
68ARM2 enumerates its PCIe devices.
If load_cal isn’t defined, U-Boot prints ## Error: "load_cal" not defined
and continues booting. You can ignore it: on those boards, U-Boot loads the
module calibration within firmware instead.
For a NIU3A or NIU3E:
setenv load_fw_deos_qspi 'run load_cal; run cfg_satawp && run R5fw && run dbootQspi'For a 68ARM2 (U-Boot on older 68ARM2 boards doesn’t define cfg_satawp, so
the first line adds it):
setenv cfg_satawp 'setexpr nvmro *0x83c10098 \& 0x4; if itest 4 -eq $nvmro; then mw.l 0x83c10094 1; else mw.l 0x83c10094 0; fi; mw.l 0x83c40160 1;'
setenv load_fw_deos_qspi 'run cfg_satawp && pci enum && run dbootQspi'Then, on any board:
setenv bootcmd 'run load_fw_deos_qspi'
saveenvUsing Linux
Required Tools (Linux)
- NAI Zynq UltraScale+ motherboard (68ARM2, NIU3A or NIU3E) running Linux
- Ethernet connection and SSH access to the board
- Deos images built in OpenArbor:
deosBoot.binandcomposite.darc
Warning
Without a UART connection, a failed Deos boot leaves the board unusable until you can reach U-Boot over the UART.
Program the Deos Images Into Flash (Linux)
From the development machine, copy the images to temporary storage on the board:
scp deosBoot.bin root@192.168.1.16:/var/volatile
scp composite.darc root@192.168.1.16:/var/volatileLog in to the board and go to that folder:
ssh root@192.168.1.16
cd /var/volatileProgram the images into flash. The offsets are relative to the start of the Deos Boot region (see NAI Flash Map) and must be 128 KiB aligned.
cust_flash -v deosBoot.bin 0x0
cust_flash -v composite.darc 0x100000Boot From Flash (Linux)
Add the U-Boot variables from Linux. The ping in dbootQspi initializes the
network controller before Deos starts. It doesn’t need a reply from the server.
fw_setenv dbootstart 0x18000000
fw_setenv dbootsize 0x00100000
fw_setenv deosapp 0x18100000
fw_setenv deosappsize 0x07F00000
fw_setenv ipaddr 192.168.1.16
fw_setenv serverip 192.168.1.100
fw_setenv dbootQspi 'ping $serverip; sf probe 0 && sf read 0x0001B000 ${dbootstart} ${dbootsize} && sf read 0x20000000 ${deosapp} ${deosappsize} && dcache flush && dcache off && go 1b000 20000000'Set the Boot Command (Linux)
To boot Deos from QSPI flash every time, add the load_fw_deos_qspi variable
for your board and point bootcmd at it (see
Set the Boot Command (U-Boot) for why the boards differ).
For a NIU3A or NIU3E:
fw_setenv load_fw_deos_qspi 'run load_cal; run cfg_satawp && run R5fw && run dbootQspi'For a 68ARM2 (U-Boot on older 68ARM2 boards doesn’t define cfg_satawp, so
the first line adds it):
fw_setenv cfg_satawp 'setexpr nvmro *0x83c10098 \& 0x4; if itest 4 -eq $nvmro; then mw.l 0x83c10094 1; else mw.l 0x83c10094 0; fi; mw.l 0x83c40160 1;'
fw_setenv load_fw_deos_qspi 'run cfg_satawp && pci enum && run dbootQspi'Then, on any board:
fw_setenv bootcmd 'run load_fw_deos_qspi'