summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--util/flash_fp_mcu33
1 files changed, 16 insertions, 17 deletions
diff --git a/util/flash_fp_mcu b/util/flash_fp_mcu
index b857ba82f6..8a01a074df 100644
--- a/util/flash_fp_mcu
+++ b/util/flash_fp_mcu
@@ -745,25 +745,24 @@ config_guybrush() {
readonly TRANSPORT="UART"
readonly DEVICE="/dev/ttyS1"
- local gpiochip="gpiochip768"
- # Support kernel version 5.10 during transition to 5.15+
- match_kernel_regex "^5\.10\." && gpiochip="gpiochip256"
- readonly GPIO_CHIP="${gpiochip}"
+ local gpiochip_dev_path="*/platform/AMD0030\:00/gpio/*"
+ local gpiobase
+ if ! gpiobase=$(get_sysfs_gpiochip_base "${gpiochip_dev_path}"); then
+ echo "Unable to find gpio chip base"
+ return "${EXIT_PRECONDITION}"
+ fi
- local offset=0
- # Support kernel version 5.10 during transition to 5.15+
- # v5.10 has GPIOs that are offset by -512
- match_kernel_regex "^5\.10\." && offset=512
+ local GPIO_CHIP="gpiochip${gpiobase}"
- # FPMCU RST_ODL is on AGPIO 11 = 768 + 11 = 779
- local gpionrst=779
- readonly GPIO_NRST=$(( gpionrst - offset ))
- # FPMCU BOOT0 is on AGPIO 144 = 768 + 144 = 912
- local gpioboot=912
- readonly GPIO_BOOT0=$(( gpioboot - offset ))
- # FPMCU PWR_EN is on AGPIO 3 = 768 + 3 = 771
- local gpiopwren=771
- readonly GPIO_PWREN=$(( gpiopwren - offset ))
+ # FPMCU RST_ODL is on AGPIO 11
+ local gpionrst=11
+ readonly GPIO_NRST=$(( gpionrst + gpiobase ))
+ # FPMCU BOOT0 is on AGPIO 144
+ local gpioboot=144
+ readonly GPIO_BOOT0=$(( gpioboot + gpiobase ))
+ # FPMCU PWR_EN is on AGPIO 3
+ local gpiopwren=3
+ readonly GPIO_PWREN=$(( gpiopwren + gpiobase ))
}
config_skyrim() {