Add initial support for the Samsung Exynos OTP controller. Read the
product and chip IDs from the OTP controller registers space and
register the SoC info to the SoC interface.
The driver can be extended to empower the controller become nvmem
provider. This is not in the scope of this patch because it seems the
OTP memory space is not yet used by any consumer, even downstream.
Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org>
---
drivers/nvmem/Kconfig | 10 +++
drivers/nvmem/Makefile | 2 +
drivers/nvmem/exynos-otp.c | 160 +++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 172 insertions(+)
diff --git a/drivers/nvmem/Kconfig b/drivers/nvmem/Kconfig
index e0d88d3199c11a3b71cc274b2114e9554ac486fc..aa8c14d4624b820a3685cdf14f2f32521a82db4a 100644
--- a/drivers/nvmem/Kconfig
+++ b/drivers/nvmem/Kconfig
@@ -84,6 +84,16 @@ config NVMEM_BRCM_NVRAM
This driver provides support for Broadcom's NVRAM that can be accessed
using I/O mapping.
+config NVMEM_EXYNOS_OTP
+ tristate "Samsung Exynos OTP support"
+ depends on ARCH_EXYNOS || COMPILE_TEST
+ help
+ This driver provides support for the OTP controller found on some
+ Samsung Exynos SoCs.
+
+ This driver can also be built as a module. If so, the module
+ will be called nvmem-exynos-otp.
+
config NVMEM_IMX_IIM
tristate "i.MX IC Identification Module support"
depends on ARCH_MXC || COMPILE_TEST
diff --git a/drivers/nvmem/Makefile b/drivers/nvmem/Makefile
index 70a4464dcb1e25cf9116280a32f4a0f4f9941a75..920a536fc359a5a7d8f3aabba6a712e85c277ee7 100644
--- a/drivers/nvmem/Makefile
+++ b/drivers/nvmem/Makefile
@@ -20,6 +20,8 @@ obj-$(CONFIG_NVMEM_BCM_OCOTP) += nvmem-bcm-ocotp.o
nvmem-bcm-ocotp-y := bcm-ocotp.o
obj-$(CONFIG_NVMEM_BRCM_NVRAM) += nvmem_brcm_nvram.o
nvmem_brcm_nvram-y := brcm_nvram.o
+obj-$(CONFIG_NVMEM_EXYNOS_OTP) += nvmem-exynos-otp.o
+nvmem-exynos-otp-y := exynos-otp.o
obj-$(CONFIG_NVMEM_IMX_IIM) += nvmem-imx-iim.o
nvmem-imx-iim-y := imx-iim.o
obj-$(CONFIG_NVMEM_IMX_OCOTP) += nvmem-imx-ocotp.o
diff --git a/drivers/nvmem/exynos-otp.c b/drivers/nvmem/exynos-otp.c
new file mode 100644
index 0000000000000000000000000000000000000000..5acdc6ef1f8e07ffb6d465b160659732f4ef5a22
--- /dev/null
+++ b/drivers/nvmem/exynos-otp.c
@@ -0,0 +1,160 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Copyright 2025 Linaro Ltd.
+ *
+ * Samsung Exynos OTP driver.
+ */
+
+#include <linux/array_size.h>
+#include <linux/clk.h>
+#include <linux/device.h>
+#include <linux/device/devres.h>
+#include <linux/err.h>
+#include <linux/ioport.h>
+#include <linux/mod_devicetable.h>
+#include <linux/module.h>
+#include <linux/platform_device.h>
+#include <linux/regmap.h>
+#include <linux/sys_soc.h>
+
+#define EXYNOS_OTP_PRODUCT_ID 0
+#define EXYNOS_OTP_PRODUCT_ID_MASK GENMASK(31, 12)
+#define EXYNOS_OTP_PRODUCT_ID_MAIN_REV GENMASK(3, 0)
+
+#define EXYNOS_OTP_CHIPID(i) (0x4 + (i) * 4)
+#define EXYNOS_OTP_CHIPID3_SUB_REV GENMASK(19, 16)
+
+#define EXYNOS_OTP_PRODUCT_ID_MAIN_REV_SHIFT 4
+
+struct exynos_otp {
+ struct clk *pclk;
+ struct device *dev;
+ struct regmap *regmap;
+};
+
+static const struct exynos_otp_soc_id {
+ const char *name;
+ u32 id;
+} eotp_soc_ids[] = {
+ { "GS101", 0x9845 },
+};
+
+static const char *exynos_otp_xlate_soc_name(u32 id)
+{
+ int i;
+
+ for (i = 0; i < ARRAY_SIZE(eotp_soc_ids); i++)
+ if (id == eotp_soc_ids[i].id)
+ return eotp_soc_ids[i].name;
+ return NULL;
+}
+
+static void exynos_otp_unregister_soc(void *data)
+{
+ soc_device_unregister(data);
+}
+
+static int exynos_otp_soc_device_register(struct exynos_otp *eotp)
+{
+ struct soc_device_attribute *soc_dev_attr;
+ struct regmap *regmap = eotp->regmap;
+ struct device *dev = eotp->dev;
+ struct soc_device *soc_dev;
+ u32 val, main_rev, sub_rev;
+ u32 product_id, revision;
+ int ret;
+
+ soc_dev_attr = devm_kzalloc(dev, sizeof(*soc_dev_attr), GFP_KERNEL);
+ if (!soc_dev_attr)
+ return -ENOMEM;
+
+ ret = regmap_read(regmap, EXYNOS_OTP_PRODUCT_ID, &val);
+ if (ret)
+ return dev_err_probe(dev, ret, "failed to read product id\n");
+
+ product_id = FIELD_GET(EXYNOS_OTP_PRODUCT_ID_MASK, val);
+ main_rev = FIELD_GET(EXYNOS_OTP_PRODUCT_ID_MAIN_REV, val);
+
+ ret = regmap_read(regmap, EXYNOS_OTP_CHIPID(3), &val);
+ if (ret)
+ return dev_err_probe(dev, ret, "failed to read chip id\n");
+
+ sub_rev = FIELD_GET(EXYNOS_OTP_CHIPID3_SUB_REV, val);
+ revision = main_rev << EXYNOS_OTP_PRODUCT_ID_MAIN_REV_SHIFT | sub_rev;
+
+ soc_dev_attr->family = "Samsung Exynos";
+ soc_dev_attr->soc_id = exynos_otp_xlate_soc_name(product_id);
+ if (!soc_dev_attr->soc_id)
+ return dev_err_probe(dev, -ENODEV, "failed to translate chip id to name\n");
+
+ soc_dev_attr->revision = devm_kasprintf(dev, GFP_KERNEL, "%x",
+ revision);
+ if (!soc_dev_attr->revision)
+ return -ENOMEM;
+
+ soc_dev = soc_device_register(soc_dev_attr);
+ if (IS_ERR(soc_dev))
+ return dev_err_probe(dev, PTR_ERR(soc_dev),
+ "failed to register to the SoC interface\n");
+
+ ret = devm_add_action_or_reset(dev, exynos_otp_unregister_soc, soc_dev);
+ if (ret)
+ return dev_err_probe(dev, ret, "failed to add devm action\n");
+
+ return 0;
+}
+
+static int exynos_otp_probe(struct platform_device *pdev)
+{
+ struct device *dev = &pdev->dev;
+ struct exynos_otp *eotp;
+ struct resource *res;
+ void __iomem *base;
+
+ eotp = devm_kzalloc(dev, sizeof(*eotp), GFP_KERNEL);
+ if (!eotp)
+ return -ENOMEM;
+
+ base = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
+ if (IS_ERR(base))
+ return PTR_ERR(base);
+
+ const struct regmap_config reg_config = {
+ .reg_bits = 32,
+ .reg_stride = 4,
+ .val_bits = 32,
+ .use_relaxed_mmio = true,
+ .max_register = (resource_size(res) - reg_config.reg_stride),
+ };
+
+ eotp->regmap = devm_regmap_init_mmio(dev, base, ®_config);
+ if (IS_ERR(eotp->regmap))
+ return PTR_ERR(eotp->regmap);
+
+ eotp->pclk = devm_clk_get_enabled(dev, NULL);
+ if (IS_ERR(eotp->pclk))
+ return dev_err_probe(dev, PTR_ERR(eotp->pclk), "failed to get clock\n");
+
+ eotp->dev = dev;
+
+ return exynos_otp_soc_device_register(eotp);
+}
+
+static const struct of_device_id exynos_otp_dt_ids[] = {
+ { .compatible = "google,gs101-otp" },
+ {},
+};
+MODULE_DEVICE_TABLE(of, exynos_otp_dt_ids);
+
+static struct platform_driver exynos_otp_driver = {
+ .probe = exynos_otp_probe,
+ .driver = {
+ .name = "exynos-otp",
+ .of_match_table = exynos_otp_dt_ids,
+ },
+};
+module_platform_driver(exynos_otp_driver);
+
+MODULE_AUTHOR("Tudor Ambarus <tudor.ambarus@linaro.org>");
+MODULE_DESCRIPTION("Samsung Exynos OTP driver");
+MODULE_LICENSE("GPL");
--
2.51.2.1041.gc1ab5b90ca-goog
On Wed, Nov 12, 2025 at 08:29:06AM +0000, Tudor Ambarus wrote: > Add initial support for the Samsung Exynos OTP controller. Read the > product and chip IDs from the OTP controller registers space and > register the SoC info to the SoC interface. > > The driver can be extended to empower the controller become nvmem > provider. This is not in the scope of this patch because it seems the > OTP memory space is not yet used by any consumer, even downstream. Quick look tells me you just duplicated existing Samsung ChipID driver. Even actual product ID registers and masks are the same, with one difference - you read CHIPID3... which is the same as in newer Exynos, e.g. Exynos8895. What is exactly the point of having this as separate driver? I think this can easily be just customized chipid driver - with different implementation of exynos_chipid_get_chipid_info(). Best regards, Krzysztof
On 11/13/25 10:30 AM, Krzysztof Kozlowski wrote: > On Wed, Nov 12, 2025 at 08:29:06AM +0000, Tudor Ambarus wrote: >> Add initial support for the Samsung Exynos OTP controller. Read the >> product and chip IDs from the OTP controller registers space and >> register the SoC info to the SoC interface. >> >> The driver can be extended to empower the controller become nvmem >> provider. This is not in the scope of this patch because it seems the >> OTP memory space is not yet used by any consumer, even downstream. > > Quick look tells me you just duplicated existing Samsung ChipID driver. > Even actual product ID registers and masks are the same, with one > difference - you read CHIPID3... which is the same as in newer Exynos, > e.g. Exynos8895. Yes, that's correct. It's very similar with the Samsung ChipID driver. > > What is exactly the point of having this as separate driver? I think The difference is that for gs101 the chipid info is part of the OTP registers. GS101 OTP has a clock, an interrupt line, a register space (that contains product and chip ID, TMU data, ASV, etc) and a 32Kbit memory space that can be read/program/locked with specific commands. The ChipID driver handles older exynos platforms that have a dedicated chipid device that references a SFR register space to get the product and chip ID. On GS101 (but also for e850 and autov9 I assume) the "ChipID block" is just an abstraction, it's not a physical device. The ChipID info is from OTP. When the power-on sequence progresses, the OTP chipid values are loaded to the OTP registers. We need the OTP clock to be on in order to read them. So GS101 has an OTP device that also happens to have chip ID info. For now I just got the chipid info and registered it to the SoC interface (which is very similar to that the exynos-chipid driver does), but this driver can be extended to export both its memory space and register space as nvmem devices, if any consumer needs them. Downstream GS101 drivers seem to use just the chip id info and a dvfs version from the OTP registers. DVFS version is not going to be used upstream as we're defining the OPPs in DT. So I was not interested in extending the driver with nvmem provider support, because it seems we don't need it for GS101. Do the above justify the point of having a dedicated driver? > this can easily be just customized chipid driver - with different > implementation of exynos_chipid_get_chipid_info(). If the answer is no to my question above, how shall I model the device that binds to the existing exynos-chipid driver? Thanks! ta
On 13/11/2025 10:28, Tudor Ambarus wrote: > > > On 11/13/25 10:30 AM, Krzysztof Kozlowski wrote: >> On Wed, Nov 12, 2025 at 08:29:06AM +0000, Tudor Ambarus wrote: >>> Add initial support for the Samsung Exynos OTP controller. Read the >>> product and chip IDs from the OTP controller registers space and >>> register the SoC info to the SoC interface. >>> >>> The driver can be extended to empower the controller become nvmem >>> provider. This is not in the scope of this patch because it seems the >>> OTP memory space is not yet used by any consumer, even downstream. >> >> Quick look tells me you just duplicated existing Samsung ChipID driver. >> Even actual product ID registers and masks are the same, with one >> difference - you read CHIPID3... which is the same as in newer Exynos, >> e.g. Exynos8895. > > Yes, that's correct. It's very similar with the Samsung ChipID driver. > >> >> What is exactly the point of having this as separate driver? I think > > The difference is that for gs101 the chipid info is part of the OTP > registers. GS101 OTP has a clock, an interrupt line, a register space > (that contains product and chip ID, TMU data, ASV, etc) and a 32Kbit > memory space that can be read/program/locked with specific commands. > > The ChipID driver handles older exynos platforms that have a dedicated > chipid device that references a SFR register space to get the product > and chip ID. On GS101 (but also for e850 and autov9 I assume) the > "ChipID block" is just an abstraction, it's not a physical device. The > ChipID info is from OTP. When the power-on sequence progresses, the OTP > chipid values are loaded to the OTP registers. We need the OTP clock to > be on in order to read them. So GS101 has an OTP device that also happens > to have chip ID info. > > For now I just got the chipid info and registered it to the SoC interface > (which is very similar to that the exynos-chipid driver does), but this > driver can be extended to export both its memory space and register space There is no code for that now and possibility of extension is not a reason to duplicate yet. > as nvmem devices, if any consumer needs them. Downstream GS101 drivers > seem to use just the chip id info and a dvfs version from the OTP > registers. DVFS version is not going to be used upstream as we're defining > the OPPs in DT. So I was not interested in extending the driver with nvmem > provider support, because it seems we don't need it for GS101. > > Do the above justify the point of having a dedicated driver? Only partially, I asked about driver. I did not spot previously the clock, so we have two differences - CHIPID3 register and clock - right? I wonder why Exynos8895 and others, which are already supported, do not use CHIPID3, but nevertheless these two differences can be easily integrated into existing driver. > >> this can easily be just customized chipid driver - with different >> implementation of exynos_chipid_get_chipid_info(). > > If the answer is no to my question above, how shall I model the device > that binds to the existing exynos-chipid driver? Just extend the existing driver. Best regards, Krzysztof
On 11/13/25 11:35 AM, Krzysztof Kozlowski wrote:
> On 13/11/2025 10:28, Tudor Ambarus wrote:
>>
>>
>> On 11/13/25 10:30 AM, Krzysztof Kozlowski wrote:
>>> On Wed, Nov 12, 2025 at 08:29:06AM +0000, Tudor Ambarus wrote:
>>>> Add initial support for the Samsung Exynos OTP controller. Read the
>>>> product and chip IDs from the OTP controller registers space and
>>>> register the SoC info to the SoC interface.
>>>>
>>>> The driver can be extended to empower the controller become nvmem
>>>> provider. This is not in the scope of this patch because it seems the
>>>> OTP memory space is not yet used by any consumer, even downstream.
>>>
>>> Quick look tells me you just duplicated existing Samsung ChipID driver.
>>> Even actual product ID registers and masks are the same, with one
>>> difference - you read CHIPID3... which is the same as in newer Exynos,
>>> e.g. Exynos8895.
>>
>> Yes, that's correct. It's very similar with the Samsung ChipID driver.
>>
>>>
>>> What is exactly the point of having this as separate driver? I think
>>
>> The difference is that for gs101 the chipid info is part of the OTP
>> registers. GS101 OTP has a clock, an interrupt line, a register space
>> (that contains product and chip ID, TMU data, ASV, etc) and a 32Kbit
>> memory space that can be read/program/locked with specific commands.
>>
>> The ChipID driver handles older exynos platforms that have a dedicated
>> chipid device that references a SFR register space to get the product
>> and chip ID. On GS101 (but also for e850 and autov9 I assume) the
>> "ChipID block" is just an abstraction, it's not a physical device. The
>> ChipID info is from OTP. When the power-on sequence progresses, the OTP
>> chipid values are loaded to the OTP registers. We need the OTP clock to
>> be on in order to read them. So GS101 has an OTP device that also happens
>> to have chip ID info.
>>
>> For now I just got the chipid info and registered it to the SoC interface
>> (which is very similar to that the exynos-chipid driver does), but this
>> driver can be extended to export both its memory space and register space
>
>
> There is no code for that now and possibility of extension is not a
> reason to duplicate yet.
>
>> as nvmem devices, if any consumer needs them. Downstream GS101 drivers
>> seem to use just the chip id info and a dvfs version from the OTP
>> registers. DVFS version is not going to be used upstream as we're defining
>> the OPPs in DT. So I was not interested in extending the driver with nvmem
>> provider support, because it seems we don't need it for GS101.
>>
>> Do the above justify the point of having a dedicated driver?
> Only partially, I asked about driver. I did not spot previously the
> clock, so we have two differences - CHIPID3 register and clock - right?
clock and interrupts, but I don't use the interrupts because I just need
to read the OTP registers to get the chip id info.
> I wonder why Exynos8895 and others, which are already supported, do not
> use CHIPID3, but nevertheless these two differences can be easily
> integrated into existing driver.
they can be integrated, but I want to make sure we're making the best
decision.
>>> this can easily be just customized chipid driver - with different
>>> implementation of exynos_chipid_get_chipid_info().
>>
>> If the answer is no to my question above, how shall I model the device
>> that binds to the existing exynos-chipid driver?
> Just extend the existing driver.
>
So you mean I shall have something like that in DT:
+ chipid@10000000 {
+ compatible = "google,gs101-chipid";
+ reg = <0x10000000 0xf084>;
+ clocks = <&cmu_misc CLK_GOUT_MISC_OTP_CON_TOP_PCLK>;
+ interrupts = <GIC_SPI 752 IRQ_TYPE_LEVEL_HIGH 0>;
+ };
Maybe remove the interrupts because I don't need them for reading OTP regs.
What happens in the maybe unlikely case we do want to add support for OTP
for GS101? How will we describe that in DT?
Thanks!
ta
On 13/11/2025 10:51, Tudor Ambarus wrote:
>
>
> On 11/13/25 11:35 AM, Krzysztof Kozlowski wrote:
>> On 13/11/2025 10:28, Tudor Ambarus wrote:
>>>
>>>
>>> On 11/13/25 10:30 AM, Krzysztof Kozlowski wrote:
>>>> On Wed, Nov 12, 2025 at 08:29:06AM +0000, Tudor Ambarus wrote:
>>>>> Add initial support for the Samsung Exynos OTP controller. Read the
>>>>> product and chip IDs from the OTP controller registers space and
>>>>> register the SoC info to the SoC interface.
>>>>>
>>>>> The driver can be extended to empower the controller become nvmem
>>>>> provider. This is not in the scope of this patch because it seems the
>>>>> OTP memory space is not yet used by any consumer, even downstream.
>>>>
>>>> Quick look tells me you just duplicated existing Samsung ChipID driver.
>>>> Even actual product ID registers and masks are the same, with one
>>>> difference - you read CHIPID3... which is the same as in newer Exynos,
>>>> e.g. Exynos8895.
>>>
>>> Yes, that's correct. It's very similar with the Samsung ChipID driver.
>>>
>>>>
>>>> What is exactly the point of having this as separate driver? I think
>>>
>>> The difference is that for gs101 the chipid info is part of the OTP
>>> registers. GS101 OTP has a clock, an interrupt line, a register space
>>> (that contains product and chip ID, TMU data, ASV, etc) and a 32Kbit
>>> memory space that can be read/program/locked with specific commands.
>>>
>>> The ChipID driver handles older exynos platforms that have a dedicated
>>> chipid device that references a SFR register space to get the product
>>> and chip ID. On GS101 (but also for e850 and autov9 I assume) the
>>> "ChipID block" is just an abstraction, it's not a physical device. The
>>> ChipID info is from OTP. When the power-on sequence progresses, the OTP
>>> chipid values are loaded to the OTP registers. We need the OTP clock to
>>> be on in order to read them. So GS101 has an OTP device that also happens
>>> to have chip ID info.
>>>
>>> For now I just got the chipid info and registered it to the SoC interface
>>> (which is very similar to that the exynos-chipid driver does), but this
>>> driver can be extended to export both its memory space and register space
>>
>>
>> There is no code for that now and possibility of extension is not a
>> reason to duplicate yet.
>>
>>> as nvmem devices, if any consumer needs them. Downstream GS101 drivers
>>> seem to use just the chip id info and a dvfs version from the OTP
>>> registers. DVFS version is not going to be used upstream as we're defining
>>> the OPPs in DT. So I was not interested in extending the driver with nvmem
>>> provider support, because it seems we don't need it for GS101.
>>>
>>> Do the above justify the point of having a dedicated driver?
>> Only partially, I asked about driver. I did not spot previously the
>> clock, so we have two differences - CHIPID3 register and clock - right?
>
> clock and interrupts, but I don't use the interrupts because I just need
> to read the OTP registers to get the chip id info.
>
>> I wonder why Exynos8895 and others, which are already supported, do not
>> use CHIPID3, but nevertheless these two differences can be easily
>> integrated into existing driver.
>
> they can be integrated, but I want to make sure we're making the best
> decision.
>
>>>> this can easily be just customized chipid driver - with different
>>>> implementation of exynos_chipid_get_chipid_info().
>>>
>>> If the answer is no to my question above, how shall I model the device
>>> that binds to the existing exynos-chipid driver?
>> Just extend the existing driver.
>>
> So you mean I shall have something like that in DT:
>
> + chipid@10000000 {
> + compatible = "google,gs101-chipid";
No. I said about driver. Why are you mixing these?
In previous v1 I said that bindings are wrong, because you created two
bindings for the same device. This was fixed and bindings look okay.
That's done.
We speak here ONLY about the driver.
> + reg = <0x10000000 0xf084>;
> + clocks = <&cmu_misc CLK_GOUT_MISC_OTP_CON_TOP_PCLK>;
> + interrupts = <GIC_SPI 752 IRQ_TYPE_LEVEL_HIGH 0>;
> + };
>
> Maybe remove the interrupts because I don't need them for reading OTP regs.
No, they must stay because hardware description must be complete.
>
> What happens in the maybe unlikely case we do want to add support for OTP
> for GS101? How will we describe that in DT?
You add nvmem-cells to that node. You can add them even now to the
binding to make hardware description complete, but because we do not see
any use of that and nvmem-cells are mostly for other consumers of the
node, it does not matter that much. Maybe mention that in commit msg,
that you skip nvmem-cells because this OTP is not used at all as NVMEM
anywhere in downstream, upstream and you do not see such possibility.
Best regards,
Krzysztof
On 11/13/25 11:51 AM, Tudor Ambarus wrote:
>
>
> On 11/13/25 11:35 AM, Krzysztof Kozlowski wrote:
>> On 13/11/2025 10:28, Tudor Ambarus wrote:
>>>
>>>
>>> On 11/13/25 10:30 AM, Krzysztof Kozlowski wrote:
>>>> On Wed, Nov 12, 2025 at 08:29:06AM +0000, Tudor Ambarus wrote:
>>>>> Add initial support for the Samsung Exynos OTP controller. Read the
>>>>> product and chip IDs from the OTP controller registers space and
>>>>> register the SoC info to the SoC interface.
>>>>>
>>>>> The driver can be extended to empower the controller become nvmem
>>>>> provider. This is not in the scope of this patch because it seems the
>>>>> OTP memory space is not yet used by any consumer, even downstream.
>>>>
>>>> Quick look tells me you just duplicated existing Samsung ChipID driver.
>>>> Even actual product ID registers and masks are the same, with one
>>>> difference - you read CHIPID3... which is the same as in newer Exynos,
>>>> e.g. Exynos8895.
>>>
>>> Yes, that's correct. It's very similar with the Samsung ChipID driver.
>>>
>>>>
>>>> What is exactly the point of having this as separate driver? I think
>>>
>>> The difference is that for gs101 the chipid info is part of the OTP
>>> registers. GS101 OTP has a clock, an interrupt line, a register space
>>> (that contains product and chip ID, TMU data, ASV, etc) and a 32Kbit
>>> memory space that can be read/program/locked with specific commands.
>>>
>>> The ChipID driver handles older exynos platforms that have a dedicated
>>> chipid device that references a SFR register space to get the product
>>> and chip ID. On GS101 (but also for e850 and autov9 I assume) the
>>> "ChipID block" is just an abstraction, it's not a physical device. The
>>> ChipID info is from OTP. When the power-on sequence progresses, the OTP
>>> chipid values are loaded to the OTP registers. We need the OTP clock to
>>> be on in order to read them. So GS101 has an OTP device that also happens
>>> to have chip ID info.
>>>
>>> For now I just got the chipid info and registered it to the SoC interface
>>> (which is very similar to that the exynos-chipid driver does), but this
>>> driver can be extended to export both its memory space and register space
>>
>>
>> There is no code for that now and possibility of extension is not a
>> reason to duplicate yet.
>>
>>> as nvmem devices, if any consumer needs them. Downstream GS101 drivers
>>> seem to use just the chip id info and a dvfs version from the OTP
>>> registers. DVFS version is not going to be used upstream as we're defining
>>> the OPPs in DT. So I was not interested in extending the driver with nvmem
>>> provider support, because it seems we don't need it for GS101.
>>>
>>> Do the above justify the point of having a dedicated driver?
>> Only partially, I asked about driver. I did not spot previously the
>> clock, so we have two differences - CHIPID3 register and clock - right?
>
> clock and interrupts, but I don't use the interrupts because I just need
> to read the OTP registers to get the chip id info.
>
>> I wonder why Exynos8895 and others, which are already supported, do not
>> use CHIPID3, but nevertheless these two differences can be easily
>> integrated into existing driver.
>
> they can be integrated, but I want to make sure we're making the best
> decision.
>
>>>> this can easily be just customized chipid driver - with different
>>>> implementation of exynos_chipid_get_chipid_info().
>>>
>>> If the answer is no to my question above, how shall I model the device
>>> that binds to the existing exynos-chipid driver?
>> Just extend the existing driver.
>>
> So you mean I shall have something like that in DT:
>
> + chipid@10000000 {
> + compatible = "google,gs101-chipid";
> + reg = <0x10000000 0xf084>;
> + clocks = <&cmu_misc CLK_GOUT_MISC_OTP_CON_TOP_PCLK>;
> + interrupts = <GIC_SPI 752 IRQ_TYPE_LEVEL_HIGH 0>;
> + };
>
> Maybe remove the interrupts because I don't need them for reading OTP regs.
>
> What happens in the maybe unlikely case we do want to add support for OTP
> for GS101? How will we describe that in DT?
>
Ah, I guess you meant to keep the node as I described it in patch 3/5,
an efuse node with a google,gs101-otp compatible, that will bind to the
existing exynos-chipid driver. Then if/when we add OTP support, move
everything to a new OTP driver. That can work, yes. Unless I add some
OTP support now, to justify the new driver. Both shall be okay, right?
Thanks,
ta
On 13/11/2025 11:26, Tudor Ambarus wrote:
>>
>>>>> this can easily be just customized chipid driver - with different
>>>>> implementation of exynos_chipid_get_chipid_info().
>>>>
>>>> If the answer is no to my question above, how shall I model the device
>>>> that binds to the existing exynos-chipid driver?
>>> Just extend the existing driver.
>>>
>> So you mean I shall have something like that in DT:
>>
>> + chipid@10000000 {
>> + compatible = "google,gs101-chipid";
>> + reg = <0x10000000 0xf084>;
>> + clocks = <&cmu_misc CLK_GOUT_MISC_OTP_CON_TOP_PCLK>;
>> + interrupts = <GIC_SPI 752 IRQ_TYPE_LEVEL_HIGH 0>;
>> + };
>>
>> Maybe remove the interrupts because I don't need them for reading OTP regs.
>>
>> What happens in the maybe unlikely case we do want to add support for OTP
>> for GS101? How will we describe that in DT?
>>
>
> Ah, I guess you meant to keep the node as I described it in patch 3/5,
> an efuse node with a google,gs101-otp compatible, that will bind to the
> existing exynos-chipid driver. Then if/when we add OTP support, move
> everything to a new OTP driver. That can work, yes. Unless I add some
> OTP support now, to justify the new driver. Both shall be okay, right?
Yes.
Best regards,
Krzysztof
On 11/13/25 12:44 PM, Krzysztof Kozlowski wrote:
> On 13/11/2025 11:26, Tudor Ambarus wrote:
>>>
>>>>>> this can easily be just customized chipid driver - with different
>>>>>> implementation of exynos_chipid_get_chipid_info().
>>>>>
>>>>> If the answer is no to my question above, how shall I model the device
>>>>> that binds to the existing exynos-chipid driver?
>>>> Just extend the existing driver.
>>>>
>>> So you mean I shall have something like that in DT:
>>>
>>> + chipid@10000000 {
>>> + compatible = "google,gs101-chipid";
>>> + reg = <0x10000000 0xf084>;
>>> + clocks = <&cmu_misc CLK_GOUT_MISC_OTP_CON_TOP_PCLK>;
>>> + interrupts = <GIC_SPI 752 IRQ_TYPE_LEVEL_HIGH 0>;
>>> + };
>>>
>>> Maybe remove the interrupts because I don't need them for reading OTP regs.
>>>
>>> What happens in the maybe unlikely case we do want to add support for OTP
>>> for GS101? How will we describe that in DT?
>>>
>>
>> Ah, I guess you meant to keep the node as I described it in patch 3/5,
>> an efuse node with a google,gs101-otp compatible, that will bind to the
>> existing exynos-chipid driver. Then if/when we add OTP support, move
>> everything to a new OTP driver. That can work, yes. Unless I add some
>> OTP support now, to justify the new driver. Both shall be okay, right?
>
> Yes.
>
I'm going to extend the existing chipid driver. I looked downstream again,
and couldn't see any other consumer of OTP, even for newer SoCs than gs101.
Thanks!
ta
© 2016 - 2026 Red Hat, Inc.