public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH v3 0/2] Add AM62P silicon revision detection via NVMEM
@ 2026-02-09 17:23 Judith Mendez
  2026-02-09 17:23 ` [PATCH v3 1/2] dt-bindings: hwinfo: ti,k3-socinfo: Add nvmem-cells support Judith Mendez
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Judith Mendez @ 2026-02-09 17:23 UTC (permalink / raw)
  To: Judith Mendez, Nishanth Menon, Vignesh Raghavendra, Tero Kristo,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Santosh Shilimkar
  Cc: linux-arm-kernel, devicetree, linux-kernel, Andrew Davis

This series adds support for detecting AM62P silicon revisions using
the NVMEM framework to read the GP_SW1 register.

Background:
===========
On AM62P SoCs, the standard JTAGID register does not provide information
on silicon revision, instead the GP_SW1 register contains the information
needed for proper device identification.

Proper silicon revision detection is required to apply proper workarounds
and quirks for different silicon revisions, particularly for MMCSD [0].

Implementation history:
=======================
An initial implementation [0] added a second register range directly to
the chipid node to access GP_SW registers. Following upstream review
feedback to split the patches appropriately, an alternative RFC approach
[1] was explored that introduced a new NVMEM eFuse binding specifically
for TI K3 SoCs.

This final implementation takes a simpler approach by leveraging the
existing NVMEM framework with optional nvmem-cells support. The k3-socinfo
driver can now optionally consume silicon revision data from the NVMEM
provider, making it more flexible and avoiding the need for either direct
register access or new bindings.

Implementation details:
=======================
- NVMEM support is fully optional - the driver continues to work without
  it and falls back to SR1.0 for AM62P devices
- When NVMEM cells are present, the driver reads GP_SW1 to accurately
  detect SR1.1 and SR1.2 variants

Changelog:
==========
Changes since v2:
- Switch k3_chipinfo_variant_to_sr() parameter from pdev to dev for
  consistency
- Move nvmem-cells binding description under items, simplify description,
  and drop maxItems
- Add review tags for both patches

Revisions:
==========
v2: https://lore.kernel.org/all/20260206191914.52878-1-jm@ti.com/
v1: https://lore.kernel.org/all/20260204213746.2589028-1-jm@ti.com/

[0] https://lore.kernel.org/linux-mmc/20250805234950.3781367-1-jm@ti.com/
[1] https://lore.kernel.org/all/20250924210735.1732423-1-jm@ti.com/

Judith Mendez (2):
  dt-bindings: hwinfo: ti,k3-socinfo: Add nvmem-cells support
  soc: ti: k3-socinfo: Add support for AM62P variants via NVMEM

 .../bindings/hwinfo/ti,k3-socinfo.yaml        | 11 +++++
 drivers/soc/ti/k3-socinfo.c                   | 41 +++++++++++++++++--
 2 files changed, 49 insertions(+), 3 deletions(-)

-- 
2.52.0



^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v3 1/2] dt-bindings: hwinfo: ti,k3-socinfo: Add nvmem-cells support
  2026-02-09 17:23 [PATCH v3 0/2] Add AM62P silicon revision detection via NVMEM Judith Mendez
@ 2026-02-09 17:23 ` Judith Mendez
  2026-02-09 17:23 ` [PATCH v3 2/2] soc: ti: k3-socinfo: Add support for AM62P variants via NVMEM Judith Mendez
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Judith Mendez @ 2026-02-09 17:23 UTC (permalink / raw)
  To: Judith Mendez, Nishanth Menon, Vignesh Raghavendra, Tero Kristo,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Santosh Shilimkar
  Cc: linux-arm-kernel, devicetree, linux-kernel, Andrew Davis

Add optional nvmem-cells and nvmem-cell-names properties to support
reading silicon revision information from alternate location using
NVMEM providers. This is used on AM62P to read GP_SW1 register for
accurate silicon revision detection.

Signed-off-by: Judith Mendez <jm@ti.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
---
Changes since v2:
- Move description under items
- Simplify description, only say what NVMEM is supposed to be
- Drop maxItems since its implied with items listing
---
 .../devicetree/bindings/hwinfo/ti,k3-socinfo.yaml     | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/Documentation/devicetree/bindings/hwinfo/ti,k3-socinfo.yaml b/Documentation/devicetree/bindings/hwinfo/ti,k3-socinfo.yaml
index dada28b47ea07..2900224aac743 100644
--- a/Documentation/devicetree/bindings/hwinfo/ti,k3-socinfo.yaml
+++ b/Documentation/devicetree/bindings/hwinfo/ti,k3-socinfo.yaml
@@ -15,6 +15,9 @@ description: |
   represented by CTRLMMR_xxx_JTAGID register which contains information about
   SoC id and revision.
 
+  On some SoCs like AM62P, the silicon revision is determined by reading
+  alternative registers via NVMEM cells.
+
 properties:
   $nodename:
     pattern: "^chipid@[0-9a-f]+$"
@@ -26,6 +29,14 @@ properties:
   reg:
     maxItems: 1
 
+  nvmem-cells:
+    items:
+      - description: Alternate silicon revision register
+
+  nvmem-cell-names:
+    items:
+      - const: gpsw1
+
 required:
   - compatible
   - reg
-- 
2.52.0



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH v3 2/2] soc: ti: k3-socinfo: Add support for AM62P variants via NVMEM
  2026-02-09 17:23 [PATCH v3 0/2] Add AM62P silicon revision detection via NVMEM Judith Mendez
  2026-02-09 17:23 ` [PATCH v3 1/2] dt-bindings: hwinfo: ti,k3-socinfo: Add nvmem-cells support Judith Mendez
