add device tree stuff
This commit is contained in:
@@ -60,6 +60,58 @@ tcl: $(BUILD_QUARTUS_DIR)/$(PROJECT).qsf $(BUILD_QUARTUS_DIR)/$(PROJECT).qpf
|
||||
$(BUILD_QUARTUS_DIR)/output_files/sockit.sof quartus: tcl
|
||||
cd $(BUILD_QUARTUS_DIR) && quartus_sh --flow compile $(QUARTUS_QPF)
|
||||
|
||||
HELP_TARGETS += quartus
|
||||
quartus.HELP := Geneate SOF bitfile
|
||||
|
||||
##### UBOOT / PRELOADER #########################
|
||||
.PHONY: preloader
|
||||
PRELOADER_DIR := $(BUILD_DIR)/software/preloader
|
||||
QSYS_HPS_INST_NAME := hps_0
|
||||
PRELOADER_HANDOFF := $(BUILD_QUARTUS_DIR)/hps_isw_handoff/$(QSYS_BASE)_$(QSYS_HPS_INST_NAME)/
|
||||
PRELOADER_ID := $(PRELOADER_HANDOFF)/id
|
||||
PRELOADER_DEPS := $(PRELOADER_ID) quartus
|
||||
|
||||
preloader $(PRELOADER_DIR)/Makefile:
|
||||
mkdir -p $(PRELOADER_DIR)
|
||||
cd $(PRELOADER_DIR) && bsp-create-settings \
|
||||
--type spl \
|
||||
--bsp-dir . \
|
||||
--preloader-settings-dir "$(PRELOADER_HANDOFF)" \
|
||||
--settings settings.bsp \
|
||||
--set spl.boot.WATCHDOG_ENABLE false
|
||||
make -C $(PRELOADER_DIR)
|
||||
|
||||
uboot: $(PRELOADER_DIR)/Makefile
|
||||
make -C $(PRELOADER_DIR) uboot
|
||||
|
||||
bsp-edit: $(BUILD_DIR)/software/preloader/settings.bsp
|
||||
bsp-editor --settings $^ &
|
||||
|
||||
HELP_TARGETS += bsp-edit preloader uboot
|
||||
bsp-edit.HELP = Edit BSP settings file
|
||||
preloader.HELP = Build SoC preloader
|
||||
uboot.HELP = Build UBoot
|
||||
|
||||
##### Device Tree ###############################
|
||||
.PHONY: dtb dts
|
||||
DTS_BOARDINFO := $(TOP)/soc/soc_system_board_info.xml
|
||||
DEVICE_TREE_SOURCE := $(patsubst %.sopcinfo,%.dts,$(QSYS_SOPCINFO))
|
||||
DEVICE_TREE_BLOB := $(patsubst %.dts,%.dtb,$(DEVICE_TREE_SOURCE))
|
||||
|
||||
$(DEVICE_TREE_SOURCE): %.dts: %.sopcinfo
|
||||
sopc2dts --input $< --output $@ --board $(DTS_BOARDINFO)
|
||||
|
||||
$(DEVICE_TREE_BLOB): %.dtb: %.dts
|
||||
dtc -I dts -O dtb -o $@ $<
|
||||
|
||||
dts: $(DEVICE_TREE_SOURCE)
|
||||
dtb: $(DEVICE_TREE_BLOB)
|
||||
|
||||
HELP_TARGETS += dts
|
||||
dts.HELP := Generate a device tree for this qsys design (alpha)
|
||||
HELP_TARGETS += dtb
|
||||
dtb.HELP := Generate a device tree blob for this qsys design (alpha)
|
||||
|
||||
##### CONFIGURE BUILD ###########################
|
||||
.PHONY: config
|
||||
config $(BUILD_QUARTUS_DIR)/$(PROJECT).qsf:
|
||||
|
||||
Reference in New Issue
Block a user