Skip to contentSkip to conversation

Add standalone ethernet MAC entries for qcs615

PATCH In review Yijie Yang 4 participants 18 messages Dec 24, 2024 – Dec 27, 2024

Subsystems (7)
lore
Share & tools
lore

Yijie Yang

author
#0 lore raw

v2 cover Add standalone ethernet MAC entries for qcs615

Add separate EMAC entries for qcs615 since its core version is 2.3.1, compared to sm8150's 2.1.2.

---
Changes in v2:
- Update the subject for the first patch.
- Link to v1: https://lore.kernel.org/r/[email protected]

---
Yijie Yang (3):
dt-bindings: net: qcom,ethqos: Drop fallback compatible for qcom,qcs615-ethqos
dt-bindings: net: snps,dwmac: add description for qcs615
net: stmmac: dwmac-qcom-ethqos: add support for EMAC on qcs615 platforms

 Documentation/devicetree/bindings/net/qcom,ethqos.yaml  |  5 +----
 Documentation/devicetree/bindings/net/snps,dwmac.yaml   |  2 ++
 drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c | 17 +++++++++++++++++
 3 files changed, 20 insertions(+), 4 deletions(-)

---
base-commit: 3664e6c4f4d07fa51834cd59d94b42b7f803e79b
change-id: 20241111-schema-7915779020f5

Best regards,

Signature · 1 line
Yijie Yang <[email protected]>
author
#1 lore raw

PATCH v2 1/3 dt-bindings: net: qcom,ethqos: Drop fallback compatible for qcom,qcs615-ethqos

The core version of EMAC on qcs615 has minor differences compared to that on sm8150. During the bring-up routine, the loopback bit needs to be set, and the Power-On Reset (POR) status of the registers isn't entirely consistent with sm8150 either.
Therefore, it should be treated as a separate entity rather than a fallback option.

Fixes 32535b9410b8 ("dt-bindings: net: qcom,ethqos: add description for qcs615")
---
 Documentation/devicetree/bindings/net/qcom,ethqos.yaml | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
Documentation/devicetree/bindings/net/qcom,ethqos.yaml +1 -4
index 0bcd593a7bd093d4475908d82585c36dd6b3a284..576a52742ff45d4984388bbc0fcc91fa91bab677 100644
@@ -23,12 +23,9 @@ properties:
           - enum:
               - qcom,qcs8300-ethqos
           - const: qcom,sa8775p-ethqos
-      - items:
-          - enum:
-              - qcom,qcs615-ethqos
-          - const: qcom,sm8150-ethqos
       - enum:
           - qcom,qcs404-ethqos
+          - qcom,qcs615-ethqos
           - qcom,sa8775p-ethqos
           - qcom,sc8280xp-ethqos
           - qcom,sm8150-ethqos
Signature · 1 line
2.34.1
#2 lore raw

Re: [PATCH v2 1/3] dt-bindings: net: qcom,ethqos: Drop fallback compatible for qcom,qcs615-ethqos

Quoted 6 lines · Yijie Yang

The core version of EMAC on qcs615 has minor differences compared to that on sm8150. During the bring-up routine, the loopback bit needs to be set, and the Power-On Reset (POR) status of the registers isn't entirely consistent with sm8150 either.
Therefore, it should be treated as a separate entity rather than a fallback option.

... and explanation of ABI impact? You were asked about this last time, so this is supposed to end up here.

Quoted 6 lines
Fixes 32535b9410b8 ("dt-bindings: net: qcom,ethqos: add description for qcs615")
---
 Documentation/devicetree/bindings/net/qcom,ethqos.yaml | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

Best regards,
Krzysztof

author
#3 lore raw

Re: [PATCH v2 1/3] dt-bindings: net: qcom,ethqos: Drop fallback compatible for qcom,qcs615-ethqos

Quoted 10 lines · Krzysztof Kozlowski
Quoted 6 lines · Yijie Yang

The core version of EMAC on qcs615 has minor differences compared to that on sm8150. During the bring-up routine, the loopback bit needs to be set, and the Power-On Reset (POR) status of the registers isn't entirely consistent with sm8150 either.
Therefore, it should be treated as a separate entity rather than a fallback option.

... and explanation of ABI impact? You were asked about this last time, so this is supposed to end up here.

