Skip to contentSkip to conversation

PCI: mediatek-gen3: Add controller support for MT8195

PATCH Superseded Jianjun Wang 4 participants 9 messages Jun 1, 2021 – Jun 23, 2021

Subsystems (5)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

cover PCI: mediatek-gen3: Add controller support for MT8195

These series patches modify pcie-mediatek-gen3.c and dt-bindings compatible string to support the PCIe controller for MT8195.

Jianjun Wang (2):
dt-bindings: PCI: mediatek-gen3: Add support for MT8195
PCI: mediatek-gen3: Add controller support for MT8195

 Documentation/devicetree/bindings/pci/mediatek-pcie-gen3.yaml | 4 +++-
 drivers/pci/controller/pcie-mediatek-gen3.c                   | 1 +
 2 files changed, 4 insertions(+), 1 deletion(-)
Signature · 1 line
2.18.0
#1 lore raw

PATCH 1/2 dt-bindings: PCI: mediatek-gen3: Add support for MT8195

MT8195 is an ARM platform SoC which has the same PCIe IP with MT8192.

---
 Documentation/devicetree/bindings/pci/mediatek-pcie-gen3.yaml | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/pci/mediatek-pcie-gen3.yaml +3 -1
index e7b1f9892da4..d5e4a3e63d97 100644
@@ -48,7 +48,9 @@ allOf:
 
 properties:
   compatible:
-    const: mediatek,mt8192-pcie
+    oneOf:
+      - const: mediatek,mt8192-pcie
+      - const: mediatek,mt8195-pcie
 
   reg:
     maxItems: 1
Signature · 1 line
2.18.0
#2 lore raw

Re: [PATCH 1/2] dt-bindings: PCI: mediatek-gen3: Add support for MT8195

Hi,

Quoted 2 lines · Jianjun Wang

MT8195 is an ARM platform SoC which has the same PCIe IP with MT8192.

Based on what I'm seeing internally, there seems to be some inconsistency across the MediaTek platform on whether new compatible strings should be introduced for "fully compatible" IP blocks.

If this hardware block in MT8195 is "the same" as the one in MT8192, do we really need the new compatible string? Are there any concerns?

Thanks
ChenYu

Quoted 26 lines
---
 Documentation/devicetree/bindings/pci/mediatek-pcie-gen3.yaml | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/pci/mediatek-pcie-gen3.yaml +3 -2
index e7b1f9892da4..d5e4a3e63d97 100644
@@ -48,7 +48,9 @@ allOf:
 
 properties:
   compatible:
-    const: mediatek,mt8192-pcie
+    oneOf:
+      - const: mediatek,mt8192-pcie
+      - const: mediatek,mt8195-pcie
 
   reg:
     maxItems: 1
--

2.18.0
_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek

#3 lore raw

Re: [PATCH 1/2] dt-bindings: PCI: mediatek-gen3: Add support for MT8195

Quoted 4 lines · Chen-Yu Tsai

Hi,

Quoted 1 line · Jianjun Wang
Quoted 8 lines
Quoted 1 line

MT8195 is an ARM platform SoC which has the same PCIe IP with MT8192.

Based on what I'm seeing internally, there seems to be some inconsistency across the MediaTek platform on whether new compatible strings should be introduced for "fully compatible" IP blocks.

If this hardware block in MT8195 is "the same" as the one in MT8192, do we really need the new compatible string? Are there any concerns?

Hi Chen-Yu,

It's ok to reuse the compatible string with MT8192, but I think this will be easier to find which platforms this driver is compatible with, especially when we have more and more platforms in the future.

Thanks.

Quoted 32 lines

Thanks
ChenYu

Quoted 26 lines
---
 Documentation/devicetree/bindings/pci/mediatek-pcie-gen3.yaml | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/pci/mediatek-pcie-gen3.yaml +3 -2
index e7b1f9892da4..d5e4a3e63d97 100644
@@ -48,7 +48,9 @@ allOf:
 
 properties:
   compatible:
-    const: mediatek,mt8192-pcie
+    oneOf:
+      - const: mediatek,mt8192-pcie
+      - const: mediatek,mt8195-pcie
 
   reg:
     maxItems: 1
--

2.18.0
_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek

#4 lore raw

Re: [PATCH 1/2] dt-bindings: PCI: mediatek-gen3: Add support for MT8195

Hi,

Quoted 12 lines · Jianjun Wang
Quoted 10 lines · Chen-Yu Tsai

Hi,

Quoted 2 lines · Jianjun Wang

MT8195 is an ARM platform SoC which has the same PCIe IP with MT8192.

Based on what I'm seeing internally, there seems to be some inconsistency across the MediaTek platform on whether new compatible strings should be introduced for "fully compatible" IP blocks.

Quoted 8 lines
Quoted 2 lines

If this hardware block in MT8195 is "the same" as the one in MT8192, do we really need the new compatible string? Are there any concerns?

