diff options
author | Shuo Liu <shuo.liu@intel.com> | 2024-03-19 02:06:30 +0800 |
---|---|---|
committer | Lean Sheng Tan <sheng.tan@9elements.com> | 2024-05-02 17:44:05 +0000 |
commit | 104308090058914657a032cdcbd3a869846f31b4 (patch) | |
tree | 11dd1dcaade9b4ab18d0020290e6156eb80200f8 /src/soc/intel/xeon_sp/util.c | |
parent | 45a670d223ce7e77a4ba1e5d6419753d2e6a558d (diff) |
soc/intel/xeon_sp: Use fixed BDF for IBL
Integrated Boot Logic (IBL) codes doesn't support bootloader
controlled Primary-to-Sideband Bridge (P2SB) hidden and unhidden.
Hence, dynamically read IBL HPET/IOAPIC Bus:Device.Function (BDF)
by bootloader is not supported, because when P2SB is hidden the
register access is denied.
TEST=Build and boot on intel/archercity CRB
TEST=Build on intel/avenuecity CRB
TEST=Build on intel/beechnutcity CRB
Change-Id: I3975cb00e215c4984c63bb8510e8aef7d4cc85a4
Signed-off-by: Shuo Liu <shuo.liu@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/81321
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/soc/intel/xeon_sp/util.c')
-rw-r--r-- | src/soc/intel/xeon_sp/util.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/soc/intel/xeon_sp/util.c b/src/soc/intel/xeon_sp/util.c index 5c63f18a93..2fdf45e04f 100644 --- a/src/soc/intel/xeon_sp/util.c +++ b/src/soc/intel/xeon_sp/util.c @@ -9,8 +9,10 @@ #include <device/pci_ids.h> #include <intelblocks/cfg.h> #include <intelblocks/cpulib.h> +#include <intelblocks/p2sb.h> #include <intelpch/lockdown.h> #include <soc/chip_common.h> +#include <soc/pch_pci_devs.h> #include <soc/pci_devs.h> #include <soc/msr.h> #include <soc/soc_util.h> @@ -88,6 +90,32 @@ unsigned int soc_get_num_cpus(void) return get_iio_uds()->SystemStatus.numCpus; } +union p2sb_bdf soc_get_hpet_bdf(void) +{ + if (CONFIG(SOC_INTEL_COMMON_IBL_BASE)) { + union p2sb_bdf bdf = { + .bus = HPET_BUS_NUM, + .dev = HPET_DEV_NUM, + .fn = HPET0_FUNC_NUM + }; + return bdf; + } + return p2sb_get_hpet_bdf(); +} + +union p2sb_bdf soc_get_ioapic_bdf(void) +{ + if (CONFIG(SOC_INTEL_COMMON_IBL_BASE)) { + union p2sb_bdf bdf = { + .bus = PCH_IOAPIC_BUS_NUMBER, + .dev = PCH_IOAPIC_DEV_NUM, + .fn = PCH_IOAPIC_FUNC_NUM + }; + return bdf; + } + return p2sb_get_ioapic_bdf(); +} + #if ENV_RAMSTAGE /* Setting devtree variables is only allowed in ramstage. */ void lock_pam0123(void) |