aboutsummaryrefslogtreecommitdiff
path: root/src/soc
diff options
context:
space:
mode:
authorFelix Held <felix-coreboot@felixheld.de>2021-06-19 00:06:02 +0200
committerFelix Held <felix-coreboot@felixheld.de>2021-06-21 15:15:26 +0000
commit42583de6b8e2692962e2ec86136fe7ae2b42e162 (patch)
tree282e9e3dfbbdd8d8a8ff9c05f6d4a9764ac6db73 /src/soc
parent95d4ee8168a67648e0b4a6ff855865db8c0a5420 (diff)
soc/amd/cezanne/fsp_m_params: set HD Audio enable UPD from devicetree
Pass the info if the non-graphics HD audio controller device is enabled or disabled in the board's devicetree via a UPD to the FSP so that it knows if it should enable or disable the corresponding device. TEST=When adding "device ref hda on end" to the devicetree of amd/majolica the non-graphics HD Audio controller shows up in lspci and when that line isn't added the PCIe device doesn't show up. Signed-off-by: Felix Held <felix-coreboot@felixheld.de> Change-Id: I9f5e164d308906bfc788e5c2674c13c7b2ebf471 Reviewed-on: https://review.coreboot.org/c/coreboot/+/55680 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Marshall Dawson <marshalldawson3rd@gmail.com>
Diffstat (limited to 'src/soc')
-rw-r--r--src/soc/amd/cezanne/fsp_m_params.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/soc/amd/cezanne/fsp_m_params.c b/src/soc/amd/cezanne/fsp_m_params.c
index 5601568d30..1a0366b4fa 100644
--- a/src/soc/amd/cezanne/fsp_m_params.c
+++ b/src/soc/amd/cezanne/fsp_m_params.c
@@ -36,6 +36,29 @@ static bool devtree_gfx_hda_dev_enabled(void)
return gfx_hda_dev->enabled;
}
+static const struct device_path hda_path[] = {
+ {
+ .type = DEVICE_PATH_PCI,
+ .pci.devfn = PCIE_ABC_A_DEVFN
+ },
+ {
+ .type = DEVICE_PATH_PCI,
+ .pci.devfn = HD_AUDIO_DEVFN
+ },
+};
+
+static bool devtree_hda_dev_enabled(void)
+{
+ const struct device *hda_dev;
+
+ hda_dev = find_dev_nested_path(pci_root_bus(), hda_path, ARRAY_SIZE(hda_path));
+
+ if (!hda_dev)
+ return false;
+
+ return hda_dev->enabled;
+}
+
static const struct device_path sata0_path[] = {
{
.type = DEVICE_PATH_PCI,
@@ -202,6 +225,7 @@ void platform_fsp_memory_init_params_cb(FSPM_UPD *mupd, uint32_t version)
mcfg->pspp_policy = config->pspp_policy;
mcfg->enable_nb_azalia = devtree_gfx_hda_dev_enabled();
+ mcfg->hda_enable = devtree_hda_dev_enabled();
mcfg->sata_enable = devtree_sata_dev_enabled();
if (config->usb_phy_custom)