Hi Chen-Yu,

It's ok to reuse the compatible string with MT8192, but I think this will be easier to find which platforms this driver is compatible with, especially when we have more and more platforms in the future.

If it's just for informational purposes, then having the MT8192 compatible as a fallback would work, and we wouldn't need to make changes to the driver. This works better especially if we have to support multiple operating systems that use device tree.

So we would want

    "mediatek,mt8195-pcie", "mediatek,mt8192-pcie"

and

    "mediatek,mt8192-pcie"

be the valid options.

Personally I'm not seeing enough value to justify adding the compatible string just for informational purposes though. One could easily discern which hardware is used by looking at the device tree.

Regards
ChenYu

Quoted 34 lines

Thanks.

Quoted 32 lines

Thanks
ChenYu

Quoted 26 lines
---
 Documentation/devicetree/bindings/pci/mediatek-pcie-gen3.yaml | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/pci/mediatek-pcie-gen3.yaml +3 -2
index e7b1f9892da4..d5e4a3e63d97 100644
@@ -48,7 +48,9 @@ allOf:
 
 properties:
   compatible:
-    const: mediatek,mt8192-pcie
+    oneOf:
+      - const: mediatek,mt8192-pcie
+      - const: mediatek,mt8195-pcie
 
   reg:
     maxItems: 1
--

2.18.0
_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek

maintainer
#5 lore raw

Re: [PATCH 1/2] dt-bindings: PCI: mediatek-gen3: Add support for MT8195

Quoted 35 lines · Chen-Yu Tsai

Hi,

Quoted 12 lines · Jianjun Wang
Quoted 10 lines · Chen-Yu Tsai

Hi,

Quoted 2 lines · Jianjun Wang

MT8195 is an ARM platform SoC which has the same PCIe IP with MT8192.

Based on what I'm seeing internally, there seems to be some inconsistency across the MediaTek platform on whether new compatible strings should be introduced for "fully compatible" IP blocks.

Quoted 8 lines
Quoted 2 lines

If this hardware block in MT8195 is "the same" as the one in MT8192, do we really need the new compatible string? Are there any concerns?

Hi Chen-Yu,

It's ok to reuse the compatible string with MT8192, but I think this will be easier to find which platforms this driver is compatible with, especially when we have more and more platforms in the future.

If it's just for informational purposes, then having the MT8192 compatible as a fallback would work, and we wouldn't need to make changes to the driver. This works better especially if we have to support multiple operating systems that use device tree.

So we would want

    "mediatek,mt8195-pcie", "mediatek,mt8192-pcie"

and

Quoted 8 lines
    "mediatek,mt8192-pcie"

be the valid options.

Personally I'm not seeing enough value to justify adding the compatible string just for informational purposes though. One could easily discern which hardware is used by looking at the device tree.

I agree, if no differences between the two chips are known, adding a binding withe new compatible and a fallback is a good thing. If we later on realize that mt8195 PCI block has differences, we can add the matching to the driver.

Regards,
Matthias

Quoted 39 lines

Regards
ChenYu

Quoted 34 lines

Thanks.

Quoted 32 lines

Thanks
ChenYu

Quoted 26 lines
---
 Documentation/devicetree/bindings/pci/mediatek-pcie-gen3.yaml | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/pci/mediatek-pcie-gen3.yaml +3 -2
index e7b1f9892da4..d5e4a3e63d97 100644
@@ -48,7 +48,9 @@ allOf:
 
 properties:
   compatible:
-    const: mediatek,mt8192-pcie
+    oneOf:
+      - const: mediatek,mt8192-pcie
+      - const: mediatek,mt8195-pcie
 
   reg:
     maxItems: 1
--

2.18.0
_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek

#6 lore raw

Re: [PATCH 1/2] dt-bindings: PCI: mediatek-gen3: Add support for MT8195

Quoted 47 lines · Matthias Brugger
Quoted 35 lines · Chen-Yu Tsai

Hi,

Quoted 12 lines · Jianjun Wang
Quoted 10 lines · Chen-Yu Tsai

Hi,

Quoted 2 lines · Jianjun Wang

MT8195 is an ARM platform SoC which has the same PCIe IP with MT8192.

Based on what I'm seeing internally, there seems to be some inconsistency across the MediaTek platform on whether new compatible strings should be introduced for "fully compatible" IP blocks.

Quoted 8 lines
Quoted 2 lines

If this hardware block in MT8195 is "the same" as the one in MT8192, do we really need the new compatible string? Are there any concerns?

Hi Chen-Yu,

It's ok to reuse the compatible string with MT8192, but I think this will be easier to find which platforms this driver is compatible with, especially when we have more and more platforms in the future.

If it's just for informational purposes, then having the MT8192 compatible as a fallback would work, and we wouldn't need to make changes to the driver. This works better especially if we have to support multiple operating systems that use device tree.

