Attention is currently required from: Michał Żygowski, Piotr Król.
Hello build bot (Jenkins), Angel Pons, Piotr Król,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/67940
to look at the new patch set (#16).
Change subject: mb/protectli/vault_cml: Add Comet Lake 6 port board support
......................................................................
mb/protectli/vault_cml: Add Comet Lake 6 port board support
Signed-off-by: Michał Żygowski <michal.zygowski(a)3mdeb.com>
Change-Id: If1b4f9c8245a082ff875ae9c6102a1c45e677d0b
---
M Documentation/mainboard/index.md
A Documentation/mainboard/protectli/vp46xx.md
A Documentation/mainboard/protectli/vp46xx_back.jpg
A Documentation/mainboard/protectli/vp46xx_flash.jpg
A Documentation/mainboard/protectli/vp46xx_front.jpg
A src/mainboard/protectli/vault_cml/Kconfig
A src/mainboard/protectli/vault_cml/Kconfig.name
A src/mainboard/protectli/vault_cml/Makefile.inc
A src/mainboard/protectli/vault_cml/acpi/ec.asl
A src/mainboard/protectli/vault_cml/acpi/superio.asl
A src/mainboard/protectli/vault_cml/board.fmd
A src/mainboard/protectli/vault_cml/board_info.txt
A src/mainboard/protectli/vault_cml/bootblock.c
A src/mainboard/protectli/vault_cml/cmos.default
A src/mainboard/protectli/vault_cml/cmos.layout
A src/mainboard/protectli/vault_cml/data.vbt
A src/mainboard/protectli/vault_cml/devicetree.cb
A src/mainboard/protectli/vault_cml/die.c
A src/mainboard/protectli/vault_cml/dsdt.asl
A src/mainboard/protectli/vault_cml/gma-mainboard.ads
A src/mainboard/protectli/vault_cml/gpio.c
A src/mainboard/protectli/vault_cml/gpio.h
A src/mainboard/protectli/vault_cml/hda_verb.c
A src/mainboard/protectli/vault_cml/mainboard.c
A src/mainboard/protectli/vault_cml/romstage.c
A src/mainboard/protectli/vault_cml/vboot-rwa.fmd
26 files changed, 1,296 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/40/67940/16
--
To view, visit https://review.coreboot.org/c/coreboot/+/67940
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: If1b4f9c8245a082ff875ae9c6102a1c45e677d0b
Gerrit-Change-Number: 67940
Gerrit-PatchSet: 16
Gerrit-Owner: Michał Żygowski <michal.zygowski(a)3mdeb.com>
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: Piotr Król <piotr.krol(a)3mdeb.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Michał Żygowski <michal.zygowski(a)3mdeb.com>
Gerrit-Attention: Piotr Król <piotr.krol(a)3mdeb.com>
Gerrit-MessageType: newpatchset
Michał Żygowski has submitted this change. ( https://review.coreboot.org/c/coreboot/+/63957 )
Change subject: drivers/crb: Initialize Intel PTT control area
......................................................................
drivers/crb: Initialize Intel PTT control area
On newer systems such as Alder Lake it has been noticed that Intel PTT
control area is not writable until PTT is switched to ready state. The
EDK2 CRB drivers always initialize the command/response buffer address
and size registers before invoking the TPM command. See STEP 2 in
PtpCrbTpmCommand function in
tianocore/edk2/SecurityPkg/Library/Tpm2DeviceLibDTpm/Tpm2Ptp.c
Doing the same in coreboot allowed to perform PTT TPM startup
successfully and measure the components to PCRs in ramstage on an
Alder Lake S platform.
TEST=Enable measured boot and see Intel PTT is started successfully
and no errors occur during PCR extends on MSI PRO Z690-A DDR4 WIFI.
Signed-off-by: Michał Żygowski <michal.zygowski(a)3mdeb.com>
Change-Id: Ia8e473ecc1a520851d6d48ccad9da35c6f91005d
Reviewed-on: https://review.coreboot.org/c/coreboot/+/63957
Reviewed-by: Paul Menzel <paulepanter(a)mailbox.org>
Tested-by: build bot (Jenkins) <no-reply(a)coreboot.org>
Reviewed-by: Krystian Hebel <krystian.hebel(a)3mdeb.com>
---
M src/drivers/crb/tpm.c
M src/drivers/crb/tpm.h
2 files changed, 75 insertions(+), 0 deletions(-)
Approvals:
build bot (Jenkins): Verified
Paul Menzel: Looks good to me, but someone else must approve
Krystian Hebel: Looks good to me, approved
diff --git a/src/drivers/crb/tpm.c b/src/drivers/crb/tpm.c
index 1bdca00..858aeb7 100644
--- a/src/drivers/crb/tpm.c
+++ b/src/drivers/crb/tpm.c
@@ -48,6 +48,22 @@
control_area.response_size = read32(CRB_REG(cur_loc, CRB_REG_RESP_SIZE));
control_area.response_bfr =
(void *)(uintptr_t)read64(CRB_REG(cur_loc, CRB_REG_RESP_ADDR));
+
+ /*
+ * Intel PTT has to write the command/response address and size
+ * register before each command submission otherwise the control area
+ * is all zeroed. This has been observed on Alder Lake S CPU and may be
+ * applicable to other new microarchitectures. Update the local control
+ * area data to make tpm2_process_command not fail on buffer checks.
+ * PTT command/response buffer is fixed to be at offset 0x80 and spans
+ * up to the end of 4KB region for the current locality.
+ */
+ if (CONFIG(HAVE_INTEL_PTT)) {
+ control_area.command_size = 0x1000 - CRB_REG_DATA_BUFF;
+ control_area.response_size = control_area.command_size;
+ control_area.command_bfr = CRB_REG(cur_loc, CRB_REG_DATA_BUFF);
+ control_area.response_bfr = CRB_REG(cur_loc, CRB_REG_DATA_BUFF);
+ }
}
/* Wait for Reg to be expected Value */
@@ -115,6 +131,7 @@
int rc = crb_wait_for_reg32(CRB_REG(locality, CRB_REG_LOC_STATE), 750,
LOC_STATE_LOC_ASSIGN, LOC_STATE_LOC_ASSIGN);
+
if (!rc && (locality == 0))
return locality;
@@ -181,12 +198,33 @@
/* Read back control area structure */
crb_readControlArea();
+ /*
+ * PTT may have no assigned locality before startup. Request locality here to save
+ * some precious milliseconds which would be wasted in crb_activate_locality polling
+ * for LOC_STATE_LOC_ASSIGN bit for the first time.
+ */
+ if (CONFIG(HAVE_INTEL_PTT)) {
+ uint8_t locality = (read8(CRB_REG(0, CRB_REG_LOC_STATE)) >> 2) & 0x07;
+ write8(CRB_REG(locality, CRB_REG_LOC_CTRL), LOC_CTRL_REQ_ACCESS);
+ }
+
/* Good to go. */
printk(BIOS_SPEW, "TPM: CRB TPM initialized successfully\n");
return 0;
}
+static void set_ptt_cmd_resp_buffers(void)
+{
+ write32(CRB_REG(cur_loc, CRB_REG_CMD_ADDR + 4), 0);
+ write32(CRB_REG(cur_loc, CRB_REG_CMD_ADDR),
+ (uintptr_t)CRB_REG(cur_loc, CRB_REG_DATA_BUFF));
+ write32(CRB_REG(cur_loc, CRB_REG_CMD_SIZE), control_area.command_size);
+ write64(CRB_REG(cur_loc, CRB_REG_RESP_ADDR),
+ (uintptr_t)CRB_REG(cur_loc, CRB_REG_DATA_BUFF));
+ write32(CRB_REG(cur_loc, CRB_REG_RESP_SIZE), control_area.response_size);
+}
+
/*
* tpm2_process_command
*/
@@ -220,6 +258,14 @@
// Write to Command Buffer
memcpy(control_area.command_bfr, tpm2_command, command_size);
+ /*
+ * Initialize CRB addresses and sizes for PTT. It seems to be possible
+ * only after CRB is switched to ready and before writing start bit.
+ * This is also what EDK2 TPM CRB drivers do.
+ */
+ if (CONFIG(HAVE_INTEL_PTT))
+ set_ptt_cmd_resp_buffers();
+
// Write Start Bit
write8(CRB_REG(cur_loc, CRB_REG_START), 0x1);
diff --git a/src/drivers/crb/tpm.h b/src/drivers/crb/tpm.h
index c43beb6..be26be2 100644
--- a/src/drivers/crb/tpm.h
+++ b/src/drivers/crb/tpm.h
@@ -33,6 +33,7 @@
#define CRB_REG_CMD_ADDR 0x5C
#define CRB_REG_RESP_SIZE 0x64
#define CRB_REG_RESP_ADDR 0x68
+#define CRB_REG_DATA_BUFF 0x80
/* CRB INTF BIT MASK */
#define CRB_INTF_REG_CAP_CRB (1<<14)
--
To view, visit https://review.coreboot.org/c/coreboot/+/63957
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ia8e473ecc1a520851d6d48ccad9da35c6f91005d
Gerrit-Change-Number: 63957
Gerrit-PatchSet: 16
Gerrit-Owner: Michał Żygowski <michal.zygowski(a)3mdeb.com>
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-Reviewer: Krystian Hebel <krystian.hebel(a)3mdeb.com>
Gerrit-Reviewer: Michał Żygowski <michal.zygowski(a)3mdeb.com>
Gerrit-Reviewer: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-MessageType: merged
Attention is currently required from: Kacper Stojek, Maximilian Brune.
Michał Żygowski has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/66825 )
Change subject: util/inteltool: Add support for Alderlake P in inteltool
......................................................................
Patch Set 15: Code-Review+2
--
To view, visit https://review.coreboot.org/c/coreboot/+/66825
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I2ba4ef7eee33d4dd762a05dd755de5e4d2e566dd
Gerrit-Change-Number: 66825
Gerrit-PatchSet: 15
Gerrit-Owner: Kacper Stojek
Gerrit-Reviewer: Maximilian Brune <maximilian.brune(a)9elements.com>
Gerrit-Reviewer: Michał Kopeć <michal.kopec(a)3mdeb.com>
Gerrit-Reviewer: Michał Żygowski <michal.zygowski(a)3mdeb.com>
Gerrit-Reviewer: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-CC: Maciej Pijanowski <maciej.pijanowski(a)3mdeb.com>
Gerrit-Attention: Kacper Stojek
Gerrit-Attention: Maximilian Brune <maximilian.brune(a)9elements.com>
Gerrit-Comment-Date: Wed, 05 Oct 2022 08:25:25 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment