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 | |
| 21 | static void fw_config_handle(void *unused) |
| 22 | { |
| 23 | if (!fw_config_probe(FW_CONFIG(DB_USB, DB_1C_LTE))) { |
| 24 | printk(BIOS_INFO, "Disable LTE-related GPIO pins.\n"); |
| 25 | gpio_configure_pads(lte_disable_pads, ARRAY_SIZE(lte_disable_pads)); |
| 26 | } |
| 27 | } |
| 28 | BOOT_STATE_INIT_ENTRY(BS_DEV_ENABLE, BS_ON_ENTRY, fw_config_handle, NULL); |