All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: U-Boot Mailing List <u-boot@lists.denx.de>
Subject: [PATCH V4 11/14] arm: dts: iot2050: Optionally embed OTP programming data into image
Date: Thu,  2 Feb 2023 09:07:56 +0100	[thread overview]
Message-ID: <fa8449ba6c006a93cc777a2ce24aaf4b5505b0f6.1675325279.git.jan.kiszka@siemens.com> (raw)
In-Reply-To: <cover.1675325279.git.jan.kiszka@siemens.com>

From: Jan Kiszka <jan.kiszka@siemens.com>

Use external blob otpcmd.bin to replace the 0xff filled OTP programming
command block to create a firmware image that provisions the OTP on
first boot. This otpcmd.bin is generated from the customer keys using
steps described in the meta-iot2050 integration layer for the device.

Based on original patch by Baocheng Su.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 arch/arm/dts/k3-am65-iot2050-boot-image.dtsi | 8 ++++++++
 board/siemens/iot2050/Kconfig                | 7 +++++++
 doc/board/siemens/iot2050.rst                | 8 ++++++++
 tools/binman/missing-blob-help               | 8 ++++++++
 4 files changed, 31 insertions(+)

diff --git a/arch/arm/dts/k3-am65-iot2050-boot-image.dtsi b/arch/arm/dts/k3-am65-iot2050-boot-image.dtsi
index 9082a79a034..25a22a7b7b8 100644
--- a/arch/arm/dts/k3-am65-iot2050-boot-image.dtsi
+++ b/arch/arm/dts/k3-am65-iot2050-boot-image.dtsi
@@ -111,10 +111,18 @@
 		};
 
 		/* OTP update command block */
+#if CONFIG_IOT2050_EMBED_OTPCMD
+		blob-ext@0x6c0000 {
+			offset = <0x6c0000>;
+			size   = <0x010000>;
+			filename = "otpcmd.bin";
+			missing-msg = "iot2050-otpcmd";
+#else
 		fill@0x6c0000 {
 			offset = <0x6c0000>;
 			size   = <0x010000>;
 			fill-byte = [ff];
+#endif
 		};
 	};
 };
diff --git a/board/siemens/iot2050/Kconfig b/board/siemens/iot2050/Kconfig
index a2b40881d11..e66b2427d95 100644
--- a/board/siemens/iot2050/Kconfig
+++ b/board/siemens/iot2050/Kconfig
@@ -49,4 +49,11 @@ config IOT2050_BOOT_SWITCH
 	bool "Disable eMMC boot via USER button (Advanced version only)"
 	default y
 
+config IOT2050_EMBED_OTPCMD
+	bool "Embed OTP programming data"
+	help
+	  Embed signed OTP programming data 'otpcmd.bin' into the firmware
+	  image. This data will be evaluated and executed on first boot of the
+	  device.
+
 endif
diff --git a/doc/board/siemens/iot2050.rst b/doc/board/siemens/iot2050.rst
index 4e0925c72c9..cb49a0e36bf 100644
--- a/doc/board/siemens/iot2050.rst
+++ b/doc/board/siemens/iot2050.rst
@@ -27,6 +27,14 @@ The following binaries from that source need to be present in the build folder:
  - seboot_pg1.bin
  - seboot_pg2.bin
 
+For building an image containing the OTP key provisioning data, below binary
+needs to be present in the build folder:
+
+ - otpcmd.bin
+
+Regarding how to generating this otpcmd.bin, please refer to:
+https://github.com/siemens/meta-iot2050/tree/master/recipes-bsp/secure-boot-otp-provisioning/files/make-otpcmd.sh
+
 Building
 --------
 
diff --git a/tools/binman/missing-blob-help b/tools/binman/missing-blob-help
index 5bb8961ce03..7e88cd03954 100644
--- a/tools/binman/missing-blob-help
+++ b/tools/binman/missing-blob-help
@@ -23,6 +23,14 @@ See the documentation for IOT2050 board. Your image is missing SEBoot
 which is mandatory for board startup. Prebuilt SEBoot located at
 meta-iot2050/tree/master/recipes-bsp/u-boot/files/prebuild/seboot_pg*.bin.
 
+iot2050-otpcmd:
+See the documentation for IOT2050 board. Your image is missing OTP command data
+block which is used for provisioning the customer keys to the board.
+Please refer to
+meta-iot2050/tree/master/recipes-bsp/secure-boot-otp-provisioning/files/make-otpcmd.sh
+for how to generate this binary. If you are not using secure boot or do not
+intend to provision the keys, disable CONFIG_IOT2050_EMBED_OTPCMD.
+
 k3-rti-wdt-firmware:
 If CONFIG_WDT_K3_RTI_LOAD_FW is enabled, a firmware image is needed for
 the R5F core(s) to trigger the system reset. One possible source is
-- 
2.35.3


  parent reply	other threads:[~2023-02-02  8:15 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-02  8:07 [PATCH V4 00/14] IOT2050-related enhancements Jan Kiszka
2023-02-02  8:07 ` [PATCH V4 01/14] env: Complete generic support for writable list Jan Kiszka
2023-02-02 12:48   ` Marek Vasut
2023-02-02 13:51     ` Jan Kiszka
2023-02-02 14:57       ` Marek Vasut
2023-02-02  8:07 ` [PATCH V4 02/14] env: Couple networking-related variable flags to CONFIG_NET Jan Kiszka
2023-02-02  8:07 ` [PATCH V4 03/14] tools: Add script for converting public key into device tree include Jan Kiszka
2023-02-02  8:07 ` [PATCH V4 04/14] board: siemens: iot2050: Split the build for PG1 and PG2 Jan Kiszka
2023-02-02  8:07 ` [PATCH V4 05/14] arm: dts: iot2050: Use the auto generator nodes for fdt Jan Kiszka
2023-02-02  8:07 ` [PATCH V4 06/14] iot2050: Update firmware layout Jan Kiszka
2023-02-02  8:07 ` [PATCH V4 07/14] iot2050: Add watchdog start to bootcmd Jan Kiszka
2023-02-02  8:07 ` [PATCH V4 08/14] iot2050: Add CONFIG_ENV_FLAGS_LIST_STATIC Jan Kiszka
2023-02-02  8:07 ` [PATCH V4 09/14] arm: dts: iot2050: Allow verifying U-Boot proper by SPL Jan Kiszka
2023-02-02  8:07 ` [PATCH V4 10/14] iot2050: Add script for signing artifacts Jan Kiszka
2023-02-02  8:07 ` Jan Kiszka [this message]
2023-02-02  8:07 ` [PATCH V4 12/14] doc: iot2050: Add a note about the watchdog firmware Jan Kiszka
2023-02-02  8:07 ` [PATCH V4 13/14] board: siemens: iot2050: use the named gpio to control the user-button Jan Kiszka
2023-02-02  8:07 ` [PATCH V4 14/14] iot2050: Refresh defconfigs and activate CONFIG_EFI_SCROLL_ON_CLEAR_SCREEN Jan Kiszka

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=fa8449ba6c006a93cc777a2ce24aaf4b5505b0f6.1675325279.git.jan.kiszka@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=u-boot@lists.denx.de \
    /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.