diff options
author | David Wu <david_wu@quanta.corp-partner.google.com> | 2024-06-13 12:13:40 +0800 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2024-06-17 14:29:40 +0000 |
commit | 2fb6eec811e6421392442ef0e5902f55fd34d0e4 (patch) | |
tree | af9d005a24c71fa4b6d0d800b510fb272592478e /src/mainboard/google/brya/variants/riven/variant.c | |
parent | 56d116f4498e06a5b44731ac3a97a63d6d873128 (diff) |
mb/google/nissa/var/riven: Disable storage devices based on fw_config
Disable devices in variant.c instead of adding probe statements to
devicetree because storage devices need to be enabled when fw_config is
unprovisioned, and devicetree does not currently support this (it
disables all probed devices when fw_config is unprovisioned).
BUG=b:337169542
TEST=Local build successfully.
Change-Id: I3d71a35e9c0a33b72720b093b5a05eb69d5bb9f8
Signed-off-by: David Wu <david_wu@quanta.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/83060
Reviewed-by: Eric Lai <ericllai@google.com>
Reviewed-by: Kapil Porwal <kapilporwal@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Subrata Banik <subratabanik@google.com>
Diffstat (limited to 'src/mainboard/google/brya/variants/riven/variant.c')
-rw-r--r-- | src/mainboard/google/brya/variants/riven/variant.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/mainboard/google/brya/variants/riven/variant.c b/src/mainboard/google/brya/variants/riven/variant.c new file mode 100644 index 0000000000..937215c06d --- /dev/null +++ b/src/mainboard/google/brya/variants/riven/variant.c @@ -0,0 +1,29 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include <baseboard/variants.h> +#include <console/console.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; + } +} |