From patchwork Thu May 2 09:57:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 13651537 X-Patchwork-Delegate: geert@linux-m68k.org Received: from gauss.telenet-ops.be (gauss.telenet-ops.be [195.130.132.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 02F8E55C0A for ; Thu, 2 May 2024 10:05:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.130.132.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714644360; cv=none; b=rMnsd45RV86nfxDX1hjbL8+kLNU8xvXewtS8b8Z5BEwFARLouAYkoWa9WsF1JG6vAoOy9pd7ATNRQtaRWcLmpfGWzNWQ6S0SlJEqTioGT8d2IKximZejlbMfqCVSo+9DSA3+MZt/WxDUhoQwYl8IMYHuQUSrK+HwWaI6Wb/TGD4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714644360; c=relaxed/simple; bh=wtROmOjpsYU5GBY1Rlv4h8b3SmHRVtSwvGeJLTUi/fc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=CAJt2WPbim3O6xVtMFjhYXhN7VkuUBSOs8BdCL+QY4qmP14btr0CjVls92RXnbJYDLRfyG7MkJAE9nhehNIX3y4ZEiT5odw9PdPHh68wWBjJNw+Rw9pkObDT88VVHvhLLnVujfpMU70L7bJliNpe7fx3CyC2zDw6NdXvd2+SGgw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=glider.be; spf=none smtp.mailfrom=linux-m68k.org; arc=none smtp.client-ip=195.130.132.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=glider.be Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux-m68k.org Received: from albert.telenet-ops.be (albert.telenet-ops.be [IPv6:2a02:1800:110:4::f00:1a]) by gauss.telenet-ops.be (Postfix) with ESMTPS id 4VVTr052Ctz4wy8v for ; Thu, 02 May 2024 11:57:20 +0200 (CEST) Received: from ramsan.of.borg ([IPv6:2a02:1810:ac12:ed80:93f:7d7e:5c98:dabc]) by albert.telenet-ops.be with bizsmtp id J9xC2C0063PjoSD069xClr; Thu, 02 May 2024 11:57:12 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtp (Exim 4.95) (envelope-from ) id 1s2TAv-002nZC-S8; Thu, 02 May 2024 11:57:12 +0200 Received: from geert by rox.of.borg with local (Exim 4.95) (envelope-from ) id 1s2TBg-004jYE-3c; Thu, 02 May 2024 11:57:12 +0200 From: Geert Uytterhoeven To: Yoshihiro Shimoda Cc: linux-renesas-soc@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH/RFC 1/8] dt-bindings: fuse: Document R-Car E-FUSE / PFC Date: Thu, 2 May 2024 11:57:04 +0200 Message-Id: <9623b0aca13c640f2b6883e5a0e49beb97721ca2.1714642390.git.geert+renesas@glider.be> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-renesas-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Document support for E-FUSE non-volatile memory accessible through PFC on R-Car V3U and S4-8. Signed-off-by: Geert Uytterhoeven --- .../bindings/fuse/renesas,rcar-efuse.yaml | 55 +++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 Documentation/devicetree/bindings/fuse/renesas,rcar-efuse.yaml diff --git a/Documentation/devicetree/bindings/fuse/renesas,rcar-efuse.yaml b/Documentation/devicetree/bindings/fuse/renesas,rcar-efuse.yaml new file mode 100644 index 0000000000000000..d7e289244e72cce1 --- /dev/null +++ b/Documentation/devicetree/bindings/fuse/renesas,rcar-efuse.yaml @@ -0,0 +1,55 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/fuse/renesas,rcar-efuse.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: R-Car E-FUSE connected to PFC + +maintainers: + - Geert Uytterhoeven + +description: + The E-FUSE is a type of non-volatile memory, which is accessible through the + Pin Function Controller (PFC) on some R-Car Gen4 SoCs. + +properties: + compatible: + enum: + - renesas,r8a779a0-efuse # R-Car V3U + - renesas,r8a779f0-efuse # R-Car S4-8 + + reg: + maxItems: 1 + description: PFC System Group Fuse Control and Monitor register block + + clocks: + maxItems: 1 + + power-domains: + maxItems: 1 + + resets: + maxItems: 1 + +required: + - compatible + - reg + - clocks + - power-domains + - resets + +additionalProperties: false + +examples: + - | + #include + #include + + fuse: fuse@e6078800 { + compatible = "renesas,r8a779a0-efuse"; + reg = <0xe6078800 0x100>; + clocks = <&cpg CPG_MOD 916>; + power-domains = <&sysc R8A779A0_PD_ALWAYS_ON>; + resets = <&cpg 916>; + }; From patchwork Thu May 2 09:57:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 13651516 X-Patchwork-Delegate: geert@linux-m68k.org Received: from laurent.telenet-ops.be (laurent.telenet-ops.be [195.130.137.89]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 50CD756751 for ; Thu, 2 May 2024 09:57:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.130.137.89 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714643843; cv=none; b=bz/3MtCVm45iW5VUiwGY+zcjIgzR7UuZX9LY9NWW1ke3mGH0yXddKFpwEhpGXvhDD3IYFKHtUGCf8fZs+XUFMjHhqBd1hPvesgySpvcJQ2Y6QQb7BzJl+RDzyDuHfQ6iUxe5ZQpbJoakx/Vh15I0bRQGAX6lk2HUn5B+sG2gI+U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714643843; c=relaxed/simple; bh=2CmnMP9+6aPHmNHVKDiaYZ6UZcvqAaXkOYkViBVhAWM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=b1743r6RPrvdavrgPGkYbh3VhxBvH6R0Dn0PUVanWjXxcu4PsVifYLxWMJMQiWkJXKCgKNp4zVPzbr8LL6KKP/EluGSIrVQsTa/9Eg6LGCf0xQZL9BOQZvYnqZdyHbBpbYZWmuDsyPTvVUU8XgPR+KTml/VjUmUZwP8f61qsgFE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=glider.be; spf=none smtp.mailfrom=linux-m68k.org; arc=none smtp.client-ip=195.130.137.89 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=glider.be Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux-m68k.org Received: from ramsan.of.borg ([IPv6:2a02:1810:ac12:ed80:93f:7d7e:5c98:dabc]) by laurent.telenet-ops.be with bizsmtp id J9xC2C0093PjoSD019xC0F; Thu, 02 May 2024 11:57:12 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtp (Exim 4.95) (envelope-from ) id 1s2TAv-002nZE-Sa; Thu, 02 May 2024 11:57:12 +0200 Received: from geert by rox.of.borg with local (Exim 4.95) (envelope-from ) id 1s2TBg-004jYH-4P; Thu, 02 May 2024 11:57:12 +0200 From: Geert Uytterhoeven To: Yoshihiro Shimoda Cc: linux-renesas-soc@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH/RFC 2/8] dt-bindings: fuse: Document R-Car E-FUSE / OTP_MEM Date: Thu, 2 May 2024 11:57:05 +0200 Message-Id: <1bdad606a9c07df40d1c2fd77bbdad350a981aa1.1714642390.git.geert+renesas@glider.be> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-renesas-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Document support for E-FUSE non-volatile memory accessible through OTP_MEM on R-Car V4H and V4M. Signed-off-by: Geert Uytterhoeven --- .../bindings/fuse/renesas,rcar-otp.yaml | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 Documentation/devicetree/bindings/fuse/renesas,rcar-otp.yaml diff --git a/Documentation/devicetree/bindings/fuse/renesas,rcar-otp.yaml b/Documentation/devicetree/bindings/fuse/renesas,rcar-otp.yaml new file mode 100644 index 0000000000000000..d74872ae9ff378f9 --- /dev/null +++ b/Documentation/devicetree/bindings/fuse/renesas,rcar-otp.yaml @@ -0,0 +1,38 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/fuse/renesas,rcar-otp.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: R-Car E-FUSE connected to OTP_MEM + +maintainers: + - Geert Uytterhoeven + +description: + The E-FUSE is a type of non-volatile memory, which is accessible through the + One-Time Programmable Memory (OTP_MEM) module on some R-Car Gen4 SoCs. + +properties: + compatible: + enum: + - renesas,r8a779g0-otp # R-CarV4H + - renesas,r8a779h0-otp # R-CarV4M + + reg: + items: + - description: OTP_MEM_0 + - description: OTP_MEM_1 + +required: + - compatible + - reg + +additionalProperties: false + +examples: + - | + otp: otp@e61be000 { + compatible = "renesas,r8a779g0-otp"; + reg = <0xe61be000 0x1000>, <0xe61bf000 0x1000>; + }; From patchwork Thu May 2 09:57:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 13651533 X-Patchwork-Delegate: geert@linux-m68k.org Received: from weierstrass.telenet-ops.be (weierstrass.telenet-ops.be [195.130.137.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 45EFA59151 for ; Thu, 2 May 2024 10:03:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.130.137.81 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714644187; cv=none; b=qmSJSB08E1B/DVN5K6ha/kpF2DbhBHqZpnLKT/6tOStP1OygAMSHxWdx4oPvThvtkj6ALkM5uzoOdCNtJX1MJxf+9wikEghyPnbcItjmhTm6no2GCE2jGz2OJJSFDkcQVsX6G3BBo88CrHE+iUMvGyGEr7KgVd5hDTcmiMZBaYY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714644187; c=relaxed/simple; bh=fgRW8O7Ob8xSs2Nto4omNILH9dxRAq2SvaX2DmZGFCc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=k72u3jk7lYUjP3WDIs7upgnnlbVviurgkScLFFMUXK/Y3MyXrk4Vqjaf8aq22OFmuN6MphafM2Cl98ALztCC5Ft5SJVXwr100Gd5MSjBkTzZMmtztBta3z5/KabM8EmX/GH6Oq7kWPMmoyW2QlkwbhTzu4Cq71S/hcz9cQ9MceE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=glider.be; spf=none smtp.mailfrom=linux-m68k.org; arc=none smtp.client-ip=195.130.137.81 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=glider.be Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux-m68k.org Received: from xavier.telenet-ops.be (xavier.telenet-ops.be [IPv6:2a02:1800:120:4::f00:14]) by weierstrass.telenet-ops.be (Postfix) with ESMTPS id 4VVTr05PLtz4x6PS for ; Thu, 02 May 2024 11:57:20 +0200 (CEST) Received: from ramsan.of.borg ([IPv6:2a02:1810:ac12:ed80:93f:7d7e:5c98:dabc]) by xavier.telenet-ops.be with bizsmtp id J9xC2C0093PjoSD019xCHp; Thu, 02 May 2024 11:57:12 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtp (Exim 4.95) (envelope-from ) id 1s2TAv-002nZG-T6; Thu, 02 May 2024 11:57:12 +0200 Received: from geert by rox.of.borg with local (Exim 4.95) (envelope-from ) id 1s2TBg-004jYM-50; Thu, 02 May 2024 11:57:12 +0200 From: Geert Uytterhoeven To: Yoshihiro Shimoda Cc: linux-renesas-soc@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH/RFC 3/8] soc: renesas: Add R-Car fuse driver Date: Thu, 2 May 2024 11:57:06 +0200 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-renesas-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 R-Car Gen3/Gen4 SoCs contain fuses indicating hardware support or hardware parameters. Add a driver to access the state of the fuses. This supports three type of hardware fuse provides: 1. E-FUSE non-volatile memory accessible through the Pin Function Controller on R-Car V3U and S4-8, 2. E-FUSE non-volatile memory accessible through OTP_MEM on R-Car V4H and V4M, 3. Fuses tightly integrated with the Pin Function Controller on R-Car Gen3 SoCs. Types 1 and 2 use hardware descriptions in DT. Type 3 relies on a platform device with accompanying platform data, to be provided by the PFC driver. Two APIs are provided to read the state of the fuses: - An kernelspace API (rcar_fuse_read()), to be used by e.g. the Renesas UFSHCD driver, Symbolic register indices are provided for convenience. - A userspace API, using the NVMEM framework. Signed-off-by: Geert Uytterhoeven --- Questions: - Should the NVMEM support be made optional, relaxing the dependency on NVMEM? - Currently, the NVMEM access is restricted to the root user. Should his be relaxed? - On R-Car S4, the full space from RCAR_FUSE_MON0 to RCAR_LTM0_MON2 is exposed. Should this be split into separate blocks? --- drivers/soc/renesas/Kconfig | 8 + drivers/soc/renesas/Makefile | 1 + drivers/soc/renesas/rcar-fuse.c | 201 ++++++++++++++++++++++++ include/linux/platform_data/rcar_fuse.h | 11 ++ include/linux/soc/renesas/rcar-fuse.h | 41 +++++ 5 files changed, 262 insertions(+) create mode 100644 drivers/soc/renesas/rcar-fuse.c create mode 100644 include/linux/platform_data/rcar_fuse.h create mode 100644 include/linux/soc/renesas/rcar-fuse.h diff --git a/drivers/soc/renesas/Kconfig b/drivers/soc/renesas/Kconfig index 3125ab575b60b8d1..13aadcf1dec7b8b8 100644 --- a/drivers/soc/renesas/Kconfig +++ b/drivers/soc/renesas/Kconfig @@ -376,6 +376,14 @@ config ARCH_R9A07G043 endif # RISCV +config FUSE_RCAR + tristate "R-Car Fuse support" + depends on (ARCH_RENESAS && ARM64) || COMPILE_TEST + depends on NVMEM + help + Enable support for reading the fuses in the PFC, E-FUSE or OTP + non-volatile memory block on R-Car Gen3/Gen4 SoCs. + config PWC_RZV2M bool "Renesas RZ/V2M PWC support" if COMPILE_TEST diff --git a/drivers/soc/renesas/Makefile b/drivers/soc/renesas/Makefile index 725eedd9d73ceae7..8ff382a82ac94496 100644 --- a/drivers/soc/renesas/Makefile +++ b/drivers/soc/renesas/Makefile @@ -8,5 +8,6 @@ obj-$(CONFIG_ARCH_R9A06G032) += r9a06g032-smp.o endif # Family +obj-$(CONFIG_FUSE_RCAR) += rcar-fuse.o obj-$(CONFIG_PWC_RZV2M) += pwc-rzv2m.o obj-$(CONFIG_RST_RCAR) += rcar-rst.o diff --git a/drivers/soc/renesas/rcar-fuse.c b/drivers/soc/renesas/rcar-fuse.c new file mode 100644 index 0000000000000000..8fb2374f919b83e5 --- /dev/null +++ b/drivers/soc/renesas/rcar-fuse.c @@ -0,0 +1,201 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * R-Car Gen3/Gen4 E-FUSE/OTP Driver + * + * Copyright (C) 2024 Glider bv + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +struct rcar_fuse { + struct device *dev; + void __iomem *base; + unsigned int offset; + unsigned int nregs; + struct nvmem_device *nvmem; +}; + +struct rcar_fuse_data { + unsigned int bank; /* 0: PFC + E-FUSE, 1: OPT_MEM + E-FUSE */ + unsigned int offset; + unsigned int nregs; +}; + +/* NVMEM access must not use the rcar_fuse singleton */ +static int rcar_fuse_nvmem_read(void *priv, unsigned int offset, void *val, + size_t bytes) +{ + struct rcar_fuse *fuse = priv; + u32 *buf = val; + int ret; + + ret = pm_runtime_resume_and_get(fuse->dev); + if (ret < 0) + return ret; + + for (; bytes >= 4; bytes -= 4, offset += 4) + *buf++ = readl(fuse->base + fuse->offset + offset); + + pm_runtime_put(fuse->dev); + + return 0; +} + +static struct rcar_fuse *rcar_fuse; +static DEFINE_MUTEX(rcar_fuse_lock); /* Protects rcar_fuse singleton */ + +int rcar_fuse_read(unsigned int idx, u32 *val) +{ + int ret; + + guard(mutex)(&rcar_fuse_lock); + + if (!rcar_fuse) + return -EPROBE_DEFER; + + if (idx >= rcar_fuse->nregs) + return -EINVAL; + + ret = pm_runtime_resume_and_get(rcar_fuse->dev); + if (ret < 0) + return ret; + + *val = readl(rcar_fuse->base + rcar_fuse->offset + idx * sizeof(u32)); + + pm_runtime_put(rcar_fuse->dev); + + return 0; +} +EXPORT_SYMBOL_GPL(rcar_fuse_read); + +static int rcar_fuse_probe(struct platform_device *pdev) +{ + const struct rcar_fuse_platform_data *pdata; + const struct rcar_fuse_data *data; + struct device *dev = &pdev->dev; + struct nvmem_config nvmem; + struct rcar_fuse *fuse; + int ret; + + guard(mutex)(&rcar_fuse_lock); + + if (rcar_fuse) + return -EEXIST; + + ret = devm_pm_runtime_enable(dev); + if (ret < 0) + return ret; + + fuse = devm_kzalloc(dev, sizeof(*fuse), GFP_KERNEL); + if (!fuse) + return -ENOMEM; + + fuse->dev = dev; + + data = device_get_match_data(dev); + if (!data) { + /* Fuse block integrated into PFC */ + pdata = dev->platform_data; + if (!pdata) + return -EINVAL; + + fuse->base = pdata->base; + fuse->offset = pdata->offset; + fuse->nregs = pdata->nregs; + } else { + /* PFC + E-FUSE or OTP_MEM + E-FUSE */ + fuse->base = devm_platform_ioremap_resource(pdev, data->bank); + if (IS_ERR(fuse->base)) + return PTR_ERR(fuse->base); + + fuse->offset = data->offset; + fuse->nregs = data->nregs; + }; + + memset(&nvmem, 0, sizeof(nvmem)); + nvmem.dev = dev; + nvmem.name = "fuse"; + nvmem.id = -1; + nvmem.owner = THIS_MODULE; + nvmem.type = NVMEM_TYPE_OTP; + nvmem.read_only = true; + nvmem.root_only = true; + nvmem.reg_read = rcar_fuse_nvmem_read; + nvmem.size = fuse->nregs * 4; + nvmem.word_size = 4; + nvmem.stride = 4; + nvmem.priv = fuse; + + fuse->nvmem = devm_nvmem_register(dev, &nvmem); + if (IS_ERR(fuse->nvmem)) + return dev_err_probe(dev, PTR_ERR(fuse->nvmem), + "failed to register NVMEM device\n"); + + rcar_fuse = fuse; + + return 0; +} + +static void rcar_fuse_remove(struct platform_device *pdev) +{ + guard(mutex)(&rcar_fuse_lock); + + rcar_fuse = NULL; +} + +static const struct rcar_fuse_data rcar_fuse_v3u = { + .bank = 0, + .offset = 0xc0, + .nregs = 10, +}; + +static const struct rcar_fuse_data rcar_fuse_s4 = { + .bank = 0, + .offset = 0xc0, + .nregs = 35, +}; + +static const struct rcar_fuse_data rcar_fuse_v4h = { + .bank = 1, + .offset = 0x100, + .nregs = 40 +}; + +static const struct rcar_fuse_data rcar_fuse_v4m = { + .bank = 1, + .offset = 0x100, + .nregs = 4, +}; + +static const struct of_device_id rcar_fuse_match[] = { + { .compatible = "renesas,r8a779a0-efuse", .data = &rcar_fuse_v3u }, + { .compatible = "renesas,r8a779f0-efuse", .data = &rcar_fuse_s4 }, + { .compatible = "renesas,r8a779g0-otp", .data = &rcar_fuse_v4h }, + { .compatible = "renesas,r8a779h0-otp", .data = &rcar_fuse_v4m }, + { /* sentinel */ } +}; + +static struct platform_driver rcar_fuse_driver = { + .probe = rcar_fuse_probe, + .remove_new = rcar_fuse_remove, + .driver = { + .name = "rcar_fuse", + .of_match_table = rcar_fuse_match, + }, +}; +module_platform_driver(rcar_fuse_driver); + +MODULE_DESCRIPTION("Renesas R-Car E-FUSE/OTP driver"); +MODULE_LICENSE("GPL"); +MODULE_AUTHOR("Geert Uytterhoeven"); diff --git a/include/linux/platform_data/rcar_fuse.h b/include/linux/platform_data/rcar_fuse.h new file mode 100644 index 0000000000000000..07933336b5f4e668 --- /dev/null +++ b/include/linux/platform_data/rcar_fuse.h @@ -0,0 +1,11 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#ifndef __LINUX_PLATFORM_DATA_RCAR_FUSE_H__ +#define __LINUX_PLATFORM_DATA_RCAR_FUSE_H__ + +struct rcar_fuse_platform_data { + void __iomem *base; + unsigned int offset; + unsigned int nregs; +}; + +#endif /* __LINUX_PLATFORM_DATA_RCAR_FUSE_H__ */ diff --git a/include/linux/soc/renesas/rcar-fuse.h b/include/linux/soc/renesas/rcar-fuse.h new file mode 100644 index 0000000000000000..37fc23ef74057066 --- /dev/null +++ b/include/linux/soc/renesas/rcar-fuse.h @@ -0,0 +1,41 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#ifndef __LINUX_SOC_RENESAS_RCAR_FUSE_H__ +#define __LINUX_SOC_RENESAS_RCAR_FUSE_H__ + +#define RCAR_FUSE_MON0 0 +#define RCAR_FUSE_MON1 1 +#define RCAR_FUSE_MON2 2 +#define RCAR_FUSE_MON3 3 +#define RCAR_FUSE_MON4 4 +#define RCAR_FUSE_MON5 5 +#define RCAR_FUSE_MON6 6 +#define RCAR_FUSE_MON7 7 +#define RCAR_FUSE_MON8 8 +#define RCAR_FUSE_MON9 9 + +#define RCAR_LTM0_MON0 32 +#define RCAR_LTM0_MON1 33 +#define RCAR_LTM0_MON2 34 + +#define RCAR_OTPMONITOR0 0 +#define RCAR_OTPMONITOR3 3 +#define RCAR_OTPMONITOR28 28 +#define RCAR_OTPMONITOR32 32 +#define RCAR_OTPMONITOR33 33 +#define RCAR_OTPMONITOR34 34 +#define RCAR_OTPMONITOR35 35 +#define RCAR_OTPMONITOR36 36 +#define RCAR_OTPMONITOR37 37 +#define RCAR_OTPMONITOR38 38 +#define RCAR_OTPMONITOR39 39 + +#if IS_ENABLED(CONFIG_FUSE_RCAR) +int rcar_fuse_read(unsigned int idx, u32 *val); +#else +static inline int rcar_fuse_read(unsigned int idx, u32 *val) +{ + return -ENODEV; +} +#endif + +#endif /* __LINUX_SOC_RENESAS_RCAR_FUSE_H__ */ From patchwork Thu May 2 09:57:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 13651517 X-Patchwork-Delegate: geert@linux-m68k.org Received: from michel.telenet-ops.be (michel.telenet-ops.be [195.130.137.88]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5219356753 for ; Thu, 2 May 2024 09:57:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.130.137.88 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714643844; cv=none; b=pOuMSDVtP4twvYHkFyPajpOl7U2roSXG3yUNsLGt1T48en7qM6x+mqDWrK1VwYNTfufVy7FUHl9kKe60H9Gi3G1Vtetgv9GIpYboUryFTqw6q/pm1mVbW2pngARebFuyJX0cw0FfazIRE6hOu54ce/GFlgOf6x3wR5wK+yma7yM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714643844; c=relaxed/simple; bh=QLj8qX+7jOXeRft9LOlGkWyRXTUDkvHAHKBlpTuS7Xo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=aRk7prSzODlau1wxCF+CKLJ535TBMyjX5bFUQ9jx7zAuDZkWgLEMgI10WqYFpoaqYbYn3xVzat8QIQs5BZRO7EnHRpPnI5nLAluS+8gnXTho7QJuaeQ2IxwE/qd0kxnnSSr1XmXcmS8jR9NsNs5e20ZmSDa1hsRjFThe13fY/Xc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=glider.be; spf=none smtp.mailfrom=linux-m68k.org; arc=none smtp.client-ip=195.130.137.88 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=glider.be Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux-m68k.org Received: from ramsan.of.borg ([IPv6:2a02:1810:ac12:ed80:93f:7d7e:5c98:dabc]) by michel.telenet-ops.be with bizsmtp id J9xC2C0063PjoSD069xCJB; Thu, 02 May 2024 11:57:12 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtp (Exim 4.95) (envelope-from ) id 1s2TAv-002nZK-Ti; Thu, 02 May 2024 11:57:12 +0200 Received: from geert by rox.of.borg with local (Exim 4.95) (envelope-from ) id 1s2TBg-004jYQ-5c; Thu, 02 May 2024 11:57:12 +0200 From: Geert Uytterhoeven To: Yoshihiro Shimoda Cc: linux-renesas-soc@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH/RFC 4/8] pinctrl: renesas: Add R-Car Gen3 fuse support Date: Thu, 2 May 2024 11:57:07 +0200 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-renesas-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 On R-Car Gen3 SoCs, the fuse registers are tightly integrated into the Pin Function Controller. Add support for them by providing the rcar-fuse driver with all needed info through a platform device and platform data. Note that the number of fuse registers on R-Car V3H and V3H2 differs, while their PFC blocks use the same compatible value, hence this is handled by checking the top-level compatible value. Signed-off-by: Geert Uytterhoeven --- FUSE_MON[1-3] on R-Car V3M were only briefly documented in Hardware User's Manual Rev. 0.52/0.53 --- drivers/pinctrl/renesas/core.c | 18 ++++++++++++++++++ drivers/pinctrl/renesas/pfc-r8a77951.c | 2 ++ drivers/pinctrl/renesas/pfc-r8a7796.c | 4 ++++ drivers/pinctrl/renesas/pfc-r8a77965.c | 2 ++ drivers/pinctrl/renesas/pfc-r8a77970.c | 2 ++ drivers/pinctrl/renesas/pfc-r8a77980.c | 14 +++++++++++++- drivers/pinctrl/renesas/pfc-r8a77990.c | 2 ++ drivers/pinctrl/renesas/pfc-r8a77995.c | 2 ++ drivers/pinctrl/renesas/sh_pfc.h | 4 +++- 9 files changed, 48 insertions(+), 2 deletions(-) diff --git a/drivers/pinctrl/renesas/core.c b/drivers/pinctrl/renesas/core.c index 96d6040a8871419b..1c8447fcfb1180e3 100644 --- a/drivers/pinctrl/renesas/core.c +++ b/drivers/pinctrl/renesas/core.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -27,6 +28,8 @@ #include "core.h" +#define FUSE_MON0 0x3e4 /* R-Car Gen3 */ + static int sh_pfc_map_resources(struct sh_pfc *pfc, struct platform_device *pdev) { @@ -1372,6 +1375,21 @@ static int sh_pfc_probe(struct platform_device *pdev) } #endif + if (pfc->info->nr_fuse_regs) { + struct rcar_fuse_platform_data pdata = { + .base = pfc->windows[0].virt, + .offset = FUSE_MON0, + .nregs = pfc->info->nr_fuse_regs, + }; + struct platform_device *fdev; + + fdev = platform_device_register_data(pfc->dev, "rcar_fuse", -1, + &pdata, sizeof(pdata)); + if (IS_ERR(fdev)) + dev_err_probe(pfc->dev, PTR_ERR(fdev), + "failed to register fuses, ignoring\n"); + } + platform_set_drvdata(pdev, pfc); dev_info(pfc->dev, "%s support registered\n", info->name); diff --git a/drivers/pinctrl/renesas/pfc-r8a77951.c b/drivers/pinctrl/renesas/pfc-r8a77951.c index a1d74f61fd8cce64..ae60bc5f70f0c223 100644 --- a/drivers/pinctrl/renesas/pfc-r8a77951.c +++ b/drivers/pinctrl/renesas/pfc-r8a77951.c @@ -6187,5 +6187,7 @@ const struct sh_pfc_soc_info r8a77951_pinmux_info = { .pinmux_data = pinmux_data, .pinmux_data_size = ARRAY_SIZE(pinmux_data), + + .nr_fuse_regs = 1, }; #endif diff --git a/drivers/pinctrl/renesas/pfc-r8a7796.c b/drivers/pinctrl/renesas/pfc-r8a7796.c index 807834f319f07d8c..b1ebd9a0b612e5b8 100644 --- a/drivers/pinctrl/renesas/pfc-r8a7796.c +++ b/drivers/pinctrl/renesas/pfc-r8a7796.c @@ -6139,6 +6139,8 @@ const struct sh_pfc_soc_info r8a77960_pinmux_info = { .pinmux_data = pinmux_data, .pinmux_data_size = ARRAY_SIZE(pinmux_data), + + .nr_fuse_regs = 1, }; #endif @@ -6166,5 +6168,7 @@ const struct sh_pfc_soc_info r8a77961_pinmux_info = { .pinmux_data = pinmux_data, .pinmux_data_size = ARRAY_SIZE(pinmux_data), + + .nr_fuse_regs = 1, }; #endif diff --git a/drivers/pinctrl/renesas/pfc-r8a77965.c b/drivers/pinctrl/renesas/pfc-r8a77965.c index e7c88a5d983f4343..47f9843a336225ac 100644 --- a/drivers/pinctrl/renesas/pfc-r8a77965.c +++ b/drivers/pinctrl/renesas/pfc-r8a77965.c @@ -6380,5 +6380,7 @@ const struct sh_pfc_soc_info r8a77965_pinmux_info = { .pinmux_data = pinmux_data, .pinmux_data_size = ARRAY_SIZE(pinmux_data), + + .nr_fuse_regs = 1, }; #endif diff --git a/drivers/pinctrl/renesas/pfc-r8a77970.c b/drivers/pinctrl/renesas/pfc-r8a77970.c index e1b3e3b38ec3b864..688fe31c5b98ac14 100644 --- a/drivers/pinctrl/renesas/pfc-r8a77970.c +++ b/drivers/pinctrl/renesas/pfc-r8a77970.c @@ -2557,4 +2557,6 @@ const struct sh_pfc_soc_info r8a77970_pinmux_info = { .pinmux_data = pinmux_data, .pinmux_data_size = ARRAY_SIZE(pinmux_data), + + .nr_fuse_regs = 4, }; diff --git a/drivers/pinctrl/renesas/pfc-r8a77980.c b/drivers/pinctrl/renesas/pfc-r8a77980.c index 877134d78c7e50c6..085eb6090420d013 100644 --- a/drivers/pinctrl/renesas/pfc-r8a77980.c +++ b/drivers/pinctrl/renesas/pfc-r8a77980.c @@ -15,6 +15,7 @@ #include #include #include +#include #include "sh_pfc.h" @@ -3048,13 +3049,22 @@ static const struct pinmux_bias_reg pinmux_bias_regs[] = { { /* sentinel */ } }; +static int r8a77980_pinmux_init(struct sh_pfc *pfc) +{ + if (of_machine_is_compatible("renesas,r8a77980a")) + r8a77980_pinmux_info.nr_fuse_regs = 5; + + return 0; +} + static const struct sh_pfc_soc_operations r8a77980_pfc_ops = { + .init = r8a77980_pinmux_init, .pin_to_pocctrl = r8a77980_pin_to_pocctrl, .get_bias = rcar_pinmux_get_bias, .set_bias = rcar_pinmux_set_bias, }; -const struct sh_pfc_soc_info r8a77980_pinmux_info = { +struct sh_pfc_soc_info r8a77980_pinmux_info = { .name = "r8a77980_pfc", .ops = &r8a77980_pfc_ops, .unlock_reg = 0xe6060000, /* PMMR */ @@ -3074,4 +3084,6 @@ const struct sh_pfc_soc_info r8a77980_pinmux_info = { .pinmux_data = pinmux_data, .pinmux_data_size = ARRAY_SIZE(pinmux_data), + + .nr_fuse_regs = 1, }; diff --git a/drivers/pinctrl/renesas/pfc-r8a77990.c b/drivers/pinctrl/renesas/pfc-r8a77990.c index 262390dd7d67a101..748b9198d1efd820 100644 --- a/drivers/pinctrl/renesas/pfc-r8a77990.c +++ b/drivers/pinctrl/renesas/pfc-r8a77990.c @@ -5336,5 +5336,7 @@ const struct sh_pfc_soc_info r8a77990_pinmux_info = { .pinmux_data = pinmux_data, .pinmux_data_size = ARRAY_SIZE(pinmux_data), + + .nr_fuse_regs = 1, }; #endif diff --git a/drivers/pinctrl/renesas/pfc-r8a77995.c b/drivers/pinctrl/renesas/pfc-r8a77995.c index 298e7a07e4934e67..f9003b8236a8881e 100644 --- a/drivers/pinctrl/renesas/pfc-r8a77995.c +++ b/drivers/pinctrl/renesas/pfc-r8a77995.c @@ -3193,4 +3193,6 @@ const struct sh_pfc_soc_info r8a77995_pinmux_info = { .pinmux_data = pinmux_data, .pinmux_data_size = ARRAY_SIZE(pinmux_data), + + .nr_fuse_regs = 1, }; diff --git a/drivers/pinctrl/renesas/sh_pfc.h b/drivers/pinctrl/renesas/sh_pfc.h index 0061e96400598e49..ce9b591a275ffbd3 100644 --- a/drivers/pinctrl/renesas/sh_pfc.h +++ b/drivers/pinctrl/renesas/sh_pfc.h @@ -290,6 +290,8 @@ struct sh_pfc_soc_info { unsigned int pinmux_data_size; u32 unlock_reg; /* can be literal address or mask */ + + unsigned int nr_fuse_regs; }; extern const struct sh_pfc_soc_info emev2_pinmux_info; @@ -316,7 +318,7 @@ extern const struct sh_pfc_soc_info r8a77960_pinmux_info; extern const struct sh_pfc_soc_info r8a77961_pinmux_info; extern const struct sh_pfc_soc_info r8a77965_pinmux_info; extern const struct sh_pfc_soc_info r8a77970_pinmux_info; -extern const struct sh_pfc_soc_info r8a77980_pinmux_info; +extern struct sh_pfc_soc_info r8a77980_pinmux_info; extern const struct sh_pfc_soc_info r8a77990_pinmux_info; extern const struct sh_pfc_soc_info r8a77995_pinmux_info; extern const struct sh_pfc_soc_info r8a779a0_pinmux_info; From patchwork Thu May 2 09:57:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 13651518 X-Patchwork-Delegate: geert@linux-m68k.org Received: from michel.telenet-ops.be (michel.telenet-ops.be [195.130.137.88]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7868756770 for ; Thu, 2 May 2024 09:57:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.130.137.88 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714643844; cv=none; b=lyl+2PEqFhrgZWJzwgzrShkx2h3R6KdbeK+6dwfqB7QflzmzsHh9+tuiG596pr5QOITyQaSqzt7xjdlYZADDZx76iTmOicq86nKlwZK8lGBWvHJza5diY0rALgjH6R659rywN2umm1wMEMFYLbpeHM7C75tN2wNDKugSXLqxv9w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714643844; c=relaxed/simple; bh=jAJv4tcMRuN6EOgJM/ak6xYzvJBS5Vr0jKxw2W+C6Ig=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=sOoYDg6YYDL7ae4dzraY0c0pXh3CMuHP2GfoBVYj1OPY2wJhTUSCxv7NXBjPC9CJ1sNJa5vQp6atcIsNENkW9q8eniALRdLBP4/pbVnK/nUICAAcFsPvQ7b2XaCI5ULXwdSEhvd/D8T4V2sQuUFrGFiWRAmrTk82c95DmQv05Dk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=glider.be; spf=none smtp.mailfrom=linux-m68k.org; arc=none smtp.client-ip=195.130.137.88 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=glider.be Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux-m68k.org Received: from ramsan.of.borg ([IPv6:2a02:1810:ac12:ed80:93f:7d7e:5c98:dabc]) by michel.telenet-ops.be with bizsmtp id J9xC2C0083PjoSD069xCJC; Thu, 02 May 2024 11:57:12 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtp (Exim 4.95) (envelope-from ) id 1s2TAv-002nZP-UK; Thu, 02 May 2024 11:57:12 +0200 Received: from geert by rox.of.borg with local (Exim 4.95) (envelope-from ) id 1s2TBg-004jYU-6C; Thu, 02 May 2024 11:57:12 +0200 From: Geert Uytterhoeven To: Yoshihiro Shimoda Cc: linux-renesas-soc@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH/RFC 5/8] arm64: dts: renesas: r8a779a0: Add E-FUSE node Date: Thu, 2 May 2024 11:57:08 +0200 Message-Id: <80dffb3b93a2952f2da1bedd67d7f9080fd8e108.1714642390.git.geert+renesas@glider.be> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-renesas-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Add a device node for the System Group Fuse Control and Monitor block of the Pin Function Controller (PFC) on the R-Car V3U (R8A779A0) SoC, which provides E-FUSE services. Signed-off-by: Geert Uytterhoeven --- Assuming the Fuse Control and Monitor block is driven by the same module clock as GPIO Group 0. --- arch/arm64/boot/dts/renesas/r8a779a0.dtsi | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/arch/arm64/boot/dts/renesas/r8a779a0.dtsi b/arch/arm64/boot/dts/renesas/r8a779a0.dtsi index cfa70b441e329a0b..1abe92c98358eddb 100644 --- a/arch/arm64/boot/dts/renesas/r8a779a0.dtsi +++ b/arch/arm64/boot/dts/renesas/r8a779a0.dtsi @@ -245,6 +245,14 @@ gpio9: gpio@e6069980 { #interrupt-cells = <2>; }; + fuse: fuse@e6078800 { + compatible = "renesas,r8a779a0-efuse"; + reg = <0 0xe6078800 0 0x100>; + clocks = <&cpg CPG_MOD 916>; + power-domains = <&sysc R8A779A0_PD_ALWAYS_ON>; + resets = <&cpg 916>; + }; + cmt0: timer@e60f0000 { compatible = "renesas,r8a779a0-cmt0", "renesas,rcar-gen4-cmt0"; From patchwork Thu May 2 09:57:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 13651535 X-Patchwork-Delegate: geert@linux-m68k.org Received: from riemann.telenet-ops.be (riemann.telenet-ops.be [195.130.137.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E51175647B for ; Thu, 2 May 2024 10:03:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.130.137.80 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714644211; cv=none; b=BPejNloA+tSv+ehsL4WlEajyO8rEg1z0uT7Fps+/OHjksOQ572Ggi06yhmrbv+Q91CbHbICUmxAhXEC+ISGevEL5tSfOVCkqwd7gX38nDQgdSvZnIkhI/VhsZzCIhvoa6Zme1x8PeayGF0MelYSST8iXiUpQXgIr39UqFqXUiqc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714644211; c=relaxed/simple; bh=+zle50mb2cC/5Szf6CPvqyL/XqLgtEFsClJr1q+p58Q=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=FRYNdah4MLpXfJAIL1mViupG9WSQAcTe3uk/YwBkT/gK3Rp5UBIcge2fvw30gDhO5Q06WiS40WRwksgjSjpvUd/rMAgUUHC42bR/XwlLgIWATkxGSMNCEjN+2fGMPFODROUl5U1J+0D0i0I97sV8sHbyGaGLzCaKKliOi7Z9RmM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=glider.be; spf=none smtp.mailfrom=linux-m68k.org; arc=none smtp.client-ip=195.130.137.80 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=glider.be Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux-m68k.org Received: from xavier.telenet-ops.be (xavier.telenet-ops.be [IPv6:2a02:1800:120:4::f00:14]) by riemann.telenet-ops.be (Postfix) with ESMTPS id 4VVTr05J3wz4x1Fq for ; Thu, 02 May 2024 11:57:20 +0200 (CEST) Received: from ramsan.of.borg ([IPv6:2a02:1810:ac12:ed80:93f:7d7e:5c98:dabc]) by xavier.telenet-ops.be with bizsmtp id J9xC2C00D3PjoSD019xCHq; Thu, 02 May 2024 11:57:12 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtp (Exim 4.95) (envelope-from ) id 1s2TAv-002nZW-V0; Thu, 02 May 2024 11:57:12 +0200 Received: from geert by rox.of.borg with local (Exim 4.95) (envelope-from ) id 1s2TBg-004jYY-6o; Thu, 02 May 2024 11:57:12 +0200 From: Geert Uytterhoeven To: Yoshihiro Shimoda Cc: linux-renesas-soc@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH/RFC 6/8] arm64: dts: renesas: r8a779g0: Add E-FUSE node Date: Thu, 2 May 2024 11:57:09 +0200 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-renesas-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Add a device node for the System Group Fuse Control and Monitor block of the Pin Function Controller (PFC) on the R-Car S4-8 (R8A779F0) SoC, which provides E-FUSE services. Signed-off-by: Geert Uytterhoeven --- Assuming the Fuse Control and Monitor block is driven by the same module clock as GPIO Group 0. --- arch/arm64/boot/dts/renesas/r8a779f0.dtsi | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/arch/arm64/boot/dts/renesas/r8a779f0.dtsi b/arch/arm64/boot/dts/renesas/r8a779f0.dtsi index 72cf30341fc4d63e..48390654e172bd5d 100644 --- a/arch/arm64/boot/dts/renesas/r8a779f0.dtsi +++ b/arch/arm64/boot/dts/renesas/r8a779f0.dtsi @@ -377,6 +377,14 @@ gpio3: gpio@e6051980 { #interrupt-cells = <2>; }; + fuse: fuse@e6078800 { + compatible = "renesas,r8a779f0-efuse"; + reg = <0 0xe6078800 0 0x100>; + clocks = <&cpg CPG_MOD 915>; + power-domains = <&sysc R8A779F0_PD_ALWAYS_ON>; + resets = <&cpg 915>; + }; + cmt0: timer@e60f0000 { compatible = "renesas,r8a779f0-cmt0", "renesas,rcar-gen4-cmt0"; From patchwork Thu May 2 09:57:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 13651515 X-Patchwork-Delegate: geert@linux-m68k.org Received: from andre.telenet-ops.be (andre.telenet-ops.be [195.130.132.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 69A625676F for ; Thu, 2 May 2024 09:57:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.130.132.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714643843; cv=none; b=JG+VgHk5pnykT63zKPA9yEzuWABVPXG6lkyMpFiMrTicuEJj57qTLRs70tMmA0GctdtCopJk3Qd8v6cyf24/55FdxaI6+PcQP09xcO6UP6aDfrvdS1uiW8t4eyHY6Jus0Rq/IjUNWUPbwLI7IWrQQ501NVBzCQ22zYlhh2YjsXk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714643843; c=relaxed/simple; bh=i3bcuMyG4AM1MOLlMIZI1V5ciCzZ7sDRQNyXhrrOjzU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=BO6Xq/eMDwBdbRApBAyrRfbpfO8DdlGgGuJ23/WqTWSrg9lXA1KHdN8NA8y5NFBbM+WX/4ZKCMlTnmCCRfc53bDKMGIAo56cmDTp5vvnKiVyKrunWp9TZMeBa533sk38HxURrZVvHXXU9vXWHrlfBVqzc/SML7pikm2MLmH0w8E= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=glider.be; spf=none smtp.mailfrom=linux-m68k.org; arc=none smtp.client-ip=195.130.132.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=glider.be Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux-m68k.org Received: from ramsan.of.borg ([IPv6:2a02:1810:ac12:ed80:93f:7d7e:5c98:dabc]) by andre.telenet-ops.be with bizsmtp id J9xC2C00H3PjoSD019xCxQ; Thu, 02 May 2024 11:57:12 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtp (Exim 4.95) (envelope-from ) id 1s2TAv-002nZZ-Vh; Thu, 02 May 2024 11:57:12 +0200 Received: from geert by rox.of.borg with local (Exim 4.95) (envelope-from ) id 1s2TBg-004jYc-7P; Thu, 02 May 2024 11:57:12 +0200 From: Geert Uytterhoeven To: Yoshihiro Shimoda Cc: linux-renesas-soc@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH/RFC 7/8] arm64: dts: renesas: r8a779g0: Add OTP_MEM node Date: Thu, 2 May 2024 11:57:10 +0200 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-renesas-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Add a device node for the OTP non-volatile memory on the R-Car V4H (R8A779G0) SoC, which provides E-FUSE services. Signed-off-by: Geert Uytterhoeven --- arch/arm64/boot/dts/renesas/r8a779g0.dtsi | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/arm64/boot/dts/renesas/r8a779g0.dtsi b/arch/arm64/boot/dts/renesas/r8a779g0.dtsi index 9bc542bc616909d1..0f9ab81ce289409a 100644 --- a/arch/arm64/boot/dts/renesas/r8a779g0.dtsi +++ b/arch/arm64/boot/dts/renesas/r8a779g0.dtsi @@ -463,6 +463,11 @@ tsc: thermal@e6198000 { #thermal-sensor-cells = <1>; }; + otp: otp@e61be000 { + compatible = "renesas,r8a779g0-otp"; + reg = <0 0xe61be000 0 0x1000>, <0 0xe61bf000 0 0x1000>; + }; + intc_ex: interrupt-controller@e61c0000 { compatible = "renesas,intc-ex-r8a779g0", "renesas,irqc"; #interrupt-cells = <2>; From patchwork Thu May 2 09:57:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 13651514 X-Patchwork-Delegate: geert@linux-m68k.org Received: from baptiste.telenet-ops.be (baptiste.telenet-ops.be [195.130.132.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 058B85674B for ; Thu, 2 May 2024 09:57:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.130.132.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714643843; cv=none; b=Oaydi8qULGXMTW6NAa2UiN0SMJQ8+Kxw5NeDrZorKZIgGB4pyzQiS0/McAPq2h3/+D7T2/HuGhZ02lRSz90Ozd68Y7JOAzrnhnUqThQvc54tMaswSwiUb5U4r7MF9S/0LSdP1DsEzB9RBYIxLVJx7Ow3iuRitYdQcPmILeipQQk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714643843; c=relaxed/simple; bh=ekClIaVeU7FniI7QxtD2BQawc20SAF5Bd0LNDcoSWXs=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=B/nXQtf2VHXvbKRFVvyiP4Fm3U5ODtFMYiEvDVBfBLS9caKMJpuP1z+sRPXHzz+zIFfcgOgXE9RdtqG4RM3/2ECt7hPWOhgpKpjIfvu5f1ENr3SzmzI7R+g9N3cQS760EufpsPSZYp28Tkz+ZTh/cNlIgpnUz/NkeqOfHhs5Q1g= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=glider.be; spf=none smtp.mailfrom=linux-m68k.org; arc=none smtp.client-ip=195.130.132.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=glider.be Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux-m68k.org Received: from ramsan.of.borg ([IPv6:2a02:1810:ac12:ed80:93f:7d7e:5c98:dabc]) by baptiste.telenet-ops.be with bizsmtp id J9xC2C0083PjoSD019xCKA; Thu, 02 May 2024 11:57:12 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtp (Exim 4.95) (envelope-from ) id 1s2TAw-002nZe-0s; Thu, 02 May 2024 11:57:12 +0200 Received: from geert by rox.of.borg with local (Exim 4.95) (envelope-from ) id 1s2TBg-004jYj-87; Thu, 02 May 2024 11:57:12 +0200 From: Geert Uytterhoeven To: Yoshihiro Shimoda Cc: linux-renesas-soc@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH/RFC 8/8] arm64: dts: renesas: r8a779h0: Add OTP_MEM node Date: Thu, 2 May 2024 11:57:11 +0200 Message-Id: <4139a68854d258a8f989900cb75d51a2a496df27.1714642390.git.geert+renesas@glider.be> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-renesas-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Add a device node for the OTP non-volatile memory on the R-Car V4M (R8A779H0) SoC, which provides E-FUSE services. Signed-off-by: Geert Uytterhoeven --- arch/arm64/boot/dts/renesas/r8a779h0.dtsi | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/arm64/boot/dts/renesas/r8a779h0.dtsi b/arch/arm64/boot/dts/renesas/r8a779h0.dtsi index 6d791024cabe1b94..ea3d2b2de10b2999 100644 --- a/arch/arm64/boot/dts/renesas/r8a779h0.dtsi +++ b/arch/arm64/boot/dts/renesas/r8a779h0.dtsi @@ -404,6 +404,11 @@ tsc: thermal@e6198000 { #thermal-sensor-cells = <1>; }; + otp: otp@e61be000 { + compatible = "renesas,r8a779h0-otp"; + reg = <0 0xe61be000 0 0x1000>, <0 0xe61bf000 0 0x1000>; + }; + intc_ex: interrupt-controller@e61c0000 { compatible = "renesas,intc-ex-r8a779h0", "renesas,irqc"; #interrupt-cells = <2>;