From: Krzysztof Kozlowski <krzk@kernel.org>
To: Tudor Ambarus <tudor.ambarus@linaro.org>
Cc: "Srinivas Kandagatla" <srini@kernel.org>,
"Rob Herring" <robh@kernel.org>,
"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
"Conor Dooley" <conor+dt@kernel.org>,
"Alim Akhtar" <alim.akhtar@samsung.com>,
"Peter Griffin" <peter.griffin@linaro.org>,
"André Draszik" <andre.draszik@linaro.org>,
semen.protsenko@linaro.org, willmcvicker@google.com,
kernel-team@android.com, linux-kernel@vger.kernel.org,
linux-samsung-soc@vger.kernel.org, devicetree@vger.kernel.org,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v2 2/5] nvmem: add Samsung Exynos OTP support
Date: Thu, 13 Nov 2025 11:43:44 +0100 [thread overview]
Message-ID: <4ff4c304-fb37-4b4d-a9bc-d5cc80e0a274@kernel.org> (raw)
In-Reply-To: <1af37451-1f66-4b6b-8b36-846cbd2ca1e8@linaro.org>
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
next prev parent reply other threads:[~2025-11-13 10:43 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-12 8:29 [PATCH v2 0/5] nvmem: add Samsung Exynos OTP support Tudor Ambarus
2025-11-12 8:29 ` [PATCH v2 1/5] dt-bindings: nvmem: add google,gs101-otp Tudor Ambarus
2025-11-13 8:22 ` Krzysztof Kozlowski
2025-11-13 9:05 ` André Draszik
2025-11-12 8:29 ` [PATCH v2 2/5] nvmem: add Samsung Exynos OTP support Tudor Ambarus
2025-11-13 8:30 ` Krzysztof Kozlowski
2025-11-13 9:28 ` Tudor Ambarus
2025-11-13 9:35 ` Krzysztof Kozlowski
2025-11-13 9:51 ` Tudor Ambarus
2025-11-13 10:26 ` Tudor Ambarus
2025-11-13 10:44 ` Krzysztof Kozlowski
2025-11-13 12:52 ` Tudor Ambarus
2025-11-13 10:43 ` Krzysztof Kozlowski [this message]
2025-11-12 8:29 ` [PATCH v2 3/5] arm64: dts: exynos: gs101: add OTP node Tudor Ambarus
2025-11-12 8:29 ` [PATCH v2 4/5] arm64: defconfig: enable Samsung Exynos OTP controller Tudor Ambarus
2025-11-12 8:29 ` [PATCH v2 5/5] MAINTAINERS: add entry for the Samsung Exynos OTP controller driver Tudor Ambarus
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=4ff4c304-fb37-4b4d-a9bc-d5cc80e0a274@kernel.org \
--to=krzk@kernel.org \
--cc=alim.akhtar@samsung.com \
--cc=andre.draszik@linaro.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=kernel-team@android.com \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=peter.griffin@linaro.org \
--cc=robh@kernel.org \
--cc=semen.protsenko@linaro.org \
--cc=srini@kernel.org \
--cc=tudor.ambarus@linaro.org \
--cc=willmcvicker@google.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