diff --git a/README b/README index 989f75f..35d1874 100644 --- a/README +++ b/README @@ -1 +1,15 @@ Arrow SoCKIT + +-- FPGA build requirements +export QUARTUS_ROOTDIR=/home/dev/altera/13.1/quartus/ +export PATH=$PATH:$QUARTUS_ROOTDIR/bin:$QUARTUS_ROOTDIR/../DS-5/bin +export QUARTUS_64BIT=$( [ "`uname -p`" = "x86_64" ] && echo 1 || echo 0 ) +export SOCEDS_DEST_ROOT=/home/dev/altera/13.1/embedded +file=/home/dev/altera/13.1/embedded/env.sh; test -e $file && source $file + +-- Linux build requirements (Yocto) +git clone git://git.rocketboards.org/poky-socfpga.git poky-socfpga.git +cd poky-socfpga.git/ +git checkout -b dylan-altera remotes/origin/dylan-altera +source ./altera-init build +bitbake virtual/kernel virtual/bootloader altera-image-minimal diff --git a/fpga/soc/soc_system_board_info.xml b/fpga/soc/soc_system_board_info.xml new file mode 100644 index 0000000..8037af9 --- /dev/null +++ b/fpga/soc/soc_system_board_info.xml @@ -0,0 +1,230 @@ + + + + + + + + + + + + + + + + + + + 1 + 1 + 1 + + + 2 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +0x0 +0x800000 + + + + +0x800000 +0x800000 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +hps_0_gpio1 +15 +1 + + + + +hps_0_gpio1 +14 +1 + + + + +hps_0_gpio1 +13 +1 + + + + +hps_0_gpio1 +12 +1 + + + + +led_pio +0 +1 + + + + +led_pio +1 +1 + + + + +led_pio +2 +1 + + + + +led_pio +3 +1 + + + + + + + + +0 +176 +4 +0 +177 +4 + + + + + + +0xff118000 +0x100 + + + + + +0xff119000 +0x100 + + + + + + + + diff --git a/fpga/syn/Makefile b/fpga/syn/Makefile index 02a1fb9..4c683df 100644 --- a/fpga/syn/Makefile +++ b/fpga/syn/Makefile @@ -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: