COLD17d

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

From: Link Mauve <hidden>
Date: 2026-07-29 22:50:18
Also in: linux-devicetree, lkml
Subsystem: linux for powerpc (32-bit and 64-bit), the rest · Maintainers: Madhavan Srinivasan, Linus Torvalds

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 <redacted>
---
 arch/powerpc/boot/dts/wii.dts | 42 +++++++++++++++++++++++++++++++++++
 1 file changed, 42 insertions(+)

Changes since v1:
- Link to v1:
  https://lore.kernel.org/lkml/20260726181921.16269-1-linkmauve@linkmauve.fr/T/ (local)
- 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, thats 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

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help