dt-bindings: PCI: mediatek-gen3: Add support for Airoha AN7583
Subsystems (5)
PATCH 1/2 dt-bindings: PCI: mediatek-gen3: Add support for Airoha AN7583
Introduce Airoha AN7583 SoC compatible in mediatek-gen3 PCIe controller binding.
This differ from the Airoha EN7581 SoC by the fact that only one Gen3 PCIe controller is present on the SoC.
--- .../bindings/pci/mediatek-pcie-gen3.yaml | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+)
Documentation/devicetree/bindings/pci/mediatek-pcie-gen3.yaml +21 -0
@@ -59,6 +59,7 @@ properties: - const: mediatek,mt8192-pcie - const: mediatek,mt8196-pcie - const: airoha,en7581-pcie + - const: airoha,an7583-pcie-gen3 reg: maxItems: 1
@@ -298,6 +299,26 @@ allOf: - const: phy-lane1 - const: phy-lane2 + - if: + properties: + compatible: + const: airoha,an7583-pcie-gen3 + then: + properties: + clocks: + maxItems: 1 + + clock-names: + items: + - const: sys-ck + + resets: + minItems: 1 + + reset-names: + items: + - const: phy-lane0 + unevaluatedProperties: false examples:
Signature · 1 line
2.51.0
PATCH 2/2 PCI: mediatek-gen3: add support for Airoha AN7583 SoC
Add support for Airoha AN7583 SoC that implement the same logic of Airoha EN7581 with the only difference that only 1 PCIe line is supported (for GEN3).
A dedicated compatible is defined with the pdata struct with the 1 reset line.
--- drivers/pci/controller/pcie-mediatek-gen3.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
drivers/pci/controller/pcie-mediatek-gen3.c +10 -0
@@ -1360,8 +1360,18 @@ static const struct mtk_gen3_pcie_pdata mtk_pcie_soc_en7581 = { .flags = SKIP_PCIE_RSTB, }; +static const struct mtk_gen3_pcie_pdata mtk_pcie_soc_an7583 = { + .power_up = mtk_pcie_en7581_power_up, + .phy_resets = { + .id[0 ] ="phy-lane0" , + .num_resets =1 , + }, + .flags =SKIP_PCIE_RSTB , +}; +static const struct of_device_id mtk_pcie_of_match[] = { { .compatible ="airoha,en7581-pcie" , .data = &mtk_pcie_soc_en7581 }, + { .compatible ="airoha,an7583-pcie-gen3" , .data = &mtk_pcie_soc_an7583 }, { .compatible ="mediatek,mt8192-pcie" , .data = &mtk_pcie_soc_mt8192 }, { .compatible ="mediatek,mt8196-pcie" , .data = &mtk_pcie_soc_mt8196 }, {},
Signature · 1 line
2.51.0
AngeloGioacchino Del Regno
maintainerRe: [PATCH 2/2] PCI: mediatek-gen3: add support for Airoha AN7583 SoC
Il 20/09/25 11:25, Christian Marangi ha scritto:
Quoted 22 lines
Add support for Airoha AN7583 SoC that implement the same logic of Airoha EN7581 with the only difference that only 1 PCIe line is supported (for GEN3).
A dedicated compatible is defined with the pdata struct with the 1 reset line.
Signed-off-by Christian Marangi <[email protected]>--- drivers/pci/controller/pcie-mediatek-gen3.c | 10 ++++++++++ 1 file changed, 10 insertions(+)drivers/pci/controller/pcie-mediatek-gen3.c +2
-0@@ -1360,8 +1360,18 @@ static const struct mtk_gen3_pcie_pdata mtk_pcie_soc_en7581 = { .flags = SKIP_PCIE_RSTB, }; +static const struct mtk_gen3_pcie_pdata mtk_pcie_soc_an7583 = { + .power_up = mtk_pcie_en7581_power_up,
drivers/pci/controller/pcie-mediatek-gen3.c static const struct mtk_gen3_pcie_pdata mtk_pcie_soc_en7581 = { · line 1374
Quoted 10 lines
drivers/pci/controller/pcie-mediatek-gen3.c +8
-0+ .phy_resets = { + .id[0] = "phy-lane0", + .num_resets = 1, + }, + .flags = SKIP_PCIE_RSTB, +}; +static const struct of_device_id mtk_pcie_of_match[] = { { .compatible ="airoha,en7581-pcie" , .data = &mtk_pcie_soc_en7581 }, + { .compatible ="airoha,an7583-pcie-gen3" , .data = &mtk_pcie_soc_an7583 },
Same comments as the dt-bindings review, "an" comes before "en", also rename to airoha,an7583-pcie.
Cheers,
Angelo
Quoted 3 lines
drivers/pci/controller/pcie-mediatek-gen3.c +0
-0{ .compatible = "mediatek,mt8192-pcie", .data = &mtk_pcie_soc_mt8192 }, { .compatible = "mediatek,mt8196-pcie", .data = &mtk_pcie_soc_mt8196 }, {},
AngeloGioacchino Del Regno
maintainerIl 20/09/25 11:25, Christian Marangi ha scritto:
Quoted 16 lines
Introduce Airoha AN7583 SoC compatible in mediatek-gen3 PCIe controller binding.
This differ from the Airoha EN7581 SoC by the fact that only one Gen3 PCIe controller is present on the SoC.
Signed-off-by Christian Marangi <[email protected]>--- .../bindings/pci/mediatek-pcie-gen3.yaml | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+)Documentation/devicetree/bindings/pci/mediatek-pcie-gen3.yaml +0
-0
Documentation/devicetree/bindings/pci/mediatek-pcie-gen3.yaml properties: · line 60
Quoted 2 lines
Documentation/devicetree/bindings/pci/mediatek-pcie-gen3.yaml +0
-0@@ -59,6 +59,7 @@ properties: - const: mediatek,mt8192-pcie - const: mediatek,mt8196-pcie
"an" comes before "en", please move it here.
Also, for consistency with all of the other compatibles, this should be just "airoha,an7583-pcie": please rename it.
Quoted 9 lines
Documentation/devicetree/bindings/pci/mediatek-pcie-gen3.yaml +1
-0- const: airoha,en7581-pcie + - const: airoha,an7583-pcie-gen3reg:
maxItems: 1
Documentation/devicetree/bindings/pci/mediatek-pcie-gen3.yaml allOf: · line 305
Quoted 7 lines
Documentation/devicetree/bindings/pci/mediatek-pcie-gen3.yaml +4
-0@@ -298,6 +299,26 @@ allOf: - const: phy-lane1 - const: phy-lane2 + - if: + properties: + compatible: + const: airoha,an7583-pcie-gen3
same for this if block, please put it before en7583.
Everything else looks good.
Cheers,
Angelo
Quoted 19 lines
Documentation/devicetree/bindings/pci/mediatek-pcie-gen3.yaml +16
-0+ then: + properties: + clocks: + maxItems: 1 + + clock-names: + items: + - const: sys-ck + + resets: + minItems: 1 + + reset-names: + items: + - const: phy-lane0 + unevaluatedProperties: false examples:
Quoted 22 lines · AngeloGioacchino Del Regno
Il 20/09/25 11:25, Christian Marangi ha scritto:
Quoted 16 lines
Introduce Airoha AN7583 SoC compatible in mediatek-gen3 PCIe controller binding.
This differ from the Airoha EN7581 SoC by the fact that only one Gen3 PCIe controller is present on the SoC.
Signed-off-by Christian Marangi <[email protected]>--- .../bindings/pci/mediatek-pcie-gen3.yaml | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+)Documentation/devicetree/bindings/pci/mediatek-pcie-gen3.yaml +0
-0Documentation/devicetree/bindings/pci/mediatek-pcie-gen3.yaml properties: · line 60
Quoted 2 lines
Documentation/devicetree/bindings/pci/mediatek-pcie-gen3.yaml +0
-0@@ -59,6 +59,7 @@ properties: - const: mediatek,mt8192-pcie - const: mediatek,mt8196-pcie"an" comes before "en", please move it here.
Quoted 3 lines
Also, for consistency with all of the other compatibles, this should be just "airoha,an7583-pcie": please rename it.
Thanks for the review. The "gen3" wasn't added randomly. On AN7583 they put both gen2 and gen3 PCIe. One line is gen3, the other gen2. So either we differenciate for gen2 or we add the gen3 tag.
I decided to add it here to follow the naming pattern with mediatek-pcie-gen3.
If you have better idea on this, I'm all open.
Quoted 43 lines
Quoted 8 lines
Documentation/devicetree/bindings/pci/mediatek-pcie-gen3.yaml +1
-0- const: airoha,en7581-pcie + - const: airoha,an7583-pcie-gen3reg:
maxItems: 1Documentation/devicetree/bindings/pci/mediatek-pcie-gen3.yaml allOf: · line 304
Quoted 6 lines
Documentation/devicetree/bindings/pci/mediatek-pcie-gen3.yaml +4
-0@@ -298,6 +299,26 @@ allOf: - const: phy-lane1 - const: phy-lane2 + - if: + properties: + compatible: + const: airoha,an7583-pcie-gen3same for this if block, please put it before en7583.
Everything else looks good.
Cheers,
AngeloQuoted 18 lines
Documentation/devicetree/bindings/pci/mediatek-pcie-gen3.yaml +16
-0+ then: + properties: + clocks: + maxItems: 1 + + clock-names: + items: + - const: sys-ck + + resets: + minItems: 1 + + reset-names: + items: + - const: phy-lane0 + unevaluatedProperties: false examples:
Signature · 1 line
Ansuel