Skip to contentSkip to conversation

Add support for AM62P SR1.2

PATCH In review Judith Mendez 3 participants 12 messages Aug 5, 2025 – Aug 7, 2025

Subsystems (6)
lore
Share & tools
lore

Judith Mendez

author maintainer
#0 lore raw

cover Add support for AM62P SR1.2

This patch series adds support for the AM62P SR1.2 silicon revision by adding logic in k3-socinfo to detect AM62P variants. Also update binding doc to account for second register range GP_SW.

This also disables HS400 support for AM62P SR1.0 and SR1.1 in sdhci host driver and enable by default for AM62P SR1.2.

Tested against AM62P SR1.2, SR1.1, SR1.0 and AM62X SK. Log for AM62P SR1.2:
https://gist.github.com/jmenti/5d06c60a94104a476eda9371ab6c7f37

Judith Mendez (4):
dt-bindings: hwinfo: Add second register range for GP_SW
soc: ti: k3-socinfo: Add support for AM62P variants
mmc: sdhci_am654: Disable HS400 for AM62P SR1.0 and SR1.1
arm64: dts: ti: k3-am62p-j722s-common-wakeup: Add GP_SW reg range to
chipid node

 .../bindings/hwinfo/ti,k3-socinfo.yaml        |  9 +-
 .../dts/ti/k3-am62p-j722s-common-wakeup.dtsi  |  3 +-
 drivers/mmc/host/sdhci_am654.c                | 16 ++++
 drivers/soc/ti/k3-socinfo.c                   | 82 +++++++++++++++++--
 4 files changed, 98 insertions(+), 12 deletions(-)
Signature · 1 line
2.49.0
author maintainer
#1 lore raw

PATCH 1/4 dt-bindings: hwinfo: Add second register range for GP_SW

This adds a second register range in ti,k3-socinfo. This register range can also be used to detect silicon revisions.

AM62px SR1.0, SR1.1, and SR1.2 can only be distinguished with GP_SW registers, so increase maximum items to 2 for reg property and update the example.

---
 .../devicetree/bindings/hwinfo/ti,k3-socinfo.yaml        | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
Documentation/devicetree/bindings/hwinfo/ti,k3-socinfo.yaml +6 -3
index dada28b47ea0..3b656fc0cb5a 100644
@@ -24,7 +24,8 @@ properties:
       - const: ti,am654-chipid
 
   reg:
-    maxItems: 1
+    maxItems: 2
+    minItems: 1
 
 required:
   - compatible
@@ -34,7 +35,9 @@ additionalProperties: false
 
 examples:
   - |