So we would want

    "mediatek,mt8195-pcie", "mediatek,mt8192-pcie"

and

Quoted 8 lines
    "mediatek,mt8192-pcie"

be the valid options.

Personally I'm not seeing enough value to justify adding the compatible string just for informational purposes though. One could easily discern which hardware is used by looking at the device tree.

Quoted 4 lines

I agree, if no differences between the two chips are known, adding a binding withe new compatible and a fallback is a good thing. If we later on realize that mt8195 PCI block has differences, we can add the matching to the driver.

So this series can be dropped, right ?

Thanks,
Lorenzo

Quoted 42 lines

Regards,
Matthias

Quoted 39 lines

Regards
ChenYu

Quoted 34 lines

Thanks.

Quoted 32 lines

Thanks
ChenYu

Quoted 26 lines
---
 Documentation/devicetree/bindings/pci/mediatek-pcie-gen3.yaml | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/pci/mediatek-pcie-gen3.yaml +3 -2
index e7b1f9892da4..d5e4a3e63d97 100644
@@ -48,7 +48,9 @@ allOf:
 
 properties:
   compatible:
-    const: mediatek,mt8192-pcie
+    oneOf:
+      - const: mediatek,mt8192-pcie
+      - const: mediatek,mt8195-pcie
 
   reg:
     maxItems: 1
--

2.18.0
_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek

#7 lore raw

Re: [PATCH 1/2] dt-bindings: PCI: mediatek-gen3: Add support for MT8195

Quoted 48 lines · Lorenzo Pieralisi
Quoted 47 lines · Matthias Brugger
Quoted 43 lines · Chen-Yu Tsai

Hi,

Quoted 12 lines · Jianjun Wang
Quoted 10 lines · Chen-Yu Tsai

Hi,

Quoted 2 lines · Jianjun Wang

MT8195 is an ARM platform SoC which has the same PCIe IP with MT8192.

Based on what I'm seeing internally, there seems to be some inconsistency across the MediaTek platform on whether new compatible strings should be introduced for "fully compatible" IP blocks.

Quoted 8 lines
Quoted 2 lines

If this hardware block in MT8195 is "the same" as the one in MT8192, do we really need the new compatible string? Are there any concerns?

Hi Chen-Yu,

It's ok to reuse the compatible string with MT8192, but I think this will be easier to find which platforms this driver is compatible with, especially when we have more and more platforms in the future.

If it's just for informational purposes, then having the MT8192 compatible as a fallback would work, and we wouldn't need to make changes to the driver. This works better especially if we have to support multiple operating systems that use device tree.

So we would want

    "mediatek,mt8195-pcie", "mediatek,mt8192-pcie"

and

    "mediatek,mt8192-pcie"

be the valid options.

Personally I'm not seeing enough value to justify adding the compatible string just for informational purposes though. One could easily discern which hardware is used by looking at the device tree.

Quoted 6 lines
Quoted 4 lines

I agree, if no differences between the two chips are known, adding a binding withe new compatible and a fallback is a good thing. If we later on realize that mt8195 PCI block has differences, we can add the matching to the driver.

So this series can be dropped, right ?

Yes, we will send dt-bindings with dts changes in another series, thanks.

Quoted 46 lines

Thanks,
Lorenzo

Quoted 42 lines

Regards,
Matthias

Quoted 39 lines

Regards
ChenYu

Quoted 34 lines

Thanks.

Quoted 32 lines

Thanks
ChenYu

Quoted 26 lines
---
 Documentation/devicetree/bindings/pci/mediatek-pcie-gen3.yaml | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/pci/mediatek-pcie-gen3.yaml +3 -2
index e7b1f9892da4..d5e4a3e63d97 100644
@@ -48,7 +48,9 @@ allOf:
 
 properties:
   compatible:
-    const: mediatek,mt8192-pcie
+    oneOf:
+      - const: mediatek,mt8192-pcie
+      - const: mediatek,mt8195-pcie
 
   reg:
     maxItems: 1
--

2.18.0
_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek

#8 lore raw

PATCH 2/2 PCI: mediatek-gen3: Add controller support for MT8195

In reply to Jianjun Wang

MT8195 is an ARM platform SoC which has the same PCIe IP with MT8192.

---
 drivers/pci/controller/pcie-mediatek-gen3.c | 1 +
 1 file changed, 1 insertion(+)
drivers/pci/controller/pcie-mediatek-gen3.c +1 -0
index 3c5b97716d40..c12e2450d0e1 100644
@@ -1010,6 +1010,7 @@ static const struct dev_pm_ops mtk_pcie_pm_ops = {
 
 static const struct of_device_id mtk_pcie_of_match[] = {
 	{ .compatible = "mediatek,mt8192-pcie" },
+	{ .compatible = "mediatek,mt8195-pcie" },
 	{},
 };
 
Signature · 1 line
2.18.0