Skip to content

meta-lmp: xilinx-tools: bitstream-extraction: Add bitstream support#255

Merged
ricardosalveti merged 2 commits intofoundriesio:masterfrom
Tim-Anderson:update-xilinx-fpga-support
Jan 28, 2021
Merged

meta-lmp: xilinx-tools: bitstream-extraction: Add bitstream support#255
ricardosalveti merged 2 commits intofoundriesio:masterfrom
Tim-Anderson:update-xilinx-fpga-support

Conversation

@Tim-Anderson
Copy link
Copy Markdown
Contributor

Signed-off-by: Tim Anderson [email protected]

EXTRA_IMAGEDEPENDS_remove = "qemu-devicetrees"

# bitstream support
MACHINE_FIRMWARE_append_uz3eg-iocc = " bitstream-extraction fpga-manager-script"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is machine specific, move this line to conf/machine/uz3eg-iocc.conf instead.

Also, please split the machine changes into a different commit.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will do


if [ -e ${XSCTH_WS}/${XSCTH_PROJ}_hwproj/*.bit ]; then
install -d ${D}/${nonarch_base_libdir}/firmware/
install -d ${D}/var/lib/firmware/bitstream/
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Var is a special directory in our setup because it is RW, so not really managed by ostree.

As all you need is a link, it is better to create a systemd tmpfile for this recipe, like https://github.com/foundriesio/meta-lmp/blob/master/meta-lmp-base/recipes-security/softhsm/softhsm/tmpfiles.conf (but using link instead, check https://www.freedesktop.org/software/systemd/man/tmpfiles.d.html for more info). This allows the link to be created by systemd during boot automatically, and it will keep working even if the user erases /var completely (as it will be restored on a following boot).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, your recipe will have to install the link and the systemd tmpfiles configuration will have to create the directory (under var).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the kernel driver will only load from /lib/firmware/... so the symlink has to point to someplace that is writable. and since the utility creates the /var/lib/firmware/bitstream automatically I do not think a systemd operation is strictly neccessary.

install -Dm 0644 ${XSCTH_WS}/${XSCTH_PROJ}_hwproj/*.bit ${D}/${nonarch_base_libdir}/firmware/
fi
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For loading from fit you will also need a do_deploy (no needed for now, but just a heads up).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

understood, I will add that when I look at the u-boot pieces

@@ -0,0 +1,5 @@
FILESEXTRAPATHS_prepend := "${THISDIR}/files:"

SRC_URI_append += " \
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to use append with += (either append or +=).

Copy link
Copy Markdown
Member

@ricardosalveti ricardosalveti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comments inline.

@Tim-Anderson Tim-Anderson force-pushed the update-xilinx-fpga-support branch from 90e17cd to deab47f Compare January 26, 2021 00:17
HDF_EXT = "dsa"

# bitstream support
MACHINE_FIRMWARE_append_uz3eg-iocc = " bitstream-extraction fpga-manager-script"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need for append_uz3eg-iocc as this is already the board configuration file, just append works.

@Tim-Anderson Tim-Anderson force-pushed the update-xilinx-fpga-support branch from deab47f to bebf365 Compare January 26, 2021 14:18
Copy link
Copy Markdown
Member

@ricardosalveti ricardosalveti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ricardosalveti ricardosalveti merged commit fd58132 into foundriesio:master Jan 28, 2021
@Tim-Anderson Tim-Anderson deleted the update-xilinx-fpga-support branch January 28, 2021 00:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants