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>
This commit is contained in:
committed by
Subrata Banik
parent
2ecc785a69
commit
c694522b52
@ -8,4 +8,3 @@ romstage-y += memory.c
|
|||||||
ramstage-$(CONFIG_FW_CONFIG) += fw_config.c
|
ramstage-$(CONFIG_FW_CONFIG) += fw_config.c
|
||||||
ramstage-y += gpio.c
|
ramstage-y += gpio.c
|
||||||
ramstage-$(CONFIG_SOC_INTEL_COMMON_BLOCK_HDA_VERB) += hda_verb.c
|
ramstage-$(CONFIG_SOC_INTEL_COMMON_BLOCK_HDA_VERB) += hda_verb.c
|
||||||
ramstage-y += variant.c
|
|
||||||
|
@ -34,9 +34,16 @@ static const struct pad_config emmc_disable_pads[] = {
|
|||||||
|
|
||||||
void fw_config_gpio_padbased_override(struct pad_config *padbased_table)
|
void fw_config_gpio_padbased_override(struct pad_config *padbased_table)
|
||||||
{
|
{
|
||||||
if (fw_config_is_provisioned() && !fw_config_probe(FW_CONFIG(STORAGE, STORAGE_EMMC))) {
|
if (!fw_config_is_provisioned()) {
|
||||||
printk(BIOS_INFO, "Disable eMMC GPIO pins.\n");
|
printk(BIOS_WARNING, "FW_CONFIG is not provisioned. Exiting...\n");
|
||||||
gpio_padbased_override(padbased_table, emmc_disable_pads,
|
return;
|
||||||
ARRAY_SIZE(emmc_disable_pads));
|
}
|
||||||
|
|
||||||
|
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));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -9,9 +9,10 @@ fw_config
|
|||||||
option PDC_TI_BYPASS 2
|
option PDC_TI_BYPASS 2
|
||||||
end
|
end
|
||||||
field STORAGE 30 31
|
field STORAGE 30 31
|
||||||
option STORAGE_EMMC 0
|
option STORAGE_EMMC 0
|
||||||
option STORAGE_NVME 1
|
option STORAGE_NVME 1
|
||||||
option STORAGE_UFS 2
|
option STORAGE_UFS 2
|
||||||
|
option STORAGE_UNKNOWN 3
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -521,14 +522,22 @@ chip soc/intel/alderlake
|
|||||||
end #I2C5
|
end #I2C5
|
||||||
device ref heci1 on end
|
device ref heci1 on end
|
||||||
device ref pcie_rp7 off 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
|
device ref ish on
|
||||||
chip drivers/intel/ish
|
chip drivers/intel/ish
|
||||||
register "add_acpi_dma_property" = "true"
|
register "add_acpi_dma_property" = "true"
|
||||||
device generic 0 on end
|
device generic 0 on end
|
||||||
end
|
end
|
||||||
|
probe STORAGE STORAGE_UNKNOWN
|
||||||
|
probe STORAGE STORAGE_UFS
|
||||||
|
end
|
||||||
|
device ref ufs on
|
||||||
|
probe STORAGE STORAGE_UNKNOWN
|
||||||
|
probe STORAGE STORAGE_UFS
|
||||||
end
|
end
|
||||||
device ref ufs on end
|
|
||||||
device ref uart0 on end
|
device ref uart0 on end
|
||||||
device ref pch_espi on
|
device ref pch_espi on
|
||||||
chip ec/google/chromeec
|
chip ec/google/chromeec
|
||||||
|
@ -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;
|
|
||||||
}
|
|
||||||
}
|
|
Reference in New Issue
Block a user