Use U-Boot SPL instead of Xilinx FSBL

This commit is contained in:
Joris van Rantwijk 2024-09-19 21:08:22 +02:00
parent 4dbc5a60ad
commit f5d027cecc
4 changed files with 25 additions and 3 deletions

View File

@ -7,6 +7,19 @@ setup_toolchain
make -C "$UBOOT_DIR" CROSS_COMPILE=arm-linux- distclean make -C "$UBOOT_DIR" CROSS_COMPILE=arm-linux- distclean
# We need the XSA file from Vivado.
# It contains the init code for the U-Boot SPL image.
if [ ! -f "$XSA_FILE" ]; then
echo "ERROR: $XSA_FILE not found" >&2
echo "Build the FPGA image before building U-Boot."
exit 1
fi
# Create board directory with ps7_init_gpl.c.
rm -rf "$UBOOT_DIR/board/xilinx/zynq/redpitaya"
mkdir "$UBOOT_DIR/board/xilinx/zynq/redpitaya"
unzip $XSA_FILE ps7_init_gpl.c ps7_init_gpl.h -d "$UBOOT_DIR/board/xilinx/zynq/redpitaya"
cp -a devicetree/redpitaya_puzzlefw.dts "$UBOOT_DIR/arch/arm/dts/redpitaya.dts" cp -a devicetree/redpitaya_puzzlefw.dts "$UBOOT_DIR/arch/arm/dts/redpitaya.dts"
cp -a config/uboot_redpitaya_puzzlefw_defconfig "$UBOOT_DIR/configs/redpitaya_puzzlefw_defconfig" cp -a config/uboot_redpitaya_puzzlefw_defconfig "$UBOOT_DIR/configs/redpitaya_puzzlefw_defconfig"

View File

@ -13,8 +13,9 @@ fi
mkdir -p "$SDCARD_DIR" mkdir -p "$SDCARD_DIR"
# Copy Xilinx boot image (FSBL and U-Boot) # Copy U-Boot SPL and U-Boot program image
cp -a "$BOOTIMG_DIR/boot.bin" "$SDCARD_DIR" cp -a "$UBOOT_DIR/spl/boot.bin" "$SDCARD_DIR"
cp -a "$UBOOT_DIR/u-boot.img" "$SDCARD_DIR"
# Wrap Linux kernel in U-Boot image file # Wrap Linux kernel in U-Boot image file
$MKIMAGE -A arm -O linux -C none -T kernel -a 0x8000 -e 0x8000 -n Linux -d "$LINUX_DIR/arch/arm/boot/zImage" "$SDCARD_DIR/uImage" $MKIMAGE -A arm -O linux -C none -T kernel -a 0x8000 -e 0x8000 -n Linux -d "$LINUX_DIR/arch/arm/boot/zImage" "$SDCARD_DIR/uImage"

View File

@ -146,7 +146,11 @@
}; };
&qspi { &qspi {
status = "okay"; // NOTE: "bootph-all" is a marker for U-Boot.
// It must be added to all sections that are required
// for the U-Boot SPL image.
bootph-all;
status = "okay";
is-dual = <0>; is-dual = <0>;
num-cs = <1>; num-cs = <1>;
spi-rx-bus-width = <4>; spi-rx-bus-width = <4>;
@ -154,6 +158,7 @@
}; };
&sdhci0 { &sdhci0 {
bootph-all;
status = "okay"; status = "okay";
xlnx,has-cd = <0x1>; xlnx,has-cd = <0x1>;
xlnx,has-power = <0x1>; xlnx,has-power = <0x1>;
@ -173,6 +178,7 @@
}; };
&uart0 { &uart0 {
bootph-all;
status = "okay"; status = "okay";
device_type = "serial"; device_type = "serial";
cts-override; cts-override;

View File

@ -17,6 +17,8 @@ LINUX_DIR="linux-xlnx"
BOOTIMG_DIR="boot_img" BOOTIMG_DIR="boot_img"
SDCARD_DIR="sdcard_files" SDCARD_DIR="sdcard_files"
XSA_FILE="../fpga/vivado/output/redpitaya_puzzlefw.xsa"
setup_toolchain () { setup_toolchain () {
if [ ! -x "$TOOLCHAIN_DIR/arm-linux-gcc" ]; then if [ ! -x "$TOOLCHAIN_DIR/arm-linux-gcc" ]; then
echo "ERROR: Missing $TOOLCHAIN_DIR/arm-linux-gcc" >&2 echo "ERROR: Missing $TOOLCHAIN_DIR/arm-linux-gcc" >&2