summaryrefslogtreecommitdiff
path: root/src/soc/intel/jasperlake/fsp_params.c
diff options
context:
space:
mode:
authorSubrata Banik <subrata.banik@intel.com>2021-06-09 03:57:41 +0530
committerSubrata Banik <subrata.banik@intel.com>2021-06-16 03:48:43 +0000
commit1fcfe3d96a75d1450d7bde5c228e6cd5341db1d4 (patch)
tree11a2472d8a1bd007a2d4b3b0f3c65c4b5c4f6f91 /src/soc/intel/jasperlake/fsp_params.c
parent6f910e24b6650da46bc45ea6bd25d426b3361752 (diff)
soc/intel/jasperlake: Make use of is_devfn_enabled() function
1. Replace all pcidev_path_on_root() and is_dev_enabled() functions combination with is_devfn_enabled(). 2. Remove unused local variable of device structure type (struct device *). 3. Replace pcidev_path_on_root() and dev->enabled check with is_devfn_enabled() call. TEST=Able to build and boot without any regression seen on dedede Signed-off-by: Subrata Banik <subrata.banik@intel.com> Change-Id: I4919a1ec02df50bc41fd66d5f3a352108a7aa04c Reviewed-on: https://review.coreboot.org/c/coreboot/+/55329 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Diffstat (limited to 'src/soc/intel/jasperlake/fsp_params.c')
-rw-r--r--src/soc/intel/jasperlake/fsp_params.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/src/soc/intel/jasperlake/fsp_params.c b/src/soc/intel/jasperlake/fsp_params.c
index dcee306056..4f2b936c4b 100644
--- a/src/soc/intel/jasperlake/fsp_params.c
+++ b/src/soc/intel/jasperlake/fsp_params.c
@@ -78,8 +78,7 @@ void platform_fsp_silicon_init_params_cb(FSPS_UPD *supd)
params->GraphicsConfigPtr = (uintptr_t)vbt_get();
/* Check if IGD is present and fill Graphics init param accordingly */
- dev = pcidev_path_on_root(SA_DEVFN_IGD);
- params->PeiGraphicsPeimInit = CONFIG(RUN_FSP_GOP) && is_dev_enabled(dev);
+ params->PeiGraphicsPeimInit = CONFIG(RUN_FSP_GOP) && is_devfn_enabled(SA_DEVFN_IGD);
params->PavpEnable = CONFIG(PAVP);
@@ -147,8 +146,7 @@ void platform_fsp_silicon_init_params_cb(FSPS_UPD *supd)
}
/* SATA */
- dev = pcidev_path_on_root(PCH_DEVFN_SATA);
- params->SataEnable = is_dev_enabled(dev);
+ params->SataEnable = is_devfn_enabled(PCH_DEVFN_SATA);
if (params->SataEnable) {
params->SataMode = config->SataMode;
params->SataSalpSupport = config->SataSalpSupport;
@@ -169,21 +167,18 @@ void platform_fsp_silicon_init_params_cb(FSPS_UPD *supd)
params->ImonOffset[0] = config->ImonOffset;
/* SDCard related configuration */
- dev = pcidev_path_on_root(PCH_DEVFN_SDCARD);
- params->ScsSdCardEnabled = is_dev_enabled(dev);
+ params->ScsSdCardEnabled = is_devfn_enabled(PCH_DEVFN_SDCARD);
if (params->ScsSdCardEnabled)
params->SdCardPowerEnableActiveHigh = config->SdCardPowerEnableActiveHigh;
/* Enable Processor Thermal Control */
- dev = pcidev_path_on_root(SA_DEVFN_DPTF);
- params->Device4Enable = is_dev_enabled(dev);
+ params->Device4Enable = is_devfn_enabled(SA_DEVFN_DPTF);
/* Set TccActivationOffset */
params->TccActivationOffset = config->tcc_offset;
/* eMMC configuration */
- dev = pcidev_path_on_root(PCH_DEVFN_EMMC);
- params->ScsEmmcEnabled = is_dev_enabled(dev);
+ params->ScsEmmcEnabled = is_devfn_enabled(PCH_DEVFN_EMMC);
if (params->ScsEmmcEnabled)
params->ScsEmmcHs400Enabled = config->ScsEmmcHs400Enabled;
@@ -192,7 +187,6 @@ void platform_fsp_silicon_init_params_cb(FSPS_UPD *supd)
if (dev) {
if (!xdci_can_enable())
dev->enabled = 0;
-
params->XdciEnable = dev->enabled;
} else {
params->XdciEnable = 0;