-    chipid@43000014 {
+    chipid@14 {
         compatible = "ti,am654-chipid";
-        reg = <0x43000014 0x4>;
+        reg = <0x43000014 0x4>,
+              <0x43000230 0x10>;
+        bootph-all;
     };
Signature · 1 line
2.49.0
#2 lore raw

Re: [PATCH 1/4] dt-bindings: hwinfo: Add second register range for GP_SW

Quoted 1 line · Judith Mendez

This adds a second register range in ti,k3-socinfo. This register

Please do not use "This commit/patch/change", but imperative mood. See longer explanation here:
https://elixir.bootlin.com/linux/v5.17.1/source/Documentation/process/submitting-patches.rst#L95

Quoted 16 lines

range can also be used to detect silicon revisions.

AM62px SR1.0, SR1.1, and SR1.2 can only be distinguished with GP_SW registers, so increase maximum items to 2 for reg property and update the example.

---
 .../devicetree/bindings/hwinfo/ti,k3-socinfo.yaml        | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
Documentation/devicetree/bindings/hwinfo/ti,k3-socinfo.yaml +0 -0
index dada28b47ea0..3b656fc0cb5a 100644

Documentation/devicetree/bindings/hwinfo/ti,k3-socinfo.yaml properties: · line 28

Quoted 6 lines
Documentation/devicetree/bindings/hwinfo/ti,k3-socinfo.yaml +2 -1
@@ -24,7 +24,8 @@ properties:
       - const: ti,am654-chipid
 
   reg:
-    maxItems: 1
+    maxItems: 2
+    minItems: 1

They always come with reversed order... but anyway, you instead must list the items with minItems.

another problem is that this is not supposed to be per register. I already complained more than once about some of TI bindings: stop creating device nodes or address spaces per register.

That's one address space.

Documentation/devicetree/bindings/hwinfo/ti,k3-socinfo.yaml additionalProperties: false · line 38

Quoted 9 lines
Documentation/devicetree/bindings/hwinfo/ti,k3-socinfo.yaml +1 -1
 required:
   - compatible
@@ -34,7 +35,9 @@ additionalProperties: false
 
 examples:
   - |
-    chipid@43000014 {
+    chipid@14 {

And this was never even checked :/ You have clear warnings here.

Best regards,
Krzysztof

author maintainer
#3 lore raw

Re: [PATCH 1/4] dt-bindings: hwinfo: Add second register range for GP_SW

Hi Krystoff,

Quoted 6 lines · Krzysztof Kozlowski
Quoted 1 line · Judith Mendez

This adds a second register range in ti,k3-socinfo. This register

Please do not use "This commit/patch/change", but imperative mood. See longer explanation here:
https://elixir.bootlin.com/linux/v5.17.1/source/Documentation/process/submitting-patches.rst#L95

I can reword this.

Quoted 28 lines
Quoted 18 lines

range can also be used to detect silicon revisions.

AM62px SR1.0, SR1.1, and SR1.2 can only be distinguished with GP_SW registers, so increase maximum items to 2 for reg property and update the example.

---
  .../devicetree/bindings/hwinfo/ti,k3-socinfo.yaml        | 9 ++++++---
  1 file changed, 6 insertions(+), 3 deletions(-)
Documentation/devicetree/bindings/hwinfo/ti,k3-socinfo.yaml +0 -0
index dada28b47ea0..3b656fc0cb5a 100644

Documentation/devicetree/bindings/hwinfo/ti,k3-socinfo.yaml properties: · line 28

Quoted 6 lines
Documentation/devicetree/bindings/hwinfo/ti,k3-socinfo.yaml +2 -1
@@ -24,7 +24,8 @@ properties:
        - const: ti,am654-chipid
 
    reg:
-    maxItems: 1
+    maxItems: 2
+    minItems: 1

They always come with reversed order... but anyway, you instead must list the items with minItems.

Quoted 5 lines

another problem is that this is not supposed to be per register. I already complained more than once about some of TI bindings: stop creating device nodes or address spaces per register.

That's one address space.

That does not really make sense. Registers jtag vs gp_sw have a different back-end, one from silicon and another from efuse. Not even sure if the memory map will always be the same across processors.

Quoted 6 lines
Quoted 6 lines
Documentation/devicetree/bindings/hwinfo/ti,k3-socinfo.yaml +0 -0
  required:
    - compatible
@@ -34,7 +35,9 @@ additionalProperties: false
 
Quoted 6 lines

Documentation/devicetree/bindings/hwinfo/ti,k3-socinfo.yaml additionalProperties: false · line 38

Quoted 4 lines
Documentation/devicetree/bindings/hwinfo/ti,k3-socinfo.yaml +1 -1
  examples:
    - |
-    chipid@43000014 {
+    chipid@14 {

And this was never even checked :/ You have clear warnings here.

I will double check this.

~ Judith

#4 lore raw

Re: [PATCH 1/4] dt-bindings: hwinfo: Add second register range for GP_SW

Quoted 1 line · Judith Mendez

Hi Krystoff,

That's not really my name. I know it is tricky to type, so it's enough to say Hi.

Quoted 9 lines
Quoted 9 lines

Documentation/devicetree/bindings/hwinfo/ti,k3-socinfo.yaml properties: · line 28

Quoted 5 lines

reg:

Documentation/devicetree/bindings/hwinfo/ti,k3-socinfo.yaml +2 -1
-    maxItems: 1
+    maxItems: 2
+    minItems: 1

They always come with reversed order... but anyway, you instead must list the items with minItems.

Quoted 8 lines
Quoted 5 lines

another problem is that this is not supposed to be per register. I already complained more than once about some of TI bindings: stop creating device nodes or address spaces per register.

That's one address space.

That does not really make sense. Registers jtag vs gp_sw have a different back-end, one from silicon and another from efuse. Not even

How does the datasheet describe this address space(s) (not registers, address space)?

Quoted 3 lines

sure if the memory map will always be the same across processors.

Quoted 1 line

Best regards,
Krzysztof

author maintainer
#5 lore raw

PATCH 2/4 soc: ti: k3-socinfo: Add support for AM62P variants

In reply to Judith Mendez

This adds a support for detecting AM62P SR1.0, SR1.1, SR1.2.

On AM62P, silicon revision is discovered with GP_SW1 instead of JTAGID register, so introduce GP_SW register range to determine SoC revision.

---
 drivers/soc/ti/k3-socinfo.c | 82 +++++++++++++++++++++++++++++++++----
 1 file changed, 74 insertions(+), 8 deletions(-)
drivers/soc/ti/k3-socinfo.c +74 -8
index d716be113c84..9daeced656d6 100644
@@ -15,6 +15,7 @@
 #include <linux/sys_soc.h>
 
 #define CTRLMMR_WKUP_JTAGID_REG		0
+#define CTRLMMR_WKUP_GP_SW1_REG		4
 /*
  * Bits:
  *  31-28 VARIANT	Device variant
@@ -62,10 +63,63 @@ static const struct k3_soc_id {
 	{ JTAG_ID_PARTNO_AM62LX, "AM62LX" },
 };
 
+static const struct regmap_config k3_chipinfo_regmap_cfg = {
+	.reg_bits = 32,
+	.val_bits = 32,
+	.reg_stride = 4,
+};
+
 static const char * const j721e_rev_string_map[] = {
 	"1.0", "1.1", "2.0",
 };
 
+static const char * const am62p_gpsw_rev_string_map[] = {
+	"1.0", "1.1", "1.2",
+};
+
+static int
+k3_chipinfo_get_variant_alternate(struct platform_device *pdev, unsigned int partno, u32 *variant)
+{
+	struct device *dev = &pdev->dev;
+	struct regmap *regmap;
+	void __iomem *base;
+	u32 offset;
+	int ret;
+
+	base = devm_platform_ioremap_resource(pdev, 1);
+	if (IS_ERR(base))
+		return PTR_ERR(base);
+
+	regmap = regmap_init_mmio(dev, base, &k3_chipinfo_regmap_cfg);
+	if (IS_ERR(regmap))
+		return PTR_ERR(regmap);
+
+	switch (partno) {
+	case JTAG_ID_PARTNO_AM62PX:
+		offset = CTRLMMR_WKUP_GP_SW1_REG;
+		break;
+	default:
+		offset = CTRLMMR_WKUP_GP_SW1_REG;
+	}
+
+	ret = regmap_read(regmap, offset, variant);
+
+	if (ret < 0)
+		return ret;
+
+	return 0;
+}
+
+static bool k3_chipinfo_variant_in_gp_sw(unsigned int partno)
+{
+	switch (partno) {
+	case JTAG_ID_PARTNO_AM62PX:
+		return true;
+	default:
+		return false;
+	}
+}
+
 static int
 k3_chipinfo_partno_to_names(unsigned int partno,
 			    struct soc_device_attribute *soc_dev_attr)
@@ -83,8 +137,10 @@ 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)
+			  struct soc_device_attribute *soc_dev_attr, u32 gp_sw1)
 {
+	u32 gpsw_variant = gp_sw1 % 16;
+
 	switch (partno) {
 	case JTAG_ID_PARTNO_J721E:
 		if (variant >= ARRAY_SIZE(j721e_rev_string_map))
@@ -92,6 +148,13 @@ k3_chipinfo_variant_to_sr(unsigned int partno, unsigned int variant,
 		soc_dev_attr->revision = kasprintf(GFP_KERNEL, "SR%s",
 						   j721e_rev_string_map[variant]);
 		break;
+	case JTAG_ID_PARTNO_AM62PX:
+		/* Always parse AM62P variant from GP_SW1 */
+		if (gpsw_variant >= ARRAY_SIZE(am62p_gpsw_rev_string_map))
+			goto err_unknown_variant;
+		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",
@@ -107,12 +170,6 @@ k3_chipinfo_variant_to_sr(unsigned int partno, unsigned int variant,
 	return -ENODEV;
 }
 
-static const struct regmap_config k3_chipinfo_regmap_cfg = {
-	.reg_bits = 32,
-	.val_bits = 32,
-	.reg_stride = 4,
-};
-
 static int k3_chipinfo_probe(struct platform_device *pdev)
 {
 	struct device_node *node = pdev->dev.of_node;
@@ -121,6 +178,7 @@ static int k3_chipinfo_probe(struct platform_device *pdev)
 	struct soc_device *soc_dev;
 	struct regmap *regmap;
 	void __iomem *base;
+	u32 gp_sw1_val = 0;
 	u32 partno_id;
 	u32 variant;
 	u32 jtag_id;
@@ -163,7 +221,15 @@ static int k3_chipinfo_probe(struct platform_device *pdev)
 		goto err;
 	}
 
-	ret = k3_chipinfo_variant_to_sr(partno_id, variant, soc_dev_attr);
+	if (k3_chipinfo_variant_in_gp_sw(partno_id)) {
+		ret = k3_chipinfo_get_variant_alternate(pdev, partno_id, &gp_sw1_val);
+		if (ret < 0) {
+			dev_err(dev, "Failed to read GP_SW1: %d\n", ret);
+			goto err;
+		}
+	}
+
+	ret = k3_chipinfo_variant_to_sr(partno_id, variant, soc_dev_attr, gp_sw1_val);
 	if (ret) {
 		dev_err(dev, "Unknown SoC SR[0x%08X]: %d\n", jtag_id, ret);
 		goto err;
Signature · 1 line
2.49.0
#6 lore raw

Re: [PATCH 2/4] soc: ti: k3-socinfo: Add support for AM62P variants

Quoted 44 lines · Judith Mendez

This adds a support for detecting AM62P SR1.0, SR1.1, SR1.2.

On AM62P, silicon revision is discovered with GP_SW1 instead of JTAGID register, so introduce GP_SW register range to determine SoC revision.

---
  drivers/soc/ti/k3-socinfo.c | 82 +++++++++++++++++++++++++++++++++----
  1 file changed, 74 insertions(+), 8 deletions(-)
drivers/soc/ti/k3-socinfo.c +15 -0
index d716be113c84..9daeced656d6 100644
@@ -15,6 +15,7 @@
  #include <linux/sys_soc.h>
 
  #define CTRLMMR_WKUP_JTAGID_REG		0
+#define CTRLMMR_WKUP_GP_SW1_REG		4
  /*
   * Bits:
   *  31-28 VARIANT	Device variant
@@ -62,10 +63,63 @@ static const struct k3_soc_id {
  	{ JTAG_ID_PARTNO_AM62LX, "AM62LX" },
  };
 
+static const struct regmap_config k3_chipinfo_regmap_cfg = {
+	.reg_bits = 32,
+	.val_bits = 32,
+	.reg_stride = 4,
+};
+
  static const char * const j721e_rev_string_map[] = {
  	"1.0", "1.1", "2.0",
  };
 
+static const char * const am62p_gpsw_rev_string_map[] = {
+	"1.0", "1.1", "1.2",
+};
+
+static int
+k3_chipinfo_get_variant_alternate(struct platform_device *pdev, unsigned int partno, u32 *variant)
+{
+	struct device *dev = &pdev->dev;

drivers/soc/ti/k3-socinfo.c static const struct k3_soc_id { · line 93

Quoted 10 lines
drivers/soc/ti/k3-socinfo.c +10 -0
+	struct regmap *regmap;
+	void __iomem *base;
+	u32 offset;
+	int ret;
+
+	base = devm_platform_ioremap_resource(pdev, 1);
+	if (IS_ERR(base))
+		return PTR_ERR(base);
+
+	regmap = regmap_init_mmio(dev, base, &k3_chipinfo_regmap_cfg);

devm_regmap_init_mmio()

Otherwise this regmap never gets freed up in the error paths.

drivers/soc/ti/k3-socinfo.c static const struct k3_soc_id { · line 102

Quoted 9 lines
drivers/soc/ti/k3-socinfo.c +9 -0
+	if (IS_ERR(regmap))
+		return PTR_ERR(regmap);
+
+	switch (partno) {
+	case JTAG_ID_PARTNO_AM62PX:
+		offset = CTRLMMR_WKUP_GP_SW1_REG;
+		break;
+	default:
+		offset = CTRLMMR_WKUP_GP_SW1_REG;

This switch case does nothing, if offset ever can get any other value, then you can add it back.

drivers/soc/ti/k3-socinfo.c static const struct k3_soc_id { · line 106

Quoted 4 lines
drivers/soc/ti/k3-socinfo.c +4 -0
+	}
+
+	ret = regmap_read(regmap, offset, variant);
+

Extra newline

drivers/soc/ti/k3-socinfo.c static const struct k3_soc_id { · line 116

Quoted 10 lines
drivers/soc/ti/k3-socinfo.c +10 -0
+	if (ret < 0)
+		return ret;
+
+	return 0;
+}
+
+static bool k3_chipinfo_variant_in_gp_sw(unsigned int partno)
+{
+	switch (partno) {
+	case JTAG_ID_PARTNO_AM62PX:

Do you really need a function just to hold a switch-case? You also have a switch-case that checks for PARTNO_AM62PX in the below function that makes use of the extra "gp_sw1", why not inside that case fetch the value. Would avoid passing in a variable "gp_sw1" which is unused in all but the PARTNO_AM62PX case.

Andrew

Quoted 73 lines
drivers/soc/ti/k3-socinfo.c +26 -8
+		return true;
+	default:
+		return false;
+	}
+}
+
  static int
  k3_chipinfo_partno_to_names(unsigned int partno,
  			    struct soc_device_attribute *soc_dev_attr)
@@ -83,8 +137,10 @@ 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)
+			  struct soc_device_attribute *soc_dev_attr, u32 gp_sw1)
  {
+	u32 gpsw_variant = gp_sw1 % 16;
+
  	switch (partno) {
  	case JTAG_ID_PARTNO_J721E:
  		if (variant >= ARRAY_SIZE(j721e_rev_string_map))
@@ -92,6 +148,13 @@ k3_chipinfo_variant_to_sr(unsigned int partno, unsigned int variant,
  		soc_dev_attr->revision = kasprintf(GFP_KERNEL, "SR%s",
  						   j721e_rev_string_map[variant]);
  		break;
+	case JTAG_ID_PARTNO_AM62PX:
+		/* Always parse AM62P variant from GP_SW1 */
+		if (gpsw_variant >= ARRAY_SIZE(am62p_gpsw_rev_string_map))
+			goto err_unknown_variant;
+		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",
@@ -107,12 +170,6 @@ k3_chipinfo_variant_to_sr(unsigned int partno, unsigned int variant,
  	return -ENODEV;
  }
 
-static const struct regmap_config k3_chipinfo_regmap_cfg = {
-	.reg_bits = 32,
-	.val_bits = 32,
-	.reg_stride = 4,
-};
-
  static int k3_chipinfo_probe(struct platform_device *pdev)
  {
  	struct device_node *node = pdev->dev.of_node;
@@ -121,6 +178,7 @@ static int k3_chipinfo_probe(struct platform_device *pdev)
  	struct soc_device *soc_dev;
  	struct regmap *regmap;
  	void __iomem *base;
+	u32 gp_sw1_val = 0;
  	u32 partno_id;
  	u32 variant;
  	u32 jtag_id;
@@ -163,7 +221,15 @@ static int k3_chipinfo_probe(struct platform_device *pdev)
  		goto err;
  	}
 
-	ret = k3_chipinfo_variant_to_sr(partno_id, variant, soc_dev_attr);
+	if (k3_chipinfo_variant_in_gp_sw(partno_id)) {
+		ret = k3_chipinfo_get_variant_alternate(pdev, partno_id, &gp_sw1_val);
+		if (ret < 0) {
+			dev_err(dev, "Failed to read GP_SW1: %d\n", ret);
+			goto err;
+		}
+	}
+
+	ret = k3_chipinfo_variant_to_sr(partno_id, variant, soc_dev_attr, gp_sw1_val);
  	if (ret) {
  		dev_err(dev, "Unknown SoC SR[0x%08X]: %d\n", jtag_id, ret);
  		goto err;
author maintainer
#7 lore raw

Re: [PATCH 2/4] soc: ti: k3-socinfo: Add support for AM62P variants

Hi Andrew,

Quoted 56 lines · Andrew Davis
Quoted 42 lines · Judith Mendez

This adds a support for detecting AM62P SR1.0, SR1.1, SR1.2.

On AM62P, silicon revision is discovered with GP_SW1 instead of JTAGID register, so introduce GP_SW register range to determine SoC revision.

---
  drivers/soc/ti/k3-socinfo.c | 82 +++++++++++++++++++++++++++++++++----

  1 file changed, 74 insertions(+), 8 deletions(-)
drivers/soc/ti/k3-socinfo.c +15 -0
index d716be113c84..9daeced656d6 100644
@@ -15,6 +15,7 @@
   #include <linux/sys_soc.h>
   #define CTRLMMR_WKUP_JTAGID_REG        0
+#define CTRLMMR_WKUP_GP_SW1_REG        4
   /*
    * Bits:
    *  31-28 VARIANT    Device variant
@@ -62,10 +63,63 @@ static const struct k3_soc_id {
       { JTAG_ID_PARTNO_AM62LX, "AM62LX" },
   };
+static const struct regmap_config k3_chipinfo_regmap_cfg = {
+    .reg_bits = 32,
+    .val_bits = 32,
+    .reg_stride = 4,
+};
+
   static const char * const j721e_rev_string_map[] = {
       "1.0", "1.1", "2.0",
   };
+static const char * const am62p_gpsw_rev_string_map[] = {
+    "1.0", "1.1", "1.2",
+};
+
+static int
+k3_chipinfo_get_variant_alternate(struct platform_device *pdev, 
 unsigned int partno, u32 *variant)
+{
+    struct device *dev = &pdev->dev;

drivers/soc/ti/k3-socinfo.c static const struct k3_soc_id { · line 92

Quoted 10 lines
drivers/soc/ti/k3-socinfo.c +10 -0
+    struct regmap *regmap;
+    void __iomem *base;
+    u32 offset;
+    int ret;
+
+    base = devm_platform_ioremap_resource(pdev, 1);
+    if (IS_ERR(base))
+        return PTR_ERR(base);
+
+    regmap = regmap_init_mmio(dev, base, &k3_chipinfo_regmap_cfg);

devm_regmap_init_mmio()

Quoted 1 line

Otherwise this regmap never gets freed up in the error paths.

Thanks for reviewing, but....

I have completely changed this patch in v2, feel free to review v2 though (:

..

author maintainer
#8 lore raw

PATCH 3/4 mmc: sdhci_am654: Disable HS400 for AM62P SR1.0 and SR1.1

In reply to Judith Mendez

This adds SDHCI_AM654_QUIRK_DISABLE_HS400 quirk which shall be used to disable HS400 support. AM62P SR1.0 and SR1.1 do not support HS400 due to errata i2458 [0] so disable HS400 for these SoC revisions.

[0] https://www.ti.com/lit/er/sprz574a/sprz574a.pdf

---
 drivers/mmc/host/sdhci_am654.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
drivers/mmc/host/sdhci_am654.c +16 -0
index e4fc345be7e5..b7d2adff3277 100644
@@ -156,6 +156,7 @@ struct sdhci_am654_data {
 
 #define SDHCI_AM654_QUIRK_FORCE_CDTEST BIT(0)
 #define SDHCI_AM654_QUIRK_SUPPRESS_V1P8_ENA BIT(1)
+#define SDHCI_AM654_QUIRK_DISABLE_HS400 BIT(2)
 };
 
 struct window {
@@ -820,6 +821,9 @@ static int sdhci_am654_init(struct sdhci_host *host)
 	if (ret)
 		goto err_cleanup_host;
 
+	if (sdhci_am654->quirks & SDHCI_AM654_QUIRK_DISABLE_HS400)
+		host->mmc->caps2 &= ~(MMC_CAP2_HS400 | MMC_CAP2_HS400_ES);
+
 	ret = __sdhci_add_host(host);
 	if (ret)
 		goto err_cleanup_host;
@@ -883,6 +887,12 @@ static int sdhci_am654_get_of_property(struct platform_device *pdev,
 	return 0;
 }
 
+static const struct soc_device_attribute sdhci_am654_descope_hs400[] = {
+	{ .family = "AM62PX", .revision = "SR1.0" },
+	{ .family = "AM62PX", .revision = "SR1.1" },
+	{ /* sentinel */ }
+};
+
 static const struct of_device_id sdhci_am654_of_match[] = {
 	{
 		.compatible = "ti,am654-sdhci-5.1",
@@ -970,6 +980,12 @@ static int sdhci_am654_probe(struct platform_device *pdev)
 	if (ret)
 		return dev_err_probe(dev, ret, "parsing dt failed\n");
 
+	soc = soc_device_match(sdhci_am654_descope_hs400);
+	if (soc) {
+		dev_err(dev, "Disable descoped HS400 mode for this silicon revision\n");
+		sdhci_am654->quirks |= SDHCI_AM654_QUIRK_DISABLE_HS400;
+	}
+
 	host->mmc_host_ops.start_signal_voltage_switch = sdhci_am654_start_signal_voltage_switch;
 	host->mmc_host_ops.execute_tuning = sdhci_am654_execute_tuning;
 
Signature · 1 line
2.49.0
#9 lore raw

Re: [PATCH 3/4] mmc: sdhci_am654: Disable HS400 for AM62P SR1.0 and SR1.1

Quoted 46 lines · Judith Mendez

This adds SDHCI_AM654_QUIRK_DISABLE_HS400 quirk which shall be used to disable HS400 support. AM62P SR1.0 and SR1.1 do not support HS400 due to errata i2458 [0] so disable HS400 for these SoC revisions.

[0] https://www.ti.com/lit/er/sprz574a/sprz574a.pdf

---
  drivers/mmc/host/sdhci_am654.c | 16 ++++++++++++++++
  1 file changed, 16 insertions(+)
drivers/mmc/host/sdhci_am654.c +10 -0
index e4fc345be7e5..b7d2adff3277 100644
@@ -156,6 +156,7 @@ struct sdhci_am654_data {
 
  #define SDHCI_AM654_QUIRK_FORCE_CDTEST BIT(0)
  #define SDHCI_AM654_QUIRK_SUPPRESS_V1P8_ENA BIT(1)
+#define SDHCI_AM654_QUIRK_DISABLE_HS400 BIT(2)
  };
 
  struct window {
@@ -820,6 +821,9 @@ static int sdhci_am654_init(struct sdhci_host *host)
  	if (ret)
  		goto err_cleanup_host;
 
+	if (sdhci_am654->quirks & SDHCI_AM654_QUIRK_DISABLE_HS400)
+		host->mmc->caps2 &= ~(MMC_CAP2_HS400 | MMC_CAP2_HS400_ES);
+
  	ret = __sdhci_add_host(host);
  	if (ret)
  		goto err_cleanup_host;
@@ -883,6 +887,12 @@ static int sdhci_am654_get_of_property(struct platform_device *pdev,
  	return 0;
  }
 
+static const struct soc_device_attribute sdhci_am654_descope_hs400[] = {
+	{ .family = "AM62PX", .revision = "SR1.0" },
+	{ .family = "AM62PX", .revision = "SR1.1" },
+	{ /* sentinel */ }
+};
+
  static const struct of_device_id sdhci_am654_of_match[] = {
  	{
  		.compatible = "ti,am654-sdhci-5.1",

drivers/mmc/host/sdhci_am654.c static int sdhci_am654_probe(struct platform_device *pdev) · line 985

Quoted 6 lines
drivers/mmc/host/sdhci_am654.c +3 -0
@@ -970,6 +980,12 @@ static int sdhci_am654_probe(struct platform_device *pdev)
  	if (ret)
  		return dev_err_probe(dev, ret, "parsing dt failed\n");
 
+	soc = soc_device_match(sdhci_am654_descope_hs400);
+	if (soc) {
+		dev_err(dev, "Disable descoped HS400 mode for this silicon revision\n");

Not really an error, use dev_info() or dev_warn(). Also this message should go up in the init function when the caps are actually removed, and only printed if the caps were set in the first place.

Andrew

Quoted 6 lines
drivers/mmc/host/sdhci_am654.c +3 -0
+		sdhci_am654->quirks |= SDHCI_AM654_QUIRK_DISABLE_HS400;
+	}
+
  	host->mmc_host_ops.start_signal_voltage_switch = sdhci_am654_start_signal_voltage_switch;
  	host->mmc_host_ops.execute_tuning = sdhci_am654_execute_tuning;
 
author maintainer
#10 lore raw

Re: [PATCH 3/4] mmc: sdhci_am654: Disable HS400 for AM62P SR1.0 and SR1.1

Hi Andrew,

Quoted 47 lines · Andrew Davis
Quoted 46 lines · Judith Mendez

This adds SDHCI_AM654_QUIRK_DISABLE_HS400 quirk which shall be used to disable HS400 support. AM62P SR1.0 and SR1.1 do not support HS400 due to errata i2458 [0] so disable HS400 for these SoC revisions.

[0] https://www.ti.com/lit/er/sprz574a/sprz574a.pdf

---
  drivers/mmc/host/sdhci_am654.c | 16 ++++++++++++++++

  1 file changed, 16 insertions(+)
drivers/mmc/host/sdhci_am654.c +10 -0
index e4fc345be7e5..b7d2adff3277 100644
@@ -156,6 +156,7 @@ struct sdhci_am654_data {
   #define SDHCI_AM654_QUIRK_FORCE_CDTEST BIT(0)
   #define SDHCI_AM654_QUIRK_SUPPRESS_V1P8_ENA BIT(1)
+#define SDHCI_AM654_QUIRK_DISABLE_HS400 BIT(2)
   };
   struct window {
@@ -820,6 +821,9 @@ static int sdhci_am654_init(struct sdhci_host *host)
       if (ret)
           goto err_cleanup_host;
+    if (sdhci_am654->quirks & SDHCI_AM654_QUIRK_DISABLE_HS400)
+        host->mmc->caps2 &= ~(MMC_CAP2_HS400 | MMC_CAP2_HS400_ES);
+
       ret = __sdhci_add_host(host);
       if (ret)
           goto err_cleanup_host;
@@ -883,6 +887,12 @@ static int sdhci_am654_get_of_property(struct 
 platform_device *pdev,
       return 0;
   }
+static const struct soc_device_attribute sdhci_am654_descope_hs400[] = {
+    { .family = "AM62PX", .revision = "SR1.0" },
+    { .family = "AM62PX", .revision = "SR1.1" },
+    { /* sentinel */ }
+};
+
   static const struct of_device_id sdhci_am654_of_match[] = {
       {
           .compatible = "ti,am654-sdhci-5.1",
@@ -970,6 +980,12 @@ static int sdhci_am654_probe(struct 
 platform_device *pdev)
       if (ret)
           return dev_err_probe(dev, ret, "parsing dt failed\n");
Quoted 8 lines

drivers/mmc/host/sdhci_am654.c static int sdhci_am654_probe(struct platform_device *pdev)

Quoted 4 lines
drivers/mmc/host/sdhci_am654.c +3 -0
+    soc = soc_device_match(sdhci_am654_descope_hs400);
+    if (soc) {
+        dev_err(dev, "Disable descoped HS400 mode for this silicon 
 revision\n");

Not really an error, use dev_info() or dev_warn(). Also this message should go up in the init function when the caps are actually removed, and only printed if the caps were set in the first place.

Will fix for v2, thanks

~ Judith

author maintainer
#11 lore raw

PATCH 4/4 arm64: dts: ti: k3-am62p-j722s-common-wakeup: Add GP_SW reg range to chipid node

In reply to Judith Mendez

This adds GP_SW register range to k3-am62p-j722s-common-wakeup which will be used to determine SoC revision.

---
 arch/arm64/boot/dts/ti/k3-am62p-j722s-common-wakeup.dtsi | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/arm64/boot/dts/ti/k3-am62p-j722s-common-wakeup.dtsi +2 -1
index 6757b37a9de3..48778c49d8fc 100644
@@ -18,7 +18,8 @@ wkup_conf: bus@43000000 {
 
 		chipid: chipid@14 {
 			compatible = "ti,am654-chipid";
-			reg = <0x14 0x4>;
+			reg = <0x14 0x4>,
+			      <0x230 0x10>;
 			bootph-all;
 		};
 
Signature · 1 line
2.49.0