David Gebski has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/41484 )
Change subject: Documentation/mainboard/lenovo/t420s.md: Add documentation for Lenovo T420s
......................................................................
Documentation/mainboard/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: I9fae5cfd596da144f2161ad35323cb2a6de645a9
---
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/84/41484/1
diff --git a/Documentation/mainboard/lenovo/t420s.md b/Documentation/mainboard/lenovo/t420s.md
new file mode 100644
index 0000000..ce848c5
--- /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 magnesum 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..b99ce6e
--- /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..e7b7626
--- /dev/null
+++ b/Documentation/mainboard/lenovo/t420s_rpi.jpg
Binary files differ
--
To view, visit https://review.coreboot.org/c/coreboot/+/41484
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I9fae5cfd596da144f2161ad35323cb2a6de645a9
Gerrit-Change-Number: 41484
Gerrit-PatchSet: 1
Gerrit-Owner: David Gebski
Gerrit-MessageType: newchange
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