David Gebski has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/41490 )
Change subject: Doc/mb/lenovo/t420s.md: Add documentation for Lenovo T420s
......................................................................
Doc/mb/lenovo/t420s.md: Add documentation for Lenovo T420s
Borrowed text mostly from documentation for Lenovo T420.
Added two images showing the pinout.
Signed-off-by: Zalckos <mail(a)davidgebski.nl>
Change-Id: Ia2c6701bc8269e73e4af5a9414b7ded77a4d3571
---
A Documentation/mainboard/lenovo/t420s.md
A Documentation/mainboard/lenovo/t420s_board.jpg
A Documentation/mainboard/lenovo/t420s_rpi.jpg
3 files changed, 22 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/90/41490/1
diff --git a/Documentation/mainboard/lenovo/t420s.md b/Documentation/mainboard/lenovo/t420s.md
new file mode 100644
index 0000000..82be80c
--- /dev/null
+++ b/Documentation/mainboard/lenovo/t420s.md
@@ -0,0 +1,22 @@
+# Lenovo T420s
+
+## Flashing instructions
+The flash IC is located at the bottom center of the mainboard. Sadly, access
+to the IC is blocked by the magnesium frame, so you need to disassemble the
+entire laptop and remove the mainboard.
+
+Below is a picture of IC on the mainboard with clip attached, and a picture of
+the Raspberry Pi with cables attached. In this case it's a Winbond flash chip
+"W25Q64.V".
+
+![t420s_board](t420s_board.jpg)
+![t420s_rpi](t420s_rpi.jpg)
+
+For more details have a look at [T420 / T520 / X220 / T420s / W520 common] and
+the general [flashing tutorial].
+
+Steps to access the flash IC are described here [T4xx series].
+
+[T4xx series]: t4xx_series.md
+[flashing tutorial]: ../../flash_tutorial/ext_power.md
+[T420 / T520 / X220 / T420s / W520 common]: Sandy_Bridge_series.md
diff --git a/Documentation/mainboard/lenovo/t420s_board.jpg b/Documentation/mainboard/lenovo/t420s_board.jpg
new file mode 100644
index 0000000..3ec4201
--- /dev/null
+++ b/Documentation/mainboard/lenovo/t420s_board.jpg
Binary files differ
diff --git a/Documentation/mainboard/lenovo/t420s_rpi.jpg b/Documentation/mainboard/lenovo/t420s_rpi.jpg
new file mode 100644
index 0000000..6fe204c
--- /dev/null
+++ b/Documentation/mainboard/lenovo/t420s_rpi.jpg
Binary files differ
--
To view, visit https://review.coreboot.org/c/coreboot/+/41490
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ia2c6701bc8269e73e4af5a9414b7ded77a4d3571
Gerrit-Change-Number: 41490
Gerrit-PatchSet: 1
Gerrit-Owner: David Gebski
Gerrit-MessageType: newchange
Hello Kyösti Mälkki, Aaron Durbin, Arthur Heymans, cedarhouse1(a)comcast.net,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/coreboot/+/38768
to review the following change.
Change subject: [UNTESTED] intel/stm: Introduce stm_update_smm_info()
......................................................................
[UNTESTED] intel/stm: Introduce stm_update_smm_info()
Add a helper that will be called from `mp_init.c`. This allows to keep
SMRAM allocations local to STM code.
Call it after validation of the original numbers.
Change-Id: I2c29a4adfc78f21126122caefffa27a4d6d8c5df
Signed-off-by: Nico Huber <nico.h(a)gmx.de>
---
M src/cpu/x86/mp_init.c
M src/security/intel/stm/SmmStm.h
M src/security/intel/stm/StmPlatformSmm.c
3 files changed, 26 insertions(+), 21 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/68/38768/1
diff --git a/src/cpu/x86/mp_init.c b/src/cpu/x86/mp_init.c
index 9bc4aab..5b34d4b 100644
--- a/src/cpu/x86/mp_init.c
+++ b/src/cpu/x86/mp_init.c
@@ -1042,26 +1042,6 @@
&state->smm_save_state_size);
/*
- * Make sure there is enough room for the SMM descriptor
- */
- if (CONFIG(STM)) {
- state->smm_save_state_size +=
- sizeof(TXT_PROCESSOR_SMM_DESCRIPTOR);
-
- /* Currently, the CPU SMM save state size is based on a simplistic
- * algorithm. (align on 4K)
- * note: In the future, this will need to handle newer x86 processors
- * that require alignment of the save state on 32K boundaries.
- * The alignment is done here because coreboot has a hard coded
- * value of 0x400 for this value.
- * Also, this alignment only works on CPUs less than 5 threads
- */
- if (CONFIG(STM))
- state->smm_save_state_size =
- ALIGN_UP(state->smm_save_state_size, 0x1000);
- }
-
- /*
* Default to smm_initiate_relocation() if trigger callback isn't
* provided.
*/
@@ -1093,8 +1073,11 @@
mp_state.ops.relocation_handler != NULL)
smm_enable();
- if (is_smm_enabled())
+ if (is_smm_enabled()) {
printk(BIOS_INFO, "Will perform SMM setup.\n");
+ stm_update_smm_info(&mp_state.perm_smbase, &mp_state.perm_smsize,
+ &mp_state.smm_save_state_size);
+ }
mp_params.num_cpus = mp_state.cpu_count;
/* Gather microcode information. */
diff --git a/src/security/intel/stm/SmmStm.h b/src/security/intel/stm/SmmStm.h
index 1690255..f6ab0bf 100644
--- a/src/security/intel/stm/SmmStm.h
+++ b/src/security/intel/stm/SmmStm.h
@@ -27,6 +27,13 @@
*/
int load_stm_image(uintptr_t mseg);
+#if CONFIG(STM)
+void stm_update_smm_info(
+ uintptr_t *perm_smbase, size_t *perm_smsize, size_t *smm_save_state_size);
+#else
+static inline void stm_update_smm_info(uintptr_t *, size_t *, size_t *) {}
+#endif
+
void stm_setup(
uintptr_t mseg, int cpu, uintptr_t smbase,
uintptr_t smbase_base, uint32_t offset32);
diff --git a/src/security/intel/stm/StmPlatformSmm.c b/src/security/intel/stm/StmPlatformSmm.c
index 5be6ee7..c389afa 100644
--- a/src/security/intel/stm/StmPlatformSmm.c
+++ b/src/security/intel/stm/StmPlatformSmm.c
@@ -154,6 +154,21 @@
static int stm_load_status = 0;
+void stm_update_smm_info(
+ uintptr_t *const perm_smbase, size_t *const perm_smsize,
+ size_t *const smm_save_state_size)
+{
+ *smm_save_state_size += sizeof(TXT_PROCESSOR_SMM_DESCRIPTOR);
+
+ /*
+ * Currently, the CPU SMM save state size is based on a simplistic
+ * algorithm. (align on 4K)
+ * note: In the future, this will need to handle newer x86 processors
+ * that require alignment of the save state on 32K boundaries.
+ */
+ *smm_save_state_size = ALIGN_UP(*smm_save_state_size, 0x1000);
+}
+
void stm_setup(uintptr_t mseg, int cpu, uintptr_t smbase,
uintptr_t base_smbase, uint32_t offset32)
{
--
To view, visit https://review.coreboot.org/c/coreboot/+/38768
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I2c29a4adfc78f21126122caefffa27a4d6d8c5df
Gerrit-Change-Number: 38768
Gerrit-PatchSet: 1
Gerrit-Owner: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: Aaron Durbin <adurbin(a)chromium.org>
Gerrit-Reviewer: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-Reviewer: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Gerrit-Reviewer: cedarhouse1(a)comcast.net
Gerrit-MessageType: newchange
Hello Marco Chen,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/coreboot/+/33661
to review the following change.
Change subject: vendorcode/google: load sar config from CBFS first then VPD
......................................................................
vendorcode/google: load sar config from CBFS first then VPD
SAR config provisioned in RO VPD can be done in the factory only. Once
it is wrong, we can override the SAR config by updating FW RW which can
carry new SAR config in CBFS. As a result, we should check CBFS first
then VPD.
Change-Id: I5aa6235fb7a6d0b2ed52893a42f7bd57806af6c1
Signed-off-by: Marco Chen <marcochen(a)chromium.org>
---
M src/vendorcode/google/chromeos/sar.c
1 file changed, 23 insertions(+), 22 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/61/33661/1
diff --git a/src/vendorcode/google/chromeos/sar.c b/src/vendorcode/google/chromeos/sar.c
index bbcb211..a5a2c3b 100644
--- a/src/vendorcode/google/chromeos/sar.c
+++ b/src/vendorcode/google/chromeos/sar.c
@@ -82,36 +82,37 @@
sizeof(struct wifi_sar_delta_table);
}
- /* Try to read the SAR limit entry from VPD */
- if (!vpd_gets(wifi_sar_limit_key, wifi_sar_limit_str,
- buffer_size, VPD_ANY)) {
- printk(BIOS_ERR, "Error: Could not locate '%s' in VPD.\n",
- wifi_sar_limit_key);
-
- if (!CONFIG(WIFI_SAR_CBFS))
- return -1;
-
+ if (CONFIG(WIFI_SAR_CBFS)) {
printk(BIOS_DEBUG, "Checking CBFS for default SAR values\n");
sar_cbfs_len = load_sar_file_from_cbfs(
(void *) wifi_sar_limit_str,
sar_expected_len);
- if (sar_cbfs_len != sar_expected_len) {
- printk(BIOS_ERR, "%s has bad len in CBFS\n",
- WIFI_SAR_CBFS_FILENAME);
- return -1;
- }
- } else {
- /* VPD key "wifi_sar" found. strlen is checked with addition of
- * 1 as we have created buffer size 1 char larger for the reason
- * mentioned at start of this function itself */
- if (strlen(wifi_sar_limit_str) + 1 != sar_expected_len) {
- printk(BIOS_ERR, "WIFI SAR key has bad len in VPD\n");
- return -1;
- }
+ if (sar_cbfs_len == sar_expected_len)
+ goto done;
+
+ printk(BIOS_ERR, "%s has bad len in CBFS\n",
+ WIFI_SAR_CBFS_FILENAME);
}
+ /* Try to read the SAR limit entry from VPD */
+ if (!vpd_gets(wifi_sar_limit_key, wifi_sar_limit_str,
+ buffer_size, VPD_ANY)) {
+ printk(BIOS_ERR, "Error: Could not locate '%s' in VPD.\n",
+ wifi_sar_limit_key);
+ return -1;
+ }
+
+ /* VPD key "wifi_sar" found. strlen is checked with addition of
+ * 1 as we have created buffer size 1 char larger for the reason
+ * mentioned at start of this function itself */
+ if (strlen(wifi_sar_limit_str) + 1 != sar_expected_len) {
+ printk(BIOS_ERR, "WIFI SAR key has bad len in VPD\n");
+ return -1;
+ }
+
+done:
/* Decode the heximal encoded string to binary values */
if (hexstrtobin(wifi_sar_limit_str, bin_buffer, bin_buff_adjusted_size)
< bin_buff_adjusted_size) {
--
To view, visit https://review.coreboot.org/c/coreboot/+/33661
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I5aa6235fb7a6d0b2ed52893a42f7bd57806af6c1
Gerrit-Change-Number: 33661
Gerrit-PatchSet: 1
Gerrit-Owner: Marco Chen <marcochen(a)google.com>
Gerrit-Reviewer: Marco Chen <marcochen(a)chromium.org>
Gerrit-MessageType: newchange