Skip to contentSkip to conversation

board: ast2600-ibm: Add AST2600 BMC based POWER10+ servers

PATCH In review Eddie James 2 participants 2 messages May 26, 2022 – May 27, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 board: ast2600-ibm: Add AST2600 BMC based POWER10+ servers

Support IBM-specific options for POWER10+ servers built on AST2600 BMC.

---
Changes since v1:
- Drop the defconfig in favor of yocto fragment
- remove __weak for board init
- select BOARD_LATE_INIT

 arch/arm/mach-aspeed/ast2600/Kconfig |  9 ++++++
 board/aspeed/ast2600_ibm/Kconfig     | 13 +++++++++
 board/aspeed/ast2600_ibm/Makefile    |  1 +
 board/aspeed/ast2600_ibm/ibm.c       | 43 ++++++++++++++++++++++++++++
 4 files changed, 66 insertions(+)
 create mode 100644 board/aspeed/ast2600_ibm/Kconfig
 create mode 100644 board/aspeed/ast2600_ibm/Makefile
 create mode 100644 board/aspeed/ast2600_ibm/ibm.c
arch/arm/mach-aspeed/ast2600/Kconfig +9 -0
index fcdc425de5..46cc1ad1db 100644
@@ -31,6 +31,14 @@ config TARGET_SLT_AST2600
 	help
 	  SLT-AST2600 is Aspeed SLT board for AST2600 chip.
 
+config TARGET_AST2600_IBM
+	bool "AST2600-IBM"
+	select BOARD_LATE_INIT
+	select TPM
+	select TPM2_TIS_I2C
+	help
+	  AST2600-IBM is IBM boards for AST2600 BMC based P0WER10+ servers
+
 config TARGET_AST2600_INTEL
 	bool "AST2600-INTEL"
 	depends on ASPEED_AST2600
@@ -43,6 +51,7 @@ endchoice
 source "board/aspeed/evb_ast2600/Kconfig"
 source "board/aspeed/fpga_ast2600/Kconfig"
 source "board/aspeed/slt_ast2600/Kconfig"
+source "board/aspeed/ast2600_ibm/Kconfig"
 source "board/aspeed/ast2600_intel/Kconfig"
 
 endif
board/aspeed/ast2600_ibm/Kconfig new file +13 -0
new file mode 100644
index 0000000000..38ee579ed7
@@ -0,0 +1,13 @@
+if TARGET_AST2600_IBM
+
+config SYS_BOARD
+	default "ast2600_ibm"
+
+config SYS_VENDOR
+	default "aspeed"
+
+config SYS_CONFIG_NAME
+	string "board configuration name"
+	default "ast2600_ibm"
+
+endif
board/aspeed/ast2600_ibm/Makefile new file +1 -0
new file mode 100644
index 0000000000..ae1aded893
@@ -0,0 +1 @@
+obj-y += ibm.o
board/aspeed/ast2600_ibm/ibm.c new file +43 -0

43 lines not on this page · raw message

Signature · 1 line
2.27.0
maintainer
#1 lore raw
Quoted 10 lines · Eddie James

Support IBM-specific options for POWER10+ servers built on AST2600 BMC.

---
Changes since v1:
- Drop the defconfig in favor of yocto fragment
- remove __weak for board init
- select BOARD_LATE_INIT

Thanks, I've merged this with a minor addition to the commit message about late init.

I confirmed that setting these two in the config does what we want:

echo CONFIG_BOARD_EARLY_INIT_F=n >> .config
echo CONFIG_TARGET_AST2600_IBM=y >> .config

Quoted 115 lines
 arch/arm/mach-aspeed/ast2600/Kconfig |  9 ++++++
 board/aspeed/ast2600_ibm/Kconfig     | 13 +++++++++
 board/aspeed/ast2600_ibm/Makefile    |  1 +
 board/aspeed/ast2600_ibm/ibm.c       | 43 ++++++++++++++++++++++++++++
 4 files changed, 66 insertions(+)
 create mode 100644 board/aspeed/ast2600_ibm/Kconfig
 create mode 100644 board/aspeed/ast2600_ibm/Makefile
 create mode 100644 board/aspeed/ast2600_ibm/ibm.c
arch/arm/mach-aspeed/ast2600/Kconfig +9 -0
index fcdc425de5..46cc1ad1db 100644
@@ -31,6 +31,14 @@ config TARGET_SLT_AST2600
        help
          SLT-AST2600 is Aspeed SLT board for AST2600 chip.
 
+config TARGET_AST2600_IBM
+       bool "AST2600-IBM"
+       select BOARD_LATE_INIT
+       select TPM
+       select TPM2_TIS_I2C
+       help
+         AST2600-IBM is IBM boards for AST2600 BMC based P0WER10+ servers
+
 config TARGET_AST2600_INTEL
        bool "AST2600-INTEL"
        depends on ASPEED_AST2600
@@ -43,6 +51,7 @@ endchoice
 source "board/aspeed/evb_ast2600/Kconfig"
 source "board/aspeed/fpga_ast2600/Kconfig"
 source "board/aspeed/slt_ast2600/Kconfig"
+source "board/aspeed/ast2600_ibm/Kconfig"
 source "board/aspeed/ast2600_intel/Kconfig"
 
 endif
board/aspeed/ast2600_ibm/Kconfig new file +13 -0
new file mode 100644
index 0000000000..38ee579ed7
@@ -0,0 +1,13 @@
+if TARGET_AST2600_IBM
+
+config SYS_BOARD
+       default "ast2600_ibm"
+
+config SYS_VENDOR
+       default "aspeed"
+
+config SYS_CONFIG_NAME
+       string "board configuration name"
+       default "ast2600_ibm"
+
+endif
board/aspeed/ast2600_ibm/Makefile new file +1 -0
new file mode 100644
index 0000000000..ae1aded893
@@ -0,0 +1 @@
+obj-y += ibm.o
board/aspeed/ast2600_ibm/ibm.c new file +43 -1
new file mode 100644
index 0000000000..37f469435f
@@ -0,0 +1,43 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * 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] = {
+               0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x00, 0x01,
+               0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09,
+               0xa0, 0xb1, 0xc2, 0xd3, 0xe4, 0xf5, 0x06, 0x17,
+               0x28, 0x39, 0x4a, 0x5b, 0x6c, 0x7d, 0x8e, 0x9f
+       };
+
+       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;
+}
--

2.27.0