I actually replied to this query last time, but maybe it wasn't clear. Firstly, no one is using Ethernet on this platform yet. Secondly, the previous fallback to sm8150 is incorrect and causes packet loss. Instead, it should fall back to qcs404.

Quoted 9 lines
Quoted 7 lines
Fixes 32535b9410b8 ("dt-bindings: net: qcom,ethqos: add description for qcs615")
---
  Documentation/devicetree/bindings/net/qcom,ethqos.yaml | 5 +----
  1 file changed, 1 insertion(+), 4 deletions(-)

Best regards,
Krzysztof

Signature · 2 lines
Best Regards,
Yijie
#4 lore raw

Re: [PATCH v2 1/3] dt-bindings: net: qcom,ethqos: Drop fallback compatible for qcom,qcs615-ethqos

Quoted 11 lines · Yijie Yang
Quoted 8 lines · Krzysztof Kozlowski
Quoted 6 lines · Yijie Yang

The core version of EMAC on qcs615 has minor differences compared to that on sm8150. During the bring-up routine, the loopback bit needs to be set, and the Power-On Reset (POR) status of the registers isn't entirely consistent with sm8150 either.
Therefore, it should be treated as a separate entity rather than a fallback option.

Quoted 7 lines
Quoted 2 lines

... and explanation of ABI impact? You were asked about this last time, so this is supposed to end up here.

I actually replied to this query last time, but maybe it wasn't clear. Firstly, no one is using Ethernet on this platform yet. Secondly, the previous fallback to sm8150 is incorrect and causes packet loss. Instead, it should fall back to qcs404.

One of the purposes of the commit message is to answer questions reviews might have. You were even asked this question, so that should of been a clue to include the answer in the commit message.

Andrew

author
#5 lore raw

Re: [PATCH v2 1/3] dt-bindings: net: qcom,ethqos: Drop fallback compatible for qcom,qcs615-ethqos

Quoted 15 lines · Andrew Lunn
Quoted 14 lines · Yijie Yang
Quoted 10 lines · Krzysztof Kozlowski
Quoted 6 lines · Yijie Yang

The core version of EMAC on qcs615 has minor differences compared to that on sm8150. During the bring-up routine, the loopback bit needs to be set, and the Power-On Reset (POR) status of the registers isn't entirely consistent with sm8150 either.
Therefore, it should be treated as a separate entity rather than a fallback option.

... and explanation of ABI impact? You were asked about this last time, so this is supposed to end up here.

Quoted 9 lines
Quoted 4 lines

I actually replied to this query last time, but maybe it wasn't clear. Firstly, no one is using Ethernet on this platform yet. Secondly, the previous fallback to sm8150 is incorrect and causes packet loss. Instead, it should fall back to qcs404.

One of the purposes of the commit message is to answer questions reviews might have. You were even asked this question, so that should of been a clue to include the answer in the commit message.

I will include it in the commit message in the next version.

Quoted 1 line

Andrew

Signature · 2 lines
Best Regards,
Yijie
#6 lore raw

Re: [PATCH v2 1/3] dt-bindings: net: qcom,ethqos: Drop fallback compatible for qcom,qcs615-ethqos

In reply to Yijie Yang
Quoted 11 lines · Yijie Yang
Quoted 8 lines · Krzysztof Kozlowski
Quoted 6 lines · Yijie Yang

The core version of EMAC on qcs615 has minor differences compared to that on sm8150. During the bring-up routine, the loopback bit needs to be set, and the Power-On Reset (POR) status of the registers isn't entirely consistent with sm8150 either.
Therefore, it should be treated as a separate entity rather than a fallback option.

Quoted 8 lines
Quoted 2 lines

... and explanation of ABI impact? You were asked about this last time, so this is supposed to end up here.

I actually replied to this query last time, but maybe it wasn't clear. Firstly, no one is using Ethernet on this platform yet. Secondly, the previous fallback to sm8150 is incorrect and causes packet loss. Instead, it should fall back to qcs404.

And if you send v3 with same commit msg, I will ask the same. Your commit msg must answer to this.

Best regards,
Krzysztof

author
#7 lore raw

PATCH v2 2/3 dt-bindings: net: snps,dwmac: add description for qcs615

In reply to Yijie Yang

