Subrata Banik has submitted this change. ( https://review.coreboot.org/c/coreboot/+/83657?usp=email )
(
4 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. )Change subject: mb/google/brya/var/orisa: Update fw_config probe for storage devices ......................................................................
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 rishikaraj@google.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/83657 Reviewed-by: Subrata Banik subratabanik@google.com Reviewed-by: Eric Lai ericllai@google.com Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M src/mainboard/google/brya/variants/orisa/Makefile.mk M src/mainboard/google/brya/variants/orisa/fw_config.c M src/mainboard/google/brya/variants/orisa/overridetree.cb D src/mainboard/google/brya/variants/orisa/variant.c 4 files changed, 25 insertions(+), 38 deletions(-)
Approvals: Subrata Banik: Looks good to me, approved build bot (Jenkins): Verified Eric Lai: Looks good to me, approved
diff --git a/src/mainboard/google/brya/variants/orisa/Makefile.mk b/src/mainboard/google/brya/variants/orisa/Makefile.mk index c0c4232..ea9cec1 100644 --- a/src/mainboard/google/brya/variants/orisa/Makefile.mk +++ b/src/mainboard/google/brya/variants/orisa/Makefile.mk @@ -8,4 +8,3 @@ 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 800fc1f..2977cb6 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 @@
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 f04eee2..14324d3 100644 --- a/src/mainboard/google/brya/variants/orisa/overridetree.cb +++ b/src/mainboard/google/brya/variants/orisa/overridetree.cb @@ -9,9 +9,10 @@ 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 @@ 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 end + device ref ufs on + probe STORAGE STORAGE_UNKNOWN + probe STORAGE STORAGE_UFS + 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 f34fb26..0000000 --- a/src/mainboard/google/brya/variants/orisa/variant.c +++ /dev/null @@ -1,28 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ - -#include <baseboard/variants.h> -#include <device/device.h> -#include <fw_config.h> - -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; - } -}