[PATCH v2] powerpc: wii: Add the fixed OTP layout

Link Mauve <[email protected]> Thu, 30 Jul 2026 00:50:08 +0200
Newsgroups org.ozlabs.lists.linuxppc-dev,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
These 128 bytes have a known fixed layout, so we can expose those as
cells for either kernel or userspace consumption.

Signed-off-by: Link Mauve <[email protected]>
---
 arch/powerpc/boot/dts/wii.dts | 42 +++++++++++++++++++++++++++++++++++
 1 file changed, 42 insertions(+)

Changes since v1:
- Link to v1:
  https://lore.kernel.org/lkml/[email protected]/T/
- Switch to using hyphens instead of underscores as it is preferred in
  device-trees.
- Extend device-private-key@28 to 0x1e bytes instead of 0x1c, which is
  its correct size.
- Document that this cell and the next one overlap for two bytes, and
  it’s expected.

diff --git a/arch/powerpc/boot/dts/wii.dts b/arch/powerpc/boot/dts/wii.dts
index 473d9feb9cdb..d3a94d94e9e1 100644
--- a/arch/powerpc/boot/dts/wii.dts
+++ b/arch/powerpc/boot/dts/wii.dts
@@ -233,6 +233,48 @@ control@d800100 {
 		otp@d8001ec {
 			compatible = "nintendo,hollywood-otp";
 			reg = <0x0d8001ec 0x8>;
+
+			nvmem-layout {
+				compatible = "fixed-layout";
+				#address-cells = <1>;
+				#size-cells = <1>;
+
+				boot1-sha1@0 {
+					reg = <0x00 0x14>;
+				};
+
+				common-key@14 {
+					reg = <0x14 0x10>;
+				};
+
+				device-id@24 {
+					reg = <0x24 0x4>;
+				};
+
+				/*
+				 * device-private-key@28 and nand-hmac-key@44
+				 * overlap on two bytes, that’s expected.
+				 */
+				device-private-key@28 {
+					reg = <0x28 0x1e>;
+				};
+
+				nand-hmac-key@44 {
+					reg = <0x44 0x14>;
+				};
+
+				nand-key@58 {
+					reg = <0x58 0x10>;
+				};
+
+				backup-key@68 {
+					reg = <0x68 0x10>;
+				};
+
+				unknown@78 {
+					reg = <0x78 0x8>;
+				};
+			};
 		};
 
 		disk@d806000 {

base-commit: 78bc8af4affb9a732504eb22eeac7d1e50883853
-- 
2.55.0