From patchwork Wed May 19 09:45:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Emmanuel Gil Peyrot X-Patchwork-Id: 1480860 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org (client-ip=2404:9400:2:0:216:3eff:fee1:b9f1; helo=lists.ozlabs.org; envelope-from=linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org; receiver=) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2404:9400:2:0:216:3eff:fee1:b9f1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FlWm46vK0z9sW4 for ; Wed, 19 May 2021 22:05:40 +1000 (AEST) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4FlWm45J2Vz3d47 for ; Wed, 19 May 2021 22:05:40 +1000 (AEST) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=linkmauve.fr (client-ip=2a01:e0a:828:c7c0:49:5ff:fe41:d261; helo=luna.linkmauve.fr; envelope-from=linkmauve@linkmauve.fr; receiver=) Received: from luna.linkmauve.fr (unknown [IPv6:2a01:e0a:828:c7c0:49:5ff:fe41:d261]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with UTF8SMTPS id 4FlSfp3Ck0z2xv5 for ; Wed, 19 May 2021 19:45:54 +1000 (AEST) Received: by luna.linkmauve.fr (Postfix, from userid 1000) id E79E3F40627; Wed, 19 May 2021 11:45:49 +0200 (CEST) From: Emmanuel Gil Peyrot To: Srinivas Kandagatla , linuxppc-dev@lists.ozlabs.org, devicetree@vger.kernel.org Subject: =?unknown-8bit?q?=5BPATCH_0/4=5D_nvmem=3A_nintendo-otp=3A_Add_new_d?= =?unknown-8bit?q?river_for_the_Wii_and_Wii=C2=A0U_OTP?= Date: Wed, 19 May 2021 11:45:42 +0200 Message-Id: <20210519094546.3954-1-linkmauve@linkmauve.fr> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 X-Mailman-Approved-At: Wed, 19 May 2021 22:03:54 +1000 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Emmanuel Gil Peyrot , linux-kernel@vger.kernel.org, Rob Herring , Paul Mackerras , Ash Logan , =?utf-8?q?Jonathan_Neusch=C3=A4fer?= Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" The OTP is a read-only memory area which contains various keys and signatures used to decrypt, encrypt or verify various pieces of storage. Its size depends on the console, it is 128 bytes on the Wii and 1024 bytes on the Wii U (split into eight 128 bytes banks). It can be used directly by writing into one register and reading from the other one, without any additional synchronisation. This series has only been tested on the Wii U so far, using the downstream 4.19 branch from linux-wiiu[1], but it should also work on the Wii on mainline. [1] https://gitlab.com/linux-wiiu/linux-wiiu Emmanuel Gil Peyrot (4): nvmem: nintendo-otp: Add new driver for the Wii and Wii U OTP dt-bindings: nintendo-otp: Document the Wii and Wii U OTP support powerpc: wii.dts: Expose the OTP on this platform powerpc: wii_defconfig: Enable OTP by default .../bindings/nvmem/nintendo-otp.txt | 14 +++ arch/powerpc/boot/dts/wii.dts | 5 + arch/powerpc/configs/wii_defconfig | 1 + drivers/nvmem/Kconfig | 11 ++ drivers/nvmem/Makefile | 2 + drivers/nvmem/nintendo-otp.c | 115 ++++++++++++++++++ 6 files changed, 148 insertions(+) create mode 100644 Documentation/devicetree/bindings/nvmem/nintendo-otp.txt create mode 100644 drivers/nvmem/nintendo-otp.c