From nobody Thu Nov 28 08:41:08 2024 Received: from albert.telenet-ops.be (albert.telenet-ops.be [195.130.137.90]) (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 37C1F19CC27 for ; Thu, 3 Oct 2024 14:04:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.130.137.90 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727964283; cv=none; b=J0VyLk6uES3QAPCMpiC3Fm0I37jQvlxQ6YoZgQR22I2VXpgWPL9/RAH/nJ+kPmG7NmOweBhJT2WjuS8okiU0AEmw0zQZwXbA4OvSy2IZSJ+W9mrncVbcezBZgLZ98jJ7S3dyHT017VZh/8V0BzSXmWiVyMVDo0/X4OiR3jzQkJk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727964283; c=relaxed/simple; bh=47fe7Fwb0yXTDKoNl2wd/u4e8OnEK9iPFbqci4doMh0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=siyOslFEfmPq007cJpnH4BHp8iMFPFOx7zkxl/N0lCz4FbmrRoj/tsLmEj04WtbX8+fSeLfjLBRyEBQIPSAE+oHDhN/EPSa84Z9ngmVBWik2D445qXMA3tgavzzydE2GtPQzkamSUsqfPrKP4wCJPKvVaVzDGC18/8vCw5rNciw= 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.90 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:d4db:7463:4f08:3c82]) by albert.telenet-ops.be with cmsmtp id Kq4d2D00J5K8SYz06q4d4G; Thu, 03 Oct 2024 16:04:39 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtp (Exim 4.95) (envelope-from ) id 1swMRR-001CGk-74; Thu, 03 Oct 2024 16:04:37 +0200 Received: from geert by rox.of.borg with local (Exim 4.95) (envelope-from ) id 1swMRZ-006e9w-F1; Thu, 03 Oct 2024 16:04:37 +0200 From: Geert Uytterhoeven To: Srinivas Kandagatla , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Magnus Damm , Yoshihiro Shimoda , Arnd Bergmann Cc: devicetree@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH v3 resend 5/7] arm64: dts: renesas: r8a779f4: Add UFS tuning parameters in E-FUSE Date: Thu, 3 Oct 2024 16:04:29 +0200 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Describe the location in the E-FUSE block of the PLL and AFE tuning parameters for the Universal Flash Storage controller. Signed-off-by: Geert Uytterhoeven --- v3: - New. After adding: &ufs { nvmem-cells =3D <&ufs_tune>; nvmem-cell-names =3D "calibration"; }; The calibration data can be retrieved using the following sample code: #include static int nvmem_dump_cell(struct platform_device *pdev, const char *na= me) { struct device *dev =3D &pdev->dev; struct nvmem_cell *cell; int res =3D 0; void *data; size_t len; cell =3D nvmem_cell_get(dev, name); if (IS_ERR(cell)) return dev_err_probe(dev, PTR_ERR(cell), "Failed to get cell %s\n", name); data =3D nvmem_cell_read(cell, &len); if (IS_ERR(data)) { res =3D dev_err_probe(dev, PTR_ERR(data), "Failed to read cell %s\n", name); goto put; } pr_info("Cell %s contains %zu bytes of data\n", name, len); print_hex_dump(KERN_INFO, "| ", DUMP_PREFIX_NONE, 32, 1, data, len, 0); kfree(data); put: nvmem_cell_put(cell); return res; } Calling nvmem_dump_cell(pdev, "calibration") from ufs_renesas_probe() on the R-Car S4 Starter Kit development board gives: Cell calibration contains 8 bytes of data | 23 51 23 51 52 98 52 98 --- arch/arm64/boot/dts/renesas/r8a779f4.dtsi | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/arch/arm64/boot/dts/renesas/r8a779f4.dtsi b/arch/arm64/boot/dt= s/renesas/r8a779f4.dtsi index ebed41892df3346c..dfa3c015e04b740c 100644 --- a/arch/arm64/boot/dts/renesas/r8a779f4.dtsi +++ b/arch/arm64/boot/dts/renesas/r8a779f4.dtsi @@ -10,3 +10,15 @@ / { compatible =3D "renesas,r8a779f4", "renesas,r8a779f0"; }; + +&fuse { + nvmem-layout { + compatible =3D "fixed-layout"; + #address-cells =3D <1>; + #size-cells =3D <1>; + + ufs_tune: calib@144 { + reg =3D <0x144 0x08>; + }; + }; +}; --=20 2.34.1