stanley.wu | 6b74434 | 2021-08-07 01:23:44 +0800 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-or-later */ |
| 2 | |
| 3 | #include <baseboard/gpio.h> |
| 4 | #include <baseboard/variants.h> |
| 5 | #include <commonlib/helpers.h> |
stanley.wu | 6b74434 | 2021-08-07 01:23:44 +0800 | [diff] [blame] | 6 | |
| 7 | /* Pad configuration in ramstage*/ |
| 8 | static const struct pad_config gpio_table[] = { |
| 9 | /* A10 : WWAN_EN => LTE_PWR_OFF_ODL */ |
| 10 | PAD_CFG_GPO(GPP_A10, 1, PWROK), |
| 11 | |
| 12 | /* B7 : WWAN_SAR_DETECT_R_ODL */ |
| 13 | PAD_CFG_GPO(GPP_B7, 1, DEEP), |
| 14 | |
| 15 | /* C12 : AP_PEN_DET_ODL */ |
| 16 | PAD_CFG_GPI_GPIO_DRIVER(GPP_C12, UP_20K, DEEP), |
| 17 | /* C18 : AP_I2C_EMR_SDA */ |
| 18 | PAD_NC(GPP_C18, NONE), |
| 19 | /* C19 : AP_I2C_EMR_SCL */ |
| 20 | PAD_NC(GPP_C19, NONE), |
| 21 | /* C22 : UART2_RTS_N */ |
| 22 | PAD_NC(GPP_C22, NONE), |
| 23 | /* C23 : UART2_CTS_N */ |
| 24 | PAD_NC(GPP_C23, NONE), |
| 25 | |
| 26 | /* D12 : WCAM_RST_L */ |
| 27 | PAD_NC(GPP_D12, NONE), |
| 28 | /* D13 : EN_PP2800_CAMERA */ |
| 29 | PAD_CFG_GPO(GPP_D13, 1, PLTRST), |
| 30 | /* D14 : EN_PP1200_CAMERA */ |
| 31 | PAD_NC(GPP_D14, NONE), |
| 32 | /* D15 : UCAM_RST_L */ |
| 33 | PAD_NC(GPP_D15, NONE), |
| 34 | /* D19 : WWAN_WLAN_COEX1 */ |
| 35 | PAD_NC(GPP_D19, NONE), |
| 36 | /* D20 : WWAN_WLAN_COEX2 */ |
| 37 | PAD_NC(GPP_D20, NONE), |
| 38 | /* D21 : WWAN_WLAN_COEX3 */ |
| 39 | PAD_NC(GPP_D21, NONE), |
| 40 | /* D22 : AP_I2C_SUB_SDA*/ |
| 41 | PAD_CFG_NF(GPP_D22, NONE, DEEP, NF1), |
| 42 | /* D23 : AP_I2C_SUB_SCL */ |
| 43 | PAD_CFG_NF(GPP_D23, NONE, DEEP, NF1), |
| 44 | |
| 45 | /* E0 : CLK_24M_UCAM */ |
| 46 | PAD_NC(GPP_E0, NONE), |
| 47 | /* E2 : CLK_24M_WCAM */ |
| 48 | PAD_NC(GPP_E2, NONE), |
| 49 | /* E11 : AP_I2C_SUB_INT_ODL */ |
| 50 | PAD_CFG_GPI_APIC(GPP_E11, NONE, PLTRST, LEVEL, NONE), |
| 51 | |
| 52 | /* H6 : AP_I2C_CAM_SDA */ |
| 53 | PAD_NC(GPP_H6, NONE), |
| 54 | /* H7 : AP_I2C_CAM_SCL */ |
| 55 | PAD_NC(GPP_H7, NONE), |
| 56 | /* H17 : WWAN_RST_L => LTE_RESET_R_ODL */ |
| 57 | PAD_CFG_GPO(GPP_H17, 0, PLTRST), |
| 58 | }; |
| 59 | |
| 60 | const struct pad_config *variant_override_gpio_table(size_t *num) |
| 61 | { |
| 62 | *num = ARRAY_SIZE(gpio_table); |
| 63 | return gpio_table; |
| 64 | } |