Fixup Update Gateware Feature
v3 cover Fixup Update Gateware Feature
Hi all,
The following patchset fixes the gateware update feature following the addition of the firmware upload API in linux v6.6. Using debugfs for firmware updating has now been removed. The update-gateware script now makes use of the firmware upload API with sysfs and enables applying overlays during boot. The README steps for updating the firmware have also been optimised, making it easier for the user.
Three configs have been added:
1. When applying overlays at boot time all dtbs need to be compiled with the -@ flag.
2. The updated update-gateware script uses stat on the target to get the size of firmware files - add coreutils and it's dependency (busybox_show_others) for this.
Thanks,
Jamie.
v2 -> v3:
- swap patch 1 and 2 ordering
- add fixes tag as appropriate
- update configs/beaglev_fire commit message to be more appropriate
- update update-gateware.sh steps in README.txt
v1 -> v2:
- used fw_upload interface to write the overlay file, i.e. remove use of stat and dd
- removed coreutils package
Jamie Gibbons (3):
configs/beaglev_fire: add support for overlays and update script board/beagleboard/beaglev_fire: fix update gateware feature board/beagleboard/beaglev_fire: cleanup gatewate update
board/beagleboard/beaglev_fire/README.txt | 15 ++-- board/beagleboard/beaglev_fire/boot.cmd | 1 + .../usr/share/microchip/update-gateware.sh | 71 ++++++++++++++----- configs/beaglev_fire_defconfig | 1 + 4 files changed, 59 insertions(+), 29 deletions(-) mode change 100644 => 100755 board/beagleboard/beaglev_fire/rootfs-overlay/usr/share/microchip/update-gateware.sh
Signature · 6 lines
2.43.0 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH v3 1/3 configs/beaglev_fire: add support for overlays and update script
When applying overlays at boot time all dtbs need to be compiled with the -@ flag. Set the appropriate config to do this.
---
Changelog:
- V1 updated update-gateware script used stat on the target to get the size of firmware files. Therefore, v1 enabled coreutils and it's dependency to make use of this package on the target when this script was used.
- V2 updated update-gateware script no longer used stat and therefore, coreutils was no longer necessary.
configs/beaglev_fire_defconfig | 1 + 1 file changed, 1 insertion(+)
configs/beaglev_fire_defconfig +1 -0
@@ -12,6 +12,7 @@ BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="$(call github,linux4microchip,linux,li BR2_LINUX_KERNEL_DEFCONFIG="mpfs" BR2_LINUX_KERNEL_DTS_SUPPORT=y BR2_LINUX_KERNEL_INTREE_DTS_NAME="microchip/mpfs-beaglev-fire" +BR2_LINUX_KERNEL_DTB_OVERLAY_SUPPORT=y BR2_PACKAGE_MTD=y BR2_TARGET_ROOTFS_EXT2=y BR2_TARGET_ROOTFS_EXT2_4=y
Signature · 6 lines
2.43.0 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH v3 2/3 board/beagleboard/beaglev_fire: fix update gateware feature
In reply to Jamie Gibbons via buildrootFollowing the addition of the firmware upload API in linux v6.6, using debugfs for firmware updating has been removed. Update the update-gateware script to use the firmware upload API with sysfs and enable applying the overlays during boot.
The fw_upload interface can detect when there is an overlay file and will write it correctly. Use this functionality to write the overlay file and remove dd command related code.
--- board/beagleboard/beaglev_fire/boot.cmd | 1 + .../usr/share/microchip/update-gateware.sh | 51 ++++++++++++++----- 2 files changed, 40 insertions(+), 12 deletions(-) mode change 100644 => 100755 board/beagleboard/beaglev_fire/rootfs-overlay/usr/share/microchip/update-gateware.sh
board/beagleboard/beaglev_fire/boot.cmd +1 -0
@@ -12,4 +12,5 @@ bootm loados ${scriptaddr}; bootm ramdisk; bootm prep; fdt set /soc/ethernet@20110000 mac-address ${beaglevfire_mac_addr0}; +run design_overlays; bootm go;
board/beagleboard/beaglev_fire/rootfs-overlay/usr/share/microchip/update-gateware.sh +39 -12
59 lines not on this page · raw message
Signature · 6 lines
2.43.0 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH v3 3/3 board/beagleboard/beaglev_fire: cleanup gatewate update
In reply to Jamie Gibbons via buildrootUpdate the README following the update gateware fix and optimise the script, making it easier for the user to use.
--- board/beagleboard/beaglev_fire/README.txt | 15 ++++-------- .../usr/share/microchip/update-gateware.sh | 24 ++++++++++++------- 2 files changed, 20 insertions(+), 19 deletions(-)
board/beagleboard/beaglev_fire/README.txt +4 -11
@@ -108,12 +108,12 @@ https://docs.beagleboard.org/latest/boards/beaglev/fire/demos-and-tutorials/gate Unzip the downloaded artifacts.zip file. Go to the custom FPGA design directory: - 'cd artifacts/bitstreams/my_custom_fpga_design' + 'cd artifacts/bitstreams/my_custom_fpga_design/LinuxProgramming/' On your Linux host development computer, copy the bitstream to BeagleV-Fire board, replacing </path/to/your/> with the path to your BeagleV-Fire root file system. - 'cp -r ./LinuxProgramming /path/to/your/buildroot/board/beagleboard/beaglev_fire/rootfs-overlay/etc/' + 'cp ./* /path/to/your/buildroot/board/beagleboard/beaglev_fire/rootfs-overlay/lib/firmware/' To apply these changes to your image, make sure to re-build it with: `make`
@@ -121,14 +121,7 @@ https://docs.beagleboard.org/latest/boards/beaglev/fire/demos-and-tutorials/gate Then, re-flash your image - to ensure you have the necessary firmware files - by following the above section "Flashing the image to your eMMC". - On BeagleV-Fire, - 1. Make your update gateware script executable - 'chmod +x /usr/share/microchip/update-gateware.sh' - 2. Create a firmware directory - 'mkdir /lib/firmware' - 3. Change to the directory of your gateware script - `cd /usr/share/microchip/` - 3. initiate the reprogramming of the FPGA with your gateware bitstream: - './update-gateware.sh /etc/LinuxProgramming/' + On BeagleV-Fire initiate the reprogramming of the FPGA with your gateware bitstream: + `/usr/share/microchip/update-gateware.sh` Wait for a couple of minutes for the BeagleV-Fire to reprogram itself.
board/beagleboard/beaglev_fire/rootfs-overlay/usr/share/microchip/update-gateware.sh +16 -8
@@ -1,17 +1,25 @@ #!/bin/sh -if [ ! -e "$1"/mpfs_bitstream.spi ]; then +if [ $# -eq 0 ]; then + echo "No gateware location provided. Checking default location." + if [ ! -e /lib/firmware/mpfs_bitstream.spi ]; then echo "No gateware file found." exit 1 + fi +else + echo "Gateware location provided: $1" + if [ ! -e "$1"/mpfs_bitstream.spi ]; then + echo "No gateware file found." + exit 1 + else + if [ ! -d /lib/firmware ]; then + mkdir /lib/firmware + fi + cp "$1"/mpfs_dtbo.spi /lib/firmware/mpfs_dtbo.spi + cp "$1"/mpfs_bitstream.spi /lib/firmware/mpfs_bitstream.spi + fi fi -if [ ! -d /lib/firmware ] -then - mkdir /lib/firmware -fi - -cp "$1"/mpfs_dtbo.spi /lib/firmware/mpfs_dtbo.spi -cp "$1"/mpfs_bitstream.spi /lib/firmware/mpfs_bitstream.spi # Trash existing device tree overlay in case the rest of the process fails: flash_erase /dev/mtd0 0 16
Signature · 6 lines
2.43.0 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Romain Naour via buildroot
AppliedHello Jamie, All,
Le 12/02/2025 à 10:21, Jamie Gibbons via buildroot a écrit :
Quoted 14 lines
Hi all,
The following patchset fixes the gateware update feature following the addition of the firmware upload API in linux v6.6. Using debugfs for firmware updating has now been removed. The update-gateware script now makes use of the firmware upload API with sysfs and enables applying overlays during boot. The README steps for updating the firmware have also been optimised, making it easier for the user.
Three configs have been added:
1. When applying overlays at boot time all dtbs need to be compiled with the-@flag.
2. The updated update-gateware script usesstaton the target to get the size of firmware files - add coreutils and it's dependency (busybox_show_others) for this.
Thanks for this new version.
Applied to master, thanks.
Best regards,
Romain
Quoted 20 lines
Thanks,
Jamie.v2 -> v3:
- swap patch 1 and 2 ordering
- add fixes tag as appropriate
- update configs/beaglev_fire commit message to be more appropriate
- updateupdate-gateware.shsteps in README.txtv1 -> v2:
- usedfw_uploadinterface to write the overlay file, i.e. remove use ofstatanddd
- removed coreutils packageJamie Gibbons (3):
configs/beaglev_fire: add support for overlays and update script board/beagleboard/beaglev_fire: fix update gateware feature board/beagleboard/beaglev_fire: cleanup gatewate update
Quoted 7 lines
board/beagleboard/beaglev_fire/README.txt | 15 ++-- board/beagleboard/beaglev_fire/boot.cmd | 1 + .../usr/share/microchip/update-gateware.sh | 71 ++++++++++++++----- configs/beaglev_fire_defconfig | 1 + 4 files changed, 59 insertions(+), 29 deletions(-) mode change 100644 => 100755 board/beagleboard/beaglev_fire/rootfs-overlay/usr/share/microchip/update-gateware.sh
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot