drivers/mipi: Add support for KD_KD110N11_51IE panel
[coreboot2.git] / src / mainboard / google / brya / variants / yaviks / fw_config.c
blob544511eba6070a5c3b0f630b956bdadc50361f94
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 #include <baseboard/gpio.h>
4 #include <baseboard/variants.h>
5 #include <console/console.h>
6 #include <fw_config.h>
8 static const struct pad_config lte_disable_pads_yavilla[] = {
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 /* H23 : WWAN_SAR_DETECT_ODL */
16 PAD_NC(GPP_H23, NONE),
19 static const struct pad_config emmc_disable_pads[] = {
20 /* I7 : EMMC_CMD */
21 PAD_NC(GPP_I7, NONE),
22 /* I8 : EMMC_D0 */
23 PAD_NC(GPP_I8, NONE),
24 /* I9 : EMMC_D1 */
25 PAD_NC(GPP_I9, NONE),
26 /* I10 : EMMC_D2 */
27 PAD_NC(GPP_I10, NONE),
28 /* I11 : EMMC_D3 */
29 PAD_NC(GPP_I11, NONE),
30 /* I12 : EMMC_D4 */
31 PAD_NC(GPP_I12, NONE),
32 /* I13 : EMMC_D5 */
33 PAD_NC(GPP_I13, NONE),
34 /* I14 : EMMC_D6 */
35 PAD_NC(GPP_I14, NONE),
36 /* I15 : EMMC_D7 */
37 PAD_NC(GPP_I15, NONE),
38 /* I16 : EMMC_RCLK */
39 PAD_NC(GPP_I16, NONE),
40 /* I17 : EMMC_CLK */
41 PAD_NC(GPP_I17, NONE),
42 /* I18 : EMMC_RST_L */
43 PAD_NC(GPP_I18, NONE),
46 static const struct pad_config stylus_disable_pads[] = {
47 /* F13 : SOC_PEN_DETECT_R_ODL */
48 PAD_NC_LOCK(GPP_F13, NONE, LOCK_CONFIG),
49 /* F15 : SOC_PEN_DETECT_ODL */
50 PAD_NC_LOCK(GPP_F15, NONE, LOCK_CONFIG),
53 static const struct pad_config sd_disable_pads[] = {
54 /* D8 : SD_CLKREQ_ODL */
55 PAD_NC(GPP_D8, NONE),
56 /* D17 : SD_WAKE_N */
57 PAD_NC_LOCK(GPP_D17, NONE, LOCK_CONFIG),
58 /* H12 : SD_PERST_L */
59 PAD_NC_LOCK(GPP_H12, NONE, LOCK_CONFIG),
60 /* H13 : EN_PP3300_SD_X */
61 PAD_NC_LOCK(GPP_H13, NONE, LOCK_CONFIG),
64 static const struct pad_config disable_wifi_pch_susclk[] = {
65 /* GPD8 ==> NC */
66 PAD_NC(GPD8, NONE),
69 static const struct pad_config disable_usbc1_pins[] = {
70 /* GPP_A21: USB_C1_AUX_DC_P => NC */
71 PAD_NC(GPP_A21, NONE),
72 /* GPP_A22: USB_C1_AUX_DC_N => NC */
73 PAD_NC(GPP_A22, NONE),
76 void fw_config_gpio_padbased_override(struct pad_config *padbased_table)
78 if (fw_config_is_provisioned() && !fw_config_probe(FW_CONFIG(STORAGE, STORAGE_EMMC))) {
79 printk(BIOS_INFO, "Disable eMMC GPIO pins.\n");
80 gpio_padbased_override(padbased_table, emmc_disable_pads,
81 ARRAY_SIZE(emmc_disable_pads));
83 if (fw_config_is_provisioned() && fw_config_probe(FW_CONFIG(DB_USB, DB_1A))) {
84 printk(BIOS_INFO, "Disable USBC1 AUX Pins.\n");
85 gpio_padbased_override(padbased_table, disable_usbc1_pins,
86 ARRAY_SIZE(disable_usbc1_pins));
88 if (!fw_config_probe(FW_CONFIG(DB_USB, DB_1C_LTE))) {
89 printk(BIOS_INFO, "Disable LTE-related GPIO pins on yavilla.\n");
90 gpio_padbased_override(padbased_table, lte_disable_pads_yavilla,
91 ARRAY_SIZE(lte_disable_pads_yavilla));
93 if (fw_config_probe(FW_CONFIG(STYLUS, STYLUS_ABSENT))) {
94 printk(BIOS_INFO, "Disable Stylus GPIO pins.\n");
95 gpio_padbased_override(padbased_table, stylus_disable_pads,
96 ARRAY_SIZE(stylus_disable_pads));
98 if (fw_config_probe(FW_CONFIG(SD_CARD, SD_ABSENT))) {
99 printk(BIOS_INFO, "Disable SD card GPIO pins.\n");
100 gpio_padbased_override(padbased_table, sd_disable_pads,
101 ARRAY_SIZE(sd_disable_pads));
103 /* SAR_ID_3 for MT7922 */
104 if (fw_config_probe(FW_CONFIG(WIFI_SAR_ID, SAR_ID_3))) {
105 printk(BIOS_INFO, "Disable PCH SUSCLK.\n");
106 gpio_padbased_override(padbased_table, disable_wifi_pch_susclk,
107 ARRAY_SIZE(disable_wifi_pch_susclk));