Add support for AMD MDB IP as Root Port
v2 cover Add support for AMD MDB IP as Root Port
This series of patch add support for AMD MDB IP as Root Port.
The AMD MDB IP support's 32 bit and 64bit BAR's at Gen5 speed. As Root Port it supports MSI and legacy interrupts.
Thippeswamy Havalige (2):
dt-bindings: PCI: amd-mdb: Add AMD Versal2 MDB PCIe Root Port Bridge
PCI: amd-mdb: Add AMD MDB Root Port driver
.../bindings/pci/amd,versal2-mdb-host.yaml | 132 ++++++ drivers/pci/controller/dwc/Kconfig | 10 + drivers/pci/controller/dwc/Makefile | 1 + drivers/pci/controller/dwc/pcie-amd-mdb.c | 439 ++++++++++++++++++ 4 files changed, 582 insertions(+) create mode 100644 Documentation/devicetree/bindings/pci/amd,versal2-mdb-host.yaml create mode 100644 drivers/pci/controller/dwc/pcie-amd-mdb.c
Signature · 1 line
2.34.1
PATCH v2 1/2 dt-bindings: PCI: amd-mdb: Add AMD Versal2 MDB PCIe Root Port Bridge
Add AMD Versal2 MDB (Multimedia DMA Bridge) PCIe Root Port Bridge.
---
Changes in v2:
-------------
- Modify patch subject.
- Add pcie host bridge reference.
- Modify filename as per compatible string.
- Remove standard PCI properties.
- Modify interrupt controller description.
- Indentation
--- .../bindings/pci/amd,versal2-mdb-host.yaml | 132 ++++++++++++++++++ 1 file changed, 132 insertions(+) create mode 100644 Documentation/devicetree/bindings/pci/amd,versal2-mdb-host.yaml
Documentation/devicetree/bindings/pci/amd,versal2-mdb-host.yaml new file +132 -0
@@ -0,0 +1,132 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/pci/amd,mdb-pcie.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: AMD Versal2 MDB(Multimedia DMA Bridge) Host Controller + +maintainers: + - Thippeswamy Havalige <[email protected]> + +allOf: + - $ref: /schemas/pci/pci-host-bridge.yaml# + +properties: + compatible: + const: amd,versal2-mdb-host + + reg: + items: + - description: MDB PCIe controller 0 SLCR + - description: configuration region + - description: data bus interface + - description: address translation unit register + + reg-names: + items: + - const: mdb_pcie_slcr + - const: config + - const: dbi + - const: atu + + ranges: + maxItems: 2 + + msi-map: + maxItems: 1 + + bus-range: + maxItems: 1 + + "#address-cells": + const: 3 + + "#size-cells": + const: 2 + + interrupts: + maxItems: 1 + + interrupt-map-mask: + items: + - const: 0 + - const: 0 + - const: 0 + - const: 7 + + interrupt-map: + maxItems: 4 + + "#interrupt-cells": + const: 1 + + interrupt-controller: + description: identifies the node as an interrupt controller + type: object + properties: + interrupt-controller: true + + "#address-cells": + const: 0 + + "#interrupt-cells": + const: 1 + + required: + - interrupt-controller + - "#address-cells" + - "#interrupt-cells" + + additionalProperties: false + +required: + - reg + - reg-names + - interrupts + - interrupt-map + - interrupt-map-mask + - msi-map + - ranges + - "#interrupt-cells" + - interrupt-controller + +unevaluatedProperties: false + +examples: + + - | + #include <dt-bindings/interrupt-controller/arm-gic.h> + #include <dt-bindings/interrupt-controller/irq.h> + + soc { + #address-cells = <2>; + #size-cells = <2>; + pci@ed931000 { + compatible = "amd,versal2-mdb-host"; + reg = <0x0 0xed931000 0x0 0x2000>, + <0x1000 0x100000 0x0 0xff00000>, + <0x1000 0x0 0x0 0x100000>, + <0x0 0xed860000 0x0 0x2000>; + reg-names = "mdb_pcie_slcr", "config", "dbi", "atu"; + ranges = <0x2000000 0x00 0xa8000000 0x00 0xa8000000 0x00 0x10000000>, + <0x43000000 0x1100 0x00 0x1100 0x00 0x00 0x1000000>; + interrupts = <GIC_SPI 198 IRQ_TYPE_LEVEL_HIGH>; + interrupt-parent = <&gic>; + interrupt-map-mask = <0 0 0 7>; + interrupt-map = <0 0 0 1 &pcie_intc_0 0>, + <0 0 0 2 &pcie_intc_0 1>, + <0 0 0 3 &pcie_intc_0 2>, + <0 0 0 4 &pcie_intc_0 3>; + msi-map = <0x0 &gic_its 0x00 0x10000>; + #address-cells = <3>; + #size-cells = <2>; + #interrupt-cells = <1>; + device_type = "pci"; + pcie_intc_0: interrupt-controller { + #address-cells = <0>; + #interrupt-cells = <1>; + interrupt-controller; + }; + }; + };
Signature · 1 line
2.34.1
Rob Herring (Arm)
maintainerRe: [PATCH v2 1/2] dt-bindings: PCI: amd-mdb: Add AMD Versal2 MDB PCIe Root Port Bridge
Quoted 12 lines · Thippeswamy Havalige
Add AMD Versal2 MDB (Multimedia DMA Bridge) PCIe Root Port Bridge.
Signed-off-by Thippeswamy Havalige <[email protected]>---
Changes in v2:
-------------
- Modify patch subject.
- Add pcie host bridge reference.
- Modify filename as per compatible string.
- Remove standard PCI properties.
- Modify interrupt controller description.
- Indentation
Quoted 5 lines
--- .../bindings/pci/amd,versal2-mdb-host.yaml | 132 ++++++++++++++++++ 1 file changed, 132 insertions(+) create mode 100644 Documentation/devicetree/bindings/pci/amd,versal2-mdb-host.yaml
My bot found errors running 'make dt_binding_check' on your patch:
yamllint warnings/errors:
dtschema/dtc warnings/errors:
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/pci/amd,versal2-mdb-host.yaml: $id: Cannot determine base path from $id, relative path/filename doesn't match actual path or filename
$id: http://devicetree.org/schemas/pci/amd,mdb-pcie.yaml
file: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/pci/amd,versal2-mdb-host.yaml
doc reference errors (make refcheckdocs):
See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/[email protected]
The base for the series is generally the latest rc1. A different dependency should be noted in *this* patch.
If you already ran 'make dt_binding_check' and didn't see the above error(s), then make sure 'yamllint' is installed and dt-schema is up to date:
pip3 install dtschema --upgrade
Please check and re-submit after running the above command yourself. Note that DT_SCHEMA_FILES can be set to your schema file to speed up checking your schema. However, it must be unset to test all examples with your schema.
Rob Herring
maintainerRe: [PATCH v2 1/2] dt-bindings: PCI: amd-mdb: Add AMD Versal2 MDB PCIe Root Port Bridge
In reply to Thippeswamy HavaligeQuoted 34 lines · Thippeswamy Havalige
Add AMD Versal2 MDB (Multimedia DMA Bridge) PCIe Root Port Bridge.
Signed-off-by Thippeswamy Havalige <[email protected]>---
Changes in v2:
-------------
- Modify patch subject.
- Add pcie host bridge reference.
- Modify filename as per compatible string.
- Remove standard PCI properties.
- Modify interrupt controller description.
- Indentation--- .../bindings/pci/amd,versal2-mdb-host.yaml | 132 ++++++++++++++++++ 1 file changed, 132 insertions(+) create mode 100644 Documentation/devicetree/bindings/pci/amd,versal2-mdb-host.yamlDocumentation/devicetree/bindings/pci/amd,versal2-mdb-host.yaml new file +11
-0@@ -0,0 +1,132 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/pci/amd,mdb-pcie.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: AMD Versal2 MDB(Multimedia DMA Bridge) Host Controller + +maintainers: + - Thippeswamy Havalige <[email protected]> +
Documentation/devicetree/bindings/pci/amd,versal2-mdb-host.yaml line 21
Quoted 10 lines
Documentation/devicetree/bindings/pci/amd,versal2-mdb-host.yaml new file +10
-0+allOf: + - $ref: /schemas/pci/pci-host-bridge.yaml# + +properties: + compatible: + const: amd,versal2-mdb-host + + reg: + items: + - description: MDB PCIe controller 0 SLCR
SLCR is not defined anywhere.
Documentation/devicetree/bindings/pci/amd,versal2-mdb-host.yaml line 31
Quoted 10 lines
Documentation/devicetree/bindings/pci/amd,versal2-mdb-host.yaml new file +10
-0+ - description: configuration region + - description: data bus interface + - description: address translation unit register + + reg-names: + items: + - const: mdb_pcie_slcr + - const: config + - const: dbi + - const: atu
DWC based it seems. You need to reference the DWC schema.
Documentation/devicetree/bindings/pci/amd,versal2-mdb-host.yaml line 40
Quoted 9 lines
Documentation/devicetree/bindings/pci/amd,versal2-mdb-host.yaml new file +9
-0+ + ranges: + maxItems: 2 + + msi-map: + maxItems: 1 + + bus-range: + maxItems: 1
Already defined in the common schema. Plus you obviously didn't test anything with this because bus-range must be exactly 2 entries. 1 is not valid.
Documentation/devicetree/bindings/pci/amd,versal2-mdb-host.yaml line 46
Quoted 6 lines
Documentation/devicetree/bindings/pci/amd,versal2-mdb-host.yaml new file +6
-0+ + "#address-cells": + const: 3 + + "#size-cells": + const: 2
Both of these are also already defined in the pci-host-bridge.yaml.
Quoted 25 lines
Documentation/devicetree/bindings/pci/amd,versal2-mdb-host.yaml new file +25
-0+ + interrupts: + maxItems: 1 + + interrupt-map-mask: + items: + - const: 0 + - const: 0 + - const: 0 + - const: 7 + + interrupt-map: + maxItems: 4 + + "#interrupt-cells": + const: 1 + + interrupt-controller: + description: identifies the node as an interrupt controller + type: object + properties: + interrupt-controller: true + + "#address-cells": + const: 0
Documentation/devicetree/bindings/pci/amd,versal2-mdb-host.yaml line 81
Quoted 10 lines
Documentation/devicetree/bindings/pci/amd,versal2-mdb-host.yaml new file +10
-0+ + "#interrupt-cells": + const: 1 + + required: + - interrupt-controller + - "#address-cells" + - "#interrupt-cells" + + additionalProperties: false
Move this before 'properties'.
Documentation/devicetree/bindings/pci/amd,versal2-mdb-host.yaml line 90
Quoted 9 lines
Documentation/devicetree/bindings/pci/amd,versal2-mdb-host.yaml new file +9
-0+ +required: + - reg + - reg-names + - interrupts + - interrupt-map + - interrupt-map-mask + - msi-map + - ranges
Already required by common schema.
Documentation/devicetree/bindings/pci/amd,versal2-mdb-host.yaml line 97
Quoted 7 lines
Documentation/devicetree/bindings/pci/amd,versal2-mdb-host.yaml new file +7
-0+ - "#interrupt-cells" + - interrupt-controller + +unevaluatedProperties: false + +examples: +
Drop blank line.
Documentation/devicetree/bindings/pci/amd,versal2-mdb-host.yaml line 105
Quoted 8 lines
Documentation/devicetree/bindings/pci/amd,versal2-mdb-host.yaml new file +8
-0+ - | + #include <dt-bindings/interrupt-controller/arm-gic.h> + #include <dt-bindings/interrupt-controller/irq.h> + + soc { + #address-cells = <2>; + #size-cells = <2>; + pci@ed931000 {
pcie@...
Quoted 30 lines
Documentation/devicetree/bindings/pci/amd,versal2-mdb-host.yaml new file +27
-0+ compatible = "amd,versal2-mdb-host"; + reg = <0x0 0xed931000 0x0 0x2000>, + <0x1000 0x100000 0x0 0xff00000>, + <0x1000 0x0 0x0 0x100000>, + <0x0 0xed860000 0x0 0x2000>; + reg-names = "mdb_pcie_slcr", "config", "dbi", "atu"; + ranges = <0x2000000 0x00 0xa8000000 0x00 0xa8000000 0x00 0x10000000>, + <0x43000000 0x1100 0x00 0x1100 0x00 0x00 0x1000000>; + interrupts = <GIC_SPI 198 IRQ_TYPE_LEVEL_HIGH>; + interrupt-parent = <&gic>; + interrupt-map-mask = <0 0 0 7>; + interrupt-map = <0 0 0 1 &pcie_intc_0 0>, + <0 0 0 2 &pcie_intc_0 1>, + <0 0 0 3 &pcie_intc_0 2>, + <0 0 0 4 &pcie_intc_0 3>; + msi-map = <0x0 &gic_its 0x00 0x10000>; + #address-cells = <3>; + #size-cells = <2>; + #interrupt-cells = <1>; + device_type = "pci"; + pcie_intc_0: interrupt-controller { + #address-cells = <0>; + #interrupt-cells = <1>; + interrupt-controller; + }; + }; + };Signature · 1 line
2.34.1
RE: [PATCH v2 1/2] dt-bindings: PCI: amd-mdb: Add AMD Versal2 MDB PCIe Root Port Bridge
Hi Bjorn,
Quoted 54 lines
-----Original Message-----
From: Rob Herring <[email protected]>
Sent: Tuesday, December 3, 2024 8:11 PM
To: Havalige, Thippeswamy <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; linux- [email protected]; [email protected]; Simek, Michal <[email protected]>; Gogada, Bharat Kumar <[email protected]>
Subject: Re: [PATCH v2 1/2] dt-bindings: PCI: amd-mdb: Add AMD Versal2 MDB PCIe Root Port BridgeQuoted 40 lines · Thippeswamy Havalige
Add AMD Versal2 MDB (Multimedia DMA Bridge) PCIe Root Port Bridge.
Signed-off-by Thippeswamy Havalige <[email protected]>---
Changes in v2:
-------------
- Modify patch subject.
- Add pcie host bridge reference.
- Modify filename as per compatible string.
- Remove standard PCI properties.
- Modify interrupt controller description.
- Indentation--- .../bindings/pci/amd,versal2-mdb-host.yaml | 132 ++++++++++++++++++ 1 file changed, 132 insertions(+) create mode 100644
Documentation/devicetree/bindings/pci/amd,versal2-mdb-host.yamldiff --git
a/Documentation/devicetree/bindings/pci/amd,versal2-mdb-host.yamlb/Documentation/devicetree/bindings/pci/amd,versal2-mdb-host.yamlnew file mode 100644
index 000000000000..75795bab8254Documentation/devicetree/bindings/pci/amd,versal2-mdb-host.yaml new file +14
-0@@ -0,0 +1,132 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) %YAML 1.2 +--- +$id: http://devicetree.org/schemas/pci/amd,mdb-pcie.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: AMD Versal2 MDB(Multimedia DMA Bridge) Host Controller + +maintainers: + - Thippeswamy Havalige <[email protected]> + +allOf: + - $ref: /schemas/pci/pci-host-bridge.yaml# + +properties:
Quoted 8 lines
Documentation/devicetree/bindings/pci/amd,versal2-mdb-host.yaml line 21
Quoted 6 lines
Documentation/devicetree/bindings/pci/amd,versal2-mdb-host.yaml new file +6
-0+ compatible: + const: amd,versal2-mdb-host + + reg: + items: + - description: MDB PCIe controller 0 SLCRSLCR is not defined anywhere.
Thanks for review, Here SLCR refers to mdb_pcie_slcr should I modify it to lower case?
Quoted 12 lines
Documentation/devicetree/bindings/pci/amd,versal2-mdb-host.yaml line 31
Quoted 11 lines
Documentation/devicetree/bindings/pci/amd,versal2-mdb-host.yaml new file +10
-0+ - description: configuration region + - description: data bus interface + - description: address translation unit register + + reg-names: + items: + - const: mdb_pcie_slcr + - const: config + - const: dbi + - const: atu
Quoted 1 line
DWC based it seems. You need to reference the DWC schema.
- Thanks for the review, Here should I add both dwc and pci-host-bridge host bridge schema.
Quoted 4 lines
Quoted 4 lines
Documentation/devicetree/bindings/pci/amd,versal2-mdb-host.yaml new file +4
-0+ + ranges: + maxItems: 2 +
Quoted 8 lines
Documentation/devicetree/bindings/pci/amd,versal2-mdb-host.yaml line 40
Quoted 5 lines
Documentation/devicetree/bindings/pci/amd,versal2-mdb-host.yaml new file +5
-0+ msi-map: + maxItems: 1 + + bus-range: + maxItems: 1Already defined in the common schema. Plus you obviously didn't test anything with this because bus-range must be exactly 2 entries. 1 is not valid.
- Thanks for the review, Will remove it in next patch.
Quoted 9 lines
Documentation/devicetree/bindings/pci/amd,versal2-mdb-host.yaml line 46
Quoted 7 lines
Documentation/devicetree/bindings/pci/amd,versal2-mdb-host.yaml new file +6
-0+ + "#address-cells": + const: 3 + + "#size-cells": + const: 2Both of these are also already defined in the
pci-host-bridge.yaml.
Thanks for the review, Will update in next patch.
Quoted 30 lines
Quoted 30 lines
Documentation/devicetree/bindings/pci/amd,versal2-mdb-host.yaml new file +29
-0+ + interrupts: + maxItems: 1 + + interrupt-map-mask: + items: + - const: 0 + - const: 0 + - const: 0 + - const: 7 + + interrupt-map: + maxItems: 4 + + "#interrupt-cells": + const: 1 + + interrupt-controller: + description: identifies the node as an interrupt controller + type: object + properties: + interrupt-controller: true + + "#address-cells": + const: 0 + + "#interrupt-cells": + const: 1 +
Quoted 8 lines
Documentation/devicetree/bindings/pci/amd,versal2-mdb-host.yaml line 81
Quoted 6 lines
Documentation/devicetree/bindings/pci/amd,versal2-mdb-host.yaml new file +6
-0+ required: + - interrupt-controller + - "#address-cells" + - "#interrupt-cells" + + additionalProperties: falseMove this before 'properties'.
- Thanks for the review, I will update in next patch.
Quoted 12 lines
Documentation/devicetree/bindings/pci/amd,versal2-mdb-host.yaml line 90
Quoted 10 lines
Documentation/devicetree/bindings/pci/amd,versal2-mdb-host.yaml new file +9
-0+ +required: + - reg + - reg-names + - interrupts + - interrupt-map + - interrupt-map-mask + - msi-map + - rangesAlready required by common schema.
Thanks for the review, will update in next patch.
Quoted 10 lines
Documentation/devicetree/bindings/pci/amd,versal2-mdb-host.yaml line 97
Quoted 8 lines
Documentation/devicetree/bindings/pci/amd,versal2-mdb-host.yaml new file +7
-0+ - "#interrupt-cells" + - interrupt-controller + +unevaluatedProperties: false + +examples: +Drop blank line.
Thanks for the review, will update in next patch.
Quoted 11 lines
Documentation/devicetree/bindings/pci/amd,versal2-mdb-host.yaml line 105
Quoted 9 lines
Documentation/devicetree/bindings/pci/amd,versal2-mdb-host.yaml new file +8
-0+ - | + #include <dt-bindings/interrupt-controller/arm-gic.h> + #include <dt-bindings/interrupt-controller/irq.h> + + soc { + #address-cells = <2>; + #size-cells = <2>; + pci@ed931000 {pcie@...
Thanks for the review, will update in next patch.
Quoted 32 lines
Documentation/devicetree/bindings/pci/amd,versal2-mdb-host.yaml
Quoted 8 lines
Documentation/devicetree/bindings/pci/amd,versal2-mdb-host.yaml new file +7
-0+ compatible = "amd,versal2-mdb-host"; + reg = <0x0 0xed931000 0x0 0x2000>, + <0x1000 0x100000 0x0 0xff00000>, + <0x1000 0x0 0x0 0x100000>, + <0x0 0xed860000 0x0 0x2000>; + reg-names = "mdb_pcie_slcr", "config", "dbi", "atu"; + ranges = <0x2000000 0x00 0xa8000000 0x00 0xa8000000 0x00
0x10000000>,Quoted 23 lines
Documentation/devicetree/bindings/pci/amd,versal2-mdb-host.yaml new file +20
-1+ <0x43000000 0x1100 0x00 0x1100 0x00 0x00 0x1000000>; + interrupts = <GIC_SPI 198 IRQ_TYPE_LEVEL_HIGH>; + interrupt-parent = <&gic>; + interrupt-map-mask = <0 0 0 7>; + interrupt-map = <0 0 0 1 &pcie_intc_0 0>, + <0 0 0 2 &pcie_intc_0 1>, + <0 0 0 3 &pcie_intc_0 2>, + <0 0 0 4 &pcie_intc_0 3>; + msi-map = <0x0 &gic_its 0x00 0x10000>; + #address-cells = <3>; + #size-cells = <2>; + #interrupt-cells = <1>; + device_type = "pci"; + pcie_intc_0: interrupt-controller { + #address-cells = <0>; + #interrupt-cells = <1>; + interrupt-controller; + }; + }; + }; --2.34.1
Regards,
Thippeswamy H
RE: [PATCH v2 1/2] dt-bindings: PCI: amd-mdb: Add AMD Versal2 MDB PCIe Root Port Bridge
Hi Robh,
Thank you for your comments. I mistakenly mentioned Bjorn in my earlier message. My apologies for the oversight.
Regards,
Thippeswamy H
Quoted 228 lines
-----Original Message-----
From: Havalige, Thippeswamy
Sent: Wednesday, December 4, 2024 12:02 PM
To: Rob Herring <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; linux- [email protected]; [email protected]; Simek, Michal <[email protected]>; Gogada, Bharat Kumar <[email protected]>
Subject: RE: [PATCH v2 1/2] dt-bindings: PCI: amd-mdb: Add AMD Versal2 MDB PCIe Root Port BridgeHi Bjorn,
Quoted 55 lines
-----Original Message-----
From: Rob Herring <[email protected]>
Sent: Tuesday, December 3, 2024 8:11 PM
To: Havalige, Thippeswamy <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; linux- [email protected]; [email protected]; Simek, Michal <[email protected]>; Gogada, Bharat Kumar <[email protected]>
Subject: Re: [PATCH v2 1/2] dt-bindings: PCI: amd-mdb: Add AMD Versal2 MDB PCIe Root Port BridgeQuoted 41 lines · Thippeswamy Havalige
Add AMD Versal2 MDB (Multimedia DMA Bridge) PCIe Root Port Bridge.
Signed-off-by Thippeswamy Havalige <[email protected]>---
Changes in v2:
-------------
- Modify patch subject.
- Add pcie host bridge reference.
- Modify filename as per compatible string.
- Remove standard PCI properties.
- Modify interrupt controller description.
- Indentation--- .../bindings/pci/amd,versal2-mdb-host.yaml | 132 ++++++++++++++++++ 1 file changed, 132 insertions(+) create mode 100644
Documentation/devicetree/bindings/pci/amd,versal2-mdb-host.yamldiff --git
a/Documentation/devicetree/bindings/pci/amd,versal2-mdb-host.yamlb/Documentation/devicetree/bindings/pci/amd,versal2-mdb-host.yamlnew file mode 100644
index 000000000000..75795bab8254Documentation/devicetree/bindings/pci/amd,versal2-mdb-host.yam new file +15
-0+++ l@@ -0,0 +1,132 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) %YAML 1.2 +--- +$id: http://devicetree.org/schemas/pci/amd,mdb-pcie.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: AMD Versal2 MDB(Multimedia DMA Bridge) Host Controller + +maintainers: + - Thippeswamy Havalige <[email protected]> + +allOf: + - $ref: /schemas/pci/pci-host-bridge.yaml# + +properties:Quoted 8 lines
Documentation/devicetree/bindings/pci/amd,versal2-mdb-host.yam line 20
Quoted 6 lines
Documentation/devicetree/bindings/pci/amd,versal2-mdb-host.yam new file +6
-0+ compatible: + const: amd,versal2-mdb-host + + reg: + items: + - description: MDB PCIe controller 0 SLCRSLCR is not defined anywhere.
Thanks for review, Here SLCR refers to
mdb_pcie_slcrshould I modify it to lower case?Quoted 12 lines
Documentation/devicetree/bindings/pci/amd,versal2-mdb-host.yam line 30
Quoted 11 lines
Documentation/devicetree/bindings/pci/amd,versal2-mdb-host.yam new file +10
-0+ - description: configuration region + - description: data bus interface + - description: address translation unit register + + reg-names: + items: + - const: mdb_pcie_slcr + - const: config + - const: dbi + - const: atuQuoted 1 line
DWC based it seems. You need to reference the DWC schema.
- Thanks for the review, Here should I add both dwc and pci-host-bridge host bridge schema.
Quoted 4 lines
Quoted 4 lines
Documentation/devicetree/bindings/pci/amd,versal2-mdb-host.yam new file +4
-0+ + ranges: + maxItems: 2 +Quoted 8 lines
Documentation/devicetree/bindings/pci/amd,versal2-mdb-host.yam line 39
Quoted 5 lines
Documentation/devicetree/bindings/pci/amd,versal2-mdb-host.yam new file +5
-0+ msi-map: + maxItems: 1 + + bus-range: + maxItems: 1Already defined in the common schema. Plus you obviously didn't test anything with this because bus-range must be exactly 2 entries. 1 is not valid.
- Thanks for the review, Will remove it in next patch.
Quoted 9 lines
Documentation/devicetree/bindings/pci/amd,versal2-mdb-host.yam line 45
Quoted 7 lines
Documentation/devicetree/bindings/pci/amd,versal2-mdb-host.yam new file +6
-0+ + "#address-cells": + const: 3 + + "#size-cells": + const: 2Both of these are also already defined in the
pci-host-bridge.yaml.Thanks for the review, Will update in next patch.
Quoted 30 lines
Quoted 30 lines
Documentation/devicetree/bindings/pci/amd,versal2-mdb-host.yam new file +29
-0+ + interrupts: + maxItems: 1 + + interrupt-map-mask: + items: + - const: 0 + - const: 0 + - const: 0 + - const: 7 + + interrupt-map: + maxItems: 4 + + "#interrupt-cells": + const: 1 + + interrupt-controller: + description: identifies the node as an interrupt controller + type: object + properties: + interrupt-controller: true + + "#address-cells": + const: 0 + + "#interrupt-cells": + const: 1 +Quoted 8 lines
Documentation/devicetree/bindings/pci/amd,versal2-mdb-host.yam line 80
Quoted 6 lines
Documentation/devicetree/bindings/pci/amd,versal2-mdb-host.yam new file +6
-0+ required: + - interrupt-controller + - "#address-cells" + - "#interrupt-cells" + + additionalProperties: falseMove this before 'properties'.
- Thanks for the review, I will update in next patch.
Quoted 12 lines
Documentation/devicetree/bindings/pci/amd,versal2-mdb-host.yam line 89
Quoted 10 lines
Documentation/devicetree/bindings/pci/amd,versal2-mdb-host.yam new file +9
-0+ +required: + - reg + - reg-names + - interrupts + - interrupt-map + - interrupt-map-mask + - msi-map + - rangesAlready required by common schema.
Thanks for the review, will update in next patch.
Quoted 10 lines
Documentation/devicetree/bindings/pci/amd,versal2-mdb-host.yam line 96
Quoted 8 lines
Documentation/devicetree/bindings/pci/amd,versal2-mdb-host.yam new file +7
-0+ - "#interrupt-cells" + - interrupt-controller + +unevaluatedProperties: false + +examples: +Drop blank line.
Thanks for the review, will update in next patch.
Quoted 11 lines
Documentation/devicetree/bindings/pci/amd,versal2-mdb-host.yam line 104
Quoted 9 lines
Documentation/devicetree/bindings/pci/amd,versal2-mdb-host.yam new file +8
-0+ - | + #include <dt-bindings/interrupt-controller/arm-gic.h> + #include <dt-bindings/interrupt-controller/irq.h> + + soc { + #address-cells = <2>; + #size-cells = <2>; + pci@ed931000 {pcie@...
Thanks for the review, will update in next patch.
Quoted 9 lines
Documentation/devicetree/bindings/pci/amd,versal2-mdb-host.yam line 112
Quoted 9 lines
Documentation/devicetree/bindings/pci/amd,versal2-mdb-host.yam new file +8
-0+ compatible = "amd,versal2-mdb-host"; + reg = <0x0 0xed931000 0x0 0x2000>, + <0x1000 0x100000 0x0 0xff00000>, + <0x1000 0x0 0x0 0x100000>, + <0x0 0xed860000 0x0 0x2000>; + reg-names = "mdb_pcie_slcr", "config", "dbi", "atu"; + ranges = <0x2000000 0x00 0xa8000000 0x00 0xa8000000 + 0x00Quoted 24 lines
0x10000000>,Quoted 23 lines
Documentation/devicetree/bindings/pci/amd,versal2-mdb-host.yam new file +20
-1+ <0x43000000 0x1100 0x00 0x1100 0x00 0x00 0x1000000>; + interrupts = <GIC_SPI 198 IRQ_TYPE_LEVEL_HIGH>; + interrupt-parent = <&gic>; + interrupt-map-mask = <0 0 0 7>; + interrupt-map = <0 0 0 1 &pcie_intc_0 0>, + <0 0 0 2 &pcie_intc_0 1>, + <0 0 0 3 &pcie_intc_0 2>, + <0 0 0 4 &pcie_intc_0 3>; + msi-map = <0x0 &gic_its 0x00 0x10000>; + #address-cells = <3>; + #size-cells = <2>; + #interrupt-cells = <1>; + device_type = "pci"; + pcie_intc_0: interrupt-controller { + #address-cells = <0>; + #interrupt-cells = <1>; + interrupt-controller; + }; + }; + }; --2.34.1
Regards,
Thippeswamy H
PATCH v2 2/2 PCI: amd-mdb: Add AMD MDB Root Port driver
In reply to Thippeswamy HavaligeAdd support for AMD MDB(Multimedia DMA Bridge) IP core as Root Port.
The Versal2 devices include MDB Module. The integrated block for MDB along with the integrated bridge can function as PCIe Root Port controller at Gen5 32-Gb/s operation per lane.
Bridge supports error and legacy interrupts and are handled using platform specific interrupt line in Versal2.
---
changes in v2:
-------------
- Update Gen5 speed in the patch description.
- Modify Kconfig file.
- Update string _leg_ to intx.
- Get platform structure through automic variables.
- Remove _rp_ in function.
--- drivers/pci/controller/dwc/Kconfig | 10 + drivers/pci/controller/dwc/Makefile | 1 + drivers/pci/controller/dwc/pcie-amd-mdb.c | 439 ++++++++++++++++++++++ 3 files changed, 450 insertions(+) create mode 100644 drivers/pci/controller/dwc/pcie-amd-mdb.c
drivers/pci/controller/dwc/Kconfig +10 -0
@@ -27,6 +27,16 @@ config PCIE_AL required only for DT-based platforms. ACPI platforms with the Annapurna Labs PCIe controller don't need to enable this. +config PCIE_AMD_MDB + bool "AMD PCIe controller (host mode)" + depends on OF || COMPILE_TEST + depends on PCI && PCI_MSI + select PCIE_DW_HOST + help + Say Y here to enable PCIe controller support on AMD SoCs. The + PCIe controller is based on DesignWare Hardware and uses AMD + hardware wrappers. + config PCI_MESON tristate "Amlogic Meson PCIe controller" default m if ARCH_MESON
drivers/pci/controller/dwc/Makefile +1 -0
@@ -3,6 +3,7 @@ obj-$(CONFIG_PCIE_DW) += pcie-designware.o obj-$(CONFIG_PCIE_DW_HOST) += pcie-designware-host.o obj-$(CONFIG_PCIE_DW_EP) += pcie-designware-ep.o obj-$(CONFIG_PCIE_DW_PLAT) += pcie-designware-plat.o +obj-$(CONFIG_PCIE_AMD_MDB) += pcie-amd-mdb.o obj-$(CONFIG_PCIE_BT1) += pcie-bt1.o obj-$(CONFIG_PCI_DRA7XX) += pci-dra7xx.o obj-$(CONFIG_PCI_EXYNOS) += pci-exynos.o
drivers/pci/controller/dwc/pcie-amd-mdb.c new file +439 -0
439 lines not on this page · raw message
Signature · 1 line
2.34.1