From: clement.leger@linux.dev
To: Sascha Hauer <s.hauer@pengutronix.de>, barebox@lists.infradead.org
Cc: "Ahmad Fatoum" <a.fatoum@barebox.org>,
"Clément Léger" <clement.leger@linux.dev>
Subject: [PATCH 3/5] drivers: nvmem: remove KVX OTP support
Date: Fri, 23 Oct 2026 22:05:05 +0200 [thread overview]
Message-ID: <20261023200507.63716-4-clement.leger@linux.dev> (raw)
In-Reply-To: <20261023200507.63716-1-clement.leger@linux.dev>
From: Clément Léger <clement.leger@linux.dev>
Remove the kvx OTP driver.
Signed-off-by: Clément Léger <clement.leger@linux.dev>
---
drivers/nvmem/Kconfig | 7 ---
drivers/nvmem/Makefile | 3 --
drivers/nvmem/kvx-otp-nv.c | 95 --------------------------------------
3 files changed, 105 deletions(-)
delete mode 100644 drivers/nvmem/kvx-otp-nv.c
diff --git a/drivers/nvmem/Kconfig b/drivers/nvmem/Kconfig
index d66c4a88fe..b7501798cb 100644
--- a/drivers/nvmem/Kconfig
+++ b/drivers/nvmem/Kconfig
@@ -106,13 +106,6 @@ config STM32_BSEC_OPTEE_TA
trusted application STM32MP BSEC in addition to the older SMC SiP
service.
-config KVX_OTP_NV
- tristate "kalray KVX OTP Non volatile regs Support"
- depends on KVX
- help
- This is a simple driver to dump specified values of KVX OTP non
- volatile regs.
-
config STARFIVE_OTP
tristate "Starfive OTP Support"
depends on SOC_STARFIVE
diff --git a/drivers/nvmem/Makefile b/drivers/nvmem/Makefile
index cb5e6d6330..8f1bb0bf44 100644
--- a/drivers/nvmem/Makefile
+++ b/drivers/nvmem/Makefile
@@ -28,9 +28,6 @@ obj-$(CONFIG_STM32_BSEC) += nvmem_bsec.o
nvmem_bsec-y := bsec.o
nvmem_bsec-$(CONFIG_STM32_BSEC_OPTEE_TA) += stm32-bsec-optee-ta.o
-obj-$(CONFIG_KVX_OTP_NV) += nvmem-kvx-otp-nv.o
-nvmem-kvx-otp-nv-y := kvx-otp-nv.o
-
obj-$(CONFIG_NVMEM_ROCKCHIP_OTP)+= rockchip-otp.o
obj-$(CONFIG_STARFIVE_OTP) += starfive-otp.o
obj-$(CONFIG_IMX_OCOTP_ELE) += imx-ocotp-ele.o
diff --git a/drivers/nvmem/kvx-otp-nv.c b/drivers/nvmem/kvx-otp-nv.c
deleted file mode 100644
index c4591f5822..0000000000
--- a/drivers/nvmem/kvx-otp-nv.c
+++ /dev/null
@@ -1,95 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-or-later
-/*
- * Copyright (C) 2020 Kalray Inc., Clément Léger
- */
-
-#include <common.h>
-#include <driver.h>
-#include <malloc.h>
-#include <xfuncs.h>
-#include <errno.h>
-#include <init.h>
-#include <net.h>
-#include <io.h>
-
-#include <linux/nvmem-provider.h>
-
-#define OTP_NV_ALIGN 4
-#define OTP_NV_ALIGN_MASK (OTP_NV_ALIGN - 1)
-
-struct kvx_otp_nv_priv {
- void __iomem *base;
-};
-
-static int kvx_otp_nv_read(void *context, unsigned int offset,
- void *_val, size_t bytes)
-{
- struct kvx_otp_nv_priv *priv = context;
- u8 *val = _val;
- u32 tmp, copy_size;
- u8 skip = offset & OTP_NV_ALIGN_MASK;
-
- offset &= ~OTP_NV_ALIGN_MASK;
-
- while (bytes) {
- tmp = readl(priv->base + offset);
- if (skip != 0)
- copy_size = min(OTP_NV_ALIGN - skip, (int) bytes);
- else
- copy_size = min(bytes, sizeof(tmp));
-
- memcpy(val, ((u8 *) &tmp) + skip, copy_size);
- skip = 0;
-
- bytes -= copy_size;
- val += copy_size;
- offset += OTP_NV_ALIGN;
- }
-
- return 0;
-}
-
-static const struct of_device_id kvx_otp_nv_match[] = {
- { .compatible = "kalray,kvx-otp-nv" },
- { /* sentinel */},
-};
-MODULE_DEVICE_TABLE(of, kvx_otp_nv_match);
-
-static int kvx_otp_nv_probe(struct device *dev)
-{
- struct resource *res;
- struct nvmem_device *nvmem;
- struct nvmem_config econfig = { 0 };
- struct kvx_otp_nv_priv *priv;
-
- priv = kzalloc(sizeof(*priv), GFP_KERNEL);
- if (!priv)
- return -ENOMEM;
-
- res = dev_request_mem_resource(dev, 0);
- if (IS_ERR(res))
- return PTR_ERR(res);
-
- priv->base = IOMEM(res->start);
-
- econfig.name = "kvx-nv-regbank";
- econfig.stride = 1;
- econfig.word_size = 1;
- econfig.size = resource_size(res);
- econfig.dev = dev;
- econfig.priv = priv;
- econfig.reg_read = kvx_otp_nv_read;
-
- dev->priv = priv;
-
- nvmem = nvmem_register(&econfig);
-
- return PTR_ERR_OR_ZERO(nvmem);
-}
-
-static struct driver kvx_otp_nv_driver = {
- .name = "kvx-otp-nv",
- .probe = kvx_otp_nv_probe,
- .of_compatible = DRV_OF_COMPAT(kvx_otp_nv_match),
-};
-postcore_platform_driver(kvx_otp_nv_driver);
--
2.55.0
next prev parent reply other threads:[~2026-10-23 20:06 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-23 20:05 [PATCH 0/5] kvx: remove architecture support clement.leger
2026-10-23 20:05 ` [PATCH 1/5] drivers: soc: remove KVX support clement.leger
2026-10-23 20:05 ` [PATCH 2/5] drivers: clocksource: remove KVX timer clement.leger
2026-10-23 20:05 ` clement.leger [this message]
2026-10-23 20:05 ` [PATCH 4/5] drivers: watchdog: remove KVX watchdog clement.leger
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=20261023200507.63716-4-clement.leger@linux.dev \
--to=clement.leger@linux.dev \
--cc=a.fatoum@barebox.org \
--cc=barebox@lists.infradead.org \
--cc=s.hauer@pengutronix.de \
/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