Add the necessary compatible entries for qcs615 to ensure its validation.

---
 Documentation/devicetree/bindings/net/snps,dwmac.yaml | 2 ++
 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/net/snps,dwmac.yaml +2 -0
index eb1f3ae41ab9ab4536a110f6fb3e2facb0225549..658d4479aa4864d0e193f03d65eea8b54e1490df 100644
@@ -68,6 +68,7 @@ properties:
         - loongson,ls2k-dwmac
         - loongson,ls7a-dwmac
         - qcom,qcs404-ethqos
+        - qcom,qcs615-ethqos
         - qcom,sa8775p-ethqos
         - qcom,sc8280xp-ethqos
         - qcom,sm8150-ethqos
@@ -622,6 +623,7 @@ allOf:
                 - ingenic,x1830-mac
                 - ingenic,x2000-mac
                 - qcom,qcs404-ethqos
+                - qcom,qcs615-ethqos
                 - qcom,sa8775p-ethqos
                 - qcom,sc8280xp-ethqos
                 - qcom,sm8150-ethqos
Signature · 1 line
2.34.1
#8 lore raw

Re: [PATCH v2 2/3] dt-bindings: net: snps,dwmac: add description for qcs615

Quoted 7 lines · Yijie Yang

Add the necessary compatible entries for qcs615 to ensure its validation.

---
 Documentation/devicetree/bindings/net/snps,dwmac.yaml | 2 ++
 1 file changed, 2 insertions(+)

This should be squashed with previous, otherwise patchset is not bisectable.

Best regards,
Krzysztof

author
#9 lore raw

PATCH v2 3/3 net: stmmac: dwmac-qcom-ethqos: add support for EMAC on qcs615 platforms

In reply to Yijie Yang

qcs615 uses EMAC version 2.3.1, add the relevant defines and add the new compatible.

---
 drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c +17 -0
index 901a3c1959fa57efb078da795ad4f92a8b6f71e1..8c76beaee48821eb2853f4e3f8bfd37db8cadf78 100644
@@ -249,6 +249,22 @@ static const struct ethqos_emac_driver_data emac_v2_1_0_data = {
 	.has_emac_ge_3 = false,
 };
 
