Martin Roth has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/47366 )
Change subject: src: Update some incorrect config options in comments
......................................................................
src: Update some incorrect config options in comments
This is a trivial patch to fix some comments that were generating
notes in the kconfig lint test.
Signed-off-by: Martin Roth <martin(a)coreboot.org>
Change-Id: I26a95f17e82910f50c62215be5c29780fe98e29a
---
M src/drivers/i2c/designware/dw_i2c.h
M src/ec/google/chromeec/ec_commands.h
M src/include/rules.h
M src/lib/romstage_handoff.c
M src/soc/intel/braswell/memmap.c
5 files changed, 10 insertions(+), 9 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/66/47366/1
diff --git a/src/drivers/i2c/designware/dw_i2c.h b/src/drivers/i2c/designware/dw_i2c.h
index 45f305e..e20a5d1 100644
--- a/src/drivers/i2c/designware/dw_i2c.h
+++ b/src/drivers/i2c/designware/dw_i2c.h
@@ -17,7 +17,7 @@
/*
* Timing values are in units of clock period, with the clock speed
- * provided by the SOC in CONFIG_DRIVERS_I2C_DESIGNWARE_I2C_CLOCK_MHZ
+ * provided by the SOC in CONFIG_DRIVERS_I2C_DESIGNWARE_CLOCK_MHZ
* Automatic configuration is done based on requested speed, but the
* values may need tuned depending on the board and the number of
* devices present on the bus.
diff --git a/src/ec/google/chromeec/ec_commands.h b/src/ec/google/chromeec/ec_commands.h
index 241ec39..fb83d60 100644
--- a/src/ec/google/chromeec/ec_commands.h
+++ b/src/ec/google/chromeec/ec_commands.h
@@ -1388,7 +1388,7 @@
*/
EC_FEATURE_REFINED_TABLET_MODE_HYSTERESIS = 37,
/*
- * Early Firmware Selection ver.2. Enabled by CONFIG_VBOOT_EFS2.
+ * Early Firmware Selection ver.2. Enabled by VBOOT_EFS2 config option.
* Note this is a RO feature. So, a query (EC_CMD_GET_FEATURES) should
* be sent to RO to be precise.
*/
diff --git a/src/include/rules.h b/src/include/rules.h
index d30b2b8..6ebb37e 100644
--- a/src/include/rules.h
+++ b/src/include/rules.h
@@ -63,10 +63,11 @@
/*
* NOTE: "verstage" code may either run as a separate stage or linked into the
- * bootblock/romstage, depending on the setting of CONFIG_SEPARATE_VERSTAGE. The
- * ENV_SEPARATE_VERSTAGE macro will only return true for "verstage" code when
- * CONFIG_SEPARATE_VERSTAGE=y, otherwise that code will have ENV_BOOTBLOCK or
- * ENV_ROMSTAGE set (depending on the CONFIG_VBOOT_STARTS_IN_... options).
+ * bootblock/romstage, depending on the setting of the VBOOT_SEPARATE_VERSTAGE
+ * kconfig option. The ENV_SEPARATE_VERSTAGE macro will only return true for
+ * "verstage" code when CONFIG(VBOOT_SEPARATE_VERSTAGE) is true, otherwise that
+ * code will have ENV_BOOTBLOCK or ENV_ROMSTAGE set (depending on the
+ * "VBOOT_STARTS_IN_"... kconfig options).
*/
#elif defined(__VERSTAGE__)
#define ENV_DECOMPRESSOR 0
diff --git a/src/lib/romstage_handoff.c b/src/lib/romstage_handoff.c
index b54619d..0a7a822 100644
--- a/src/lib/romstage_handoff.c
+++ b/src/lib/romstage_handoff.c
@@ -8,7 +8,7 @@
struct romstage_handoff {
/* Indicate if the current boot is an S3 resume. If
- * CONFIG_RELOCTABLE_RAMSTAGE is enabled the chipset code is
+ * CONFIG_RELOCATABLE_RAMSTAGE is enabled the chipset code is
* responsible for initializing this variable. Otherwise, ramstage
* will be re-loaded from cbfs (which can be slower since it lives
* in flash). */
diff --git a/src/soc/intel/braswell/memmap.c b/src/soc/intel/braswell/memmap.c
index 6cfce43..4a791ef 100644
--- a/src/soc/intel/braswell/memmap.c
+++ b/src/soc/intel/braswell/memmap.c
@@ -27,11 +27,11 @@
/*
* +-------------------------+ Top of RAM (aligned)
* | System Management Mode |
- * | code and data | Length: CONFIG_TSEG_SIZE
+ * | code and data | Length: CONFIG_SMM_TSEG_SIZE
* | (TSEG) |
* +-------------------------+ SMM base (aligned)
* | |
- * | Chipset Reserved Memory | Length: Multiple of CONFIG_TSEG_SIZE
+ * | Chipset Reserved Memory | Length: Multiple of CONFIG_SMM_TSEG_SIZE
* | |
* +-------------------------+ top_of_ram (aligned)
* | |
--
To view, visit https://review.coreboot.org/c/coreboot/+/47366
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I26a95f17e82910f50c62215be5c29780fe98e29a
Gerrit-Change-Number: 47366
Gerrit-PatchSet: 1
Gerrit-Owner: Martin Roth <martinroth(a)google.com>
Gerrit-MessageType: newchange
Arthur Heymans has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/47070 )
Change subject: cpu/x86/smm/smm_module_loaderv2.c: Use more variables
......................................................................
cpu/x86/smm/smm_module_loaderv2.c: Use more variables
Reusing the size variable for a different purpose later on in the
function makes the code harder to read.
Change-Id: Iceb10aa40ad473b41b7da0310554725585e3c2c2
Signed-off-by: Arthur Heymans <arthur(a)aheymans.xyz>
---
M src/cpu/x86/smm/smm_module_loaderv2.c
1 file changed, 4 insertions(+), 3 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/70/47070/1
diff --git a/src/cpu/x86/smm/smm_module_loaderv2.c b/src/cpu/x86/smm/smm_module_loaderv2.c
index 3fa5871..821aa3f 100644
--- a/src/cpu/x86/smm/smm_module_loaderv2.c
+++ b/src/cpu/x86/smm/smm_module_loaderv2.c
@@ -413,12 +413,13 @@
* for default handler, but for relocated handler it lives at the beginning
* of SMRAM which is TSEG base
*/
- size = params->num_concurrent_stacks * params->per_cpu_stack_size;
- stacks_top = smm_stub_place_stacks((char *)params->smram_start, size, params);
+ const total_stack_size = params->num_concurrent_stacks * params->per_cpu_stack_size;
+ stacks_top = smm_stub_place_stacks((char *)params->smram_start, total_stack_size,
+ params);
if (stacks_top == NULL) {
printk(BIOS_ERR, "%s: not enough space for stacks\n", __func__);
printk(BIOS_ERR, "%s: ....need -> %p : available -> %zx\n", __func__,
- base, size);
+ base, total_stack_size);
return -1;
}
params->stack_top = stacks_top;
--
To view, visit https://review.coreboot.org/c/coreboot/+/47070
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Iceb10aa40ad473b41b7da0310554725585e3c2c2
Gerrit-Change-Number: 47070
Gerrit-PatchSet: 1
Gerrit-Owner: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-MessageType: newchange
Arthur Heymans has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/47069 )
Change subject: cpu/x86/smm: Check that the stub size is < save state size
......................................................................
cpu/x86/smm: Check that the stub size is < save state size
If the stub size would be larger than the save state size.
The check is placed in the stub placement code. The stub placement
code is called twice. Once for the initial SMM relocatation and for
the permanent handler in TSEG. So the check is done twice, which is
not really needed.
Change-Id: I253e1a7112cd8f7496cb1a826311f4dd5ccfc73a
Signed-off-by: Arthur Heymans <arthur(a)aheymans.xyz>
---
M src/cpu/x86/smm/smm_module_loader.c
M src/cpu/x86/smm/smm_module_loaderv2.c
2 files changed, 12 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/69/47069/1
diff --git a/src/cpu/x86/smm/smm_module_loader.c b/src/cpu/x86/smm/smm_module_loader.c
index fc1e1b3..876fde6 100644
--- a/src/cpu/x86/smm/smm_module_loader.c
+++ b/src/cpu/x86/smm/smm_module_loader.c
@@ -209,6 +209,12 @@
smm_stub_size = rmodule_memory_size(&smm_stub);
stub_entry_offset = rmodule_entry_offset(&smm_stub);
+ if (smm_stub_size > params->per_cpu_save_state_size) {
+ printk(BIOS_ERR, "SMM Module: SMM stub size larger than save state size\n");
+ printk(BIOS_ERR, "SMM Module: Staggered entry points will overlap stub\n");
+ return -1;
+ }
+
/* Assume the stub is always small enough to live within upper half of
* SMRAM region after the save state space has been allocated. */
smm_stub_loc = &base[SMM_ENTRY_OFFSET];
diff --git a/src/cpu/x86/smm/smm_module_loaderv2.c b/src/cpu/x86/smm/smm_module_loaderv2.c
index 22f336e..3fa5871 100644
--- a/src/cpu/x86/smm/smm_module_loaderv2.c
+++ b/src/cpu/x86/smm/smm_module_loaderv2.c
@@ -134,6 +134,12 @@
return 0;
}
+ if (stub_size > ss_size) {
+ printk(BIOS_ERR, "%s: Save state larger than SMM stub size\n", __func__);
+ printk(BIOS_ERR, " Decrease stub size or increase the size allocated for the save state\n");
+ return 0;
+ }
+
for (i = 0; i < num_cpus; i++) {
cpus[i].smbase = base;
cpus[i].entry = base + smm_entry_offset;
--
To view, visit https://review.coreboot.org/c/coreboot/+/47069
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I253e1a7112cd8f7496cb1a826311f4dd5ccfc73a
Gerrit-Change-Number: 47069
Gerrit-PatchSet: 1
Gerrit-Owner: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-MessageType: newchange
Angel Pons has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/47488 )
Change subject: nb/intel/sandybridge: Fix typo in comment
......................................................................
nb/intel/sandybridge: Fix typo in comment
Change-Id: I8271911695f41ef7cac1bb228309af0568e5bb0c
Signed-off-by: Angel Pons <th3fanbus(a)gmail.com>
---
M src/northbridge/intel/sandybridge/raminit_common.c
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/88/47488/1
diff --git a/src/northbridge/intel/sandybridge/raminit_common.c b/src/northbridge/intel/sandybridge/raminit_common.c
index e23753a..57c28fc 100644
--- a/src/northbridge/intel/sandybridge/raminit_common.c
+++ b/src/northbridge/intel/sandybridge/raminit_common.c
@@ -4238,7 +4238,7 @@
* The following loops writes to every DRAM address, setting the ECC bits to the
* correct value. A read from this location will no longer return a CRC error,
* except when a bit has toggled due to external events.
- * The same could be accieved by writing to the physical memory map, but it's
+ * The same could be achieved by writing to the physical memory map, but it's
* much more difficult due to SMM remapping, ME stolen memory, GFX stolen memory,
* and firmware running in x86_32.
*/
--
To view, visit https://review.coreboot.org/c/coreboot/+/47488
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I8271911695f41ef7cac1bb228309af0568e5bb0c
Gerrit-Change-Number: 47488
Gerrit-PatchSet: 1
Gerrit-Owner: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-MessageType: newchange
Angel Pons has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/47485 )
Change subject: nb/intel/sandybridge: Reduce the scope of get_CWL()
......................................................................
nb/intel/sandybridge: Reduce the scope of get_CWL()
It is only used once, and can thus be moved to the same file.
Change-Id: I4ee0621449da7fa1970a475d5a2f6e66546357ea
Signed-off-by: Angel Pons <th3fanbus(a)gmail.com>
---
M src/northbridge/intel/sandybridge/raminit_common.c
M src/northbridge/intel/sandybridge/raminit_common.h
M src/northbridge/intel/sandybridge/raminit_native.c
3 files changed, 35 insertions(+), 36 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/85/47485/1
diff --git a/src/northbridge/intel/sandybridge/raminit_common.c b/src/northbridge/intel/sandybridge/raminit_common.c
index 3ab8df2..60a218b 100644
--- a/src/northbridge/intel/sandybridge/raminit_common.c
+++ b/src/northbridge/intel/sandybridge/raminit_common.c
@@ -80,41 +80,6 @@
return reg;
}
-/* CAS write latency. To be programmed in MR2. See DDR3 SPEC for MR2 documentation. */
-u8 get_CWL(u32 tCK)
-{
- /* Get CWL based on tCK using the following rule */
- switch (tCK) {
- case TCK_1333MHZ:
- return 12;
-
- case TCK_1200MHZ:
- case TCK_1100MHZ:
- return 11;
-
- case TCK_1066MHZ:
- case TCK_1000MHZ:
- return 10;
-
- case TCK_933MHZ:
- case TCK_900MHZ:
- return 9;
-
- case TCK_800MHZ:
- case TCK_700MHZ:
- return 8;
-
- case TCK_666MHZ:
- return 7;
-
- case TCK_533MHZ:
- return 6;
-
- default:
- return 5;
- }
-}
-
void dram_find_common_params(ramctr_timing *ctrl)
{
size_t valid_dimms;
diff --git a/src/northbridge/intel/sandybridge/raminit_common.h b/src/northbridge/intel/sandybridge/raminit_common.h
index 32f2b44..5b08ce5 100644
--- a/src/northbridge/intel/sandybridge/raminit_common.h
+++ b/src/northbridge/intel/sandybridge/raminit_common.h
@@ -227,7 +227,6 @@
#define MAKE_ERR ((channel << 16) | (slotrank << 8) | 1)
#define GET_ERR_CHANNEL(x) (x >> 16)
-u8 get_CWL(u32 tCK);
void dram_mrscommands(ramctr_timing *ctrl);
void program_timings(ramctr_timing *ctrl, int channel);
void dram_find_common_params(ramctr_timing *ctrl);
diff --git a/src/northbridge/intel/sandybridge/raminit_native.c b/src/northbridge/intel/sandybridge/raminit_native.c
index 326197b..844e69a 100644
--- a/src/northbridge/intel/sandybridge/raminit_native.c
+++ b/src/northbridge/intel/sandybridge/raminit_native.c
@@ -42,6 +42,41 @@
die("Unsupported CPU or base frequency.");
}
+/* CAS write latency. To be programmed in MR2. See DDR3 SPEC for MR2 documentation. */
+static u8 get_CWL(u32 tCK)
+{
+ /* Get CWL based on tCK using the following rule */
+ switch (tCK) {
+ case TCK_1333MHZ:
+ return 12;
+
+ case TCK_1200MHZ:
+ case TCK_1100MHZ:
+ return 11;
+
+ case TCK_1066MHZ:
+ case TCK_1000MHZ:
+ return 10;
+
+ case TCK_933MHZ:
+ case TCK_900MHZ:
+ return 9;
+
+ case TCK_800MHZ:
+ case TCK_700MHZ:
+ return 8;
+
+ case TCK_666MHZ:
+ return 7;
+
+ case TCK_533MHZ:
+ return 6;
+
+ default:
+ return 5;
+ }
+}
+
/* Get REFI based on frequency index, tREFI = 7.8usec */
static u32 get_REFI(u32 FRQ, u8 base_freq)
{
--
To view, visit https://review.coreboot.org/c/coreboot/+/47485
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I4ee0621449da7fa1970a475d5a2f6e66546357ea
Gerrit-Change-Number: 47485
Gerrit-PatchSet: 1
Gerrit-Owner: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-MessageType: newchange