qualcomm/sc7280: gpio: Support eGPIO scheme

eGPIO is a scheme which allows special power island domain IOs to be
reused as regular chip GPIOs by muxing regular TLMM functions with
Island Domain functions. Allow the eGPIO to be configured via
gpio_configure API to be used as a TLMM gpio.

BUG=b:182963902
TEST=Validated on qualcomm sc7280 development board

Signed-off-by: Taniya Das <quic_tdas@quicinc.com>
Change-Id: Ib2598a41ba3bb8a8a2acff8253b5bb78633f89f9
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58580
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Shelley Chen <shchen@google.com>
This commit is contained in:
Taniya Das 2021-11-12 16:36:40 +05:30 committed by Shelley Chen
parent 88c0faddad
commit d7e7d60e0f
2 changed files with 5 additions and 1 deletions

View File

@ -16,7 +16,9 @@ void gpio_configure(gpio_t gpio, uint32_t func, uint32_t pull,
reg_val = ((enable & GPIO_BMSK) << GPIO_CFG_OE_SHFT) | reg_val = ((enable & GPIO_BMSK) << GPIO_CFG_OE_SHFT) |
((drive_str & GPIO_CFG_DRV_BMSK) << GPIO_CFG_DRV_SHFT) | ((drive_str & GPIO_CFG_DRV_BMSK) << GPIO_CFG_DRV_SHFT) |
((func & GPIO_CFG_FUNC_BMSK) << GPIO_CFG_FUNC_SHFT) | ((func & GPIO_CFG_FUNC_BMSK) << GPIO_CFG_FUNC_SHFT) |
((pull & GPIO_CFG_PULL_BMSK) << GPIO_CFG_PULL_SHFT); ((pull & GPIO_CFG_PULL_BMSK) << GPIO_CFG_PULL_SHFT) |
((read32(&regs->cfg) & GPIO_CFG_EGPIO_BMSK)
<< GPIO_CFG_EGPIO_SHFT);
write32(&regs->cfg, reg_val); write32(&regs->cfg, reg_val);
} }

View File

@ -21,6 +21,7 @@ enum gpio_tlmm_bmsk {
GPIO_CFG_PULL_BMSK = 0x3, GPIO_CFG_PULL_BMSK = 0x3,
GPIO_CFG_FUNC_BMSK = 0xF, GPIO_CFG_FUNC_BMSK = 0xF,
GPIO_CFG_DRV_BMSK = 0x7, GPIO_CFG_DRV_BMSK = 0x7,
GPIO_CFG_EGPIO_BMSK = 0x800,
}; };
/* GPIO TLMM INTR: Shift */ /* GPIO TLMM INTR: Shift */
@ -35,6 +36,7 @@ enum gpio_tlmm_shft {
GPIO_CFG_FUNC_SHFT = 2, GPIO_CFG_FUNC_SHFT = 2,
GPIO_CFG_DRV_SHFT = 6, GPIO_CFG_DRV_SHFT = 6,
GPIO_CFG_OE_SHFT = 9, GPIO_CFG_OE_SHFT = 9,
GPIO_CFG_EGPIO_SHFT = 1,
}; };
/* GPIO IO: Shift */ /* GPIO IO: Shift */