2023-08-02 19:28:17 +00:00
|
|
|
RISCV := /opt/riscv
|
|
|
|
BUILDROOT := ${RISCV}/buildroot
|
|
|
|
IMAGES := ${BUILDROOT}/output/images
|
2023-08-02 21:12:26 +00:00
|
|
|
WALLY := $(shell dirname $(shell pwd))
|
2023-08-02 19:28:17 +00:00
|
|
|
WALLYLINUX := $(shell pwd)
|
2023-08-02 19:56:23 +00:00
|
|
|
PACKAGE_SOURCE := ${WALLYLINUX}/buildroot-packages/package-source
|
|
|
|
FPGA_AXI_SDC := ${WALLYLINUX}/buildroot-packages/fpga-axi-sdc
|
2023-08-02 21:12:26 +00:00
|
|
|
DRIVER := ${PACKAGE_SOURCE}/fpga-axi-sdc.c
|
2023-08-02 19:28:17 +00:00
|
|
|
|
2023-08-03 00:26:35 +00:00
|
|
|
DTS ?= $(shell find -type f -regex ".*\.dts" | sort)
|
2023-08-02 19:28:17 +00:00
|
|
|
|
2023-08-03 00:26:35 +00:00
|
|
|
.PHONY: generate cleanDriver patch
|
|
|
|
|
|
|
|
# Generate device tree binaries from device tree source files
|
|
|
|
# Currently supported fpga device tree binaries are also generated
|
|
|
|
generate: $(DTS) $(IMAGES)
|
|
|
|
dtc -I dts -O dtb devicetree/wally-virt.dts > ${IMAGES}/wally-virt.dtb
|
|
|
|
dtc -I dts -O dtb devicetree/wally-vcu108.dts > ${IMAGES}/wally-vcu108.dtb
|
|
|
|
dtc -I dts -O dtb devicetree/wally-vcu118.dts > ${IMAGES}/wally-vcu118.dtb
|
|
|
|
dtc -I dts -O dtb devicetree/wally-vcu118.dts > ${IMAGES}/wally-artya7.dtb
|
|
|
|
|
|
|
|
disassemble:
|
|
|
|
|
|
|
|
# Generating new Buildroot directories --------------------------------
|
2023-08-02 19:28:17 +00:00
|
|
|
|
2023-08-02 23:59:42 +00:00
|
|
|
# This directive should be run as: make patch BUILDROOT=path/to/buildroot
|
2023-08-02 21:12:26 +00:00
|
|
|
patch: $(BUILDROOT) $(DRIVER)
|
2023-08-02 21:24:20 +00:00
|
|
|
@ echo "Patching buildroot directory at: $<"
|
2023-08-03 00:26:35 +00:00
|
|
|
@ echo "Copying wally configuration files and rootfs_overlay to buildroot."
|
2023-08-02 19:28:17 +00:00
|
|
|
cp -r $(WALLYLINUX)/buildroot-config-src/wally $</board
|
2023-08-03 00:26:35 +00:00
|
|
|
|
|
|
|
@ echo
|
2023-08-02 19:28:17 +00:00
|
|
|
cp -r $(WALLYLINUX)/buildroot-packages/fpga-axi-sdc $</package
|
2023-08-02 19:56:23 +00:00
|
|
|
sed -i 's|FPGA_AXI_SDC_SITE =|FPGA_AXI_SDC_SITE = $(PACKAGE_SOURCE)|1' $(BUILDROOT)/package/fpga-axi-sdc/fpga-axi-sdc.mk
|
2023-08-02 19:28:17 +00:00
|
|
|
cp $(WALLYLINUX)/buildroot-config-src/buildroot-2023.05.1/linux.config $</board/wally/linux.config
|
|
|
|
cp $(WALLYLINUX)/buildroot-config-src/buildroot-2023.05.1/main.config $</board/wally/main.config
|
|
|
|
cd $<; git apply $(WALLYLINUX)/buildroot-packages/package-2023.05.1.patch
|
2023-08-02 21:12:26 +00:00
|
|
|
cd $<; cp $(BUILDROOT)/board/wally/main.config $(BUILDROOT)/.config
|
2023-08-02 19:28:17 +00:00
|
|
|
|
|
|
|
$(BUILDROOT):
|
|
|
|
git clone https://github.com/buildroot/buildroot.git $@
|
|
|
|
cd $@; git checkout 2023.05.x
|
|
|
|
|
2023-08-02 21:12:26 +00:00
|
|
|
$(DRIVER):
|
|
|
|
@ if [ -d "$(WALLY)/addins/vivado-risc-v" ] ; then git submodule update --init $(WALLY)/addins/vivado-risc-v; fi
|
2023-08-02 21:24:20 +00:00
|
|
|
cp ../addins/vivado-risc-v/patches/fpga-axi-sdc.c $@
|
2023-08-02 21:12:26 +00:00
|
|
|
|
2023-08-02 23:59:42 +00:00
|
|
|
$(IMAGES):
|
|
|
|
@ echo "No output/images directory in buildroot."
|
2023-08-03 00:26:35 +00:00
|
|
|
@ echo "Run make --jobs in buildroot directory before generating device tree binaries."; exit 1
|
|
|
|
|
|
|
|
# ---------------------------------------------------------------------
|
2023-08-02 23:59:42 +00:00
|
|
|
|
2023-08-03 00:26:35 +00:00
|
|
|
cleanDriver:
|
2023-08-02 23:59:42 +00:00
|
|
|
rm -f $(DRIVER)
|