On 12/04/2016 7:02 PM, Nathan Rossi wrote:
On Mon, Apr 11, 2016 at 11:23 PM, Jason Wu <[email protected]> wrote:
This allows user to create bb to extract the bitstream and ps7_init_gpl.[h|c]
file from hdf file.

This looks good, but I think it would be more useful as a bbclass
instead of an include.
I can do it as bbclas and will do in v2


Signed-off-by: Jason Wu <[email protected]>
---
  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:"

This shouldn't be there by default, in case "bsps" has different
content than expected.
I think this should be removed. This was a old code I had for testing the local hdf.


+
+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 \

This can be split into two packages, ${PN}-platform-init and
${PN}-bitstream. So that it is easy to install either to the rootfs if
that is desired.
sure, will do it v2. The v2 will have something like the followings:

+FILES_${PN}-platform-init += " \
+               ${PLATFORM_INIT_DIR}/ps7_init_gpl.c \
+               ${PLATFORM_INIT_DIR}/ps7_init_gpl.h \

+FILES_${PN}-bitstream += " \
+ download.bit \

Just to be sure this is what you after.



+               "
+
+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

I will have to double check, but I think this might not work correctly
due to sysroot staging. Which is why the zynq7-platform-init.inc uses
the sysroot stage task
(http://git.yoctoproject.org/cgit/cgit.cgi/meta-xilinx/tree/recipes-bsp/platform-init/zynq7-platform-init.inc#n17)
This was tested. So It may not work. I will have a look check with you later.

Regards,

Jason


Regards,
Nathan

+}
+
+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

--
_______________________________________________
meta-xilinx mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/meta-xilinx
--
_______________________________________________
meta-xilinx mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/meta-xilinx

Reply via email to