@ 2026-02-09 17:23 ` Judith Mendez
  2026-05-05 13:59 ` [PATCH v3 0/2] Add AM62P silicon revision detection " Nishanth Menon
  2026-05-06 11:09 ` Francesco Dolcini
  3 siblings, 0 replies; 6+ messages in thread
From: Judith Mendez @ 2026-02-09 17:23 UTC (permalink / raw)
  To: Judith Mendez, Nishanth Menon, Vignesh Raghavendra, Tero Kristo,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Santosh Shilimkar
  Cc: linux-arm-kernel, devicetree, linux-kernel, Andrew Davis

Add support for detecting AM62P silicon revisions.

On AM62P, silicon revision is discovered with GP_SW1 register instead
of JTAGID register. Use the NVMEM framework to read GP_SW1 from the
gpsw-efuse nvmem provider to determine SoC revision.

Signed-off-by: Judith Mendez <jm@ti.com>
Reviewed-by: Andrew Davis <afd@ti.com>
---
Changes since v2:
- Switch k3_chipinfo_variant_to_sr() parameter from pdev to dev for
  consistency
---
 drivers/soc/ti/k3-socinfo.c | 41 ++++++++++++++++++++++++++++++++++---
 1 file changed, 38 insertions(+), 3 deletions(-)

diff --git a/drivers/soc/ti/k3-socinfo.c b/drivers/soc/ti/k3-socinfo.c
index 42275cb5ba1c8..3a35fc456e544 100644
--- a/drivers/soc/ti/k3-socinfo.c
+++ b/drivers/soc/ti/k3-socinfo.c
@@ -6,6 +6,7 @@
  */
 
 #include <linux/mfd/syscon.h>
+#include <linux/nvmem-consumer.h>
 #include <linux/of.h>
 #include <linux/of_address.h>
 #include <linux/regmap.h>
@@ -25,6 +26,8 @@
 #define CTRLMMR_WKUP_JTAGID_VARIANT_SHIFT	(28)
 #define CTRLMMR_WKUP_JTAGID_VARIANT_MASK	GENMASK(31, 28)
 
+#define GP_SW1_ADR_MASK			GENMASK(3, 0)
+
 #define CTRLMMR_WKUP_JTAGID_PARTNO_SHIFT	(12)
 #define CTRLMMR_WKUP_JTAGID_PARTNO_MASK		GENMASK(27, 12)
 
@@ -70,6 +73,23 @@ static const char * const am62lx_rev_string_map[] = {
 	"1.0", "1.1",
 };
 
+static const char * const am62p_gpsw_rev_string_map[] = {
+	"1.0", "1.1", "1.2",
+};
+
+static int
+k3_chipinfo_get_gpsw_variant(struct device *dev)
+{
+	u32 gpsw_val = 0;
+	int ret;
+
+	ret = nvmem_cell_read_u32(dev, "gpsw1", &gpsw_val);
+	if (ret)
+		return ret;
+
+	return gpsw_val & GP_SW1_ADR_MASK;
+}
+
 static int
 k3_chipinfo_partno_to_names(unsigned int partno,
 			    struct soc_device_attribute *soc_dev_attr)
@@ -86,9 +106,11 @@ k3_chipinfo_partno_to_names(unsigned int partno,
 }
 
 static int
-k3_chipinfo_variant_to_sr(unsigned int partno, unsigned int variant,
-			  struct soc_device_attribute *soc_dev_attr)
+k3_chipinfo_variant_to_sr(struct device *dev, unsigned int partno,
+			  unsigned int variant, struct soc_device_attribute *soc_dev_attr)
 {
+	int gpsw_variant = 0;
+
 	switch (partno) {
 	case JTAG_ID_PARTNO_J721E:
 		if (variant >= ARRAY_SIZE(j721e_rev_string_map))
@@ -102,6 +124,19 @@ k3_chipinfo_variant_to_sr(unsigned int partno, unsigned int variant,
 		soc_dev_attr->revision = kasprintf(GFP_KERNEL, "SR%s",
 						   am62lx_rev_string_map[variant]);
 		break;
+	case JTAG_ID_PARTNO_AM62PX:
+		/* Check GP_SW1 for silicon revision */
+		gpsw_variant = k3_chipinfo_get_gpsw_variant(dev);
+		if (gpsw_variant == -EPROBE_DEFER)
+			return gpsw_variant;
+		if (gpsw_variant < 0 || gpsw_variant >= ARRAY_SIZE(am62p_gpsw_rev_string_map)) {
+			dev_warn(dev, "Failed to get silicon variant (%d), set SR1.0\n",
+				 gpsw_variant);
+			gpsw_variant = 0;
+		}
+		soc_dev_attr->revision = kasprintf(GFP_KERNEL, "SR%s",
+						   am62p_gpsw_rev_string_map[gpsw_variant]);
+		break;
 	default:
 		variant++;
 		soc_dev_attr->revision = kasprintf(GFP_KERNEL, "SR%x.0",
@@ -173,7 +208,7 @@ static int k3_chipinfo_probe(struct platform_device *pdev)
 		goto err;
 	}
 
-	ret = k3_chipinfo_variant_to_sr(partno_id, variant, soc_dev_attr);
+	ret = k3_chipinfo_variant_to_sr(dev, partno_id, variant, soc_dev_attr);
 	if (ret) {
 		dev_err(dev, "Unknown SoC SR[0x%08X]: %d\n", jtag_id, ret);
 		goto err;
-- 
2.52.0



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v3 0/2] Add AM62P silicon revision detection via NVMEM
  2026-02-09 17:23 [PATCH v3 0/2] Add AM62P silicon revision detection via NVMEM Judith Mendez
  2026-02-09 17:23 ` [PATCH v3 1/2] dt-bindings: hwinfo: ti,k3-socinfo: Add nvmem-cells support Judith Mendez
  2026-02-09 17:23 ` [PATCH v3 2/2] soc: ti: k3-socinfo: Add support for AM62P variants via NVMEM Judith Mendez
@ 2026-05-05 13:59 ` Nishanth Menon
  2026-05-06 11:09 ` Francesco Dolcini
  3 siblings, 0 replies; 6+ messages in thread
From: Nishanth Menon @ 2026-05-05 13:59 UTC (permalink / raw)
  To: Vignesh Raghavendra, Tero Kristo, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Santosh Shilimkar,
	Judith Mendez
  Cc: Nishanth Menon, linux-arm-kernel, devicetree, linux-kernel,
	Andrew Davis

Hi Judith Mendez,

On Mon, 09 Feb 2026 11:23:28 -0600, Judith Mendez wrote:
> This series adds support for detecting AM62P silicon revisions using
> the NVMEM framework to read the GP_SW1 register.
> 
> Background:
> ===========
> On AM62P SoCs, the standard JTAGID register does not provide information
> on silicon revision, instead the GP_SW1 register contains the information
> needed for proper device identification.
> 
> [...]

I have applied the following to branch ti-drivers-soc-next on [1].
Thank you!

[1/2] dt-bindings: hwinfo: ti,k3-socinfo: Add nvmem-cells support
      commit: b0ea5175358f0872ffdc9c6073585637dc01815a
[2/2] soc: ti: k3-socinfo: Add support for AM62P variants via NVMEM
      commit: 97cfbd30525ef0df3de0681a4ca04a80a06d4f16

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent up the chain during
the next merge window (or sooner if it is a relevant bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/ti/linux.git
-- 
Regards,
Nishanth Menon
Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3  1A34 DDB5 849D 1736 249D
https://ti.com/opensource



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v3 0/2] Add AM62P silicon revision detection via NVMEM
  2026-02-09 17:23 [PATCH v3 0/2] Add AM62P silicon revision detection via NVMEM Judith Mendez
                   ` (2 preceding siblings ...)
  2026-05-05 13:59 ` [PATCH v3 0/2] Add AM62P silicon revision detection " Nishanth Menon
@ 2026-05-06 11:09 ` Francesco Dolcini
  2026-05-06 14:09   ` Andrew Davis
  3 siblings, 1 reply; 6+ messages in thread
From: Francesco Dolcini @ 2026-05-06 11:09 UTC (permalink / raw)
  To: Judith Mendez
  Cc: Nishanth Menon, Vignesh Raghavendra, Tero Kristo, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Santosh Shilimkar,
	linux-arm-kernel, devicetree, linux-kernel, Andrew Davis

Hello Judith,

On Mon, Feb 09, 2026 at 11:23:28AM -0600, Judith Mendez wrote:

...

> - NVMEM support is fully optional - the driver continues to work without
>   it and falls back to SR1.0 for AM62P devices

Is this correct? Just wanted to be sure, given the issue we had with TI
6.18 kernel on this very specific topic.

Francesco



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v3 0/2] Add AM62P silicon revision detection via NVMEM
  2026-05-06 11:09 ` Francesco Dolcini
