PandABlocks / PandABlocks-rootfs

Root filesystem build with tools for building zpg packages
Apache License 2.0
3 stars 5 forks source link

Support multiple targets (picozed and xu5) #18

Closed EmilioPeJu closed 3 years ago

EmilioPeJu commented 3 years ago

This change intends to support building rootfs for the xu5 board, the way to specify the target is with the variable PLATFORM which can be zynq or zynqmp. Here is a list of important facts to consider:

Here is an example CONFIG used to test the changes:

ROOTFS_TOP = /dls_sw/work/panda2xu5/rootfs
TOOLCHAIN_ROOT = /dls_sw/targetOS/x-tools/gcc-10.2.1-glibc-2.31/$(COMPILER_PREFIX)
TAR_FILES = /dls_sw/work/panda2xu5/tar-files
PANDA_ROOT = /scratch/tmp/PandA-rootfs
PLATFORM = zynqmp
Araneidae commented 3 years ago

I have converted this to a draft pull request, as we'll have to merge all of the following in one big action:

  1. The target independent build of PandABlocks-FPGA#33
  2. This pull request, PandABlocks-rootfs#18
  3. Possibly PandABlocks-server#10 (now merged)

I have converted PRs (1) and (2) above to draft status for now, as they definitely need to be merged at the same time.

Araneidae commented 3 years ago

Am I getting confused? Is this merge request really dependent on PandABlocks-FPGA#33?

Araneidae commented 3 years ago

Does this also need a CONFIG.example update?

EmilioPeJu commented 3 years ago

@Araneidae , Updating the kernel implies that the FPGA loading script should be changed. The xdevcfg device doesn't exist anymore (the associated driver is deprecated), and the new way is using the FPGA manager interface. The FPGA repo will likely need a change similar to the one shown below:

diff --git a/etc/load-panda-firmware b/etc/load-panda-firmware
index 45711560..14c476a2 100755
--- a/etc/load-panda-firmware
+++ b/etc/load-panda-firmware
@@ -33,6 +33,15 @@ configure_gpio_m0()
     echo $GPIO_M0 >/sys/class/gpio/unexport
 }

+load_fpga()
+{
+    local bitstream="$1"
+    # Set flags for loading full bitstream
+    echo 0 > /sys/class/fpga_manager/fpga0/flags
+    mkdir -p /lib/firmware
+    cp -f "$bitstream" /lib/firmware
+    echo "$(basename $bitstream)" > /sys/class/fpga_manager/fpga0/firmware
+}

 [ -e $carrier_firmware -a -e $slow_firmware ]  ||
     fail "Firmware not installed"
@@ -44,6 +53,6 @@ configure_gpio_m0  &&
 $check_ipmi  &&

 # If FMC passes then load the carrier firmware
-cat $carrier_firmware >/dev/xdevcfg  &&
+load_fpga $carrier_firmware  &&
 # Finally load the slow FPGA
 $slow_load <$slow_firmware
Araneidae commented 3 years ago

Ah. Ok, so these two merges still need to be synchronised. Think I've done everything I need to here?

Araneidae commented 3 years ago

All looks good to me!