From 9ee7374098ca517c7d6e759121cfd4e225e64053 Mon Sep 17 00:00:00 2001 From: Jamie Gibbons Date: Wed, 12 Feb 2025 09:21:21 +0000 Subject: [PATCH] board/beagleboard/beaglev_fire: cleanup gatewate update Update the README following the update gateware fix and optimise the script, making it easier for the user to use. Reviewed-by: Conor Dooley Signed-off-by: Jamie Gibbons Signed-off-by: Romain Naour --- board/beagleboard/beaglev_fire/README.txt | 15 +++-------- .../usr/share/microchip/update-gateware.sh | 25 ++++++++++++------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/board/beagleboard/beaglev_fire/README.txt b/board/beagleboard/beaglev_fire/README.txt index c9a824b67f..18b6e761ea 100644 --- a/board/beagleboard/beaglev_fire/README.txt +++ b/board/beagleboard/beaglev_fire/README.txt @@ -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 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. diff --git a/board/beagleboard/beaglev_fire/rootfs-overlay/usr/share/microchip/update-gateware.sh b/board/beagleboard/beaglev_fire/rootfs-overlay/usr/share/microchip/update-gateware.sh index 249c5bd260..6d92dec012 100755 --- a/board/beagleboard/beaglev_fire/rootfs-overlay/usr/share/microchip/update-gateware.sh +++ b/board/beagleboard/beaglev_fire/rootfs-overlay/usr/share/microchip/update-gateware.sh @@ -1,18 +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