[2/3] dt-bindings: Document BCM6328 PCIe Host Controller
diff mbox series

Message ID 20200617102556.3792821-3-noltari@gmail.com
State New
Headers show
Series
  • mips: bmips: add BCM6328 PCIe support
Related show

Commit Message

Álvaro Fernández Rojas June 17, 2020, 10:25 a.m. UTC
BCM6328 PCIe host controller is found on BCM6328, BCM6362 and BCM63268 SoCs.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
---
 .../bindings/pci/brcm,bcm6328-pcie.yaml       | 109 ++++++++++++++++++
 1 file changed, 109 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/pci/brcm,bcm6328-pcie.yaml

Comments

Rob Herring June 17, 2020, 5:07 p.m. UTC | #1
On Wed, 17 Jun 2020 12:25:55 +0200, Álvaro Fernández Rojas wrote:
> BCM6328 PCIe host controller is found on BCM6328, BCM6362 and BCM63268 SoCs.
> 
> Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
> ---
>  .../bindings/pci/brcm,bcm6328-pcie.yaml       | 109 ++++++++++++++++++
>  1 file changed, 109 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/pci/brcm,bcm6328-pcie.yaml
> 


My bot found errors running 'make dt_binding_check' on your patch:

Error: Documentation/devicetree/bindings/pci/brcm,bcm6328-pcie.example.dts:38.49-50 syntax error
FATAL ERROR: Unable to parse input tree
scripts/Makefile.lib:315: recipe for target 'Documentation/devicetree/bindings/pci/brcm,bcm6328-pcie.example.dt.yaml' failed
make[1]: *** [Documentation/devicetree/bindings/pci/brcm,bcm6328-pcie.example.dt.yaml] Error 1
make[1]: *** Waiting for unfinished jobs....
Makefile:1347: recipe for target 'dt_binding_check' failed
make: *** [dt_binding_check] Error 2


See https://patchwork.ozlabs.org/patch/1311090

If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure dt-schema is up to date:

pip3 install git+https://github.com/devicetree-org/dt-schema.git@master --upgrade

Please check and re-submit.
Florian Fainelli June 17, 2020, 9:50 p.m. UTC | #2
On 6/17/2020 3:25 AM, Álvaro Fernández Rojas wrote:
> BCM6328 PCIe host controller is found on BCM6328, BCM6362 and BCM63268 SoCs.
> 
> Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
> ---
>  .../bindings/pci/brcm,bcm6328-pcie.yaml       | 109 ++++++++++++++++++
>  1 file changed, 109 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/pci/brcm,bcm6328-pcie.yaml
> 
> diff --git a/Documentation/devicetree/bindings/pci/brcm,bcm6328-pcie.yaml b/Documentation/devicetree/bindings/pci/brcm,bcm6328-pcie.yaml
> new file mode 100644
> index 000000000000..d2bd4933a5fa
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/pci/brcm,bcm6328-pcie.yaml
> @@ -0,0 +1,109 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/pci/brcm,bcm6328-pcie.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: BCM6328 PCIe Host Controller Device Tree Bindings
> +
> +maintainers:
> +  - Álvaro Fernández Rojas <noltari@gmail.com>
> +
> +allOf:
> +  - $ref: /schemas/pci/pci-bus.yaml#
> +
> +properties:
> +  compatible:
> +    enum:
> +     - brcm,bcm6328-pcie
> +     - brcm,bcm6362-pcie
> +     - brcm,bcm63268-pcie
> +
> +  clocks:
> +    maxItems: 1
> +
> +  clock-names:
> +    items:
> +      - const: pcie
> +
> +  "#interrupt-cells":
> +    const: 1
> +
> +  interrupt-map-mask:
> +    maxItems: 1
> +
> +  interrupt-map:
> +    maxItems: 1
> +
> +  power-domains:
> +    maxItems: 1
> +
> +  ranges:
> +    maxItems: 1
> +
> +  reg:
> +    maxItems: 1
> +
> +  resets:
> +    maxItems: 4
> +
> +  reset-names:
> +    items:
> +      - const: pcie
> +      - const: pcie-core
> +      - const: pcie-ext
> +      - const: pcie-hard
> +
> +required:
> +  - brcm,serdes
> +  - clocks
> +  - clock-names
> +  - "#interrupt-cells"
> +  - interrupt-map-mask
> +  - interrupt-map
> +  - ranges
> +  - reg
> +  - resets
> +  - reset-names
> +
> +unevaluatedProperties: false
> +
> +examples:
> +  - |
> +    serdes_cntl: syscon@10001800 {
> +      compatible = "syscon";
> +      reg = <0x10001800 0x4>;
> +      native-endian;
> +    };

