Add driver nodes for MT8195 SoC
Subsystems (5)
v4 cover Add driver nodes for MT8195 SoC
Add pcie and venc nodes for MT8195 SoC.
This series is based on linux-next/next-20221028.
Depends on https://lore.kernel.org/all/[email protected]/
v3 -> v4:
- update resets of pcie node
v2 -> v3:
- update pcie iommu-map-mask
v1 -> v2:
- remove 8195 example from pcie yaml
- update reset-names of pcie yaml
- add resets and reset-names to pcie node
- rename venc node
---
Jianjun Wang (1):
dt-bindings: PCI: mediatek-gen3: Support mt8195
Tinghan Shen (2):
arm64: dts: mt8195: Add pcie and pcie phy nodes
arm64: dts: mt8195: Add venc node
.../bindings/pci/mediatek-pcie-gen3.yaml | 16 +- arch/arm64/boot/dts/mediatek/mt8195.dtsi | 174 ++++++++++++++++++ 2 files changed, 187 insertions(+), 3 deletions(-)
Signature · 1 line
2.18.0
PATCH v4 1/3 dt-bindings: PCI: mediatek-gen3: Support mt8195
From: Jianjun Wang <[email protected]>
In order to support mt8195 pcie node, update the yaml to support new properties of iommu and power-domain, and update the reset-names property to allow only one 'mac' name.
--- .../bindings/pci/mediatek-pcie-gen3.yaml | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-)
Documentation/devicetree/bindings/pci/mediatek-pcie-gen3.yaml +13 -3
@@ -70,14 +70,21 @@ properties: minItems: 1 maxItems: 8 + iommu-map: + maxItems: 1 + + iommu-map-mask: + const: 0 + resets: minItems: 1 maxItems: 2 reset-names: - minItems: 1 - items: - - const: phy + oneOf: + - items: + - const: phy + - const: mac - const: mac clocks:
@@ -107,6 +114,9 @@ properties: items: - const: pcie-phy + power-domains: + maxItems: 1 + '#interrupt-cells': const: 1
Signature · 1 line
2.18.0
AngeloGioacchino Del Regno
maintainerRe: [PATCH v4 1/3] dt-bindings: PCI: mediatek-gen3: Support mt8195
Il 28/10/22 11:43, Tinghan Shen ha scritto:
Quoted 29 lines
From: Jianjun Wang <[email protected]>
In order to support mt8195 pcie node, update the yaml to support new properties of iommu and power-domain, and update the reset-names property to allow only one 'mac' name.
Signed-off-by Jianjun Wang <[email protected]>Signed-off-by TingHan Shen <[email protected]>--- .../bindings/pci/mediatek-pcie-gen3.yaml | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-)Documentation/devicetree/bindings/pci/mediatek-pcie-gen3.yaml +6
-0@@ -70,14 +70,21 @@ properties: minItems: 1 maxItems: 8 + iommu-map: + maxItems: 1 + + iommu-map-mask: + const: 0 + resets: minItems: 1 maxItems: 2
Documentation/devicetree/bindings/pci/mediatek-pcie-gen3.yaml properties: · line 88
Quoted 10 lines
Documentation/devicetree/bindings/pci/mediatek-pcie-gen3.yaml +4
-3reset-names: - minItems: 1 - items: - - const: phy + oneOf: + - items: + - const: phy + - const: mac - const: mac
Sorry, this looks a bit messy.
I can propose two solutions, either:
reset-names:
minItems: 1
items:
- const: mac
- const: phy
... and change the order in mt8192.dtsi;
otherwise, something like
allOf:
- if:
properties:
compatible:
contains:
- const: mediatek,mt8195-pcie
... invert reset-names
I think that the first solution makes a bit more sense though, as the PHY reset may be moved in a PCIE-PHY specific driver instead of being managed here in pci-mediatek-gen3.
Regards,
Angelo
Rob Herring
maintainerRe: [PATCH v4 1/3] dt-bindings: PCI: mediatek-gen3: Support mt8195
Quoted 41 lines · AngeloGioacchino Del Regno
Il 28/10/22 11:43, Tinghan Shen ha scritto:
Quoted 27 lines
From: Jianjun Wang <[email protected]>
In order to support mt8195 pcie node, update the yaml to support new properties of iommu and power-domain, and update the reset-names property to allow only one 'mac' name.
Signed-off-by Jianjun Wang <[email protected]>Signed-off-by TingHan Shen <[email protected]>--- .../bindings/pci/mediatek-pcie-gen3.yaml | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-)Documentation/devicetree/bindings/pci/mediatek-pcie-gen3.yaml +6
-0@@ -70,14 +70,21 @@ properties: minItems: 1 maxItems: 8 + iommu-map: + maxItems: 1 + + iommu-map-mask: + const: 0 + resets: minItems: 1Documentation/devicetree/bindings/pci/mediatek-pcie-gen3.yaml properties: · line 86
Quoted 10 lines
Documentation/devicetree/bindings/pci/mediatek-pcie-gen3.yaml +4
-3maxItems: 2 reset-names: - minItems: 1 - items: - - const: phy + oneOf: + - items: + - const: phy + - const: mac - const: macSorry, this looks a bit messy.
Quoted 8 lines
I can propose two solutions, either:
reset-names:
minItems: 1
items:
- const: mac
- const: phy
... and change the order inmt8192.dtsi;
That doesn't work because originally 'phy' alone was allowed.
You could do:
minItems: 1
maxItems: 2
items:
enum: [ phy, mac ]
But for 2 items, either order would be allowed. Not great, but not a huge deal.
Quoted 9 lines
otherwise, something like
allOf:
- if:
properties:
compatible:
contains:
- const: mediatek,mt8195-pcie
... invert reset-names
Quoted 3 lines
I think that the first solution makes a bit more sense though, as the PHY reset may be moved in a PCIE-PHY specific driver instead of being managed here in pci-mediatek-gen3.
That either makes sense or it doesn't. If it does, then you should go ahead and separate the phy rather than change the ABI twice.
Rob
PATCH v4 2/3 arm64: dts: mt8195: Add pcie and pcie phy nodes
In reply to Tinghan ShenAdd pcie and pcie phy nodes for mt8195.
--- arch/arm64/boot/dts/mediatek/mt8195.dtsi | 150 +++++++++++++++++++++++ 1 file changed, 150 insertions(+)
arch/arm64/boot/dts/mediatek/mt8195.dtsi +150 -0
@@ -13,6 +13,7 @@ #include <dt-bindings/phy/phy.h> #include <dt-bindings/pinctrl/mt8195-pinfunc.h> #include <dt-bindings/power/mt8195-power.h> +#include <dt-bindings/reset/mt8195-resets.h> / { compatible = "mediatek,mt8195";
@@ -1182,6 +1183,110 @@ status = "disabled"; }; + pcie0: pcie@112f0000 { + compatible = "mediatek,mt8195-pcie", + "mediatek,mt8192-pcie"; + device_type = "pci"; + #address-cells = <3>; + #size-cells = <2>; + reg = <0 0x112f0000 0 0x4000>; + reg-names = "pcie-mac"; + interrupts = <GIC_SPI 791 IRQ_TYPE_LEVEL_HIGH 0>; + bus-range = <0x00 0xff>; + ranges = <0x81000000 0 0x20000000 + 0x0 0x20000000 0 0x200000>, + <0x82000000 0 0x20200000 + 0x0 0x20200000 0 0x3e00000>; + + iommu-map = <0 &iommu_infra IOMMU_PORT_INFRA_PCIE0 0x2>; + iommu-map-mask = <0x0>; + + clocks = <&infracfg_ao CLK_INFRA_AO_PCIE_PL_P_250M_P0>, + <&infracfg_ao CLK_INFRA_AO_PCIE_TL_26M>, + <&infracfg_ao CLK_INFRA_AO_PCIE_TL_96M>, + <&infracfg_ao CLK_INFRA_AO_PCIE_TL_32K>, + <&infracfg_ao CLK_INFRA_AO_PCIE_PERI_26M>, + <&pericfg_ao CLK_PERI_AO_PCIE_P0_MEM>; + clock-names = "pl_250m", "tl_26m", "tl_96m", + "tl_32k", "peri_26m", "peri_mem"; + assigned-clocks = <&topckgen CLK_TOP_TL>; + assigned-clock-parents = <&topckgen CLK_TOP_MAINPLL_D4_D4>; + + phys = <&pciephy>; + phy-names = "pcie-phy"; + + power-domains = <&spm MT8195_POWER_DOMAIN_PCIE_MAC_P0>; + + resets = <&infracfg_ao MT8195_INFRA_RST2_PCIE_P0_SWRST>; + reset-names = "mac"; + + #interrupt-cells = <1>; + interrupt-map-mask = <0 0 0 7>; + interrupt-map = <0 0 0 1 &pcie_intc0 0>, + <0 0 0 2 &pcie_intc0 1>, + <0 0 0 3 &pcie_intc0 2>, + <0 0 0 4 &pcie_intc0 3>; + status = "disabled"; + + pcie_intc0: interrupt-controller { + interrupt-controller; + #address-cells = <0>; + #interrupt-cells = <1>; + }; + }; + + pcie1: pcie@112f8000 { + compatible = "mediatek,mt8195-pcie", + "mediatek,mt8192-pcie"; + device_type = "pci"; + #address-cells = <3>; + #size-cells = <2>; + reg = <0 0x112f8000 0 0x4000>; + reg-names = "pcie-mac"; + interrupts = <GIC_SPI 792 IRQ_TYPE_LEVEL_HIGH 0>; + bus-range = <0x00 0xff>; + ranges = <0x81000000 0 0x24000000 + 0x0 0x24000000 0 0x200000>, + <0x82000000 0 0x24200000 + 0x0 0x24200000 0 0x3e00000>; + + iommu-map = <0 &iommu_infra IOMMU_PORT_INFRA_PCIE1 0x2>; + iommu-map-mask = <0x0>; + + clocks = <&infracfg_ao CLK_INFRA_AO_PCIE_PL_P_250M_P1>, + <&clk26m>, + <&infracfg_ao CLK_INFRA_AO_PCIE_TL_96M>, + <&clk26m>, + <&infracfg_ao CLK_INFRA_AO_PCIE_PERI_26M>, + /* Designer has connect pcie1 with peri_mem_p0 clock */ + <&pericfg_ao CLK_PERI_AO_PCIE_P0_MEM>; + clock-names = "pl_250m", "tl_26m", "tl_96m", + "tl_32k", "peri_26m", "peri_mem"; + assigned-clocks = <&topckgen CLK_TOP_TL_P1>; + assigned-clock-parents = <&topckgen CLK_TOP_MAINPLL_D4_D4>; + + phys = <&u3port1 PHY_TYPE_PCIE>; + phy-names = "pcie-phy"; + power-domains = <&spm MT8195_POWER_DOMAIN_PCIE_MAC_P1>; + + resets = <&infracfg_ao MT8195_INFRA_RST2_PCIE_P1_SWRST>; + reset-names = "mac"; + + #interrupt-cells = <1>; + interrupt-map-mask = <0 0 0 7>; + interrupt-map = <0 0 0 1 &pcie_intc1 0>, + <0 0 0 2 &pcie_intc1 1>, + <0 0 0 3 &pcie_intc1 2>, + <0 0 0 4 &pcie_intc1 3>; + status = "disabled"; + + pcie_intc1: interrupt-controller { + interrupt-controller; + #address-cells = <0>; + #interrupt-cells = <1>; + }; + }; + nor_flash: spi@1132c000 { compatible = "mediatek,mt8195-nor", "mediatek,mt8173-nor";
@@ -1241,6 +1346,34 @@ reg = <0x189 0x2>; bits = <7 5>; }; + pciephy_rx_ln1: pciephy-rx-ln1@190,1 { + reg = <0x190 0x1>; + bits = <0 4>; + }; + pciephy_tx_ln1_nmos: pciephy-tx-ln1-nmos@190,2 { + reg = <0x190 0x1>; + bits = <4 4>; + }; + pciephy_tx_ln1_pmos: pciephy-tx-ln1-pmos@191,1 { + reg = <0x191 0x1>; + bits = <0 4>; + }; + pciephy_rx_ln0: pciephy-rx-ln0@191,2 { + reg = <0x191 0x1>; + bits = <4 4>; + }; + pciephy_tx_ln0_nmos: pciephy-tx-ln0-nmos@192,1 { + reg = <0x192 0x1>; + bits = <0 4>; + }; + pciephy_tx_ln0_pmos: pciephy-tx-ln0-pmos@192,2 { + reg = <0x192 0x1>; + bits = <4 4>; + }; + pciephy_glb_intr: pciephy-glb-intr@193 { + reg = <0x193 0x1>; + bits = <0 4>; + }; }; u3phy2: t-phy@11c40000 {
@@ -1461,6 +1594,23 @@ }; }; + pciephy: phy@11e80000 { + compatible = "mediatek,mt8195-pcie-phy"; + reg = <0 0x11e80000 0 0x10000>; + reg-names = "sif"; + nvmem-cells = <&pciephy_glb_intr>, <&pciephy_tx_ln0_pmos>, + <&pciephy_tx_ln0_nmos>, <&pciephy_rx_ln0>, + <&pciephy_tx_ln1_pmos>, <&pciephy_tx_ln1_nmos>, + <&pciephy_rx_ln1>; + nvmem-cell-names = "glb_intr", "tx_ln0_pmos", + "tx_ln0_nmos", "rx_ln0", + "tx_ln1_pmos", "tx_ln1_nmos", + "rx_ln1"; + power-domains = <&spm MT8195_POWER_DOMAIN_PCIE_PHY>; + #phy-cells = <0>; + status = "disabled"; + }; + ufsphy: ufs-phy@11fa0000 { compatible = "mediatek,mt8195-ufsphy", "mediatek,mt8183-ufsphy"; reg = <0 0x11fa0000 0 0xc000>;
Signature · 1 line
2.18.0
Re: [PATCH v4 2/3] arm64: dts: mt8195: Add pcie and pcie phy nodes
Il 28/10/22 11:43, Tinghan Shen ha scritto:
Quoted 4 lines
Add pcie and pcie phy nodes for mt8195.
Signed-off-by Jianjun Wang <[email protected]>Signed-off-by Tinghan Shen <[email protected]>
PATCH v4 3/3 arm64: dts: mt8195: Add venc node
In reply to Tinghan ShenAdd venc node for mt8195 SoC.
--- arch/arm64/boot/dts/mediatek/mt8195.dtsi | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+)
arch/arm64/boot/dts/mediatek/mt8195.dtsi +24 -0
@@ -2109,6 +2109,30 @@ power-domains = <&spm MT8195_POWER_DOMAIN_VENC>; }; + venc: video-codec@1a020000 { + compatible = "mediatek,mt8195-vcodec-enc"; + reg = <0 0x1a020000 0 0x10000>; + iommus = <&iommu_vdo M4U_PORT_L19_VENC_RCPU>, + <&iommu_vdo M4U_PORT_L19_VENC_REC>, + <&iommu_vdo M4U_PORT_L19_VENC_BSDMA>, + <&iommu_vdo M4U_PORT_L19_VENC_SV_COMV>, + <&iommu_vdo M4U_PORT_L19_VENC_RD_COMV>, + <&iommu_vdo M4U_PORT_L19_VENC_CUR_LUMA>, + <&iommu_vdo M4U_PORT_L19_VENC_CUR_CHROMA>, + <&iommu_vdo M4U_PORT_L19_VENC_REF_LUMA>, + <&iommu_vdo M4U_PORT_L19_VENC_REF_CHROMA>; + interrupts = <GIC_SPI 341 IRQ_TYPE_LEVEL_HIGH 0>; + mediatek,scp = <&scp>; + clocks = <&vencsys CLK_VENC_VENC>; + clock-names = "venc_sel"; + assigned-clocks = <&topckgen CLK_TOP_VENC>; + assigned-clock-parents = <&topckgen CLK_TOP_UNIVPLL_D4>; + power-domains = <&spm MT8195_POWER_DOMAIN_VENC>; + #address-cells = <2>; + #size-cells = <2>; + dma-ranges = <0x1 0x0 0x0 0x40000000 0x0 0xfff00000>; + }; + vencsys_core1: clock-controller@1b000000 { compatible = "mediatek,mt8195-vencsys_core1"; reg = <0 0x1b000000 0 0x1000>;
Signature · 1 line
2.18.0
Re: [PATCH v4 3/3] arm64: dts: mt8195: Add venc node
Il 28/10/22 11:43, Tinghan Shen ha scritto:
Quoted 4 lines
Add venc node for mt8195 SoC.
Signed-off-by Irui Wang <[email protected]>Signed-off-by Tinghan Shen <[email protected]>