soc/intel/ptl: Update ME specification version to 21
[coreboot.git] / src / mainboard / google / brya / variants / primus / variant.c
blobc1ea39eb896c851a8397bd87d8f00e5d04c5a27a
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>
9 #include <static.h>
11 static void devtree_update_emmc_rtd3(uint32_t board_ver)
13 struct device *emmc_rtd3 = DEV_PTR(emmc_rtd3);
14 if (board_ver > 1)
15 return;
17 emmc_rtd3->enabled = 0;
20 static void devtree_update_audio_codec(void)
22 struct device *audio_codec = DEV_PTR(audio_codec);
23 struct drivers_i2c_generic_config *config = audio_codec->chip_info;
25 if (fw_config_probe(FW_CONFIG(AUDIO, MAX98360_ALC5682I_VS_I2S)))
26 config->hid = "RTL5682";
29 static const struct pad_config nvme_disable_pads[] = {
30 PAD_NC(GPP_B2, NONE), /* B2 : VRALERT# ==> M2_SSD_PLA_L */
31 PAD_NC(GPP_B4, NONE), /* B4 : PROC_GP3 ==> SSD_PERST_L */
32 PAD_NC(GPP_D3, NONE), /* D3 : ISH_GP3 ==> M2_SSD_PLN_L */
33 PAD_NC(GPP_D5, NONE), /* D5 : SRCCLKREQ0# ==> SSD_CLKREQ_ODL */
34 PAD_NC(GPP_D11, NONE), /* D11 : ISH_SPI_MISO ==> EN_PP3300_SSD */
37 static const struct pad_config emmc_disable_pads[] = {
38 PAD_NC(GPP_B3, NONE), /* B3 : PROC_GP2 ==> eMMC_PERST_L */
39 PAD_NC(GPP_E20, NONE), /* E20 : USB_C1_LSX_SOC_TX ==> EN_PP3300_eMMC */
40 PAD_NC(GPP_F19, NONE), /* F19 : SRCCLKREQ6# ==> EMMC_CLKREQ_ODL */
43 static void disable_unused_gpios(void)
45 int emmc_detected = gpio_get(GPP_T2);
47 if (emmc_detected == 1)
48 gpio_configure_pads(nvme_disable_pads, ARRAY_SIZE(nvme_disable_pads));
49 else
50 gpio_configure_pads(emmc_disable_pads, ARRAY_SIZE(emmc_disable_pads));
53 void variant_devtree_update(void)
55 uint32_t board_ver = board_id();
56 disable_unused_gpios();
57 devtree_update_emmc_rtd3(board_ver);
58 devtree_update_audio_codec();