+static const struct ethqos_emac_por emac_v2_3_1_por[] = {
+	{ .offset = RGMII_IO_MACRO_CONFIG,	.value = 0x00C01343 },
+	{ .offset = SDCC_HC_REG_DLL_CONFIG,	.value = 0x2004642C },
+	{ .offset = SDCC_HC_REG_DDR_CONFIG,	.value = 0x00000000 },
+	{ .offset = SDCC_HC_REG_DLL_CONFIG2,	.value = 0x00200000 },
+	{ .offset = SDCC_USR_CTL,		.value = 0x00010800 },
+	{ .offset = RGMII_IO_MACRO_CONFIG2,	.value = 0x00002060 },
+};
+
+static const struct ethqos_emac_driver_data emac_v2_3_1_data = {
+	.por = emac_v2_3_1_por,
+	.num_por = ARRAY_SIZE(emac_v2_3_1_por),
+	.rgmii_config_loopback_en = true,
+	.has_emac_ge_3 = false,
+};
+
 static const struct ethqos_emac_por emac_v3_0_0_por[] = {
 	{ .offset = RGMII_IO_MACRO_CONFIG,	.value = 0x40c01343 },
 	{ .offset = SDCC_HC_REG_DLL_CONFIG,	.value = 0x2004642c },
@@ -898,6 +914,7 @@ static int qcom_ethqos_probe(struct platform_device *pdev)
 
 static const struct of_device_id qcom_ethqos_match[] = {
 	{ .compatible = "qcom,qcs404-ethqos", .data = &emac_v2_3_0_data},
+	{ .compatible = "qcom,qcs615-ethqos", .data = &emac_v2_3_1_data},
 	{ .compatible = "qcom,sa8775p-ethqos", .data = &emac_v4_0_0_data},
 	{ .compatible = "qcom,sc8280xp-ethqos", .data = &emac_v3_0_0_data},
 	{ .compatible = "qcom,sm8150-ethqos", .data = &emac_v2_1_0_data},
Signature · 1 line
2.34.1
#10 lore raw

Re: [PATCH v2 3/3] net: stmmac: dwmac-qcom-ethqos: add support for EMAC on qcs615 platforms

Quoted 13 lines · Yijie Yang

qcs615 uses EMAC version 2.3.1, add the relevant defines and add the new compatible.

---
 drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c +0 -0
index 901a3c1959fa57efb078da795ad4f92a8b6f71e1..8c76beaee48821eb2853f4e3f8bfd37db8cadf78 100644

drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c static const struct ethqos_emac_driver_data emac_v2_1_0_data = { · line 254

Quoted 6 lines
drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c +3 -0
@@ -249,6 +249,22 @@ static const struct ethqos_emac_driver_data emac_v2_1_0_data = {
 	.has_emac_ge_3 = false,
 };
 
+static const struct ethqos_emac_por emac_v2_3_1_por[] = {
+	{ .offset = RGMII_IO_MACRO_CONFIG,	.value = 0x00C01343 },
+	{ .offset = SDCC_HC_REG_DLL_CONFIG,	.value = 0x2004642C },

lowercase the hex, please.

drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c static const struct ethqos_emac_driver_data emac_v2_1_0_data = { · line 266

Quoted 12 lines
drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c +12 -0
+	{ .offset = SDCC_HC_REG_DDR_CONFIG,	.value = 0x00000000 },
+	{ .offset = SDCC_HC_REG_DLL_CONFIG2,	.value = 0x00200000 },
+	{ .offset = SDCC_USR_CTL,		.value = 0x00010800 },
+	{ .offset = RGMII_IO_MACRO_CONFIG2,	.value = 0x00002060 },
+};
+
+static const struct ethqos_emac_driver_data emac_v2_3_1_data = {
+	.por = emac_v2_3_1_por,
+	.num_por = ARRAY_SIZE(emac_v2_3_1_por),
+	.rgmii_config_loopback_en = true,
+	.has_emac_ge_3 = false,
+};

Modulo emac_v2_3_1_por vs emac_v2_3_0_por, this is the same as emac_v2_3_0_data. Which means that bindings for qcs615-ethqos should be corrected to use qcom,qcs404-ethqos as as fallback entry, making this patch unused. Please correct the bindings instead.

Quoted 16 lines
drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c +2 -0
+
 static const struct ethqos_emac_por emac_v3_0_0_por[] = {
 	{ .offset = RGMII_IO_MACRO_CONFIG,	.value = 0x40c01343 },
 	{ .offset = SDCC_HC_REG_DLL_CONFIG,	.value = 0x2004642c },
@@ -898,6 +914,7 @@ static int qcom_ethqos_probe(struct platform_device *pdev)
 
 static const struct of_device_id qcom_ethqos_match[] = {
 	{ .compatible = "qcom,qcs404-ethqos", .data = &emac_v2_3_0_data},
+	{ .compatible = "qcom,qcs615-ethqos", .data = &emac_v2_3_1_data},
 	{ .compatible = "qcom,sa8775p-ethqos", .data = &emac_v4_0_0_data},
 	{ .compatible = "qcom,sc8280xp-ethqos", .data = &emac_v3_0_0_data},
 	{ .compatible = "qcom,sm8150-ethqos", .data = &emac_v2_1_0_data},
Signature · 2 lines
-- 
2.34.1
Signature · 2 lines
With best wishes
Dmitry
author
#11 lore raw

Re: [PATCH v2 3/3] net: stmmac: dwmac-qcom-ethqos: add support for EMAC on qcs615 platforms

Quoted 17 lines · Dmitry Baryshkov
Quoted 16 lines · Yijie Yang

qcs615 uses EMAC version 2.3.1, add the relevant defines and add the new compatible.

---
  drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c | 17 +++++++++++++++++
  1 file changed, 17 insertions(+)
drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c +0 -0
index 901a3c1959fa57efb078da795ad4f92a8b6f71e1..8c76beaee48821eb2853f4e3f8bfd37db8cadf78 100644
@@ -249,6 +249,22 @@ static const struct ethqos_emac_driver_data emac_v2_1_0_data = {
  	.has_emac_ge_3 = false,
  };
 
Quoted 5 lines

drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c static const struct ethqos_emac_driver_data emac_v2_1_0_data = { · line 254

Quoted 3 lines
drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c +3 -0
+static const struct ethqos_emac_por emac_v2_3_1_por[] = {
+	{ .offset = RGMII_IO_MACRO_CONFIG,	.value = 0x00C01343 },
+	{ .offset = SDCC_HC_REG_DLL_CONFIG,	.value = 0x2004642C },

lowercase the hex, please.

I will take care of it.

Quoted 10 lines
Quoted 10 lines
drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c +9 -0
+	{ .offset = SDCC_HC_REG_DDR_CONFIG,	.value = 0x00000000 },
+	{ .offset = SDCC_HC_REG_DLL_CONFIG2,	.value = 0x00200000 },
+	{ .offset = SDCC_USR_CTL,		.value = 0x00010800 },
+	{ .offset = RGMII_IO_MACRO_CONFIG2,	.value = 0x00002060 },
+};
+
+static const struct ethqos_emac_driver_data emac_v2_3_1_data = {
+	.por = emac_v2_3_1_por,
+	.num_por = ARRAY_SIZE(emac_v2_3_1_por),
Quoted 8 lines

drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c static const struct ethqos_emac_driver_data emac_v2_1_0_data = { · line 266

Quoted 3 lines
drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c +3 -0
+	.rgmii_config_loopback_en = true,
+	.has_emac_ge_3 = false,
+};

Modulo emac_v2_3_1_por vs emac_v2_3_0_por, this is the same as emac_v2_3_0_data. Which means that bindings for qcs615-ethqos should be corrected to use qcom,qcs404-ethqos as as fallback entry, making this patch unused. Please correct the bindings instead.

Although they currently share the same data, they are actually two different versions. Their differences are not apparent now but will become evident once new features are uploaded. If I revert to qcom,qcs404-ethqos now, it will be challenging to distinguish between them in the future.

Quoted 18 lines
Quoted 17 lines
drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c +2 -0
+
  static const struct ethqos_emac_por emac_v3_0_0_por[] = {
  	{ .offset = RGMII_IO_MACRO_CONFIG,	.value = 0x40c01343 },
  	{ .offset = SDCC_HC_REG_DLL_CONFIG,	.value = 0x2004642c },
@@ -898,6 +914,7 @@ static int qcom_ethqos_probe(struct platform_device *pdev)
 
  static const struct of_device_id qcom_ethqos_match[] = {
  	{ .compatible = "qcom,qcs404-ethqos", .data = &emac_v2_3_0_data},
+	{ .compatible = "qcom,qcs615-ethqos", .data = &emac_v2_3_1_data},
  	{ .compatible = "qcom,sa8775p-ethqos", .data = &emac_v4_0_0_data},
  	{ .compatible = "qcom,sc8280xp-ethqos", .data = &emac_v3_0_0_data},
  	{ .compatible = "qcom,sm8150-ethqos", .data = &emac_v2_1_0_data},
Signature · 2 lines
-- 
2.34.1
Signature · 2 lines
Best Regards,
Yijie
#12 lore raw

Re: [PATCH v2 3/3] net: stmmac: dwmac-qcom-ethqos: add support for EMAC on qcs615 platforms

Quoted 46 lines · Yijie Yang
Quoted 9 lines · Dmitry Baryshkov
Quoted 8 lines · Yijie Yang

qcs615 uses EMAC version 2.3.1, add the relevant defines and add the new compatible.

---
  drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c | 17 +++++++++++++++++
  1 file changed, 17 insertions(+)
Quoted 12 lines

drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c static const struct ethqos_emac_driver_data emac_v2_1_0_data = { · line 253

Quoted 10 lines
drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c +3 -0
index 901a3c1959fa57efb078da795ad4f92a8b6f71e1..8c76beaee48821eb2853f4e3f8bfd37db8cadf78 100644
@@ -249,6 +249,22 @@ static const struct ethqos_emac_driver_data emac_v2_1_0_data = {
  	.has_emac_ge_3 = false,
  };
+static const struct ethqos_emac_por emac_v2_3_1_por[] = {
+	{ .offset = RGMII_IO_MACRO_CONFIG,	.value = 0x00C01343 },
+	{ .offset = SDCC_HC_REG_DLL_CONFIG,	.value = 0x2004642C },

lowercase the hex, please.

I will take care of it.

Quoted 10 lines
Quoted 10 lines
drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c +9 -0
+	{ .offset = SDCC_HC_REG_DDR_CONFIG,	.value = 0x00000000 },
+	{ .offset = SDCC_HC_REG_DLL_CONFIG2,	.value = 0x00200000 },
+	{ .offset = SDCC_USR_CTL,		.value = 0x00010800 },
+	{ .offset = RGMII_IO_MACRO_CONFIG2,	.value = 0x00002060 },
+};
+
+static const struct ethqos_emac_driver_data emac_v2_3_1_data = {
+	.por = emac_v2_3_1_por,
+	.num_por = ARRAY_SIZE(emac_v2_3_1_por),
Quoted 8 lines

drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c static const struct ethqos_emac_driver_data emac_v2_1_0_data = { · line 266

Quoted 3 lines
drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c +3 -0
+	.rgmii_config_loopback_en = true,
+	.has_emac_ge_3 = false,
+};

Modulo emac_v2_3_1_por vs emac_v2_3_0_por, this is the same as emac_v2_3_0_data. Which means that bindings for qcs615-ethqos should be corrected to use qcom,qcs404-ethqos as as fallback entry, making this patch unused. Please correct the bindings instead.

Quoted 4 lines

Although they currently share the same data, they are actually two different versions. Their differences are not apparent now but will become evident once new features are uploaded. If I revert to qcom,qcs404-ethqos now, it will be challenging to distinguish between them in the future.

Which features? Moreover, note, the use of the fallback doesn't preclude you from addign a new compat entry later on. By having a fallback you simply declare that the device A is also compatible with the device B.

Quoted 23 lines
Quoted 18 lines
Quoted 17 lines
drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c +2 -0
+
  static const struct ethqos_emac_por emac_v3_0_0_por[] = {
  	{ .offset = RGMII_IO_MACRO_CONFIG,	.value = 0x40c01343 },
  	{ .offset = SDCC_HC_REG_DLL_CONFIG,	.value = 0x2004642c },
@@ -898,6 +914,7 @@ static int qcom_ethqos_probe(struct platform_device *pdev)
  static const struct of_device_id qcom_ethqos_match[] = {
  	{ .compatible = "qcom,qcs404-ethqos", .data = &emac_v2_3_0_data},
+	{ .compatible = "qcom,qcs615-ethqos", .data = &emac_v2_3_1_data},
  	{ .compatible = "qcom,sa8775p-ethqos", .data = &emac_v4_0_0_data},
  	{ .compatible = "qcom,sc8280xp-ethqos", .data = &emac_v3_0_0_data},
  	{ .compatible = "qcom,sm8150-ethqos", .data = &emac_v2_1_0_data},
 
Signature · 1 line
2.34.1
Signature · 2 lines
Best Regards,
Yijie
Signature · 2 lines
With best wishes
Dmitry
author
#13 lore raw

Re: [PATCH v2 3/3] net: stmmac: dwmac-qcom-ethqos: add support for EMAC on qcs615 platforms

Quoted 47 lines · Dmitry Baryshkov
Quoted 46 lines · Yijie Yang
Quoted 9 lines · Dmitry Baryshkov
Quoted 8 lines · Yijie Yang

qcs615 uses EMAC version 2.3.1, add the relevant defines and add the new compatible.

---
   drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c | 17 +++++++++++++++++
   1 file changed, 17 insertions(+)
Quoted 12 lines

drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c static const struct ethqos_emac_driver_data emac_v2_1_0_data = { · line 253

Quoted 10 lines
drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c +3 -0
index 901a3c1959fa57efb078da795ad4f92a8b6f71e1..8c76beaee48821eb2853f4e3f8bfd37db8cadf78 100644
@@ -249,6 +249,22 @@ static const struct ethqos_emac_driver_data emac_v2_1_0_data = {
   	.has_emac_ge_3 = false,
   };
+static const struct ethqos_emac_por emac_v2_3_1_por[] = {
+	{ .offset = RGMII_IO_MACRO_CONFIG,	.value = 0x00C01343 },
+	{ .offset = SDCC_HC_REG_DLL_CONFIG,	.value = 0x2004642C },

lowercase the hex, please.

I will take care of it.

Quoted 18 lines

drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c static const struct ethqos_emac_driver_data emac_v2_1_0_data = { · line 266

Quoted 13 lines
drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c +12 -0
+	{ .offset = SDCC_HC_REG_DDR_CONFIG,	.value = 0x00000000 },
+	{ .offset = SDCC_HC_REG_DLL_CONFIG2,	.value = 0x00200000 },
+	{ .offset = SDCC_USR_CTL,		.value = 0x00010800 },
+	{ .offset = RGMII_IO_MACRO_CONFIG2,	.value = 0x00002060 },
+};
+
+static const struct ethqos_emac_driver_data emac_v2_3_1_data = {
+	.por = emac_v2_3_1_por,
+	.num_por = ARRAY_SIZE(emac_v2_3_1_por),
+	.rgmii_config_loopback_en = true,
+	.has_emac_ge_3 = false,
+};

Modulo emac_v2_3_1_por vs emac_v2_3_0_por, this is the same as emac_v2_3_0_data. Which means that bindings for qcs615-ethqos should be corrected to use qcom,qcs404-ethqos as as fallback entry, making this patch unused. Please correct the bindings instead.

Quoted 9 lines
Quoted 4 lines

Although they currently share the same data, they are actually two different versions. Their differences are not apparent now but will become evident once new features are uploaded. If I revert to qcom,qcs404-ethqos now, it will be challenging to distinguish between them in the future.

Which features? Moreover, note, the use of the fallback doesn't preclude you from addign a new compat entry later on. By having a fallback you simply declare that the device A is also compatible with the device B.

Yes, you're right. I confirmed with the hardware team that the EMAC of qcs615-ride is the same as that of qcs404. I will fall back the compatible of qcs615 to the latter and drop the unnecessary patches.

Quoted 24 lines
Quoted 23 lines
Quoted 18 lines
Quoted 17 lines
drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c +2 -0
+
   static const struct ethqos_emac_por emac_v3_0_0_por[] = {
   	{ .offset = RGMII_IO_MACRO_CONFIG,	.value = 0x40c01343 },
   	{ .offset = SDCC_HC_REG_DLL_CONFIG,	.value = 0x2004642c },
@@ -898,6 +914,7 @@ static int qcom_ethqos_probe(struct platform_device *pdev)
   static const struct of_device_id qcom_ethqos_match[] = {
   	{ .compatible = "qcom,qcs404-ethqos", .data = &emac_v2_3_0_data},
+	{ .compatible = "qcom,qcs615-ethqos", .data = &emac_v2_3_1_data},
   	{ .compatible = "qcom,sa8775p-ethqos", .data = &emac_v4_0_0_data},
   	{ .compatible = "qcom,sc8280xp-ethqos", .data = &emac_v3_0_0_data},
   	{ .compatible = "qcom,sm8150-ethqos", .data = &emac_v2_1_0_data},
 
Signature · 1 line
2.34.1
Signature · 2 lines
Best Regards,
Yijie
Signature · 2 lines
Best Regards,
Yijie
#14 lore raw
In reply to Yijie Yang
Quoted 15 lines · Yijie Yang

Add separate EMAC entries for qcs615 since its core version is 2.3.1, compared to sm8150's 2.1.2.

---
Changes in v2:
- Update the subject for the first patch.
- Link to v1: https://lore.kernel.org/r/[email protected]

---
Yijie Yang (3):
dt-bindings: net: qcom,ethqos: Drop fallback compatible for qcom,qcs615-ethqos
dt-bindings: net: snps,dwmac: add description for qcs615
net: stmmac: dwmac-qcom-ethqos: add support for EMAC on qcs615 platforms

Quoted 6 lines
 Documentation/devicetree/bindings/net/qcom,ethqos.yaml  |  5 +----
 Documentation/devicetree/bindings/net/snps,dwmac.yaml   |  2 ++
 drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c | 17 +++++++++++++++++
 3 files changed, 20 insertions(+), 4 deletions(-)

---
base-commit: 3664e6c4f4d07fa51834cd59d94b42b7f803e79b

Which commit is it? I can't find it in linux-next

Quoted 6 lines

change-id: 20241111-schema-7915779020f5

Best regards,

Signature · 1 line
Yijie Yang <[email protected]>
Signature · 2 lines
With best wishes
Dmitry
author
#15 lore raw
Quoted 16 lines · Dmitry Baryshkov
Quoted 15 lines · Yijie Yang

Add separate EMAC entries for qcs615 since its core version is 2.3.1, compared to sm8150's 2.1.2.

---
Changes in v2:
- Update the subject for the first patch.
- Link to v1: https://lore.kernel.org/r/[email protected]

---
Yijie Yang (3):
dt-bindings: net: qcom,ethqos: Drop fallback compatible for qcom,qcs615-ethqos
dt-bindings: net: snps,dwmac: add description for qcs615
net: stmmac: dwmac-qcom-ethqos: add support for EMAC on qcs615 platforms

Quoted 8 lines
Quoted 6 lines
  Documentation/devicetree/bindings/net/qcom,ethqos.yaml  |  5 +----
  Documentation/devicetree/bindings/net/snps,dwmac.yaml   |  2 ++
  drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c | 17 +++++++++++++++++
  3 files changed, 20 insertions(+), 4 deletions(-)

---
base-commit: 3664e6c4f4d07fa51834cd59d94b42b7f803e79b

Which commit is it? I can't find it in linux-next

It's a tag next-20241108, titled 'Add linux-next specific files for 20241108'.

Quoted 8 lines
Quoted 7 lines

change-id: 20241111-schema-7915779020f5

Best regards,

Signature · 1 line
Yijie Yang <[email protected]>
Signature · 2 lines
Best Regards,
Yijie
#16 lore raw
Quoted 27 lines · Yijie Yang
Quoted 23 lines · Dmitry Baryshkov
Quoted 21 lines · Yijie Yang

Add separate EMAC entries for qcs615 since its core version is 2.3.1, compared to sm8150's 2.1.2.

---
Changes in v2:
- Update the subject for the first patch.
- Link to v1: https://lore.kernel.org/r/[email protected]

---
Yijie Yang (3):
dt-bindings: net: qcom,ethqos: Drop fallback compatible for qcom,qcs615-ethqos
dt-bindings: net: snps,dwmac: add description for qcs615
net: stmmac: dwmac-qcom-ethqos: add support for EMAC on qcs615 platforms

  Documentation/devicetree/bindings/net/qcom,ethqos.yaml  |  5 +----
  Documentation/devicetree/bindings/net/snps,dwmac.yaml   |  2 ++
  drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c | 17 +++++++++++++++++
  3 files changed, 20 insertions(+), 4 deletions(-)

---
base-commit: 3664e6c4f4d07fa51834cd59d94b42b7f803e79b

Quoted 4 lines
Quoted 1 line

Which commit is it? I can't find it in linux-next

It's a tag next-20241108, titled 'Add linux-next specific files for 20241108'.

Nearly two months old? okay...

Signature · 2 lines
With best wishes
Dmitry
author
#17 lore raw
Quoted 28 lines · Dmitry Baryshkov
Quoted 27 lines · Yijie Yang
Quoted 23 lines · Dmitry Baryshkov
Quoted 21 lines · Yijie Yang

Add separate EMAC entries for qcs615 since its core version is 2.3.1, compared to sm8150's 2.1.2.

---
Changes in v2:
- Update the subject for the first patch.
- Link to v1: https://lore.kernel.org/r/[email protected]

---
Yijie Yang (3):
dt-bindings: net: qcom,ethqos: Drop fallback compatible for qcom,qcs615-ethqos
dt-bindings: net: snps,dwmac: add description for qcs615
net: stmmac: dwmac-qcom-ethqos: add support for EMAC on qcs615 platforms

   Documentation/devicetree/bindings/net/qcom,ethqos.yaml  |  5 +----
   Documentation/devicetree/bindings/net/snps,dwmac.yaml   |  2 ++
   drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c | 17 +++++++++++++++++
   3 files changed, 20 insertions(+), 4 deletions(-)

---
base-commit: 3664e6c4f4d07fa51834cd59d94b42b7f803e79b

Quoted 6 lines
Quoted 4 lines
Quoted 1 line

Which commit is it? I can't find it in linux-next

It's a tag next-20241108, titled 'Add linux-next specific files for 20241108'.

Nearly two months old? okay...

I will provide an update in the next version.

Quoted 1 line
Signature · 2 lines
Best Regards,
Yijie