cpu/x86/smm/pci_resource_store: Store DEV/VEN ID
[coreboot2.git] / src / mainboard / google / brya / variants / primus / variant.c
blobe78dfdc5db620d4f2588bcc49abc2f94b82a43be
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <baseboard/variants.h>
4 #include <boardid.h>
5 #include <device/device.h>
6 #include <drivers/i2c/hid/chip.h>
7 #include <fw_config.h>
8 #include <gpio.h>
10 static void devtree_update_emmc_rtd3(uint32_t board_ver)
12 struct device *emmc_rtd3 = DEV_PTR(emmc_rtd3);
13 if (board_ver > 1)
14 return;
16 emmc_rtd3->enabled = 0;
19 static void devtree_update_audio_codec(void)
21 struct device *audio_codec = DEV_PTR(audio_codec);
22 struct drivers_i2c_generic_config *config = audio_codec->chip_info;
24 if (fw_config_probe(FW_CONFIG(AUDIO, MAX98360_ALC5682I_VS_I2S)))
25 config->hid = "RTL5682";
28 static const struct pad_config nvme_disable_pads[] = {
29 PAD_NC(GPP_B2, NONE), /* B2 : VRALERT# ==> M2_SSD_PLA_L */
30 PAD_NC(GPP_B4, NONE), /* B4 : PROC_GP3 ==> SSD_PERST_L */
31 PAD_NC(GPP_D3, NONE), /* D3 : ISH_GP3 ==> M2_SSD_PLN_L */
32 PAD_NC(GPP_D5, NONE), /* D5 : SRCCLKREQ0# ==> SSD_CLKREQ_ODL */
33 PAD_NC(GPP_D11, NONE), /* D11 : ISH_SPI_MISO ==> EN_PP3300_SSD */
36 static const struct pad_config emmc_disable_pads[] = {
37 PAD_NC(GPP_B3, NONE), /* B3 : PROC_GP2 ==> eMMC_PERST_L */
38 PAD_NC(GPP_E20, NONE), /* E20 : USB_C1_LSX_SOC_TX ==> EN_PP3300_eMMC */
39 PAD_NC(GPP_F19, NONE), /* F19 : SRCCLKREQ6# ==> EMMC_CLKREQ_ODL */
42 static void disable_unused_gpios(void)
44 int emmc_detected = gpio_get(GPP_T2);
46 if (emmc_detected == 1)
47 gpio_configure_pads(nvme_disable_pads, ARRAY_SIZE(nvme_disable_pads));
48 else
49 gpio_configure_pads(emmc_disable_pads, ARRAY_SIZE(emmc_disable_pads));
52 void variant_devtree_update(void)
54 uint32_t board_ver = board_id();
55 disable_unused_gpios();
56 devtree_update_emmc_rtd3(board_ver);
57 devtree_update_audio_codec();