Skip to content

Commit

Permalink
test_adrv9002_fh.sh: fix the test for zynqmp
Browse files Browse the repository at this point in the history
It looks like now there's also an offset for the gpio controller on
zynmp. hence, as it seems that can change between (xilinx) kernel versions,
we are now dynamically getting the GPIOs offset.

Signed-off-by: Nuno Sa <[email protected]>
  • Loading branch information
nunojsa committed Jul 26, 2023
1 parent f0e85ae commit f47b6c9
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions test_adrv9002_fh.sh
Original file line number Diff line number Diff line change
Expand Up @@ -143,19 +143,25 @@ do_gpios_export() {
local g=0
local gpio=0
local rx1_en=0
# let's dynamically get the gpios offset based on the platform as this already proved
# it can change between versions.
local off=0


# gpio's as defined in ADI devicetrees/reference designs
if [[ ${model} =~ "ZynqMP" ]]; then
off=$(cat /sys/kernel/debug/gpio | grep zynqmp_gpio | grep -Eo '[0-9]+-[0-9]+' | cut -d"-" -f1)
# hop_en will use dgpio2
hop_en=112
dgpio_3=113
rx1_en=126
hop_en=$((${off} + 112))
dgpio_3=$((${off} + 113))
rx1_en=$((${off} + 126))
elif [[ ${model} =~ "Xilinx Zynq" ]]; then
off=$(cat /sys/kernel/debug/gpio | grep zynq_gpio | grep -Eo '[0-9]+-[0-9]+' | cut -d"-" -f1)
# zynq (also applies to ZED) platforms have a 906 offset from the value defined
# in the devicetree
hop_en=$((906 + 88))
dgpio_3=$((906 + 89))
rx1_en=$((906 + 102))
hop_en=$((${off} + 88))
dgpio_3=$((${off} + 89))
rx1_en=$((${off} + 102))
else
error "Unknown System: \"${model}\""
fi
Expand Down

0 comments on commit f47b6c9

Please sign in to comment.