summaryrefslogtreecommitdiffstats
path: root/src/soc/mediatek/mt8186/include/soc
diff options
context:
space:
mode:
authorGuodong Liu <guodong.liu@mediatek.corp-partner.google.com>2022-02-21 20:22:40 +0800
committerFelix Held <felix-coreboot@felixheld.de>2022-03-09 14:31:02 +0000
commitada2a63dabe566b1cb8ebb9d909fa2c07f296136 (patch)
tree7ad6339859d63d5c9f692874b5e7ebdcf91e2815 /src/soc/mediatek/mt8186/include/soc
parent6555c4c6017bcd3255611dfef36508cd8e132f65 (diff)
downloadcoreboot-ada2a63dabe566b1cb8ebb9d909fa2c07f296136.tar.gz
coreboot-ada2a63dabe566b1cb8ebb9d909fa2c07f296136.tar.bz2
coreboot-ada2a63dabe566b1cb8ebb9d909fa2c07f296136.zip
soc/mediatek/mt8186: Add GPIO driving functions
Add GPIO driving functions to adjust pin driving. The value of drive strength is different for each SoC, so we define GPIO_DRV0 to GPIO_DRV7 which are corresponding to 2/4/6/8/10/12/14/16mA in MT8186. This implementation is according to chapter 5.1 in MT8186 Functional Specification. BUG=b:218775654, b:216462313, b:212375511 TEST=build pass Signed-off-by: Guodong Liu <guodong.liu@mediatek.corp-partner.google.com> Change-Id: I6d987f28be98b515fa5c542222bda08bea1d5118 Reviewed-on: https://review.coreboot.org/c/coreboot/+/62471 Reviewed-by: Yu-Ping Wu <yupingso@google.com> Reviewed-by: Angel Pons <th3fanbus@gmail.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/soc/mediatek/mt8186/include/soc')
-rw-r--r--src/soc/mediatek/mt8186/include/soc/gpio.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/soc/mediatek/mt8186/include/soc/gpio.h b/src/soc/mediatek/mt8186/include/soc/gpio.h
index a47d27c96da7..8a1c1471f486 100644
--- a/src/soc/mediatek/mt8186/include/soc/gpio.h
+++ b/src/soc/mediatek/mt8186/include/soc/gpio.h
@@ -12,12 +12,25 @@
#include <soc/gpio_common.h>
#include <types.h>
+#define GPIO_NUM 185
+
enum {
MAX_GPIO_REG_BITS = 32,
MAX_GPIO_MODE_PER_REG = 8,
GPIO_MODE_BITS = 4,
};
+enum gpio_drv {
+ GPIO_DRV_2_MA = 0,
+ GPIO_DRV_4_MA = 1,
+ GPIO_DRV_6_MA = 2,
+ GPIO_DRV_8_MA = 3,
+ GPIO_DRV_10_MA = 4,
+ GPIO_DRV_12_MA = 5,
+ GPIO_DRV_14_MA = 6,
+ GPIO_DRV_16_MA = 7,
+};
+
#define PIN(id, name, flag, bit, base, offset, \
func1, func2, func3, func4, func5, func6, func7) \
PAD_##name##_ID = id, \