* [PATCH v4 0/3] Add read-only SpacemiT K3 eFuse support
@ 2026-11-29 14:42 Jiayu Du
2026-11-29 14:42 ` [PATCH v4 1/3] dt-bindings: nvmem: Add SpacemiT K3 eFuse controller Jiayu Du
` (3 more replies)
0 siblings, 4 replies; 11+ messages in thread
From: Jiayu Du @ 2026-11-29 14:42 UTC (permalink / raw)
To: srini
Cc: robh, krzk+dt, conor+dt, dlan, troy.mitchell, me, aurelien, pjw,
palmer, aou, alex, p.zabel, devicetree, linux-riscv, spacemit,
linux-kernel, Jiayu Du
This series adds read-only NVMEM access to bank 0 and bank 7 of the
SpacemiT K3 eFuse controller. These banks contain temperature calibration
parameters and other configuration data.
Tested on a SpacemiT K3 COM260 Kit. Both banks returned the same data
across repeated reads and five unbind/rebind cycles. Reads from the other
banks returned zeros. With the separate K3 thermal series applied, all
seven temperature channels resumed reporting after each rebind.
Changes in v4:
- Restore the explanation for excluding the root key and SSK banks in
the driver comment and commit message.
- Collect Tested-by tags for the driver and DTS, and Reviewed-by for
the DTS.
v3: https://lore.kernel.org/all/20261122173810.2409146-1-duge1256@gmail.com/
Changes in v3:
- Use an exclusive, managed reset and assert it on detach or a subsequent
probe failure.
- Use a 512-byte NVMEM space with bank 0 at 0x000 and bank 7 at 0x0e0;
cover the other banks with keepouts.
- Update the binding and DT calibration cell offsets to 0x1c and 0xea.
- Clarify the shadow reload names and remove the incorrect reset comment.
- Drop Conor's Acked-by from the binding patch after changing the NVMEM
address layout.
v2: https://lore.kernel.org/all/20261116075423.1519438-1-duge1256@gmail.com/
Changes in v2:
- Trigger a shadow reload before polling FUSE_READY; fail probe on timeout.
- Enable the clock only while accessing hardware and leave the shared
reset deasserted on teardown.
- Explain why the root key and SSK registers are excluded.
- Use an aligned __le32 cache instead of put_unaligned_le32().
- Drop unnecessary Kconfig dependencies and the bootloader initialization
requirement.
- Use devm_platform_ioremap_resource() and align the register definitions.
- Enable the eFuse node by default in k3.dtsi.
- Add Conor's Acked-by to the binding patch.
v1: https://lore.kernel.org/all/20261106060525.346873-1-duge1256@gmail.com/
Jiayu Du (3):
dt-bindings: nvmem: Add SpacemiT K3 eFuse controller
nvmem: Add read-only SpacemiT K3 eFuse support
riscv: dts: spacemit: Add K3 eFuse and temperature trim cells
.../bindings/nvmem/spacemit,k3-efuse.yaml | 63 ++++++
MAINTAINERS | 6 +
arch/riscv/boot/dts/spacemit/k3.dtsi | 23 ++
drivers/nvmem/Kconfig | 11 +
drivers/nvmem/Makefile | 1 +
drivers/nvmem/spacemit-k3-efuse.c | 206 ++++++++++++++++++
6 files changed, 310 insertions(+)
create mode 100644 Documentation/devicetree/bindings/nvmem/spacemit,k3-efuse.yaml
create mode 100644 drivers/nvmem/spacemit-k3-efuse.c
base-commit: d6bcfc94eb4da6e089c5473970cd96727292fd97
--
2.43.0
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH v4 1/3] dt-bindings: nvmem: Add SpacemiT K3 eFuse controller
2026-11-29 14:42 [PATCH v4 0/3] Add read-only SpacemiT K3 eFuse support Jiayu Du
@ 2026-11-29 14:42 ` Jiayu Du
2026-12-04 0:19 ` Rob Herring (Arm)
2026-11-29 14:42 ` [PATCH v4 2/3] nvmem: Add read-only SpacemiT K3 eFuse support Jiayu Du
` (2 subsequent siblings)
3 siblings, 1 reply; 11+ messages in thread
From: Jiayu Du @ 2026-11-29 14:42 UTC (permalink / raw)
To: srini
Cc: robh, krzk+dt, conor+dt, dlan, troy.mitchell, me, aurelien, pjw,
palmer, aou, alex, p.zabel, devicetree, linux-riscv, spacemit,
linux-kernel, Jiayu Du
Describe the SpacemiT K3 eFuse controller, its clock and reset, and the
bank-based NVMEM layout. Banks 0 and 7 provide configuration and
temperature calibration data.
Signed-off-by: Jiayu Du <duge1256@gmail.com>
---
Conor's Acked-by from v1 is not carried over because this version changes
the NVMEM address layout described by the binding.
.../bindings/nvmem/spacemit,k3-efuse.yaml | 63 +++++++++++++++++++
MAINTAINERS | 5 ++
2 files changed, 68 insertions(+)
create mode 100644 Documentation/devicetree/bindings/nvmem/spacemit,k3-efuse.yaml
diff --git a/Documentation/devicetree/bindings/nvmem/spacemit,k3-efuse.yaml b/Documentation/devicetree/bindings/nvmem/spacemit,k3-efuse.yaml
new file mode 100644
index 000000000000..a7c27ed1e3d3
--- /dev/null
+++ b/Documentation/devicetree/bindings/nvmem/spacemit,k3-efuse.yaml
@@ -0,0 +1,63 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/nvmem/spacemit,k3-efuse.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: SpacemiT K3 eFuse controller
+
+maintainers:
+ - Jiayu Du <duge1256@gmail.com>
+
+description:
+ The K3 eFuse contains 16 banks of 32 bytes. NVMEM uses little-endian data
+ and places bank N at offset N * 32 bytes. Read access is limited to
+ banks 0 and 7.
+
+allOf:
+ - $ref: nvmem.yaml#
+
+properties:
+ compatible:
+ const: spacemit,k3-efuse
+
+ reg:
+ maxItems: 1
+ description: The 0x400-byte eFuse controller register block.
+
+ clocks:
+ maxItems: 1
+
+ resets:
+ maxItems: 1
+
+required:
+ - compatible
+ - reg
+ - clocks
+ - resets
+
+unevaluatedProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/clock/spacemit,k3-clocks.h>
+ #include <dt-bindings/reset/spacemit,k3-resets.h>
+
+ efuse@f0702800 {
+ compatible = "spacemit,k3-efuse";
+ reg = <0xf0702800 0x400>;
+ clocks = <&syscon_apmu CLK_APMU_AES_WTM>;
+ resets = <&syscon_apmu RESET_APMU_AES_WTM>;
+
+ nvmem-layout {
+ compatible = "fixed-layout";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ temperature-trim@ea {
+ reg = <0xea 0x2>;
+ bits = <4 8>;
+ };
+ };
+ };
diff --git a/MAINTAINERS b/MAINTAINERS
index 46c416cadacd..0a9eb764ffee 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -26525,6 +26525,11 @@ S: Maintained
F: Documentation/devicetree/bindings/sound/spacemit,k1-i2s.yaml
F: sound/soc/spacemit/k1_i2s.c
+SPACEMIT K3 EFUSE DRIVER
+M: Jiayu Du <duge1256@gmail.com>
+S: Maintained
+F: Documentation/devicetree/bindings/nvmem/spacemit,k3-efuse.yaml
+
SPACEMIT RESET CONTROLLER DRIVER
M: Guodong Xu <docular.xu@gmail.com>
L: linux-riscv@lists.infradead.org
--
2.43.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v4 2/3] nvmem: Add read-only SpacemiT K3 eFuse support
2026-11-29 14:42 [PATCH v4 0/3] Add read-only SpacemiT K3 eFuse support Jiayu Du
2026-11-29 14:42 ` [PATCH v4 1/3] dt-bindings: nvmem: Add SpacemiT K3 eFuse controller Jiayu Du
@ 2026-11-29 14:42 ` Jiayu Du
2026-11-30 6:04 ` Troy Mitchell
2026-11-29 14:42 ` [PATCH v4 3/3] riscv: dts: spacemit: Add K3 eFuse and temperature trim cells Jiayu Du
2026-12-04 11:57 ` [PATCH v4 0/3] Add read-only SpacemiT K3 eFuse support Iker Pedrosa
3 siblings, 1 reply; 11+ messages in thread
From: Jiayu Du @ 2026-11-29 14:42 UTC (permalink / raw)
To: srini
Cc: robh, krzk+dt, conor+dt, dlan, troy.mitchell, me, aurelien, pjw,
palmer, aou, alex, p.zabel, devicetree, linux-riscv, spacemit,
linux-kernel, Jiayu Du
Add read-only NVMEM access to bank 0 and bank 7 of the SpacemiT K3 eFuse
controller. These banks contain temperature calibration parameters and
other configuration data.
Banks 1 and 2 contain the root key and SSK. Keep them outside the
readable NVMEM ranges.
Reload the shadows during probe and cache the data for subsequent reads.
Use a 512-byte NVMEM space with bank-based offsets and keepouts for the
other banks.
Signed-off-by: Jiayu Du <duge1256@gmail.com>
Tested-by: Aurelien Jarno <aurelien@aurel32.net>
---
MAINTAINERS | 1 +
drivers/nvmem/Kconfig | 11 ++
drivers/nvmem/Makefile | 1 +
drivers/nvmem/spacemit-k3-efuse.c | 206 ++++++++++++++++++++++++++++++
4 files changed, 219 insertions(+)
create mode 100644 drivers/nvmem/spacemit-k3-efuse.c
diff --git a/MAINTAINERS b/MAINTAINERS
index 0a9eb764ffee..e0af83ecee37 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -26529,6 +26529,7 @@ SPACEMIT K3 EFUSE DRIVER
M: Jiayu Du <duge1256@gmail.com>
S: Maintained
F: Documentation/devicetree/bindings/nvmem/spacemit,k3-efuse.yaml
+F: drivers/nvmem/spacemit-k3-efuse.c
SPACEMIT RESET CONTROLLER DRIVER
M: Guodong Xu <docular.xu@gmail.com>
diff --git a/drivers/nvmem/Kconfig b/drivers/nvmem/Kconfig
index d2f5bb236663..4a8f975b35c7 100644
--- a/drivers/nvmem/Kconfig
+++ b/drivers/nvmem/Kconfig
@@ -476,6 +476,17 @@ config NVMEM_SNVS_LPGPR
This driver can also be built as a module. If so, the module
will be called nvmem-snvs-lpgpr.
+config NVMEM_SPACEMIT_K3_EFUSE
+ tristate "SpacemiT K3 eFuse support"
+ depends on ARCH_SPACEMIT || COMPILE_TEST
+ depends on OF && HAS_IOMEM
+ help
+ Say Y here to read configuration and calibration data from the
+ SpacemiT K3 eFuse shadow banks. Programming the fuses is not supported.
+
+ This driver can also be built as a module. If so, the module will
+ be called spacemit-k3-efuse.
+
config NVMEM_SPMI_SDAM
tristate "SPMI SDAM Support"
depends on SPMI
diff --git a/drivers/nvmem/Makefile b/drivers/nvmem/Makefile
index 5e70bad9f0f9..d29716957faf 100644
--- a/drivers/nvmem/Makefile
+++ b/drivers/nvmem/Makefile
@@ -81,6 +81,7 @@ obj-$(CONFIG_NVMEM_SC27XX_EFUSE) += nvmem-sc27xx-efuse.o
nvmem-sc27xx-efuse-y := sc27xx-efuse.o
obj-$(CONFIG_NVMEM_SNVS_LPGPR) += nvmem_snvs_lpgpr.o
nvmem_snvs_lpgpr-y := snvs_lpgpr.o
+obj-$(CONFIG_NVMEM_SPACEMIT_K3_EFUSE) += spacemit-k3-efuse.o
obj-$(CONFIG_NVMEM_SPMI_SDAM) += nvmem_qcom-spmi-sdam.o
nvmem_qcom-spmi-sdam-y += qcom-spmi-sdam.o
obj-$(CONFIG_NVMEM_SPRD_EFUSE) += nvmem_sprd_efuse.o
diff --git a/drivers/nvmem/spacemit-k3-efuse.c b/drivers/nvmem/spacemit-k3-efuse.c
new file mode 100644
index 000000000000..f75b8d6486fb
--- /dev/null
+++ b/drivers/nvmem/spacemit-k3-efuse.c
@@ -0,0 +1,206 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * SpacemiT K3 read-only eFuse driver
+ *
+ * Copyright (c) 2026 Spacemit Co. Ltd.
+ */
+
+#include <linux/array_size.h>
+#include <linux/bits.h>
+#include <linux/clk.h>
+#include <linux/delay.h>
+#include <linux/device.h>
+#include <linux/err.h>
+#include <linux/errno.h>
+#include <linux/io.h>
+#include <linux/iopoll.h>
+#include <linux/module.h>
+#include <linux/nvmem-provider.h>
+#include <linux/of.h>
+#include <linux/platform_device.h>
+#include <linux/reset.h>
+#include <linux/slab.h>
+#include <linux/string.h>
+
+#include <asm/byteorder.h>
+
+#define K3_EFUSE_NR_BANKS 16
+#define K3_EFUSE_BANK_SIZE 0x20
+#define K3_EFUSE_NVMEM_SIZE (K3_EFUSE_NR_BANKS * K3_EFUSE_BANK_SIZE)
+#define K3_EFUSE_BANK7_OFFSET (7 * K3_EFUSE_BANK_SIZE)
+#define K3_EFUSE_CONFIG 0x004
+#define K3_EFUSE_SOFTWARE_RESET BIT(22)
+#define K3_EFUSE_BANK0_REG 0x104
+#define K3_EFUSE_STATUS 0x184
+#define K3_EFUSE_READY BIT(1)
+#define K3_EFUSE_BANK7_REG 0x190
+#define K3_EFUSE_RELOAD_PULSE_US 1
+#define K3_EFUSE_POLL_INTERVAL_US 1
+#define K3_EFUSE_POLL_TIMEOUT_US 10000
+
+static const struct {
+ unsigned int reg;
+ unsigned int offset;
+} k3_efuse_banks[] = {
+ {
+ .reg = K3_EFUSE_BANK0_REG,
+ .offset = 0,
+ }, {
+ .reg = K3_EFUSE_BANK7_REG,
+ .offset = K3_EFUSE_BANK7_OFFSET,
+ },
+};
+
+/* Only expose banks 0 and 7. Banks 1 and 2 contain the root key and SSK. */
+static const struct nvmem_keepout k3_efuse_keepouts[] = {
+ {
+ .start = K3_EFUSE_BANK_SIZE,
+ .end = K3_EFUSE_BANK7_OFFSET,
+ }, {
+ .start = K3_EFUSE_BANK7_OFFSET + K3_EFUSE_BANK_SIZE,
+ .end = K3_EFUSE_NVMEM_SIZE,
+ },
+};
+
+struct k3_efuse {
+ __le32 data[ARRAY_SIZE(k3_efuse_banks)][K3_EFUSE_BANK_SIZE / sizeof(u32)];
+};
+
+static int k3_efuse_read(void *context, unsigned int offset, void *val,
+ size_t bytes)
+{
+ struct k3_efuse *efuse = context;
+ unsigned int bank, index;
+
+ for (bank = 0; bank < ARRAY_SIZE(k3_efuse_banks); bank++) {
+ if (offset < k3_efuse_banks[bank].offset)
+ continue;
+
+ index = offset - k3_efuse_banks[bank].offset;
+ if (index >= K3_EFUSE_BANK_SIZE ||
+ bytes > K3_EFUSE_BANK_SIZE - index)
+ continue;
+
+ memcpy(val, (u8 *)efuse->data[bank] + index, bytes);
+ return 0;
+ }
+
+ return -EINVAL;
+}
+
+static int k3_efuse_reload_shadows(void __iomem *base)
+{
+ u32 val;
+
+ val = readl(base + K3_EFUSE_CONFIG);
+ writel(val | K3_EFUSE_SOFTWARE_RESET, base + K3_EFUSE_CONFIG);
+ readl(base + K3_EFUSE_CONFIG);
+ udelay(K3_EFUSE_RELOAD_PULSE_US);
+ val = readl(base + K3_EFUSE_CONFIG);
+ writel(val & ~K3_EFUSE_SOFTWARE_RESET, base + K3_EFUSE_CONFIG);
+
+ return readl_poll_timeout(base + K3_EFUSE_STATUS, val,
+ val & K3_EFUSE_READY,
+ K3_EFUSE_POLL_INTERVAL_US,
+ K3_EFUSE_POLL_TIMEOUT_US);
+}
+
+static int k3_efuse_probe(struct platform_device *pdev)
+{
+ struct device *dev = &pdev->dev;
+ struct nvmem_config config = {
+ .dev = dev,
+ .name = dev_name(dev),
+ .id = NVMEM_DEVID_NONE,
+ .owner = THIS_MODULE,
+ .type = NVMEM_TYPE_OTP,
+ .read_only = true,
+ .root_only = true,
+ .reg_read = k3_efuse_read,
+ .word_size = 1,
+ .stride = 1,
+ .size = K3_EFUSE_NVMEM_SIZE,
+ .keepout = k3_efuse_keepouts,
+ .nkeepout = ARRAY_SIZE(k3_efuse_keepouts),
+ };
+ struct reset_control *reset;
+ struct nvmem_device *nvmem;
+ struct k3_efuse *efuse;
+ void __iomem *base;
+ struct clk *clk;
+ unsigned int bank, i;
+ int ret;
+
+ base = devm_platform_ioremap_resource(pdev, 0);
+ if (IS_ERR(base))
+ return PTR_ERR(base);
+
+ efuse = devm_kzalloc(dev, sizeof(*efuse), GFP_KERNEL);
+ if (!efuse)
+ return -ENOMEM;
+
+ clk = devm_clk_get(dev, NULL);
+ if (IS_ERR(clk))
+ return dev_err_probe(dev, PTR_ERR(clk),
+ "Failed to get clock\n");
+
+ ret = clk_prepare_enable(clk);
+ if (ret)
+ return dev_err_probe(dev, ret, "Failed to enable clock\n");
+
+ reset = devm_reset_control_get_exclusive_deasserted(dev, NULL);
+ if (IS_ERR(reset)) {
+ ret = dev_err_probe(dev, PTR_ERR(reset),
+ "Failed to get and deassert reset\n");
+ goto disable_clk;
+ }
+
+ ret = k3_efuse_reload_shadows(base);
+ if (ret) {
+ dev_err_probe(dev, ret, "Timed out waiting for shadow reload\n");
+ goto disable_clk;
+ }
+
+ for (bank = 0; bank < ARRAY_SIZE(k3_efuse_banks); bank++) {
+ for (i = 0; i < ARRAY_SIZE(efuse->data[bank]); i++) {
+ u32 val = readl(base + k3_efuse_banks[bank].reg +
+ i * sizeof(u32));
+
+ efuse->data[bank][i] = cpu_to_le32(val);
+ }
+ }
+
+ clk_disable_unprepare(clk);
+
+ config.priv = efuse;
+
+ nvmem = devm_nvmem_register(dev, &config);
+ if (IS_ERR(nvmem))
+ return dev_err_probe(dev, PTR_ERR(nvmem),
+ "Failed to register NVMEM\n");
+
+ return 0;
+
+disable_clk:
+ clk_disable_unprepare(clk);
+ return ret;
+}
+
+static const struct of_device_id k3_efuse_of_match[] = {
+ { .compatible = "spacemit,k3-efuse" },
+ { }
+};
+MODULE_DEVICE_TABLE(of, k3_efuse_of_match);
+
+static struct platform_driver k3_efuse_driver = {
+ .probe = k3_efuse_probe,
+ .driver = {
+ .name = "spacemit-k3-efuse",
+ .of_match_table = k3_efuse_of_match,
+ },
+};
+module_platform_driver(k3_efuse_driver);
+
+MODULE_AUTHOR("Jiayu Du <duge1256@gmail.com>");
+MODULE_DESCRIPTION("SpacemiT K3 read-only eFuse driver");
+MODULE_LICENSE("GPL");
--
2.43.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v4 3/3] riscv: dts: spacemit: Add K3 eFuse and temperature trim cells
2026-11-29 14:42 [PATCH v4 0/3] Add read-only SpacemiT K3 eFuse support Jiayu Du
2026-11-29 14:42 ` [PATCH v4 1/3] dt-bindings: nvmem: Add SpacemiT K3 eFuse controller Jiayu Du
2026-11-29 14:42 ` [PATCH v4 2/3] nvmem: Add read-only SpacemiT K3 eFuse support Jiayu Du
@ 2026-11-29 14:42 ` Jiayu Du
2026-11-30 6:04 ` Troy Mitchell
2026-12-04 11:57 ` [PATCH v4 0/3] Add read-only SpacemiT K3 eFuse support Iker Pedrosa
3 siblings, 1 reply; 11+ messages in thread
From: Jiayu Du @ 2026-11-29 14:42 UTC (permalink / raw)
To: srini
Cc: robh, krzk+dt, conor+dt, dlan, troy.mitchell, me, aurelien, pjw,
palmer, aou, alex, p.zabel, devicetree, linux-riscv, spacemit,
linux-kernel, Jiayu Du
Add the K3 eFuse controller and NVMEM cells for the temperature
calibration data in bank 0 and bank 7.
Signed-off-by: Jiayu Du <duge1256@gmail.com>
Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Tested-by: Aurelien Jarno <aurelien@aurel32.net>
---
arch/riscv/boot/dts/spacemit/k3.dtsi | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
diff --git a/arch/riscv/boot/dts/spacemit/k3.dtsi b/arch/riscv/boot/dts/spacemit/k3.dtsi
index e89d2cc5ca8c..af1a758788ff 100644
--- a/arch/riscv/boot/dts/spacemit/k3.dtsi
+++ b/arch/riscv/boot/dts/spacemit/k3.dtsi
@@ -1439,6 +1439,29 @@ saplic: interrupt-controller@e0804000 {
/* sec_i2c3: 0xf0614000, not available from Linux */
+ efuse: efuse@f0702800 {
+ compatible = "spacemit,k3-efuse";
+ reg = <0x0 0xf0702800 0x0 0x400>;
+ clocks = <&syscon_apmu CLK_APMU_AES_WTM>;
+ resets = <&syscon_apmu RESET_APMU_AES_WTM>;
+
+ nvmem-layout {
+ compatible = "fixed-layout";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ soc_rtemp_trim1: temperature-trim@1c {
+ reg = <0x1c 0x1>;
+ bits = <0 8>;
+ };
+
+ soc_rtemp_trim: temperature-trim@ea {
+ reg = <0xea 0x2>;
+ bits = <4 8>;
+ };
+ };
+ };
+
mimsic: interrupt-controller@f1000000 {
compatible = "spacemit,k3-imsics", "riscv,imsics";
reg = <0x0 0xf1000000 0x0 0x10000>;
--
2.43.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH v4 2/3] nvmem: Add read-only SpacemiT K3 eFuse support
2026-11-29 14:42 ` [PATCH v4 2/3] nvmem: Add read-only SpacemiT K3 eFuse support Jiayu Du
@ 2026-11-30 6:04 ` Troy Mitchell
2026-12-01 9:55 ` Jiayu Du
0 siblings, 1 reply; 11+ messages in thread
From: Troy Mitchell @ 2026-11-30 6:04 UTC (permalink / raw)
To: Jiayu Du, srini
Cc: robh, krzk+dt, conor+dt, dlan, troy.mitchell, me, aurelien, pjw,
palmer, aou, alex, p.zabel, devicetree, linux-riscv, spacemit,
linux-kernel
[-- Attachment #1: Type: text/plain, Size: 894 bytes --]
On Sun Nov 29, 2026 at 2:42 PM GMT, Jiayu Du wrote:
> Add read-only NVMEM access to bank 0 and bank 7 of the SpacemiT K3 eFuse
> controller. These banks contain temperature calibration parameters and
> other configuration data.
>
> Banks 1 and 2 contain the root key and SSK. Keep them outside the
> readable NVMEM ranges.
>
> Reload the shadows during probe and cache the data for subsequent reads.
> Use a 512-byte NVMEM space with bank-based offsets and keepouts for the
> other banks.
>
> Signed-off-by: Jiayu Du <duge1256@gmail.com>
> Tested-by: Aurelien Jarno <aurelien@aurel32.net>
Tested on CoM260 with both the vendor firmware and a build that skips the
eFuse reload; nvmem contents match the shadow registers
Tested-by: Troy Mitchell <troy.mitchell@linux.spacemit.com> # CoM260
Reviewed-by: Troy Mitchell <troy.mitchell@linux.spacemit.com>
--
Troy Mitchell
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 273 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v4 3/3] riscv: dts: spacemit: Add K3 eFuse and temperature trim cells
2026-11-29 14:42 ` [PATCH v4 3/3] riscv: dts: spacemit: Add K3 eFuse and temperature trim cells Jiayu Du
@ 2026-11-30 6:04 ` Troy Mitchell
0 siblings, 0 replies; 11+ messages in thread
From: Troy Mitchell @ 2026-11-30 6:04 UTC (permalink / raw)
To: Jiayu Du, srini
Cc: robh, krzk+dt, conor+dt, dlan, troy.mitchell, me, aurelien, pjw,
palmer, aou, alex, p.zabel, devicetree, linux-riscv, spacemit,
linux-kernel
[-- Attachment #1: Type: text/plain, Size: 1481 bytes --]
On Sun Nov 29, 2026 at 2:42 PM GMT, Jiayu Du wrote:
> Add the K3 eFuse controller and NVMEM cells for the temperature
> calibration data in bank 0 and bank 7.
>
> Signed-off-by: Jiayu Du <duge1256@gmail.com>
> Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
> Tested-by: Aurelien Jarno <aurelien@aurel32.net>
> ---
> arch/riscv/boot/dts/spacemit/k3.dtsi | 23 +++++++++++++++++++++++
> 1 file changed, 23 insertions(+)
>
> diff --git a/arch/riscv/boot/dts/spacemit/k3.dtsi b/arch/riscv/boot/dts/spacemit/k3.dtsi
> index e89d2cc5ca8c..af1a758788ff 100644
> --- a/arch/riscv/boot/dts/spacemit/k3.dtsi
> +++ b/arch/riscv/boot/dts/spacemit/k3.dtsi
> @@ -1439,6 +1439,29 @@ saplic: interrupt-controller@e0804000 {
>
> /* sec_i2c3: 0xf0614000, not available from Linux */
>
> + efuse: efuse@f0702800 {
> + compatible = "spacemit,k3-efuse";
> + reg = <0x0 0xf0702800 0x0 0x400>;
> + clocks = <&syscon_apmu CLK_APMU_AES_WTM>;
> + resets = <&syscon_apmu RESET_APMU_AES_WTM>;
> +
> + nvmem-layout {
> + compatible = "fixed-layout";
> + #address-cells = <1>;
> + #size-cells = <1>;
> +
> + soc_rtemp_trim1: temperature-trim@1c {
> + reg = <0x1c 0x1>;
> + bits = <0 8>;
> + };
> +
> + soc_rtemp_trim: temperature-trim@ea {
> + reg = <0xea 0x2>;
> + bits = <4 8>;
> + };
> + };
> + };
LGTM. Thanks.
Reviewed-by: Troy Mitchell <troy.mitchell@linux.spacemit.com>
--
Troy Mitchell
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 273 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v4 2/3] nvmem: Add read-only SpacemiT K3 eFuse support
2026-11-30 6:04 ` Troy Mitchell
@ 2026-12-01 9:55 ` Jiayu Du
0 siblings, 0 replies; 11+ messages in thread
From: Jiayu Du @ 2026-12-01 9:55 UTC (permalink / raw)
To: Troy Mitchell
Cc: srini, robh, krzk+dt, conor+dt, dlan, me, aurelien, pjw, palmer,
aou, alex, p.zabel, devicetree, linux-riscv, spacemit,
linux-kernel
On Mon, Nov 30, 2026 at 06:04:18AM +0000, Troy Mitchell wrote:
> On Sun Nov 29, 2026 at 2:42 PM GMT, Jiayu Du wrote:
> > Add read-only NVMEM access to bank 0 and bank 7 of the SpacemiT K3 eFuse
> > controller. These banks contain temperature calibration parameters and
> > other configuration data.
> >
> > Banks 1 and 2 contain the root key and SSK. Keep them outside the
> > readable NVMEM ranges.
> >
> > Reload the shadows during probe and cache the data for subsequent reads.
> > Use a 512-byte NVMEM space with bank-based offsets and keepouts for the
> > other banks.
> >
> > Signed-off-by: Jiayu Du <duge1256@gmail.com>
> > Tested-by: Aurelien Jarno <aurelien@aurel32.net>
> Tested on CoM260 with both the vendor firmware and a build that skips the
> eFuse reload; nvmem contents match the shadow registers
Thanks for reviewing and testing this on CoM260!
Best regards,
Jiayu Du
>
> Tested-by: Troy Mitchell <troy.mitchell@linux.spacemit.com> # CoM260
> Reviewed-by: Troy Mitchell <troy.mitchell@linux.spacemit.com>
>
> --
> Troy Mitchell
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v4 1/3] dt-bindings: nvmem: Add SpacemiT K3 eFuse controller
2026-11-29 14:42 ` [PATCH v4 1/3] dt-bindings: nvmem: Add SpacemiT K3 eFuse controller Jiayu Du
@ 2026-12-04 0:19 ` Rob Herring (Arm)
0 siblings, 0 replies; 11+ messages in thread
From: Rob Herring (Arm) @ 2026-12-04 0:19 UTC (permalink / raw)
To: Jiayu Du
Cc: krzk+dt, spacemit, dlan, linux-riscv, pjw, devicetree, aurelien,
srini, palmer, troy.mitchell, alex, p.zabel, linux-kernel,
conor+dt, aou, me
On Sun, 29 Nov 2026 22:42:48 +0800, Jiayu Du wrote:
> Describe the SpacemiT K3 eFuse controller, its clock and reset, and the
> bank-based NVMEM layout. Banks 0 and 7 provide configuration and
> temperature calibration data.
>
> Signed-off-by: Jiayu Du <duge1256@gmail.com>
> ---
> Conor's Acked-by from v1 is not carried over because this version changes
> the NVMEM address layout described by the binding.
>
> .../bindings/nvmem/spacemit,k3-efuse.yaml | 63 +++++++++++++++++++
> MAINTAINERS | 5 ++
> 2 files changed, 68 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/nvmem/spacemit,k3-efuse.yaml
>
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v4 0/3] Add read-only SpacemiT K3 eFuse support
2026-11-29 14:42 [PATCH v4 0/3] Add read-only SpacemiT K3 eFuse support Jiayu Du
` (2 preceding siblings ...)
2026-11-29 14:42 ` [PATCH v4 3/3] riscv: dts: spacemit: Add K3 eFuse and temperature trim cells Jiayu Du
@ 2026-12-04 11:57 ` Iker Pedrosa
2026-12-04 12:38 ` Jiayu Du
3 siblings, 1 reply; 11+ messages in thread
From: Iker Pedrosa @ 2026-12-04 11:57 UTC (permalink / raw)
To: Jiayu Du, srini
Cc: robh, krzk+dt, conor+dt, dlan, troy.mitchell, me, aurelien, pjw,
palmer, aou, alex, p.zabel, devicetree, linux-riscv, spacemit,
linux-kernel
Hi Jiayu,
On 11/29/26 15:42, Jiayu Du wrote:
> Tested on a SpacemiT K3 COM260 Kit. Both banks returned the same data
> across repeated reads and five unbind/rebind cycles. Reads from the other
> banks returned zeros. With the separate K3 thermal series applied, all
> seven temperature channels resumed reporting after each rebind.
I'm working on SpacemiT K3 enablement on the K3 Pico-ITX and looking into
the SoC thermal sensor support. Your cover letter mentions testing
against "the separate K3 thermal series". I checked the archive, but didn't
find it, so I wanted to ask if it is going to be posted upstream soon?
If there is a public branch or an earlier posting I missed, I'd be happy
to test it on the K3 Pico-ITX alongside this series and provide a
Tested-by. Otherwise, if nobody is actively upstreaming the K3 tsensor
driver yet, I'd like to pick it up and coordinate so we don't duplicate
work.
Thanks,
Iker Pedrosa
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v4 0/3] Add read-only SpacemiT K3 eFuse support
2026-12-04 11:57 ` [PATCH v4 0/3] Add read-only SpacemiT K3 eFuse support Iker Pedrosa
@ 2026-12-04 12:38 ` Jiayu Du
2026-12-04 13:27 ` ipedrosa
0 siblings, 1 reply; 11+ messages in thread
From: Jiayu Du @ 2026-12-04 12:38 UTC (permalink / raw)
To: Iker Pedrosa
Cc: srini, robh, krzk+dt, conor+dt, dlan, troy.mitchell, me, aurelien,
pjw, palmer, aou, alex, p.zabel, devicetree, linux-riscv,
spacemit, linux-kernel
Hi Iker,
On Fri, Dec 04, 2026 at 12:57:02PM +0100, Iker Pedrosa wrote:
> Hi Jiayu,
>
> On 11/29/26 15:42, Jiayu Du wrote:
> > Tested on a SpacemiT K3 COM260 Kit. Both banks returned the same data
> > across repeated reads and five unbind/rebind cycles. Reads from the other
> > banks returned zeros. With the separate K3 thermal series applied, all
> > seven temperature channels resumed reporting after each rebind.
>
> I'm working on SpacemiT K3 enablement on the K3 Pico-ITX and looking into
> the SoC thermal sensor support. Your cover letter mentions testing
> against "the separate K3 thermal series". I checked the archive, but didn't
> find it, so I wanted to ask if it is going to be posted upstream soon?
>
> If there is a public branch or an earlier posting I missed, I'd be happy
> to test it on the K3 Pico-ITX alongside this series and provide a
> Tested-by. Otherwise, if nobody is actively upstreaming the K3 tsensor
> driver yet, I'd like to pick it up and coordinate so we don't duplicate
> work.
Thanks for offering to test this on the Pico-ITX!
I'm working on K3 thermal support, but haven't posted the
series yet. I've tested all seven temperature channels and
unbind/rebind on a COM260 Kit.
The downstream driver is at [1]. I've asked SpacemiT about the CFG
bits 25/26 sequence at [2] and am waiting for their reply.
In the meantime, I'd be happy to send the current patches as an RFC,
with that open question noted, so you can test them alongside the
eFuse series. It would be great to work on this together.
[1] https://github.com/spacemit-com/linux-6.18/blob/k3-br-v1.0.y/drivers/thermal/k3-thermal.c
[2] https://github.com/spacemit-com/linux-6.18/blob/k3-br-v1.0.y/drivers/thermal/k3-thermal.c#L242-L251
Best regards,
Jiayu Du
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v4 0/3] Add read-only SpacemiT K3 eFuse support
2026-12-04 12:38 ` Jiayu Du
@ 2026-12-04 13:27 ` ipedrosa
0 siblings, 0 replies; 11+ messages in thread
From: ipedrosa @ 2026-12-04 13:27 UTC (permalink / raw)
To: Jiayu Du, srini, robh, krzk+dt, conor+dt, dlan, troy.mitchell, me,
aurelien, pjw, palmer, aou, alex, p.zabel, devicetree,
linux-riscv, spacemit, linux-kernel
Hi Jiayu,
On 12/4/26 1:38 PM, Jiayu Du <duge1256@gmail.com> wrote:
> In the meantime, I'd be happy to send the current patches as an RFC,
> with that open question noted, so you can test them alongside the
> eFuse series. It would be great to work on this together.
Sounds great! An RFC works well for me, and please CC me when you post
it. I'll test it on the K3 Pico-ITX alongside the eFuse series and
share the results on the thread.
Thanks for the pointer to the downstream driver and the CFG bits
question as well. I'll take a look at that in the meantime.
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2026-12-04 13:27 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-29 14:42 [PATCH v4 0/3] Add read-only SpacemiT K3 eFuse support Jiayu Du
2026-11-29 14:42 ` [PATCH v4 1/3] dt-bindings: nvmem: Add SpacemiT K3 eFuse controller Jiayu Du
2026-12-04 0:19 ` Rob Herring (Arm)
2026-11-29 14:42 ` [PATCH v4 2/3] nvmem: Add read-only SpacemiT K3 eFuse support Jiayu Du
2026-11-30 6:04 ` Troy Mitchell
2026-12-01 9:55 ` Jiayu Du
2026-11-29 14:42 ` [PATCH v4 3/3] riscv: dts: spacemit: Add K3 eFuse and temperature trim cells Jiayu Du
2026-11-30 6:04 ` Troy Mitchell
2026-12-04 11:57 ` [PATCH v4 0/3] Add read-only SpacemiT K3 eFuse support Iker Pedrosa
2026-12-04 12:38 ` Jiayu Du
2026-12-04 13:27 ` ipedrosa
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox