-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathMakefile.zedboard
More file actions
75 lines (54 loc) · 2.5 KB
/
Copy pathMakefile.zedboard
File metadata and controls
75 lines (54 loc) · 2.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
litex_platform = digilent_zedboard
uboot_device_tree = zynq-zed
uboot_defconfig = xilinx_zynq_virt_defconfig
vivado = vivado -nojournal -nolog -mode batch
soc_dir = build/$(litex_platform)
uboot_build_dir = $(soc_dir)/software/u-boot
uboot_src_dir = lib/u-boot
soc = poetry run python lib/litex-boards/litex_boards/targets/$(litex_platform).py
bitstream_file = $(soc_dir)/gateware/$(litex_platform).bit
firmware_elf = $(soc_dir)/software/bios/bios.elf
firmware_bin = $(soc_dir)/software/bios/bios.bin
.DEFAULT_GOAL := all
.PHONY: all clean $(firmware_elf)
all: $(soc_dir)/qspi.bin build/$(litex_platform)/boot.scr
.venv:
poetry install
clean:
rm -rf $(soc_dir)
$(firmware_elf): .venv
$(soc)
$(firmware_bin): $(firmware_elf)
$(bitstream_file): .venv
$(soc) --build && \
grep -i "All user specified timing constraints are met" $(soc_dir)/gateware/vivado.log
test -f $@
$(uboot_build_dir)/.config:
make -C $(uboot_src_dir) O=${CURDIR}/$(uboot_build_dir) ARCH=arm DEVICE_TREE=$(uboot_device_tree) CROSS_COMPILE=arm-none-linux-gnueabihf- $(uboot_defconfig)
$(uboot_build_dir)/u-boot.img: $(uboot_build_dir)/.config
make -C $(uboot_src_dir) O=${CURDIR}/$(uboot_build_dir) ARCH=arm DEVICE_TREE=$(uboot_device_tree) CROSS_COMPILE=arm-none-linux-gnueabihf- -j
$(uboot_build_dir)/spl/u-boot-spl.bin: $(uboot_build_dir)/u-boot.img
build/$(litex_platform)/boot_qspi.scr: $(litex_platform)/boot_qspi.cmd
$(uboot_build_dir)/tools/mkimage -C none -A arm -T script -d $< $@
build/$(litex_platform)/boot.scr: $(litex_platform)/boot_sd.cmd
$(uboot_build_dir)/tools/mkimage -C none -A arm -T script -d $< $@
lib/zynq-mkbootimage/mkbootimage:
cd $(@D) && make
$(soc_dir)/qspi.bin: $(litex_platform)/boot.bif $(bitstream_file) $(uboot_build_dir)/u-boot.img build/$(litex_platform)/boot_qspi.scr build/digilent_zedboard/software/bios/bios.bin $(uboot_build_dir)/spl/u-boot-spl.bin lib/zynq-mkbootimage/mkbootimage
./lib/zynq-mkbootimage/mkbootimage $< $@
gateware: $(bitstream_file)
load: $(firmware_elf) $(bitstream_file)
xsct scripts/ps7_boot.tcl \
build/$(litex_platform)/gateware/$(litex_platform).gen/sources_1/ip/Zynq/ps7_init.tcl \
$(firmware_elf) \
$(bitstream_file)
openocd:
openocd -f board/digilent_zedboard.cfg
gdb: $(firmware_elf)
arm-none-eabi-gdb -ex 'target extended-remote :3333' $^
flash: $(soc_dir)/qspi.bin
xsct scripts/ps7_flash.tcl \
build/$(litex_platform)/gateware/$(litex_platform).gen/sources_1/ip/Zynq/ps7_init.tcl \
$<
flash2: $(soc_dir)/qspi.bin
program_flash -f $< -flash_type qspi-x4-single -fsbl ./zynq_fsbl.elf