From: Aurelien Jarno <aurelien@aurel32.net>
To: Jiayu Du <duge1256@gmail.com>
Cc: srini@kernel.org, robh@kernel.org, krzk+dt@kernel.org,
conor+dt@kernel.org, dlan@kernel.org,
troy.mitchell@linux.spacemit.com, me@ziyao.cc, pjw@kernel.org,
palmer@dabbelt.com, aou@eecs.berkeley.edu, alex@ghiti.fr,
p.zabel@pengutronix.de, devicetree@vger.kernel.org,
linux-riscv@lists.infradead.org, spacemit@lists.linux.dev,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/3] nvmem: Add read-only SpacemiT K3 eFuse support
Date: Tue, 17 Nov 2026 22:09:45 +0100 [thread overview]
Message-ID: <avzCmVhf8tl6hi_B@aurel32.net> (raw)
In-Reply-To: <20261116075423.1519438-3-duge1256@gmail.com>
Hi,
On 2026-11-16 15:54, 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.
>
> Keep the root key and SSK registers outside the exposed bank ranges.
>
> FUSE_READY reports completion of a software-triggered reload. Trigger a
> reload through GEU_CONFIG bit 22 with a 1 us reset pulse, then poll
> FUSE_READY at a 1 us interval with a 10 ms timeout before taking the
> snapshot. Fail probe if the reload times out.
>
> Snapshot the shadow registers with aligned 32-bit reads and expose the
> data in little-endian order at controller-relative offsets. Serve reads
> from the snapshot and use keepouts for the remaining register ranges.
>
> Enable the AES_WTM clock only while accessing the hardware. Leave its
> shared reset deasserted on teardown because WTM_RST resets the entire GEU.
>
> Signed-off-by: Jiayu Du <duge1256@gmail.com>
> ---
> MAINTAINERS | 1 +
> drivers/nvmem/Kconfig | 11 ++
> drivers/nvmem/Makefile | 1 +
> drivers/nvmem/spacemit-k3-efuse.c | 199 ++++++++++++++++++++++++++++++
> 4 files changed, 212 insertions(+)
> create mode 100644 drivers/nvmem/spacemit-k3-efuse.c
I have been looking at the code with more details. Is there any reason
to "expose" the whole 1024-byte efuse address space in the nvmem layout
(of course with some masking) as opposed to the 16 banks x 32 bytes =
4096 bits only (still with masking)?
I find strange that user space has to know the address of bank 0 or bank
7 instead of just looking respectively at addresses 0x000 and 0x0e0.
As the layout exposed to user space also includes status or control
registers (although masked), this might makes difficult to support a
newer version of the efuse controller which have a similar data layout,
but slightly different registers colliding with the bank data.
Regards
Aurelien
--
Aurelien Jarno GPG: 4096R/1DDD8C9B
aurelien@aurel32.net http://aurel32.net
next prev parent reply other threads:[~2026-11-17 21:09 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-16 7:54 [PATCH v2 0/3] Add read-only SpacemiT K3 eFuse support Jiayu Du
2026-11-16 7:54 ` [PATCH v2 1/3] dt-bindings: nvmem: Add SpacemiT K3 eFuse controller Jiayu Du
2026-11-16 7:54 ` [PATCH v2 2/3] nvmem: Add read-only SpacemiT K3 eFuse support Jiayu Du
2026-11-16 11:54 ` Philipp Zabel
2026-11-17 12:22 ` Jiayu Du
2026-11-17 21:09 ` Aurelien Jarno [this message]
2026-11-16 7:54 ` [PATCH v2 3/3] riscv: dts: spacemit: Add K3 eFuse and temperature trim cells Jiayu Du
2026-11-17 21:10 ` Aurelien Jarno
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=avzCmVhf8tl6hi_B@aurel32.net \
--to=aurelien@aurel32.net \
--cc=alex@ghiti.fr \
--cc=aou@eecs.berkeley.edu \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dlan@kernel.org \
--cc=duge1256@gmail.com \
--cc=krzk+dt@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=me@ziyao.cc \
--cc=p.zabel@pengutronix.de \
--cc=palmer@dabbelt.com \
--cc=pjw@kernel.org \
--cc=robh@kernel.org \
--cc=spacemit@lists.linux.dev \
--cc=srini@kernel.org \
--cc=troy.mitchell@linux.spacemit.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox