From c694522b5223b19323c93e45d769ab47ebf73c83 Mon Sep 17 00:00:00 2001 From: Rishika Raj Date: Fri, 26 Jul 2024 04:48:35 +0000 Subject: mb/google/brya/var/orisa: Update fw_config probe for storage devices 1. Add STORAGE_UNKNOWN fw_config to enable all storage devices. 2. Update fw_config probe to enable/disable devices in devicetree. 3. Disable eMMC controller incase STORAGE_UFS or STORAGE_NVME fw_config is enabled. BUG=None TEST=emerge-nissa coreboot Change-Id: Id3a22aa2206e86fdca6f6fadbc849572890fee58 Signed-off-by: Rishika Raj Reviewed-on: https://review.coreboot.org/c/coreboot/+/83657 Reviewed-by: Subrata Banik Reviewed-by: Eric Lai Tested-by: build bot (Jenkins) --- .../google/brya/variants/orisa/Makefile.mk | 1 - .../google/brya/variants/orisa/fw_config.c | 15 ++++++++---- .../google/brya/variants/orisa/overridetree.cb | 19 +++++++++++---- src/mainboard/google/brya/variants/orisa/variant.c | 28 ---------------------- 4 files changed, 25 insertions(+), 38 deletions(-) delete mode 100644 src/mainboard/google/brya/variants/orisa/variant.c (limited to 'src') diff --git a/src/mainboard/google/brya/variants/orisa/Makefile.mk b/src/mainboard/google/brya/variants/orisa/Makefile.mk index c0c42324f8..ea9cec1404 100644 --- a/src/mainboard/google/brya/variants/orisa/Makefile.mk +++ b/src/mainboard/google/brya/variants/orisa/Makefile.mk @@ -8,4 +8,3 @@ romstage-y += memory.c ramstage-$(CONFIG_FW_CONFIG) += fw_config.c ramstage-y += gpio.c ramstage-$(CONFIG_SOC_INTEL_COMMON_BLOCK_HDA_VERB) += hda_verb.c -ramstage-y += variant.c diff --git a/src/mainboard/google/brya/variants/orisa/fw_config.c b/src/mainboard/google/brya/variants/orisa/fw_config.c index 800fc1f205..2977cb6c90 100644 --- a/src/mainboard/google/brya/variants/orisa/fw_config.c +++ b/src/mainboard/google/brya/variants/orisa/fw_config.c @@ -34,9 +34,16 @@ static const struct pad_config emmc_disable_pads[] = { void fw_config_gpio_padbased_override(struct pad_config *padbased_table) { - if (fw_config_is_provisioned() && !fw_config_probe(FW_CONFIG(STORAGE, STORAGE_EMMC))) { - printk(BIOS_INFO, "Disable eMMC GPIO pins.\n"); - gpio_padbased_override(padbased_table, emmc_disable_pads, - ARRAY_SIZE(emmc_disable_pads)); + if (!fw_config_is_provisioned()) { + printk(BIOS_WARNING, "FW_CONFIG is not provisioned. Exiting...\n"); + return; + } + + if (!fw_config_probe(FW_CONFIG(STORAGE, STORAGE_UNKNOWN))) { + if (!fw_config_probe(FW_CONFIG(STORAGE, STORAGE_EMMC))) { + printk(BIOS_INFO, "Disable eMMC GPIO pins.\n"); + gpio_padbased_override(padbased_table, emmc_disable_pads, + ARRAY_SIZE(emmc_disable_pads)); + } } } diff --git a/src/mainboard/google/brya/variants/orisa/overridetree.cb b/src/mainboard/google/brya/variants/orisa/overridetree.cb index f04eee2c35..14324d313d 100644 --- a/src/mainboard/google/brya/variants/orisa/overridetree.cb +++ b/src/mainboard/google/brya/variants/orisa/overridetree.cb @@ -9,9 +9,10 @@ fw_config option PDC_TI_BYPASS 2 end field STORAGE 30 31 - option STORAGE_EMMC 0 - option STORAGE_NVME 1 - option STORAGE_UFS 2 + option STORAGE_EMMC 0 + option STORAGE_NVME 1 + option STORAGE_UFS 2 + option STORAGE_UNKNOWN 3 end end @@ -521,14 +522,22 @@ chip soc/intel/alderlake end #I2C5 device ref heci1 on end device ref pcie_rp7 off end - device ref emmc on end + device ref emmc on + probe STORAGE STORAGE_UNKNOWN + probe STORAGE STORAGE_EMMC + end device ref ish on chip drivers/intel/ish register "add_acpi_dma_property" = "true" device generic 0 on end end + probe STORAGE STORAGE_UNKNOWN + probe STORAGE STORAGE_UFS + end + device ref ufs on + probe STORAGE STORAGE_UNKNOWN + probe STORAGE STORAGE_UFS end - device ref ufs on end device ref uart0 on end device ref pch_espi on chip ec/google/chromeec diff --git a/src/mainboard/google/brya/variants/orisa/variant.c b/src/mainboard/google/brya/variants/orisa/variant.c deleted file mode 100644 index f34fb2698b..0000000000 --- a/src/mainboard/google/brya/variants/orisa/variant.c +++ /dev/null @@ -1,28 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ - -#include -#include -#include - -void variant_devtree_update(void) -{ - struct device *emmc = DEV_PTR(emmc); - struct device *ufs = DEV_PTR(ufs); - struct device *ish = DEV_PTR(ish); - - if (!fw_config_is_provisioned()) { - printk(BIOS_INFO, "fw_config unprovisioned so enable all storage devices\n"); - return; - } - - if (!fw_config_probe(FW_CONFIG(STORAGE, STORAGE_EMMC))) { - printk(BIOS_INFO, "eMMC disabled by fw_config\n"); - emmc->enabled = 0; - } - - if (!fw_config_probe(FW_CONFIG(STORAGE, STORAGE_UFS))) { - printk(BIOS_INFO, "UFS disabled by fw_config\n"); - ufs->enabled = 0; - ish->enabled = 0; - } -} -- cgit v1.2.3