[meta-xilinx] [PATCH 05/20] Add basic Xilinx HDF support

Jason Wu jason.wu.misc at gmail.com
Mon Apr 11 06:23:10 PDT 2016


This allows user to create bb to extract the bitstream and ps7_init_gpl.[h|c]
file from hdf file.

Signed-off-by: Jason Wu <jason.wu.misc at gmail.com>
---
 recipes-bsp/hardware-definition-file/hdf.inc | 46 ++++++++++++++++++++++++++++
 1 file changed, 46 insertions(+)
 create mode 100644 recipes-bsp/hardware-definition-file/hdf.inc

diff --git a/recipes-bsp/hardware-definition-file/hdf.inc b/recipes-bsp/hardware-definition-file/hdf.inc
new file mode 100644
index 0000000..ba2e45c
--- /dev/null
+++ b/recipes-bsp/hardware-definition-file/hdf.inc
@@ -0,0 +1,46 @@
+SECTION = "bsp"
+DEPENDS += "unzip"
+
+S ?= "${WORKDIR}/${MACHINE}"
+
+PROVIDES = "virtual/hdf virtual/bitstream virtual/zynq7-platform-init"
+
+FILESEXTRAPATHS_prepend := "${THISDIR}/bsps:"
+
+PLATFORM_INIT ?= "ps7_init_gpl.c \
+		  ps7_init_gpl.h"
+
+FILES_${PN} += " \
+		${PLATFORM_INIT_DIR}/ps7_init_gpl.c \
+		${PLATFORM_INIT_DIR}/ps7_init_gpl.h \
+		download.bit \
+		"
+
+BITSTREAM ?= "bitstream-${PV}-${PR}.bit"
+
+INHIBIT_DEFAULT_DEPS = "1"
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+inherit zynq7-platform-paths
+
+do_install() {
+	fn=$(unzip -l ${S}/${HDF} | awk '{print $NF}' | grep ".bit$")
+	unzip -o ${S}/${HDF} ${fn} -d ${D}
+	[ "${fn}" == "download.bit"] || mv ${D}/${fn} ${D}/download.bit
+
+	install -d ${PLATFORM_INIT_STAGE_DIR}
+	for fn in ${PLATFORM_INIT}; do
+		unzip -o ${S}/${HDF} ${fn} -d ${PLATFORM_INIT_STAGE_DIR}
+	done
+}
+
+do_deploy () {
+	if [ -e ${D}/download.bit ]; then
+		install -d ${DEPLOY_DIR_IMAGE}
+		install -m 0644 ${D}/download.bit ${DEPLOY_DIR_IMAGE}/${BITSTREAM}
+		ln -sf ${BITSTREAM} ${DEPLOY_DIR_IMAGE}/download.bit
+		# for u-boot 2016.3 with spl load bitstream patch
+		ln -sf ${BITSTREAM} ${DEPLOY_DIR_IMAGE}/bitstream
+	fi
+}
+addtask deploy before do_build after do_install
-- 
1.9.1




More information about the meta-xilinx mailing list