mb/google/fatcat: Suppress unnecessary extra space in device trees
[coreboot2.git] / src / mainboard / google / brya / variants / pirrha / fw_config.c
blob2ec06595558744d9c81d4cbacf19db136a0b13e3
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 #include <baseboard/gpio.h>
4 #include <baseboard/variants.h>
5 #include <boardid.h>
6 #include <console/console.h>
7 #include <fw_config.h>
9 static const struct pad_config wfc_disable_pads[] = {
10 /* D3 : WCAM_RST_L */
11 PAD_NC_LOCK(GPP_D3, NONE, LOCK_CONFIG),
12 /* D15 : EN_PP2800_WCAM_X */
13 PAD_NC_LOCK(GPP_D15, NONE, LOCK_CONFIG),
14 /* D16 : EN_PP1800_PP1200_WCAM_X */
15 PAD_NC_LOCK(GPP_D16, NONE, LOCK_CONFIG),
16 /* H22 : WCAM_MCLK_R */
17 PAD_NC(GPP_H22, NONE),
18 /* R6 : DMIC_WCAM_CLK_R */
19 PAD_NC(GPP_R6, NONE),
20 /* R7 : DMIC_WCAM_DATA */
21 PAD_NC(GPP_R7, NONE),
24 static const struct pad_config emmc_disable_pads[] = {
25 /* I7 : EMMC_CMD */
26 PAD_NC(GPP_I7, NONE),
27 /* I8 : EMMC_D0 */
28 PAD_NC(GPP_I8, NONE),
29 /* I9 : EMMC_D1 */
30 PAD_NC(GPP_I9, NONE),
31 /* I10 : EMMC_D2 */
32 PAD_NC(GPP_I10, NONE),
33 /* I11 : EMMC_D3 */
34 PAD_NC(GPP_I11, NONE),
35 /* I12 : EMMC_D4 */
36 PAD_NC(GPP_I12, NONE),
37 /* I13 : EMMC_D5 */
38 PAD_NC(GPP_I13, NONE),
39 /* I14 : EMMC_D6 */
40 PAD_NC(GPP_I14, NONE),
41 /* I15 : EMMC_D7 */
42 PAD_NC(GPP_I15, NONE),
43 /* I16 : EMMC_RCLK */
44 PAD_NC(GPP_I16, NONE),
45 /* I17 : EMMC_CLK */
46 PAD_NC(GPP_I17, NONE),
47 /* I18 : EMMC_RST_L */
48 PAD_NC(GPP_I18, NONE),
51 static const struct pad_config stylus_disable_pads[] = {
52 /* F13 : SOC_PEN_DETECT_R_ODL */
53 PAD_NC_LOCK(GPP_F13, NONE, LOCK_CONFIG),
54 /* F15 : SOC_PEN_DETECT_ODL */
55 PAD_NC_LOCK(GPP_F15, NONE, LOCK_CONFIG),
58 void fw_config_gpio_padbased_override(struct pad_config *padbased_table)
60 // Skip checking FW config if board ID in CBI is not verified.
61 if (board_id() == BOARD_ID_UNKNOWN)
62 return;
64 if (fw_config_probe(FW_CONFIG(WFC, WFC_ABSENT))) {
65 printk(BIOS_INFO, "Disable MIPI WFC GPIO pins.\n");
66 gpio_padbased_override(padbased_table, wfc_disable_pads,
67 ARRAY_SIZE(wfc_disable_pads));
70 if (!fw_config_probe(FW_CONFIG(STORAGE, STORAGE_EMMC))) {
71 printk(BIOS_INFO, "Disable eMMC SSD GPIO pins.\n");
72 gpio_padbased_override(padbased_table, emmc_disable_pads,
73 ARRAY_SIZE(emmc_disable_pads));
76 if (fw_config_probe(FW_CONFIG(STYLUS, STYLUS_ABSENT))) {
77 printk(BIOS_INFO, "Disable Stylus GPIO pins.\n");
78 gpio_padbased_override(padbased_table, stylus_disable_pads,
79 ARRAY_SIZE(stylus_disable_pads));