From 9027e1ba2f23eb6b418f60f133da1730b7d989d3 Mon Sep 17 00:00:00 2001 From: Pratik Prajapati Date: Wed, 23 Aug 2017 17:37:43 -0700 Subject: soc/intel/cannonlake: Init UPD params based on config Initialize UPD params based upon config Change-Id: Ib2ee58f8432a957ef389b40f717533e4cfe774b9 Signed-off-by: Pratik Prajapati Reviewed-on: https://review.coreboot.org/21175 Reviewed-by: Aaron Durbin Tested-by: build bot (Jenkins) --- src/soc/intel/cannonlake/romstage/romstage.c | 31 ++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'src/soc/intel/cannonlake/romstage/romstage.c') diff --git a/src/soc/intel/cannonlake/romstage/romstage.c b/src/soc/intel/cannonlake/romstage/romstage.c index ab0e19bdc6..17c31910e9 100644 --- a/src/soc/intel/cannonlake/romstage/romstage.c +++ b/src/soc/intel/cannonlake/romstage/romstage.c @@ -15,12 +15,15 @@ #include #include +#include +#include #include #include #include #include #include #include +#include #include #include #include @@ -63,8 +66,36 @@ asmlinkage void car_stage_entry(void) run_postcar_phase(&pcf); } +static void soc_memory_init_params(FSP_M_CONFIG *m_cfg, const config_t *config) +{ + int i; + uint32_t mask = 0; + + m_cfg->TsegSize = CONFIG_SMM_TSEG_SIZE; + m_cfg->IedSize = CONFIG_IED_REGION_SIZE; + m_cfg->SaGv = config->SaGv; + m_cfg->UserBd = BOARD_TYPE_ULT_ULX; + m_cfg->RMT = config->RMT; + + for (i = 0; i < ARRAY_SIZE(config->PcieRpEnable); i++) { + if (config->PcieRpEnable[i]) + mask |= (1 << i); + } + m_cfg->PcieRpEnableMask = mask; +} + void platform_fsp_memory_init_params_cb(FSPM_UPD *mupd, uint32_t version) { + const struct device *dev = dev_find_slot(0, PCH_DEVFN_LPC); + assert(dev != NULL); + const config_t *config = dev->chip_info; + FSP_M_CONFIG *m_cfg = &mupd->FspmConfig; + + soc_memory_init_params(m_cfg, config); + + /* Enable SMBus controller based on config */ + m_cfg->SmbusEnable = config->SmbusEnable; + mainboard_memory_init_params(mupd); } -- cgit v1.2.3