Skip to content

Commit

Permalink
Revert "Makefile: Update to Vivado Version 2021.1"
Browse files Browse the repository at this point in the history
This reverts commit 315422d.
  • Loading branch information
mhennerich committed Jul 11, 2022
1 parent f3073ff commit 2ea3aa8
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 19 deletions.
31 changes: 15 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#PATH=$PATH:/opt/Xilinx/SDK/2015.4/gnu/arm/lin/bin

VIVADO_VERSION ?= 2021.1
VIVADO_VERSION ?= 2019.1
CROSS_COMPILE ?= arm-linux-gnueabihf-

HAVE_CROSS=$(shell which $(CROSS_COMPILE)gcc | wc -l)
Expand Down Expand Up @@ -130,32 +130,31 @@ build/rootfs.cpio.gz: buildroot/output/images/rootfs.cpio.gz | build
build/$(TARGET).itb: u-boot-xlnx/tools/mkimage build/zImage build/rootfs.cpio.gz $(TARGET_DTS_FILES) build/system_top.bit
u-boot-xlnx/tools/mkimage -f scripts/$(TARGET).its $@

build/system_top.xsa: | build
build/system_top.hdf: | build
ifeq (1, ${HAVE_VIVADO})
bash -c "source $(VIVADO_SETTINGS) && make -C hdl/projects/$(TARGET) && cp hdl/projects/$(TARGET)/$(TARGET).sdk/system_top.xsa $@"
bash -c "source $(VIVADO_SETTINGS) && make -C hdl/projects/$(TARGET) && cp hdl/projects/$(TARGET)/$(TARGET).sdk/system_top.hdf $@"
unzip -l $@ | grep -q ps7_init || cp hdl/projects/$(TARGET)/$(TARGET).srcs/sources_1/bd/system/ip/system_sys_ps7_0/ps7_init* build/
else ifneq ($(XSA_FILE),)
cp $(XSA_FILE) $@
else ifneq ($(XSA_URL),)
wget -T 3 -t 1 -N --directory-prefix build $(XSA_URL)
else ifneq ($(HDF_FILE),)
cp $(HDF_FILE) $@
else ifneq ($(HDF_URL),)
wget -T 3 -t 1 -N --directory-prefix build $(HDF_URL)
endif

### TODO: Build system_top.xsa from src if dl fails - need 2016.2 for that ...
### TODO: Build system_top.hdf from src if dl fails - need 2016.2 for that ...

build/sdk/hw0/zynq_fsbl/fsbl.elf build/sdk/hw0/hw/system_top.bit : build/system_top.xsa
build/sdk/fsbl/Release/fsbl.elf build/sdk/hw_0/system_top.bit : build/system_top.hdf
rm -Rf build/sdk
pwd
ifeq (1, ${HAVE_VIVADO})
bash -c "source $(VIVADO_SETTINGS) && xsct scripts/create_fsbl_project.tcl"
bash -c "source $(VIVADO_SETTINGS) && xsdk -batch -source scripts/create_fsbl_project.tcl"
else
mkdir -p build/sdk/hw0
unzip -o build/system_top.xsa system_top.bit -d build/sdk/hw0
mkdir -p build/sdk/hw_0
unzip -o build/system_top.hdf system_top.bit -d build/sdk/hw_0
endif

build/system_top.bit: build/sdk/hw0/hw/system_top.bit
build/system_top.bit: build/sdk/hw_0/system_top.bit
cp $< $@

build/boot.bin: build/sdk/hw0/zynq_fsbl/fsbl.elf build/u-boot.elf
build/boot.bin: build/sdk/fsbl/Release/fsbl.elf build/u-boot.elf
@echo img:{[bootloader] $^ } > build/boot.bif
bash -c "source $(VIVADO_SETTINGS) && bootgen -image build/boot.bif -w -o $@"

Expand Down Expand Up @@ -218,7 +217,7 @@ dfu-ram: build/$(TARGET).dfu
dfu-util -D build/$(TARGET).dfu -a firmware.dfu
dfu-util -e

jtag-bootstrap: build/u-boot.elf build/sdk/hw0/hw/ps7_init.tcl build/sdk/hw0/hw/system_top.bit scripts/run.tcl
jtag-bootstrap: build/u-boot.elf build/sdk/hw_0/ps7_init.tcl build/sdk/hw_0/system_top.bit scripts/run.tcl
$(CROSS_COMPILE)strip build/u-boot.elf
zip -j build/$(ZIP_ARCHIVE_PREFIX)-$@-$(VERSION).zip $^

Expand Down
19 changes: 16 additions & 3 deletions scripts/create_fsbl_project.tcl
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
hsi open_hw_design build/system_top.xsa
hsi open_hw_design build/system_top.hdf
set cpu_name [lindex [hsi get_cells -filter {IP_TYPE==PROCESSOR}] 0]
platform create -name hw0 -hw build/system_top.xsa -os standalone -out ./build/sdk -proc $cpu_name
platform generate

sdk setws ./build/sdk
sdk createhw -name hw_0 -hwspec build/system_top.hdf

# Workaround for broken write_sysdev in vivado 2018.2
catch {
set copyfiles [glob ./build/ps7_init*]
if {[llength $copyfiles]} {
file copy {*}$copyfiles ./build/sdk/hw_0/
}
}
sdk createapp -name fsbl -hwproject hw_0 -proc $cpu_name -os standalone -lang C -app {Zynq FSBL}
configapp -app fsbl build-config release
sdk projects -build -type all
#xsdk -batch -source create_fsbl_project.tcl

0 comments on commit 2ea3aa8

Please sign in to comment.