@ 2026-05-06 14:09   ` Andrew Davis
  0 siblings, 0 replies; 6+ messages in thread
From: Andrew Davis @ 2026-05-06 14:09 UTC (permalink / raw)
  To: Francesco Dolcini, Judith Mendez
  Cc: Nishanth Menon, Vignesh Raghavendra, Tero Kristo, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Santosh Shilimkar,
	linux-arm-kernel, devicetree, linux-kernel

On 5/6/26 6:09 AM, Francesco Dolcini wrote:
> Hello Judith,
> 
> On Mon, Feb 09, 2026 at 11:23:28AM -0600, Judith Mendez wrote:
> 
> ...
> 
>> - NVMEM support is fully optional - the driver continues to work without
>>    it and falls back to SR1.0 for AM62P devices
> 
> Is this correct? Just wanted to be sure, given the issue we had with TI
> 6.18 kernel on this very specific topic.
> 

If you do not define an NVMEM node in DT then this driver falls back to
SR1.0 and continues working. If you do define an NVMEN node but do not
enable the NVMEM driver for that node then you will go into a probe
defer loop as you found. This is a general issue not specific to this
driver that could perhaps be solved by setting limits on probe reattempts,
but that is outside the scope of this series.

Andrew

> Francesco
> 



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-05-06 14:09 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-09 17:23 [PATCH v3 0/2] Add AM62P silicon revision detection via NVMEM Judith Mendez
2026-02-09 17:23 ` [PATCH v3 1/2] dt-bindings: hwinfo: ti,k3-socinfo: Add nvmem-cells support Judith Mendez
2026-02-09 17:23 ` [PATCH v3 2/2] soc: ti: k3-socinfo: Add support for AM62P variants via NVMEM Judith Mendez
2026-05-05 13:59 ` [PATCH v3 0/2] Add AM62P silicon revision detection " Nishanth Menon
2026-05-06 11:09 ` Francesco Dolcini
2026-05-06 14:09   ` Andrew Davis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox