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

Nathan Rossi nathan at nathanrossi.com
Tue Apr 12 02:02:06 PDT 2016


On Mon, Apr 11, 2016 at 11:23 PM, Jason Wu <jason.wu.misc at gmail.com> 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.

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

This shouldn't be there by default, in case "bsps" has different
content than expected.

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

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

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
> meta-xilinx at yoctoproject.org
> https://lists.yoctoproject.org/listinfo/meta-xilinx



More information about the meta-xilinx mailing list