I believe you could be modelling the SerDes as generic PHY driver which
would be a little cleaner than the syscon approach. In newer chips like
6318 it looks like you should be able to use pcie-brcmstb.c since the
controller appears to be nearly the same and the PHY abstraction would
work nicely there.

Patch
diff mbox series

diff --git a/Documentation/devicetree/bindings/pci/brcm,bcm6328-pcie.yaml b/Documentation/devicetree/bindings/pci/brcm,bcm6328-pcie.yaml
new file mode 100644
index 000000000000..d2bd4933a5fa
--- /dev/null
+++ b/Documentation/devicetree/bindings/pci/brcm,bcm6328-pcie.yaml
@@ -0,0 +1,109 @@ 
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/pci/brcm,bcm6328-pcie.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: BCM6328 PCIe Host Controller Device Tree Bindings
+
+maintainers:
+  - Álvaro Fernández Rojas <noltari@gmail.com>
+
+allOf:
+  - $ref: /schemas/pci/pci-bus.yaml#
+
+properties:
+  compatible:
+    enum:
+     - brcm,bcm6328-pcie
+     - brcm,bcm6362-pcie
+     - brcm,bcm63268-pcie
+
+  clocks:
+    maxItems: 1
+
+  clock-names:
+    items:
+      - const: pcie
+
+  "#interrupt-cells":
+    const: 1
+
+  interrupt-map-mask:
+    maxItems: 1
+
+  interrupt-map:
+    maxItems: 1
+
+  power-domains:
+    maxItems: 1
+
+  ranges:
+    maxItems: 1
+
+  reg:
+    maxItems: 1
+
+  resets:
+    maxItems: 4
+
+  reset-names:
+    items:
+      - const: pcie
+      - const: pcie-core
+      - const: pcie-ext
+      - const: pcie-hard
+
+required:
+  - brcm,serdes
+  - clocks
+  - clock-names
+  - "#interrupt-cells"
+  - interrupt-map-mask
+  - interrupt-map
+  - ranges
+  - reg
+  - resets
+  - reset-names
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    serdes_cntl: syscon@10001800 {
+      compatible = "syscon";
+      reg = <0x10001800 0x4>;
+      native-endian;
+    };
+
+    pcie: pcie@10e40000 {
+      compatible = "brcm,bcm6328-pcie";
+      reg = <0x10e40000 0x10000>;
+      #address-cells = <3>;
+      #size-cells = <2>;
+
+      device_type = "pci";
+      bus-range = <0x00 0x01>;
+      ranges = <0x2000000 0 0x10f00000 0x10f00000 0 0x100000>;
+      linux,pci-probe-only = <1>;
+
+      #interrupt-cells = <1>;
+      interrupt-map-mask = <0 0 0 0>;
+      interrupt-map = <0 0 0 0 &periph_intc BCM6328_IRQ_PCIE_RC 0>;
+
+      clocks = <&periph_clk BCM6328_CLK_PCIE>;
+      clock-names = "pcie";
+
+      resets = <&periph_rst BCM6328_RST_PCIE>,
+               <&periph_rst BCM6328_RST_PCIE_EXT>,
+               <&periph_rst BCM6328_RST_PCIE_CORE>,
+               <&periph_rst BCM6328_RST_PCIE_HARD>;
+      reset-names = "pcie",
+                    "pcie-ext",
+                    "pcie-core",
+                    "pcie-hard";
+
+      power-domains = <&periph_pwr BCM6328_POWER_DOMAIN_PCIE>;
+
+      brcm,serdes = <&serdes_cntl>;
+    };