Shaunak Saha has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/44262 )
Change subject: soc/intel/tigerlake: move mainboard_silicon_init_params
......................................................................
soc/intel/tigerlake: move mainboard_silicon_init_params
This patch arranges mainboard_silicon_init_params before fetching
any config variables from devicetree. This would allow the variant
specific devicetree overrides to get consumed so that FSP UPD
parameters are initialized properly before SiliconInit.
BUG=b:158573805
TEST=Test that UPD values are set properly with variant specific
overrides of config's .
Signed-off-by: Shaunak Saha <shaunak.saha(a)intel.com>
Change-Id: Idfce528efa7806e292071e092fb129b53a94a145
---
M src/soc/intel/tigerlake/fsp_params.c
1 file changed, 2 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/62/44262/1
diff --git a/src/soc/intel/tigerlake/fsp_params.c b/src/soc/intel/tigerlake/fsp_params.c
index a61a025..5178d91 100644
--- a/src/soc/intel/tigerlake/fsp_params.c
+++ b/src/soc/intel/tigerlake/fsp_params.c
@@ -107,6 +107,8 @@
if (CONFIG(USE_INTEL_FSP_TO_CALL_COREBOOT_PUBLISH_MP_PPI))
params->CpuMpPpi = (uintptr_t) mp_fill_ppi_services_data();
+ mainboard_silicon_init_params(params);
+
/* D3Hot and D3Cold for TCSS */
params->D3HotEnable = !config->TcssD3HotDisable;
cpu_id = cpu_get_cpuid();
@@ -311,7 +313,6 @@
/* EnableMultiPhaseSiliconInit for running MultiPhaseSiInit */
params->EnableMultiPhaseSiliconInit = 1;
- mainboard_silicon_init_params(params);
}
/*
--
To view, visit https://review.coreboot.org/c/coreboot/+/44262
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Idfce528efa7806e292071e092fb129b53a94a145
Gerrit-Change-Number: 44262
Gerrit-PatchSet: 1
Gerrit-Owner: Shaunak Saha <shaunak.saha(a)intel.com>
Gerrit-MessageType: newchange
ky0ko has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/44845 )
Change subject: mtrr.h: refine _POW2_MASK
......................................................................
mtrr.h: refine _POW2_MASK
this patch adjusts _POW2_MASK to work with rom sizes between 64KiB
and 512MiB, additionally fixing incorrectness for sizes 128MiB and
above that previously were present.
Change-Id: I0272c0c43cba44f6fbfb5dc539509b4ed9b92e75
Signed-off-by: ky0ko <ky0ko(a)disroot.org>
---
M src/include/cpu/x86/mtrr.h
1 file changed, 4 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/45/44845/1
diff --git a/src/include/cpu/x86/mtrr.h b/src/include/cpu/x86/mtrr.h
index 42964b0..fd4159d 100644
--- a/src/include/cpu/x86/mtrr.h
+++ b/src/include/cpu/x86/mtrr.h
@@ -176,9 +176,11 @@
#endif /* !defined(__ASSEMBLER__) */
/* Align up/down to next power of 2, suitable for assembler
- too. Range of result 256kB to 128MB is good enough here. */
+ too. Range works from 64kB to 512MB. */
#define _POW2_MASK(x) ((x>>1)|(x>>2)|(x>>3)|(x>>4)|(x>>5)| \
- (x>>6)|(x>>7)|(x>>8)|((1<<18)-1))
+ (x>>6)|(x>>7)|(x>>8)|(x>>9)|(x>>10)| \
+ (x>>11)|(x>>12)|(x>>13)|((1<<16)-1))
+
#define _ALIGN_UP_POW2(x) ((x + _POW2_MASK(x)) & ~_POW2_MASK(x))
#define _ALIGN_DOWN_POW2(x) ((x) & ~_POW2_MASK(x))
--
To view, visit https://review.coreboot.org/c/coreboot/+/44845
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I0272c0c43cba44f6fbfb5dc539509b4ed9b92e75
Gerrit-Change-Number: 44845
Gerrit-PatchSet: 1
Gerrit-Owner: ky0ko <ky0ko(a)disroot.org>
Gerrit-MessageType: newchange
Bill XIE has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/39969 )
Change subject: nb/intel/sandybridge: Read spds only once if measured boot is enabled
......................................................................
nb/intel/sandybridge: Read spds only once if measured boot is enabled
Without considering s3 resume, spd may be used various times depending
on various condition. If spd is stored in CBFS and read various times,
PCR value may become inconsistent.
As mentioned in CB:39906, in order to avoid this, we could read spd
exactly once, and use the data read out various times, when measured
boot is enabled.
Change-Id: I02cad7e85d5e66fd9efb674e4dc9868233f6c233
Signed-off-by: Bill XIE <persmule(a)gmail.com>
---
M src/northbridge/intel/sandybridge/raminit.c
1 file changed, 27 insertions(+), 4 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/69/39969/1
diff --git a/src/northbridge/intel/sandybridge/raminit.c b/src/northbridge/intel/sandybridge/raminit.c
index b096a11..f3c81a6 100644
--- a/src/northbridge/intel/sandybridge/raminit.c
+++ b/src/northbridge/intel/sandybridge/raminit.c
@@ -98,6 +98,17 @@
}
}
+static bool spd_is_available(const spd_raw_data spds[], size_t num_spd)
+{
+ /* An available spd should at least have an non-zero id */
+ size_t i, j, sum = 0;
+ for (i = 0; i < num_spd; i++) {
+ for (j = 117; j < 128; j++)
+ sum += spds[i][j];
+ }
+ return (sum > 0);
+}
+
static void dram_find_spds_ddr3(spd_raw_data *spd, ramctr_timing *ctrl)
{
int dimms = 0, ch_dimms;
@@ -222,6 +233,8 @@
struct region_device rdev;
ramctr_timing *ctrl_cached = NULL;
+ if (CONFIG(TPM_MEASURED_BOOT))
+ memset(spds, 0, sizeof(spds));
MCHBAR32(SAPMCTL) |= 1;
/* Wait for ME to be ready */
@@ -271,8 +284,14 @@
/* Verify MRC cache for fast boot */
if (!s3resume && ctrl_cached) {
/* Load SPD unique information data. */
- memset(spds, 0, sizeof(spds));
- mainboard_get_spd(spds, 1);
+ if (CONFIG(TPM_MEASURED_BOOT)) {
+ /* if CONFIG(TPM_MEASURED_BOOT),
+ we manage to get spds only ONCE */
+ mainboard_get_spd(spds, 0);
+ } else {
+ memset(spds, 0, sizeof(spds));
+ mainboard_get_spd(spds, 1);
+ }
/* check SPD CRC16 to make sure the DIMMs haven't been replaced */
fast_boot = verify_crc16_spds_ddr3(spds, ctrl_cached);
@@ -307,8 +326,12 @@
ctrl.cpu = cpuid;
/* Get DDR3 SPD data */
- memset(spds, 0, sizeof(spds));
- mainboard_get_spd(spds, 0);
+ if (!CONFIG(TPM_MEASURED_BOOT) || !spd_is_available(spds, 4)) {
+ /* without CONFIG(TPM_MEASURED_BOOT), the previous read may
+ only contains id, so read it again */
+ memset(spds, 0, sizeof(spds));
+ mainboard_get_spd(spds, 0);
+ }
dram_find_spds_ddr3(spds, &ctrl);
err = try_init_dram_ddr3(&ctrl, fast_boot, s3resume, me_uma_size);
--
To view, visit https://review.coreboot.org/c/coreboot/+/39969
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I02cad7e85d5e66fd9efb674e4dc9868233f6c233
Gerrit-Change-Number: 39969
Gerrit-PatchSet: 1
Gerrit-Owner: Bill XIE <persmule(a)hardenedlinux.org>
Gerrit-MessageType: newchange