commit | 33109174ab92b491001a95d5e51ec7f04e7e8e6c | [log] [tgz] |
---|---|---|
author | ThuBaNguyen <thu@os.amperecomputing.com> | Fri Jul 02 15:39:57 2021 +0700 |
committer | ThuBaNguyen <thu@os.amperecomputing.com> | Wed Aug 04 21:05:59 2021 +0700 |
tree | c6060e503af7ce4c190762d96e82b81acb51d59e | |
parent | 9dccc52b92ae7a112469112029be7f08d55517b5 [diff] |
meta-ampere: mtjade: add mtjade-gpio-config package The OCP module in Mt.Jade platform supports the GPIO pins to set the power state. The SPI0 module also supports the GPIO pins to config SPI mode. These gpio pins have to be set to the right states before power off/on. The mtjade-gpio-config package will support that. Tested: 1. Power off/on the host. 2. The OCP and SPI0 gpio pins should be in the corrected states. Signed-off-by: ThuBaNguyen <thu@os.amperecomputing.com> Change-Id: I46bca50222b0428f73aa9c05003f650f6ec0cc0b
diff --git a/meta-ampere/meta-jade/recipes-ampere/platform/mtjade-utils/gpio-defs.sh b/meta-ampere/meta-jade/recipes-ampere/platform/mtjade-utils/gpio-defs.sh index fce59d5..7c887d4 100644 --- a/meta-ampere/meta-jade/recipes-ampere/platform/mtjade-utils/gpio-defs.sh +++ b/meta-ampere/meta-jade/recipes-ampere/platform/mtjade-utils/gpio-defs.sh
@@ -30,3 +30,11 @@ ### Common GPIOs SYS_PSON_L=42 BMC_READY=229 + +### OCP power selection +OCP_AUX_PWREN=139 +OCP_MAIN_PWREN=140 + +### SPI0 Mode selection +SPI0_PROGRAM_SEL=226 +SPI0_BACKUP_SEL=227
diff --git a/meta-ampere/meta-jade/recipes-ampere/platform/mtjade-utils/gpio-lib.sh b/meta-ampere/meta-jade/recipes-ampere/platform/mtjade-utils/gpio-lib.sh index fcc2d54..8d1aa61 100644 --- a/meta-ampere/meta-jade/recipes-ampere/platform/mtjade-utils/gpio-lib.sh +++ b/meta-ampere/meta-jade/recipes-ampere/platform/mtjade-utils/gpio-lib.sh
@@ -1,7 +1,8 @@ #!/bin/bash +source /usr/sbin/gpio-defs.sh function gpio_number() { - GPIO_BASE=$(cat /sys/class/gpio/gpio*/base) + GPIO_BASE=$(cat /sys/class/gpio/gpiochip$GPIO_CHIP0_BASE/base) echo $((${GPIO_BASE} + $1)) }