summaryrefslogtreecommitdiff
path: root/meta-fii/meta-kudo/recipes-phosphor
diff options
context:
space:
mode:
authorCharles Boyer <Charles.Boyer@fii-usa.com>2022-02-09 17:32:22 +0300
committerCharles Boyer <Charles.Boyer@fii-usa.com>2022-04-21 21:37:36 +0300
commitd7d3423ca60a040efcd61db301eea48c5f6635f4 (patch)
tree7e2cc147f52905789f9012f58b08f267052f0e51 /meta-fii/meta-kudo/recipes-phosphor
parent65ab13e0ec825b88e8fb32195127dee1cba2d579 (diff)
downloadopenbmc-d7d3423ca60a040efcd61db301eea48c5f6635f4.tar.xz
meta-fii: meta-kudo: Use GPIO line names instead of number
Replaces hard-coded GPIO throughout the Kudo layer with a reference to its line name from DTS. The process to dynamically obtain the GPIO number for Get is added to kudo-lib.sh, 1. Use `gpiofind <Line Name>` to obtain gpiochip# and pin# 2. If the gpiochip# exceeds the number of GPIO banks of Nuvoton, then it is an I/O Expander. a. Use `gpiodetect` and extract the I2C bus-addr b. Obtain GPIO base value from sysfs using bus-addr c. The GPIO number is then the (base + pin#) 3. If the gpiochip# is within Nuvoton GPIO banks, then calculate the GPIO number as ((gpiochip#)*32 + pin#) Then the GPIO number can be used in the export to obtain the value. Tested with Nuvoton: - Can read/set Nuvoton GPIO with defined line names - Can read/set GPIO from I/O Expanders with defined line names Signed-off-by: Charles Boyer <Charles.Boyer@fii-usa.com> Change-Id: I651c0707a8bbc170d3c5a5fc261e5f9c62453e9f
Diffstat (limited to 'meta-fii/meta-kudo/recipes-phosphor')
-rw-r--r--meta-fii/meta-kudo/recipes-phosphor/console/obmc-console/kudo_uart_mux_ctrl.sh7
1 files changed, 3 insertions, 4 deletions
diff --git a/meta-fii/meta-kudo/recipes-phosphor/console/obmc-console/kudo_uart_mux_ctrl.sh b/meta-fii/meta-kudo/recipes-phosphor/console/obmc-console/kudo_uart_mux_ctrl.sh
index b9453391d3..9947483f35 100644
--- a/meta-fii/meta-kudo/recipes-phosphor/console/obmc-console/kudo_uart_mux_ctrl.sh
+++ b/meta-fii/meta-kudo/recipes-phosphor/console/obmc-console/kudo_uart_mux_ctrl.sh
@@ -31,12 +31,11 @@ echo "Ampere UART MUX CTRL UART port $1 to mode" > /dev/ttyS0
case "$1" in
ttyS1)
- set_gpio_ctrl 167 out 1
+ set_gpio_ctrl S0_UART0_BMC_SEL 1
;;
ttyS3)
- set_gpio_ctrl 161 out 1
- set_gpio_ctrl 183 out 1
- set_gpio_ctrl 198 out 0
+ set_gpio_ctrl S0_UART1_BMC_SEL 1
+ set_gpio_ctrl S1_UART1_BMC_SEL 0
;;
*)
echo "Invalid tty passed to $0. Exiting!" > /dev/ttyS0