Zynq - Boot

Aus Nicki Wiki
Zur Navigation springen Zur Suche springen

JTAG boot

petalinux-boot --jtag --u-boot   # Upload von fsbl, devicetree, u-boot
petalinux-boot --jtag --kernel   # Upload von fsbl.elf, system.dtb (devicetree), 
                                   u-boot.elf, uImage, rootfs.cpio.gz.u-boot, boot.scr

SD-Card boot

BOOT.bin

Erstellen BOOT.bin (fpga, fsbl, u-boot):

petalinux-package --boot --fsbl images/linux/fsbl.elf --u-boot images/linux/u-boot.elf --fpga images/linux/design_minimal_wrapper.bit

Auf SD-Karte kopieren.

Linux

Nötige Daten zum booten von Linux mit der SD-Karte:

images/linux/BOOT.bin               #fpga, fsbl, u-boot
images/linux/boot.src               #boot script

Zusätzlich Variante 1 oder Variante 2 auf SD-Karte kopieren.

images/linux/image.ub               #device tree, kernel und rootfs
  • Variante 2:
images/linux/system.dtb             #device tree
images/linux/uImage                 #kernel
images/linux/rootfs.cpio.gz.u-boot  #rootfs

TFTP-Boot

Für TFTP-boot muss der Zynq erst fsbl und u-boot laden, entweder über SD-Karte, Flash oder JTAG. Das u-boot lädt die Dateien übers Netzwerk vom TFTP-Server.
Download nötiger Tools:

sudo apt install -y u-boot-tools

Das U-Boot Bootskript boot.scr enthält die Downloadanleitung für das u-boot.

Variante 1 (Flattened Image Tree)

Bootskript: boot.scr

echo
echo *********************
echo Load and program FPGA
echo *********************
setenv loadbit_addr_r 0x1000000
tftpboot ${loadbit_addr_r} 1_design_minimal_wrapper.bit
fpga loadb 0 ${loadbit_addr_r} ${filesize}
echo
echo ****************
echo Load Linux files
echo ****************
setenv image_addr_r 0x10000000
tftpboot ${image_addr_r} image.ub
echo
echo **************
echo Starting Linux
echo **************
bootm ${image_addr_r}

Mit mkimage das boot.scr.uimg erzeugen:

mkimage -A arm -O linux -T script -C none -n boot.scr -d boot.scr boot.scr.uimg

Neben dem boot.scr.uimg müssen zusätzlich folgende Dateien im TFTP-Server Verzeichniss liegen:

system.dtb             #device tree
uImage                 #kernel
rootfs.cpio.gz.u-boot  #rootfs

Variante 2

Bootskript:

echo
echo *********************
echo Load and program FPGA
echo *********************
setenv loadbit_addr_r 0x1000000
tftpboot ${loadbit_addr_r} 1_design_minimal_wrapper.bit
fpga loadb 0 ${loadbit_addr_r} ${filesize}
echo
echo ****************
echo Load Linux files
echo ****************
setenv fdt_addr_r 0x1f00000
setenv kernel_addr_r 0x2000000
setenv ramdisk_addr_r 0x3100000
tftpboot ${fdt_addr_r}     3_devicetree.dtb
tftpboot ${kernel_addr_r}  4_uImage
tftpboot ${ramdisk_addr_r} 5_rootfs.cpio.gz.u-boot
echo
echo **************
echo Starting Linux
echo **************
bootm ${kernel_addr_r} ${ramdisk_addr_r} ${fdt_addr_r}

Mit mkimage das boot.scr.uimg erzeugen:

mkimage -A arm -O linux -T script -C none -n boot.scr -d boot.scr boot.scr.uimg

Neben dem boot.scr.uimg muss zusätzlich folgende Datei im TFTP-Server Verzeichniss liegen:

image.ub               #device tree, kernel und rootfs

TFTP-Server

TFTP-Server starten danach den Zynq mit Ethernet starten.

Probleme

DHCP: Es wird keine oder erst sehr spät eine IP-Adresse vergeben (non-pxe client).
u-boot -> Kconfig

default "U-Boot.armv7" if CPU_V7A || CPU_V7M || CPU_V7R

ändern zu:

default "PXEClient:U-Boot.armv7" if CPU_V7A || CPU_V7M || CPU_V7R
Fehler Lösung

Upload fsbl.elf und u-boot.elf
Keine oder nur fsbl.elf Ausgabe über die serielle Konsole.

Die Ausgabe vom u-boot.elf erfolgt über UART 1 (nicht UART 0)