summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatryk Duda <pdk@semihalf.com>2022-07-18 18:33:33 +0200
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-07-18 20:25:20 +0000
commitab4c9142a68bd64754a7239d74efc00207fee87e (patch)
treeb2d4ce2b1fd84898c3242fa0becc864e16574ed5
parent2d7c0960c54039d474baf865d93aad0286455a5e (diff)
downloadchrome-ec-ab4c9142a68bd64754a7239d74efc00207fee87e.tar.gz
flash_fp_mcu: Add support for 5.19 kernel for brya
Brya-kernelnext uses 5.19 kernel which has different name for gpio chip ('gpiochip664' instead of 'gpiochip152') and uses different gpio numbers. Update config_brya() accordingly. BUG=b:239429127 BRANCH=none TEST=Run `tast run <IP> firmware.FpFlashFpMcuHello` on brya-kernelnext and brya make sure test passes on both platforms. Change-Id: I6955f208a8a7b797e339e775a3480ff7af80e842 Signed-off-by: Patryk Duda <pdk@semihalf.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3770326 Reviewed-by: Tom Hughes <tomhughes@chromium.org> Tested-by: Patryk Duda <patrykd@google.com> Commit-Queue: Patryk Duda <patrykd@google.com>
-rw-r--r--util/flash_fp_mcu30
1 files changed, 21 insertions, 9 deletions
diff --git a/util/flash_fp_mcu b/util/flash_fp_mcu
index 5268f5e9ba..fc147aa541 100644
--- a/util/flash_fp_mcu
+++ b/util/flash_fp_mcu
@@ -655,15 +655,27 @@ config_brya() {
# brya device to determine gpio number from pin number.
# For example: GPP_D1 is ISH_GP_1 which can be queried from EDS
# the pin number is 100 from the pinctrl-tigerlake.c.
- # From the gpio-ranges, the gpio value is 312 + (100-99) = 313
-
- readonly GPIO_CHIP="gpiochip152"
- # FPMCU RST_ODL is on GPP_D1 = 312 + (100 - 99) = 313
- readonly GPIO_NRST=313
- # FPMCU BOOT0 is on GPP_D0 = 312 + (99 - 99) = 312
- readonly GPIO_BOOT0=312
- # FP_PWR_EN is on GPP_D2 = 312 + (101 - 99) = 314
- readonly GPIO_PWREN=314
+ # From the gpio-ranges, the gpio value is 824 + (100-99) = 825
+
+ local gpiochip="gpiochip664"
+ # Support kernel version 5.10 during transition to 5.15+
+ match_kernel_regex "^5\.10\." && gpiochip="gpiochip152"
+ readonly GPIO_CHIP="${gpiochip}"
+
+ 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
+
+ # FPMCU RST_ODL is on GPP_D1 = 824 + (100 - 99) = 825
+ local gpionrst=825
+ readonly GPIO_NRST=$(( gpionrst - offset ))
+ # FPMCU BOOT0 is on GPP_D0 = 824 + (99 - 99) = 824
+ local gpioboot=824
+ readonly GPIO_BOOT0=$(( gpioboot - offset ))
+ # FP_PWR_EN is on GPP_D2 = 824 + (101 - 99) = 826
+ local gpiopwren=826
+ readonly GPIO_PWREN=$(( gpiopwren - offset ))
}
config_brask() {