Patrick Rudolph has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/32585
Change subject: mb/lenovo/t520: Add support for VBOOT ......................................................................
mb/lenovo/t520: Add support for VBOOT
Enable VBOOT support using a single RW_MAIN_A partition, allowing the use of tianocore payload in both RW_MAIN_A and WP_RO.
Tested on Lenovo T520.
Change-Id: Icb7b263ed86551cc53e1db7babccaca6b3ae2fe6 Signed-off-by: Patrick Rudolph patrick.rudolph@9elements.com --- M src/mainboard/lenovo/t520/Kconfig A src/mainboard/lenovo/t520/board.fmd M src/mainboard/lenovo/t520/cmos.layout A src/mainboard/lenovo/t520/vboot-rwa.fmd 4 files changed, 69 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/85/32585/1
diff --git a/src/mainboard/lenovo/t520/Kconfig b/src/mainboard/lenovo/t520/Kconfig index 06f296b..567ebc0 100644 --- a/src/mainboard/lenovo/t520/Kconfig +++ b/src/mainboard/lenovo/t520/Kconfig @@ -27,6 +27,22 @@
if BOARD_LENOVO_BASEBOARD_T520
+config VBOOT + select VBOOT_VBNV_CMOS + select VBOOT_NO_BOARD_SUPPORT + select GBB_FLAG_DISABLE_LID_SHUTDOWN + select GBB_FLAG_DISABLE_PD_SOFTWARE_SYNC + select GBB_FLAG_DISABLE_EC_SOFTWARE_SYNC + select GBB_FLAG_DISABLE_FWMP + select HAS_RECOVERY_MRC_CACHE + +config VBOOT_SLOTS_RW_A + default y + +config VBOOT_VBNV_OFFSET + hex + default 0x2a + config VARIANT_DIR string default "t520" if BOARD_LENOVO_T520 @@ -40,6 +56,11 @@ string default "variants/$(CONFIG_VARIANT_DIR)/devicetree.cb"
+config FMDFILE + string + default "src/mainboard/$(CONFIG_MAINBOARD_DIR)/vboot-rwa.fmd" if VBOOT + default "src/mainboard/$(CONFIG_MAINBOARD_DIR)/board.fmd" + config MAINBOARD_PART_NUMBER string default "ThinkPad T520" if BOARD_LENOVO_T520 diff --git a/src/mainboard/lenovo/t520/board.fmd b/src/mainboard/lenovo/t520/board.fmd new file mode 100644 index 0000000..04cf827 --- /dev/null +++ b/src/mainboard/lenovo/t520/board.fmd @@ -0,0 +1,16 @@ +FLASH@0xff800000 0x800000 { + SI_ALL@0x0 0x500000 { + SI_DESC@0x0 0x1000 + SI_GBE@0x1000 0x2000 + SI_ME@0x3000 0x4ed000 + } + SI_BIOS@0x500000 0x300000 { + RW_MRC_CACHE@0 0x10000 + SMMSTORE(PRESERVE)@0x10000 0x40000 + + WP_RO@0x50000 0x2a0000 { + FMAP@0x0 0x800 + COREBOOT(CBFS)@0x1000 0x29f000 + } + } +} diff --git a/src/mainboard/lenovo/t520/cmos.layout b/src/mainboard/lenovo/t520/cmos.layout index 1a7943e..ec6ce85 100644 --- a/src/mainboard/lenovo/t520/cmos.layout +++ b/src/mainboard/lenovo/t520/cmos.layout @@ -81,6 +81,9 @@ #437 3 r 0 unused 440 8 h 0 volume
+# VBOOT +448 128 r 0 vbnv + # SandyBridge MRC Scrambler Seed values 896 32 r 0 mrc_scrambler_seed 928 32 r 0 mrc_scrambler_seed_s3 diff --git a/src/mainboard/lenovo/t520/vboot-rwa.fmd b/src/mainboard/lenovo/t520/vboot-rwa.fmd new file mode 100644 index 0000000..8a4cd3b --- /dev/null +++ b/src/mainboard/lenovo/t520/vboot-rwa.fmd @@ -0,0 +1,29 @@ +FLASH@0xff800000 0x800000 { + SI_ALL@0x0 0x500000 { + SI_DESC@0x0 0x1000 + SI_GBE@0x1000 0x2000 + SI_ME@0x3000 0x4ed000 + } + SI_BIOS@0x500000 0x300000 { + RW_SECTION_A@0x00000 0x180000 { + VBLOCK_A@0x0 0x10000 + FW_MAIN_A(CBFS)@0x10000 0x16ffc0 + RW_FWID_A@0x17ffc0 0x40 + } + UNIFIED_MRC_CACHE@0x180000 0x20000 { + RECOVERY_MRC_CACHE@0x0 0x10000 + RW_MRC_CACHE@0x10000 0x10000 + } + RW_VPD(PRESERVE)@0x1a0000 0x1000 + SMMSTORE(PRESERVE)@0x1a1000 0x40000 + + WP_RO@0x1e1000 0x11f000 { + FMAP@0x0 0x800 + RO_FRID@0x800 0x40 + RO_PADDING@0x840 0x7c0 + RO_VPD(PRESERVE)@0x1000 0x1000 + GBB@0x2000 0x1e000 + COREBOOT(CBFS)@0x20000 0xff000 + } + } +}
Hello Alexander Couzens, Patrick Rudolph, Arthur Heymans, Philipp Deppenwiese, build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/32585
to look at the new patch set (#2).
Change subject: mb/lenovo/t520: Add support for VBOOT ......................................................................
mb/lenovo/t520: Add support for VBOOT
Enable VBOOT support using a single RW_MAIN_A partition, allowing the use of tianocore payload in both RW_MAIN_A and WP_RO.
Tested on Lenovo T520 using Icb7b263ed86551cc53e1db7babccaca6b3ae2fe6.
Change-Id: Icb7b263ed86551cc53e1db7babccaca6b3ae2fe6 Signed-off-by: Patrick Rudolph patrick.rudolph@9elements.com --- M src/mainboard/lenovo/t520/Kconfig A src/mainboard/lenovo/t520/board.fmd M src/mainboard/lenovo/t520/cmos.layout A src/mainboard/lenovo/t520/vboot-rwa.fmd 4 files changed, 68 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/85/32585/2
Hello Alexander Couzens, Patrick Rudolph, Arthur Heymans, Philipp Deppenwiese, build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/32585
to look at the new patch set (#3).
Change subject: mb/lenovo/t520: Add support for VBOOT ......................................................................
mb/lenovo/t520: Add support for VBOOT
Enable VBOOT support using a single RW_MAIN_A partition, allowing the use of tianocore payload in both RW_MAIN_A and WP_RO.
Tested on Lenovo T520 using Icb7b263ed86551cc53e1db7babccaca6b3ae2fe6.
Change-Id: Icb7b263ed86551cc53e1db7babccaca6b3ae2fe6 Signed-off-by: Patrick Rudolph patrick.rudolph@9elements.com --- M src/mainboard/lenovo/t520/Kconfig A src/mainboard/lenovo/t520/board.fmd M src/mainboard/lenovo/t520/cmos.layout A src/mainboard/lenovo/t520/vboot-rwa.fmd 4 files changed, 69 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/85/32585/3
Hello Alexander Couzens, Patrick Rudolph, Arthur Heymans, Philipp Deppenwiese, build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/32585
to look at the new patch set (#4).
Change subject: mb/lenovo/*: Add support for VBOOT on 8MiB devices ......................................................................
mb/lenovo/*: Add support for VBOOT on 8MiB devices
Enable VBOOT support on all devices that have a 8 MiB flash, using a single RW_MAIN_A partition, allowing the use of tianocore payload in both RW_MAIN_A and WP_RO.
Also build test VBOOT on Lenovo T420.
Tested on Lenovo T520 using Icb7b263ed86551cc53e1db7babccaca6b3ae2fe6.
Change-Id: Icb7b263ed86551cc53e1db7babccaca6b3ae2fe6 Signed-off-by: Patrick Rudolph patrick.rudolph@9elements.com --- M configs/config.lenovo_t420_static_option_table_no_mem_fuses M src/mainboard/lenovo/t420/Kconfig A src/mainboard/lenovo/t420/board.fmd M src/mainboard/lenovo/t420/cmos.layout A src/mainboard/lenovo/t420/vboot-rwa.fmd M src/mainboard/lenovo/t420s/Kconfig A src/mainboard/lenovo/t420s/board.fmd M src/mainboard/lenovo/t420s/cmos.layout A src/mainboard/lenovo/t420s/vboot-rwa.fmd M src/mainboard/lenovo/t520/Kconfig A src/mainboard/lenovo/t520/board.fmd M src/mainboard/lenovo/t520/cmos.layout A src/mainboard/lenovo/t520/vboot-rwa.fmd M src/mainboard/lenovo/x220/Kconfig A src/mainboard/lenovo/x220/board.fmd M src/mainboard/lenovo/x220/cmos.layout A src/mainboard/lenovo/x220/vboot-rwa.fmd 17 files changed, 277 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/85/32585/4
Philipp Deppenwiese has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32585 )
Change subject: mb/lenovo/*: Add support for VBOOT on 8MiB devices ......................................................................
Patch Set 4:
(1 comment)
https://review.coreboot.org/#/c/32585/4/src/mainboard/lenovo/t420/Kconfig File src/mainboard/lenovo/t420/Kconfig:
https://review.coreboot.org/#/c/32585/4/src/mainboard/lenovo/t420/Kconfig@31 PS4, Line 31: config VBOOT Can we move some of the flags into https://review.coreboot.org/c/coreboot/+/29815 ? Like VBOOT_VBNV_CMOS and HAS_RECOVERY_MRC_CACHE
Patrick Rudolph has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32585 )
Change subject: mb/lenovo/*: Add support for VBOOT on 8MiB devices ......................................................................
Patch Set 4:
(1 comment)
https://review.coreboot.org/#/c/32585/4/src/mainboard/lenovo/t420/Kconfig File src/mainboard/lenovo/t420/Kconfig:
https://review.coreboot.org/#/c/32585/4/src/mainboard/lenovo/t420/Kconfig@31 PS4, Line 31: config VBOOT
Can we move some of the flags into https://review.coreboot. […]
no as: VBOOT_VBNV_CMOS is board specific. The range should be reserved in cmos.layout.
HAS_RECOVERY_MRC_CACHE is board specific. It requires the corresponding entry in the FMAP.
Hello Alexander Couzens, Patrick Rudolph, Arthur Heymans, Philipp Deppenwiese, build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/32585
to look at the new patch set (#5).
Change subject: mb/lenovo/*: Add support for VBOOT on 8MiB devices ......................................................................
mb/lenovo/*: Add support for VBOOT on 8MiB devices
Enable VBOOT support on all devices that have a 8 MiB flash, using a single RW_MAIN_A partition, allowing the use of tianocore payload in both RW_MAIN_A and WP_RO.
* Add VBNV section to cmos.layout * Add FMAP for VBOOT and regular boot * Select Kconfigs for VBOOT * Enable VBOOT_SLOTS_RW_A by default
Also build test VBOOT on Lenovo T420.
Tested on Lenovo T520 using Icb7b263ed86551cc53e1db7babccaca6b3ae2fe6.
Change-Id: Icb7b263ed86551cc53e1db7babccaca6b3ae2fe6 Signed-off-by: Patrick Rudolph patrick.rudolph@9elements.com --- M configs/config.lenovo_t420_static_option_table_no_mem_fuses M src/mainboard/lenovo/t420/Kconfig A src/mainboard/lenovo/t420/board.fmd M src/mainboard/lenovo/t420/cmos.layout A src/mainboard/lenovo/t420/vboot-rwa.fmd M src/mainboard/lenovo/t420s/Kconfig A src/mainboard/lenovo/t420s/board.fmd M src/mainboard/lenovo/t420s/cmos.layout A src/mainboard/lenovo/t420s/vboot-rwa.fmd M src/mainboard/lenovo/t520/Kconfig A src/mainboard/lenovo/t520/board.fmd M src/mainboard/lenovo/t520/cmos.layout A src/mainboard/lenovo/t520/vboot-rwa.fmd M src/mainboard/lenovo/x220/Kconfig A src/mainboard/lenovo/x220/board.fmd M src/mainboard/lenovo/x220/cmos.layout A src/mainboard/lenovo/x220/vboot-rwa.fmd 17 files changed, 273 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/85/32585/5
Philipp Deppenwiese has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32585 )
Change subject: mb/lenovo/*: Add support for VBOOT on 8MiB devices ......................................................................
Patch Set 5: Code-Review+2
(1 comment)
https://review.coreboot.org/#/c/32585/4/src/mainboard/lenovo/t420/Kconfig File src/mainboard/lenovo/t420/Kconfig:
https://review.coreboot.org/#/c/32585/4/src/mainboard/lenovo/t420/Kconfig@31 PS4, Line 31: config VBOOT
no as: […]
At the moment. FMAP options are always feature and not mainboard specific. Fine for me
Arthur Heymans has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32585 )
Change subject: mb/lenovo/*: Add support for VBOOT on 8MiB devices ......................................................................
Patch Set 5:
(1 comment)
https://review.coreboot.org/#/c/32585/5/src/mainboard/lenovo/t420/board.fmd File src/mainboard/lenovo/t420/board.fmd:
https://review.coreboot.org/#/c/32585/5/src/mainboard/lenovo/t420/board.fmd@... PS5, Line 11: WP_RO@0x50000 0x2a0000 { Just wondering: are the southbridge FPR registers used to lock it down (in ramstage) ?
Patrick Rudolph has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32585 )
Change subject: mb/lenovo/*: Add support for VBOOT on 8MiB devices ......................................................................
Patch Set 5:
(1 comment)
https://review.coreboot.org/#/c/32585/5/src/mainboard/lenovo/t420/board.fmd File src/mainboard/lenovo/t420/board.fmd:
https://review.coreboot.org/#/c/32585/5/src/mainboard/lenovo/t420/board.fmd@... PS5, Line 11: WP_RO@0x50000 0x2a0000 {
Just wondering: are the southbridge FPR registers used to lock it down (in ramstage) ?
not yet. There was an attempt here: https://review.coreboot.org/c/coreboot/+/25196 I'll look into that once some of the patches up for review are merged.
Patrick Georgi has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32585 )
Change subject: mb/lenovo/*: Add support for VBOOT on 8MiB devices ......................................................................
Patch Set 5: Code-Review+2
I guess we will need to revisit fmap generation (in a future patch) now that there are schemes that are neither ChromeOS nor the generic default. The duplication here is a bit ugly and incomplete: when using a smaller payload you may well be able to run an A/B scheme.
Patrick Georgi has submitted this change and it was merged. ( https://review.coreboot.org/c/coreboot/+/32585 )
Change subject: mb/lenovo/*: Add support for VBOOT on 8MiB devices ......................................................................
mb/lenovo/*: Add support for VBOOT on 8MiB devices
Enable VBOOT support on all devices that have a 8 MiB flash, using a single RW_MAIN_A partition, allowing the use of tianocore payload in both RW_MAIN_A and WP_RO.
* Add VBNV section to cmos.layout * Add FMAP for VBOOT and regular boot * Select Kconfigs for VBOOT * Enable VBOOT_SLOTS_RW_A by default
Also build test VBOOT on Lenovo T420.
Tested on Lenovo T520 using Icb7b263ed86551cc53e1db7babccaca6b3ae2fe6.
Change-Id: Icb7b263ed86551cc53e1db7babccaca6b3ae2fe6 Signed-off-by: Patrick Rudolph patrick.rudolph@9elements.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/32585 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Philipp Deppenwiese zaolin.daisuki@gmail.com Reviewed-by: Patrick Georgi pgeorgi@google.com --- M configs/config.lenovo_t420_static_option_table_no_mem_fuses M src/mainboard/lenovo/t420/Kconfig A src/mainboard/lenovo/t420/board.fmd M src/mainboard/lenovo/t420/cmos.layout A src/mainboard/lenovo/t420/vboot-rwa.fmd M src/mainboard/lenovo/t420s/Kconfig A src/mainboard/lenovo/t420s/board.fmd M src/mainboard/lenovo/t420s/cmos.layout A src/mainboard/lenovo/t420s/vboot-rwa.fmd M src/mainboard/lenovo/t520/Kconfig A src/mainboard/lenovo/t520/board.fmd M src/mainboard/lenovo/t520/cmos.layout A src/mainboard/lenovo/t520/vboot-rwa.fmd M src/mainboard/lenovo/x220/Kconfig A src/mainboard/lenovo/x220/board.fmd M src/mainboard/lenovo/x220/cmos.layout A src/mainboard/lenovo/x220/vboot-rwa.fmd 17 files changed, 273 insertions(+), 0 deletions(-)
Approvals: build bot (Jenkins): Verified Patrick Georgi: Looks good to me, approved Philipp Deppenwiese: Looks good to me, approved
diff --git a/configs/config.lenovo_t420_static_option_table_no_mem_fuses b/configs/config.lenovo_t420_static_option_table_no_mem_fuses index a268d88..0a3513c 100644 --- a/configs/config.lenovo_t420_static_option_table_no_mem_fuses +++ b/configs/config.lenovo_t420_static_option_table_no_mem_fuses @@ -4,4 +4,6 @@ CONFIG_BOARD_LENOVO_T420=y CONFIG_NATIVE_RAMINIT_IGNORE_MAX_MEM_FUSES=y CONFIG_NATIVE_RAMINIT_IGNORE_XMP_MAX_DIMMS=y +CONFIG_VBOOT=y +CONFIG_H8_FN_KEY_AS_VBOOT_RECOVERY_SW=y # CONFIG_INTEL_CHIPSET_LOCKDOWN is not set diff --git a/src/mainboard/lenovo/t420/Kconfig b/src/mainboard/lenovo/t420/Kconfig index ce81907..3d3b56a 100644 --- a/src/mainboard/lenovo/t420/Kconfig +++ b/src/mainboard/lenovo/t420/Kconfig @@ -28,6 +28,26 @@ # Workaround for EC/KBC IRQ1. select SERIRQ_CONTINUOUS_MODE
+config VBOOT + select VBOOT_VBNV_CMOS + select GBB_FLAG_DISABLE_LID_SHUTDOWN + select GBB_FLAG_DISABLE_PD_SOFTWARE_SYNC + select GBB_FLAG_DISABLE_EC_SOFTWARE_SYNC + select GBB_FLAG_DISABLE_FWMP + select HAS_RECOVERY_MRC_CACHE + +config VBOOT_SLOTS_RW_A + default y + +config VBOOT_VBNV_OFFSET + hex + default 0x2a + +config FMDFILE + string + default "src/mainboard/$(CONFIG_MAINBOARD_DIR)/vboot-rwa.fmd" if VBOOT + default "src/mainboard/$(CONFIG_MAINBOARD_DIR)/board.fmd" + config MAINBOARD_DIR string default lenovo/t420 diff --git a/src/mainboard/lenovo/t420/board.fmd b/src/mainboard/lenovo/t420/board.fmd new file mode 100644 index 0000000..04cf827 --- /dev/null +++ b/src/mainboard/lenovo/t420/board.fmd @@ -0,0 +1,16 @@ +FLASH@0xff800000 0x800000 { + SI_ALL@0x0 0x500000 { + SI_DESC@0x0 0x1000 + SI_GBE@0x1000 0x2000 + SI_ME@0x3000 0x4ed000 + } + SI_BIOS@0x500000 0x300000 { + RW_MRC_CACHE@0 0x10000 + SMMSTORE(PRESERVE)@0x10000 0x40000 + + WP_RO@0x50000 0x2a0000 { + FMAP@0x0 0x800 + COREBOOT(CBFS)@0x1000 0x29f000 + } + } +} diff --git a/src/mainboard/lenovo/t420/cmos.layout b/src/mainboard/lenovo/t420/cmos.layout index f55c203..a9f5f5f 100644 --- a/src/mainboard/lenovo/t420/cmos.layout +++ b/src/mainboard/lenovo/t420/cmos.layout @@ -81,6 +81,9 @@
440 8 h 0 volume
+# VBOOT +448 128 r 0 vbnv + # SandyBridge MRC Scrambler Seed values 896 32 r 0 mrc_scrambler_seed 928 32 r 0 mrc_scrambler_seed_s3 diff --git a/src/mainboard/lenovo/t420/vboot-rwa.fmd b/src/mainboard/lenovo/t420/vboot-rwa.fmd new file mode 100644 index 0000000..8a4cd3b --- /dev/null +++ b/src/mainboard/lenovo/t420/vboot-rwa.fmd @@ -0,0 +1,29 @@ +FLASH@0xff800000 0x800000 { + SI_ALL@0x0 0x500000 { + SI_DESC@0x0 0x1000 + SI_GBE@0x1000 0x2000 + SI_ME@0x3000 0x4ed000 + } + SI_BIOS@0x500000 0x300000 { + RW_SECTION_A@0x00000 0x180000 { + VBLOCK_A@0x0 0x10000 + FW_MAIN_A(CBFS)@0x10000 0x16ffc0 + RW_FWID_A@0x17ffc0 0x40 + } + UNIFIED_MRC_CACHE@0x180000 0x20000 { + RECOVERY_MRC_CACHE@0x0 0x10000 + RW_MRC_CACHE@0x10000 0x10000 + } + RW_VPD(PRESERVE)@0x1a0000 0x1000 + SMMSTORE(PRESERVE)@0x1a1000 0x40000 + + WP_RO@0x1e1000 0x11f000 { + FMAP@0x0 0x800 + RO_FRID@0x800 0x40 + RO_PADDING@0x840 0x7c0 + RO_VPD(PRESERVE)@0x1000 0x1000 + GBB@0x2000 0x1e000 + COREBOOT(CBFS)@0x20000 0xff000 + } + } +} diff --git a/src/mainboard/lenovo/t420s/Kconfig b/src/mainboard/lenovo/t420s/Kconfig index c5efb55..1383d41 100644 --- a/src/mainboard/lenovo/t420s/Kconfig +++ b/src/mainboard/lenovo/t420s/Kconfig @@ -27,6 +27,26 @@ # Workaround for EC/KBC IRQ1. select SERIRQ_CONTINUOUS_MODE
+config VBOOT + select VBOOT_VBNV_CMOS + select GBB_FLAG_DISABLE_LID_SHUTDOWN + select GBB_FLAG_DISABLE_PD_SOFTWARE_SYNC + select GBB_FLAG_DISABLE_EC_SOFTWARE_SYNC + select GBB_FLAG_DISABLE_FWMP + select HAS_RECOVERY_MRC_CACHE + +config VBOOT_SLOTS_RW_A + default y + +config VBOOT_VBNV_OFFSET + hex + default 0x2a + +config FMDFILE + string + default "src/mainboard/$(CONFIG_MAINBOARD_DIR)/vboot-rwa.fmd" if VBOOT + default "src/mainboard/$(CONFIG_MAINBOARD_DIR)/board.fmd" + config MAINBOARD_DIR string default lenovo/t420s diff --git a/src/mainboard/lenovo/t420s/board.fmd b/src/mainboard/lenovo/t420s/board.fmd new file mode 100644 index 0000000..04cf827 --- /dev/null +++ b/src/mainboard/lenovo/t420s/board.fmd @@ -0,0 +1,16 @@ +FLASH@0xff800000 0x800000 { + SI_ALL@0x0 0x500000 { + SI_DESC@0x0 0x1000 + SI_GBE@0x1000 0x2000 + SI_ME@0x3000 0x4ed000 + } + SI_BIOS@0x500000 0x300000 { + RW_MRC_CACHE@0 0x10000 + SMMSTORE(PRESERVE)@0x10000 0x40000 + + WP_RO@0x50000 0x2a0000 { + FMAP@0x0 0x800 + COREBOOT(CBFS)@0x1000 0x29f000 + } + } +} diff --git a/src/mainboard/lenovo/t420s/cmos.layout b/src/mainboard/lenovo/t420s/cmos.layout index 2be55f6..172191a 100644 --- a/src/mainboard/lenovo/t420s/cmos.layout +++ b/src/mainboard/lenovo/t420s/cmos.layout @@ -81,6 +81,9 @@
440 8 h 0 volume
+# VBOOT +448 128 r 0 vbnv + # SandyBridge MRC Scrambler Seed values 896 32 r 0 mrc_scrambler_seed 928 32 r 0 mrc_scrambler_seed_s3 diff --git a/src/mainboard/lenovo/t420s/vboot-rwa.fmd b/src/mainboard/lenovo/t420s/vboot-rwa.fmd new file mode 100644 index 0000000..8a4cd3b --- /dev/null +++ b/src/mainboard/lenovo/t420s/vboot-rwa.fmd @@ -0,0 +1,29 @@ +FLASH@0xff800000 0x800000 { + SI_ALL@0x0 0x500000 { + SI_DESC@0x0 0x1000 + SI_GBE@0x1000 0x2000 + SI_ME@0x3000 0x4ed000 + } + SI_BIOS@0x500000 0x300000 { + RW_SECTION_A@0x00000 0x180000 { + VBLOCK_A@0x0 0x10000 + FW_MAIN_A(CBFS)@0x10000 0x16ffc0 + RW_FWID_A@0x17ffc0 0x40 + } + UNIFIED_MRC_CACHE@0x180000 0x20000 { + RECOVERY_MRC_CACHE@0x0 0x10000 + RW_MRC_CACHE@0x10000 0x10000 + } + RW_VPD(PRESERVE)@0x1a0000 0x1000 + SMMSTORE(PRESERVE)@0x1a1000 0x40000 + + WP_RO@0x1e1000 0x11f000 { + FMAP@0x0 0x800 + RO_FRID@0x800 0x40 + RO_PADDING@0x840 0x7c0 + RO_VPD(PRESERVE)@0x1000 0x1000 + GBB@0x2000 0x1e000 + COREBOOT(CBFS)@0x20000 0xff000 + } + } +} diff --git a/src/mainboard/lenovo/t520/Kconfig b/src/mainboard/lenovo/t520/Kconfig index 06f296b..ba17e80 100644 --- a/src/mainboard/lenovo/t520/Kconfig +++ b/src/mainboard/lenovo/t520/Kconfig @@ -27,6 +27,21 @@
if BOARD_LENOVO_BASEBOARD_T520
+config VBOOT + select VBOOT_VBNV_CMOS + select GBB_FLAG_DISABLE_LID_SHUTDOWN + select GBB_FLAG_DISABLE_PD_SOFTWARE_SYNC + select GBB_FLAG_DISABLE_EC_SOFTWARE_SYNC + select GBB_FLAG_DISABLE_FWMP + select HAS_RECOVERY_MRC_CACHE + +config VBOOT_SLOTS_RW_A + default y + +config VBOOT_VBNV_OFFSET + hex + default 0x2a + config VARIANT_DIR string default "t520" if BOARD_LENOVO_T520 @@ -40,6 +55,11 @@ string default "variants/$(CONFIG_VARIANT_DIR)/devicetree.cb"
+config FMDFILE + string + default "src/mainboard/$(CONFIG_MAINBOARD_DIR)/vboot-rwa.fmd" if VBOOT + default "src/mainboard/$(CONFIG_MAINBOARD_DIR)/board.fmd" + config MAINBOARD_PART_NUMBER string default "ThinkPad T520" if BOARD_LENOVO_T520 diff --git a/src/mainboard/lenovo/t520/board.fmd b/src/mainboard/lenovo/t520/board.fmd new file mode 100644 index 0000000..04cf827 --- /dev/null +++ b/src/mainboard/lenovo/t520/board.fmd @@ -0,0 +1,16 @@ +FLASH@0xff800000 0x800000 { + SI_ALL@0x0 0x500000 { + SI_DESC@0x0 0x1000 + SI_GBE@0x1000 0x2000 + SI_ME@0x3000 0x4ed000 + } + SI_BIOS@0x500000 0x300000 { + RW_MRC_CACHE@0 0x10000 + SMMSTORE(PRESERVE)@0x10000 0x40000 + + WP_RO@0x50000 0x2a0000 { + FMAP@0x0 0x800 + COREBOOT(CBFS)@0x1000 0x29f000 + } + } +} diff --git a/src/mainboard/lenovo/t520/cmos.layout b/src/mainboard/lenovo/t520/cmos.layout index 1a7943e..ec6ce85 100644 --- a/src/mainboard/lenovo/t520/cmos.layout +++ b/src/mainboard/lenovo/t520/cmos.layout @@ -81,6 +81,9 @@ #437 3 r 0 unused 440 8 h 0 volume
+# VBOOT +448 128 r 0 vbnv + # SandyBridge MRC Scrambler Seed values 896 32 r 0 mrc_scrambler_seed 928 32 r 0 mrc_scrambler_seed_s3 diff --git a/src/mainboard/lenovo/t520/vboot-rwa.fmd b/src/mainboard/lenovo/t520/vboot-rwa.fmd new file mode 100644 index 0000000..8a4cd3b --- /dev/null +++ b/src/mainboard/lenovo/t520/vboot-rwa.fmd @@ -0,0 +1,29 @@ +FLASH@0xff800000 0x800000 { + SI_ALL@0x0 0x500000 { + SI_DESC@0x0 0x1000 + SI_GBE@0x1000 0x2000 + SI_ME@0x3000 0x4ed000 + } + SI_BIOS@0x500000 0x300000 { + RW_SECTION_A@0x00000 0x180000 { + VBLOCK_A@0x0 0x10000 + FW_MAIN_A(CBFS)@0x10000 0x16ffc0 + RW_FWID_A@0x17ffc0 0x40 + } + UNIFIED_MRC_CACHE@0x180000 0x20000 { + RECOVERY_MRC_CACHE@0x0 0x10000 + RW_MRC_CACHE@0x10000 0x10000 + } + RW_VPD(PRESERVE)@0x1a0000 0x1000 + SMMSTORE(PRESERVE)@0x1a1000 0x40000 + + WP_RO@0x1e1000 0x11f000 { + FMAP@0x0 0x800 + RO_FRID@0x800 0x40 + RO_PADDING@0x840 0x7c0 + RO_VPD(PRESERVE)@0x1000 0x1000 + GBB@0x2000 0x1e000 + COREBOOT(CBFS)@0x20000 0xff000 + } + } +} diff --git a/src/mainboard/lenovo/x220/Kconfig b/src/mainboard/lenovo/x220/Kconfig index 16f42e8..358cf8e 100644 --- a/src/mainboard/lenovo/x220/Kconfig +++ b/src/mainboard/lenovo/x220/Kconfig @@ -26,6 +26,21 @@ # Workaround for EC/KBC IRQ1. select SERIRQ_CONTINUOUS_MODE
+config VBOOT + select VBOOT_VBNV_CMOS + select GBB_FLAG_DISABLE_LID_SHUTDOWN + select GBB_FLAG_DISABLE_PD_SOFTWARE_SYNC + select GBB_FLAG_DISABLE_EC_SOFTWARE_SYNC + select GBB_FLAG_DISABLE_FWMP + select HAS_RECOVERY_MRC_CACHE + +config VBOOT_SLOTS_RW_A + default y + +config VBOOT_VBNV_OFFSET + hex + default 0x2a + config MAINBOARD_DIR string default lenovo/x220 @@ -35,6 +50,10 @@ default "x220" if BOARD_LENOVO_X220 || BOARD_LENOVO_X220I default "x1" if BOARD_LENOVO_X1
+config FMDFILE + string + default "src/mainboard/$(CONFIG_MAINBOARD_DIR)/vboot-rwa.fmd" if VBOOT + default "src/mainboard/$(CONFIG_MAINBOARD_DIR)/board.fmd"
config MAINBOARD_PART_NUMBER string diff --git a/src/mainboard/lenovo/x220/board.fmd b/src/mainboard/lenovo/x220/board.fmd new file mode 100644 index 0000000..04cf827 --- /dev/null +++ b/src/mainboard/lenovo/x220/board.fmd @@ -0,0 +1,16 @@ +FLASH@0xff800000 0x800000 { + SI_ALL@0x0 0x500000 { + SI_DESC@0x0 0x1000 + SI_GBE@0x1000 0x2000 + SI_ME@0x3000 0x4ed000 + } + SI_BIOS@0x500000 0x300000 { + RW_MRC_CACHE@0 0x10000 + SMMSTORE(PRESERVE)@0x10000 0x40000 + + WP_RO@0x50000 0x2a0000 { + FMAP@0x0 0x800 + COREBOOT(CBFS)@0x1000 0x29f000 + } + } +} diff --git a/src/mainboard/lenovo/x220/cmos.layout b/src/mainboard/lenovo/x220/cmos.layout index d4a4ed3..dc98010 100644 --- a/src/mainboard/lenovo/x220/cmos.layout +++ b/src/mainboard/lenovo/x220/cmos.layout @@ -80,6 +80,9 @@ #435 549 r 0 unused 440 8 h 0 volume
+# VBOOT +448 128 r 0 vbnv + # SandyBridge MRC Scrambler Seed values 896 32 r 0 mrc_scrambler_seed 928 32 r 0 mrc_scrambler_seed_s3 diff --git a/src/mainboard/lenovo/x220/vboot-rwa.fmd b/src/mainboard/lenovo/x220/vboot-rwa.fmd new file mode 100644 index 0000000..8a4cd3b --- /dev/null +++ b/src/mainboard/lenovo/x220/vboot-rwa.fmd @@ -0,0 +1,29 @@ +FLASH@0xff800000 0x800000 { + SI_ALL@0x0 0x500000 { + SI_DESC@0x0 0x1000 + SI_GBE@0x1000 0x2000 + SI_ME@0x3000 0x4ed000 + } + SI_BIOS@0x500000 0x300000 { + RW_SECTION_A@0x00000 0x180000 { + VBLOCK_A@0x0 0x10000 + FW_MAIN_A(CBFS)@0x10000 0x16ffc0 + RW_FWID_A@0x17ffc0 0x40 + } + UNIFIED_MRC_CACHE@0x180000 0x20000 { + RECOVERY_MRC_CACHE@0x0 0x10000 + RW_MRC_CACHE@0x10000 0x10000 + } + RW_VPD(PRESERVE)@0x1a0000 0x1000 + SMMSTORE(PRESERVE)@0x1a1000 0x40000 + + WP_RO@0x1e1000 0x11f000 { + FMAP@0x0 0x800 + RO_FRID@0x800 0x40 + RO_PADDING@0x840 0x7c0 + RO_VPD(PRESERVE)@0x1000 0x1000 + GBB@0x2000 0x1e000 + COREBOOT(CBFS)@0x20000 0xff000 + } + } +}
Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32585 )
Change subject: mb/lenovo/*: Add support for VBOOT on 8MiB devices ......................................................................
Patch Set 6:
(1 comment)
https://review.coreboot.org/#/c/32585/6/src/mainboard/lenovo/x220/Kconfig File src/mainboard/lenovo/x220/Kconfig:
https://review.coreboot.org/#/c/32585/6/src/mainboard/lenovo/x220/Kconfig@56 PS6, Line 56: default "src/mainboard/$(CONFIG_MAINBOARD_DIR)/board.fmd" Why is this file needed? It breaks things that would otherwise be added to the default fmd (e.g. flash console). How is this related to vboot?
Patrick Rudolph has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32585 )
Change subject: mb/lenovo/*: Add support for VBOOT on 8MiB devices ......................................................................
Patch Set 6:
(1 comment)
https://review.coreboot.org/#/c/32585/6/src/mainboard/lenovo/x220/Kconfig File src/mainboard/lenovo/x220/Kconfig:
https://review.coreboot.org/#/c/32585/6/src/mainboard/lenovo/x220/Kconfig@56 PS6, Line 56: default "src/mainboard/$(CONFIG_MAINBOARD_DIR)/board.fmd"
Why is this file needed? It breaks things that would otherwise […]
I'm used to adding a default fmap on ARM. Thinking about it it makes no sense to add a default board.fmd. I'll remove it.