From: Eddie James <eajames@linux.ibm.com>
To: openbmc@lists.ozlabs.org
Cc: joel@jms.id.au
Subject: [PATCH u-boot v2019.04-aspeed-openbmc 4/4] ast2600: Measure the boot
Date: Wed, 25 Jan 2023 11:30:25 -0600 [thread overview]
Message-ID: <20230125173025.3725606-5-eajames@linux.ibm.com> (raw)
In-Reply-To: <20230125173025.3725606-1-eajames@linux.ibm.com>
Add the configuration option for measured boot and add the
event log reserved memory to the device tree.
Signed-off-by: Eddie James <eajames@linux.ibm.com>
---
arch/arm/dts/ast2600-p10bmc.dts | 22 ++++++++++++++
board/aspeed/ast2600_ibm/ibm.c | 34 ----------------------
configs/ast2600_openbmc_spl_emmc_defconfig | 1 +
3 files changed, 23 insertions(+), 34 deletions(-)
diff --git a/arch/arm/dts/ast2600-p10bmc.dts b/arch/arm/dts/ast2600-p10bmc.dts
index 1d0f88bf96..f6b5db5b50 100755
--- a/arch/arm/dts/ast2600-p10bmc.dts
+++ b/arch/arm/dts/ast2600-p10bmc.dts
@@ -13,6 +13,17 @@
reg = <0x80000000 0x40000000>;
};
+ reserved-memory {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ ranges;
+
+ event_log: tcg_event_log@b3d00000 {
+ no-map;
+ reg = <0xb3d00000 0x100000>;
+ };
+ };
+
chosen {
stdout-path = &uart5;
};
@@ -107,12 +118,23 @@
u-boot,dm-pre-reloc;
};
+&i2c {
+ u-boot,dm-pre-reloc;
+};
+
+&i2cglobal {
+ u-boot,dm-pre-reloc;
+};
+
&i2c12 {
+ u-boot,dm-pre-reloc;
status = "okay";
tpm@2e {
+ u-boot,dm-pre-reloc;
compatible = "nuvoton,npct75x";
reg = <0x2e>;
+ memory-region = <&event_log>;
};
};
diff --git a/board/aspeed/ast2600_ibm/ibm.c b/board/aspeed/ast2600_ibm/ibm.c
index 3782bbdee2..7e402932a5 100644
--- a/board/aspeed/ast2600_ibm/ibm.c
+++ b/board/aspeed/ast2600_ibm/ibm.c
@@ -3,41 +3,7 @@
* Copyright 2022 IBM Corp.
*/
-#include <common.h>
-#include <dm/uclass.h>
-#include <tpm-common.h>
-#include <tpm-v2.h>
-
int board_late_init(void)
{
- int rc;
- struct udevice *dev;
- /*
- * The digest is just an arbitrary sequence for now to ensure that the
- * TPM gets "poisoned."
- */
- const unsigned char digest[32] = {
- 0x6e, 0x65, 0x76, 0x65, 0x72, 0x67, 0x6f, 0x6e,
- 0x6e, 0x61, 0x67, 0x69, 0x76, 0x65, 0x79, 0x6f,
- 0x75, 0x75, 0x70, 0x6e, 0x65, 0x76, 0x65, 0x72,
- 0x67, 0x6f, 0x6e, 0x6e, 0x61, 0x6c, 0x65, 0x74
- };
-
- rc = uclass_first_device_err(UCLASS_TPM, &dev);
- if (rc)
- return 0;
-
- rc = tpm_init(dev);
- if (rc)
- return 0;
-
- rc = tpm2_startup(dev, TPM2_SU_CLEAR);
- if (rc)
- return 0;
-
- rc = tpm2_pcr_extend(dev, 0, digest);
- if (!rc)
- printf("TPM: PCR0 extended.\n");
-
return 0;
}
diff --git a/configs/ast2600_openbmc_spl_emmc_defconfig b/configs/ast2600_openbmc_spl_emmc_defconfig
index cf2e937fe2..7d70521c0a 100644
--- a/configs/ast2600_openbmc_spl_emmc_defconfig
+++ b/configs/ast2600_openbmc_spl_emmc_defconfig
@@ -136,4 +136,5 @@ CONFIG_USE_TINY_PRINTF=y
CONFIG_SPL_TINY_MEMSET=y
CONFIG_TPM=y
CONFIG_SPL_TPM=y
+CONFIG_MEASURED_BOOT=y
# CONFIG_EFI_LOADER is not set
--
2.31.1
next prev parent reply other threads:[~2023-01-25 17:35 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-25 17:30 [PATCH u-boot v2019.04-aspeed-openbmc 0/4] tpm: Support boot measurements Eddie James
2023-01-25 17:30 ` [PATCH u-boot v2019.04-aspeed-openbmc 1/4] tpm: Pull in upstream changes Eddie James
2023-01-25 17:30 ` [PATCH u-boot v2019.04-aspeed-openbmc 2/4] tpm: Support boot measurements Eddie James
2023-01-25 17:30 ` [PATCH u-boot v2019.04-aspeed-openbmc 3/4] bootm: Support boot measurement Eddie James
2023-01-25 17:30 ` Eddie James [this message]
2023-01-25 19:32 ` [PATCH u-boot v2019.04-aspeed-openbmc 4/4] ast2600: Measure the boot Michael Richardson
2023-01-26 22:09 ` Eddie James
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230125173025.3725606-5-eajames@linux.ibm.com \
--to=eajames@linux.ibm.com \
--cc=joel@jms.id.au \
--cc=openbmc@lists.ozlabs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.