mb/google/nissa/var/nivviks: Disable SD card based on fw_config
BUG=b:218929856
TEST=Boot to OS on nivviks. Change fw_config in CBI and check that SD
card is enabled/disabled as expected.
Change-Id: Idcf38343bb290b1eff6a2e440f868b03acba3288
Signed-off-by: Reka Norman <rekanorman@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/64207
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Kangheui Won <khwon@chromium.org>
Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com>
diff --git a/src/mainboard/google/brya/variants/nivviks/fw_config.c b/src/mainboard/google/brya/variants/nivviks/fw_config.c
index c475ca3..9e9932b 100644
--- a/src/mainboard/google/brya/variants/nivviks/fw_config.c
+++ b/src/mainboard/google/brya/variants/nivviks/fw_config.c
@@ -18,11 +18,25 @@
PAD_NC(GPP_H23, NONE),
};
+static const struct pad_config sd_disable_pads[] = {
+ /* D8 : SD_CLKREQ_ODL */
+ PAD_NC(GPP_D8, NONE),
+ /* H12 : SD_PERST_L */
+ PAD_NC(GPP_H12, NONE),
+ /* H13 : EN_PP3300_SD_X */
+ PAD_NC(GPP_H13, NONE),
+};
+
static void fw_config_handle(void *unused)
{
if (!fw_config_probe(FW_CONFIG(DB_USB, DB_1C_LTE))) {
printk(BIOS_INFO, "Disable LTE-related GPIO pins.\n");
gpio_configure_pads(lte_disable_pads, ARRAY_SIZE(lte_disable_pads));
}
+
+ if (fw_config_probe(FW_CONFIG(SD_CARD, SD_ABSENT))) {
+ printk(BIOS_INFO, "Disable SD card GPIO pins.\n");
+ gpio_configure_pads(sd_disable_pads, ARRAY_SIZE(sd_disable_pads));
+ }
}
BOOT_STATE_INIT_ENTRY(BS_DEV_ENABLE, BS_ON_ENTRY, fw_config_handle, NULL);