Reka Norman | 457d98d | 2022-02-04 11:17:32 +1100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-or-later */ |
| 2 | |
| 3 | #include <baseboard/gpio.h> |
| 4 | #include <bootstate.h> |
| 5 | #include <console/console.h> |
| 6 | #include <fw_config.h> |
| 7 | |
| 8 | static const struct pad_config lte_disable_pads[] = { |
| 9 | /* A8 : WWAN_RF_DISABLE_ODL */ |
| 10 | PAD_NC(GPP_A8, NONE), |
| 11 | /* D6 : WWAN_EN */ |
| 12 | PAD_NC(GPP_D6, NONE), |
| 13 | /* F12 : WWAN_RST_L */ |
| 14 | PAD_NC(GPP_F12, NONE), |
| 15 | /* H19 : SOC_I2C_SUB_INT_ODL */ |
| 16 | PAD_NC(GPP_H19, NONE), |
| 17 | /* H23 : WWAN_SAR_DETECT_ODL */ |
| 18 | PAD_NC(GPP_H23, NONE), |
| 19 | }; |
| 20 | |
Reka Norman | baf2246 | 2022-05-06 19:55:11 +1000 | [diff] [blame^] | 21 | static const struct pad_config sd_disable_pads[] = { |
| 22 | /* D8 : SD_CLKREQ_ODL */ |
| 23 | PAD_NC(GPP_D8, NONE), |
| 24 | /* H12 : SD_PERST_L */ |
| 25 | PAD_NC(GPP_H12, NONE), |
| 26 | /* H13 : EN_PP3300_SD_X */ |
| 27 | PAD_NC(GPP_H13, NONE), |
| 28 | }; |
| 29 | |
Reka Norman | 457d98d | 2022-02-04 11:17:32 +1100 | [diff] [blame] | 30 | static void fw_config_handle(void *unused) |
| 31 | { |
| 32 | if (!fw_config_probe(FW_CONFIG(DB_USB, DB_1C_LTE))) { |
| 33 | printk(BIOS_INFO, "Disable LTE-related GPIO pins.\n"); |
| 34 | gpio_configure_pads(lte_disable_pads, ARRAY_SIZE(lte_disable_pads)); |
| 35 | } |
Reka Norman | baf2246 | 2022-05-06 19:55:11 +1000 | [diff] [blame^] | 36 | |
| 37 | if (fw_config_probe(FW_CONFIG(SD_CARD, SD_ABSENT))) { |
| 38 | printk(BIOS_INFO, "Disable SD card GPIO pins.\n"); |
| 39 | gpio_configure_pads(sd_disable_pads, ARRAY_SIZE(sd_disable_pads)); |
| 40 | } |
Reka Norman | 457d98d | 2022-02-04 11:17:32 +1100 | [diff] [blame] | 41 | } |
| 42 | BOOT_STATE_INIT_ENTRY(BS_DEV_ENABLE, BS_ON_ENTRY, fw_config_handle, NULL); |