mb/google/nissa/var/yaviks: Disable SD card based on fw_config

Disable pins for SD card based on fw_config.

BUG=b:294456574
BRANCH=firmware-nissa-15217.B
TEST=emerge-nissa coreboot

Change-Id: I0b383d1b00056a69ba925bb5203dc4ca026b9d8e
Signed-off-by: Wisley Chen <wisley.chen@quanta.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/77105
Reviewed-by: Derek Huang <derekhuang@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Wisley Chen 2023-08-02 17:43:40 +06:00 committed by Matt DeVillier
parent 76653f638f
commit dd50567579
1 changed files with 16 additions and 0 deletions

View File

@ -50,6 +50,17 @@ static const struct pad_config stylus_disable_pads[] = {
PAD_NC_LOCK(GPP_F15, NONE, LOCK_CONFIG),
};
static const struct pad_config sd_disable_pads[] = {
/* D8 : SD_CLKREQ_ODL */
PAD_NC(GPP_D8, NONE),
/* D17 : SD_WAKE_N */
PAD_NC_LOCK(GPP_D17, NONE, LOCK_CONFIG),
/* H12 : SD_PERST_L */
PAD_NC_LOCK(GPP_H12, NONE, LOCK_CONFIG),
/* H13 : EN_PP3300_SD_X */
PAD_NC_LOCK(GPP_H13, NONE, LOCK_CONFIG),
};
void fw_config_gpio_padbased_override(struct pad_config *padbased_table)
{
if (fw_config_is_provisioned() && !fw_config_probe(FW_CONFIG(STORAGE, STORAGE_EMMC))) {
@ -67,4 +78,9 @@ void fw_config_gpio_padbased_override(struct pad_config *padbased_table)
gpio_padbased_override(padbased_table, stylus_disable_pads,
ARRAY_SIZE(stylus_disable_pads));
}
if (fw_config_probe(FW_CONFIG(SD_CARD, SD_ABSENT))) {
printk(BIOS_INFO, "Disable SD card GPIO pins.\n");
gpio_padbased_override(padbased_table, sd_disable_pads,
ARRAY_SIZE(sd_disable_pads));
}
}