Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp1063799pxv; Thu, 1 Jul 2021 16:24:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyqyzKdAJ3Tr5RMJZNswir0z5C2aFW0pPIx2M1jBZAg4NnUdARdxAxKZ7LuwQJUuZpkk71e X-Received: by 2002:aa7:c54b:: with SMTP id s11mr2875089edr.373.1625181864116; Thu, 01 Jul 2021 16:24:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625181864; cv=none; d=google.com; s=arc-20160816; b=zhAfKYljAS9EICRl4v978BjE4dJLtnyrwuOBEuri8rPew5+fd4Y4Ov+akuelyCJkSt xFnJmJ70zwPcb2LRL2mTJi5F50xr5+HdJBfwv71ci1YNecT+AIBDRWFP6o3sTV0N5xPi ZVraTFQx+VDbmj+7Jgt0eRERndRAHLzjLI5wDv3EXAmXE5YdJzGxUqE5oXU94N4m+oSL 8a1/7MWyko89AbKNmT5nZOrLLapj87bJzzzex5gIwYOYdA2VhqWrPECibIIZgdFfK0/Q 5iTFNjxp2yzaBqgNLmaP6NJPBbUiAB8oQ3Q67MzDyIai82nC1wb5Y/0xpBPx7CeeoS6w nSNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=D/4uvPNSgCB4VBZgMcr77g0AnQ/afsXSKbHw/J4L0HA=; b=H9hcOIArhBUpGRa7btU0Y82l03DBFPr27/KkILgR339tmXkYsaXCD91q1YuXk07cif JdpNsDkDluFLAFZmAQxXwg1b13wWNudYUNnEfNa6M+ETuuo8fftYRXkrs7nONjwRlKPe v4dqV0F36DgBO96ALTD35oDlHISzTZSjFrKJnLrCxjC0emNpGmdd9iO583/eKZijga+/ WrUsPxgAHVkJ2I/huijqselYYbhgFfcp58Qatvi2nS4ugmlxHSQxnPrm0N06e/kUoT07 MRiPaGufzx2yYdph2v8i62KGzed7bGRN6hUpvWv/KT99PyvQYq3ytdslf2pmpl+IJpSJ nHXw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w5si1218308edv.305.2021.07.01.16.23.58; Thu, 01 Jul 2021 16:24:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234063AbhGAXAX (ORCPT + 99 others); Thu, 1 Jul 2021 19:00:23 -0400 Received: from 82-65-109-163.subs.proxad.net ([82.65.109.163]:46292 "EHLO luna.linkmauve.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232807AbhGAXAW (ORCPT ); Thu, 1 Jul 2021 19:00:22 -0400 Received: by luna.linkmauve.fr (Postfix, from userid 1000) id 6AE76F40821; Fri, 2 Jul 2021 00:57:50 +0200 (CEST) From: Emmanuel Gil Peyrot To: Srinivas Kandagatla , linuxppc-dev@lists.ozlabs.org, devicetree@vger.kernel.org Cc: Emmanuel Gil Peyrot , Ash Logan , =?UTF-8?q?Jonathan=20Neusch=C3=A4fer?= , Rob Herring , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , linux-kernel@vger.kernel.org Subject: [PATCH v3 0/5] nvmem: nintendo-otp: Add new driver for the Wii and Wii U OTP Date: Fri, 2 Jul 2021 00:57:38 +0200 Message-Id: <20210701225743.14631-1-linkmauve@linkmauve.fr> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210519095044.4109-1-linkmauve@linkmauve.fr> References: <20210519095044.4109-1-linkmauve@linkmauve.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 been tested on both the Wii U (using my downstream master-wiiu branch[1]), as well as on the Wii on mainline. [1] https://gitlab.com/linkmauve/linux-wiiu/-/commits/master-wiiu Changes since v1: - Fixed the commit messages so they can be accepted by other email servers, sorry about that. Changes since v2: - Switched the dt binding documentation to YAML. - Used more obvious register arithmetic, and tested that gcc (at -O1 and above) outputs the exact same rlwinm instructions for them. - Use more #defines to make the code easier to read. - Include some links to the reversed documentation. - Avoid overlapping dt regions by changing the existing control@d800100 node to end before the OTP registers, with some bigger dt refactoring left for a future series. Emmanuel Gil Peyrot (5): 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: Reduce the size of the control area powerpc: wii.dts: Expose the OTP on this platform powerpc: wii_defconfig: Enable OTP by default .../bindings/nvmem/nintendo-otp.yaml | 44 +++++++ arch/powerpc/boot/dts/wii.dts | 13 +- arch/powerpc/configs/wii_defconfig | 1 + drivers/nvmem/Kconfig | 11 ++ drivers/nvmem/Makefile | 2 + drivers/nvmem/nintendo-otp.c | 124 ++++++++++++++++++ 6 files changed, 194 insertions(+), 1 deletion(-) create mode 100644 Documentation/devicetree/bindings/nvmem/nintendo-otp.yaml create mode 100644 drivers/nvmem/nintendo-otp.c -- 2.32.0