[PATCH v2 2/3] nvmem: Add read-only SpacemiT K3 eFuse support

Jiayu Du duge1256 at gmail.com
Tue Nov 17 22:15:37 PST 2026


On Tue, Nov 17, 2026 at 10:09:45PM +0100, Aurelien Jarno wrote:
> 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 at 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.
> 

Hi Aurelien,

I will use a 512-byte NVMEM space, with bank 0 starting at 0x000
and bank 7 at 0x0e0. The other banks will remain covered by keepouts.

I will also update the temperature calibration cell offsets in the
device tree to 0x1c and 0xea. The hardware accesses will stay unchanged.

Best regards,
Jiayu Du




More information about the linux-riscv mailing list