linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/6] Fix RISC-V/PCI dt-schema issues with dt-schema v2022.08
@ 2022-08-16 18:25 Conor Dooley
  2022-08-16 18:25 ` [PATCH v2 1/6] dt-bindings: PCI: fu740-pci: fix missing clock-names Conor Dooley
                   ` (5 more replies)
  0 siblings, 6 replies; 11+ messages in thread
From: Conor Dooley @ 2022-08-16 18:25 UTC (permalink / raw)
  To: Daire McNamara, Bjorn Helgaas, Rob Herring, Krzysztof Kozlowski,
	Paul Walmsley, Greentime Hu, Palmer Dabbelt, Albert Ou,
	Lorenzo Pieralisi, Conor Dooley
  Cc: linux-pci, devicetree, linux-kernel, linux-riscv

From: Conor Dooley <conor.dooley@microchip.com>

Hey all,

Got a few fixes for PCI dt-bindings that I noticed after upgrading my
dt-schema to v2022.08. (and the associated dts now too)

Since all the dts patches are for "my" boards, I'll take them once the
bindings are approved. I added a pair of other dts changes to the series,
mostly for my own benefit in tracking what I need to apply that were
previously at [0] & [1].

Thanks,
Conor.

0 - https://lore.kernel.org/all/20220811203207.179470-1-mail@conchuod.ie/
1 - https://lore.kernel.org/all/20220811204024.182453-1-mail@conchuod.ie/

Changes since v1:
- fu740: rewrite commit message
- mchp: rework clock-names as per rob's suggestion on IRC
- mchp: drop the "legacy" from the node name
- mchp: renemove the address translation property
- mchp: change the child node name in the dts rather than the binding

Conor Dooley (6):
  dt-bindings: PCI: fu740-pci: fix missing clock-names
  dt-bindings: PCI: microchip,pcie-host: fix missing clocks properties
  riscv: dts: microchip: mpfs: fix incorrect pcie child node name
  riscv: dts: microchip: mpfs: remove ti,fifo-depth property
  riscv: dts: microchip: mpfs: remove bogus card-detect-delay
  riscv: dts: microchip: mpfs: remove pci axi address translation
    property

 .../bindings/pci/microchip,pcie-host.yaml     | 25 +++++++++++++++++++
 .../bindings/pci/sifive,fu740-pcie.yaml       |  6 +++++
 .../boot/dts/microchip/mpfs-icicle-kit.dts    |  3 ---
 .../boot/dts/microchip/mpfs-polarberry.dts    |  3 ---
 arch/riscv/boot/dts/microchip/mpfs.dtsi       |  3 +--
 5 files changed, 32 insertions(+), 8 deletions(-)

-- 
2.37.1


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH v2 1/6] dt-bindings: PCI: fu740-pci: fix missing clock-names
  2022-08-16 18:25 [PATCH v2 0/6] Fix RISC-V/PCI dt-schema issues with dt-schema v2022.08 Conor Dooley
@ 2022-08-16 18:25 ` Conor Dooley
  2022-08-16 21:05   ` Jessica Clarke
  2022-08-16 18:25 ` [PATCH v2 2/6] dt-bindings: PCI: microchip,pcie-host: fix missing clocks properties Conor Dooley
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 11+ messages in thread
From: Conor Dooley @ 2022-08-16 18:25 UTC (permalink / raw)
  To: Daire McNamara, Bjorn Helgaas, Rob Herring, Krzysztof Kozlowski,
	Paul Walmsley, Greentime Hu, Palmer Dabbelt, Albert Ou,
	Lorenzo Pieralisi, Conor Dooley
  Cc: linux-pci, devicetree, linux-kernel, linux-riscv

From: Conor Dooley <conor.dooley@microchip.com>

The commit b92225b034c0 ("dt-bindings: PCI: designware: Fix
'unevaluatedProperties' warnings") removed the clock-names property as
a requirement and from the example as it triggered unevaluatedProperty
warnings. dtbs_check was not able to pick up on this at the time, but
now can:

arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dtb: pcie@e00000000: Unevaluated properties are not allowed ('clock-names' was unexpected)
        From schema: linux/Documentation/devicetree/bindings/pci/sifive,fu740-pcie.yaml

The property was already in use by the FU740 DTS and the clock must be
enabled. The Linux driver does not use this property, but outside of
the kernel this property may have users. Re-add the property and its
"clocks" dependency.

Fixes: b92225b034c0 ("dt-bindings: PCI: designware: Fix 'unevaluatedProperties' warnings")
Fixes: 43cea116be0b ("dt-bindings: PCI: Add SiFive FU740 PCIe host controller")
Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
---
v2022.08 of dt-schema is required.
---
 .../devicetree/bindings/pci/sifive,fu740-pcie.yaml          | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/Documentation/devicetree/bindings/pci/sifive,fu740-pcie.yaml b/Documentation/devicetree/bindings/pci/sifive,fu740-pcie.yaml
index 195e6afeb169..c7a9a2dc0fa6 100644
--- a/Documentation/devicetree/bindings/pci/sifive,fu740-pcie.yaml
+++ b/Documentation/devicetree/bindings/pci/sifive,fu740-pcie.yaml
@@ -51,6 +51,12 @@ properties:
     description: A phandle to the PCIe power up reset line.
     maxItems: 1
 
+  clocks:
+    maxItems: 1
+
+  clock-names:
+    const: pcie_aux
+
   pwren-gpios:
     description: Should specify the GPIO for controlling the PCI bus device power on.
     maxItems: 1
-- 
2.37.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH v2 2/6] dt-bindings: PCI: microchip,pcie-host: fix missing clocks properties
  2022-08-16 18:25 [PATCH v2 0/6] Fix RISC-V/PCI dt-schema issues with dt-schema v2022.08 Conor Dooley
  2022-08-16 18:25 ` [PATCH v2 1/6] dt-bindings: PCI: fu740-pci: fix missing clock-names Conor Dooley
@ 2022-08-16 18:25 ` Conor Dooley
  2022-08-18 15:06   ` Rob Herring
  2022-08-16 18:25 ` [PATCH v2 3/6] riscv: dts: microchip: mpfs: fix incorrect pcie child node name Conor Dooley
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 11+ messages in thread
From: Conor Dooley @ 2022-08-16 18:25 UTC (permalink / raw)
  To: Daire McNamara, Bjorn Helgaas, Rob Herring, Krzysztof Kozlowski,
	Paul Walmsley, Greentime Hu, Palmer Dabbelt, Albert Ou,
	Lorenzo Pieralisi, Conor Dooley
  Cc: linux-pci, devicetree, linux-kernel, linux-riscv

From: Conor Dooley <conor.dooley@microchip.com>

Recent versions of dt-schema warn about unevaluatedProperties:
arch/riscv/boot/dts/microchip/mpfs-icicle-kit.dtb: pcie@2000000000: Unevaluated properties are not allowed ('clock-names', 'clocks', 'legacy-interrupt-controller', 'microchip,axi-m-atr0' were unexpected)
        From schema: Documentation/devicetree/bindings/pci/microchip,pcie-host.yaml

The clocks are required to enable interfaces between the FPGA fabric
and the core complex, so add them to the binding.

Fixes: 6ee6c89aac35 ("dt-bindings: PCI: microchip: Add Microchip PolarFire host binding")
Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
---
dt-schema v2022.08 is required to replicate
---
 .../bindings/pci/microchip,pcie-host.yaml     | 25 +++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/Documentation/devicetree/bindings/pci/microchip,pcie-host.yaml b/Documentation/devicetree/bindings/pci/microchip,pcie-host.yaml
index edb4f81253c8..6bbde8693ef8 100644
--- a/Documentation/devicetree/bindings/pci/microchip,pcie-host.yaml
+++ b/Documentation/devicetree/bindings/pci/microchip,pcie-host.yaml
@@ -25,6 +25,31 @@ properties:
       - const: cfg
       - const: apb
 
+  clocks:
+    description:
+      Fabric Interface Controllers, FICs, are the interface between the FPGA
+      fabric and the core complex on PolarFire SoC. The FICs require two clocks,
+      one from each side of the interface. The "FIC clocks" described by this
+      property are on the core complex side & communication through a FIC is not
+      possible unless it's corresponding clock is enabled. A clock must be
+      enabled for each of the interfaces the root port is connected through.
+      This could in theory be all 4 interfaces, one interface or any combination
+      in between.
+    minItems: 1
+    items:
+      - description: FIC0's clock
+      - description: FIC1's clock
+      - description: FIC2's clock
+      - description: FIC3's clock
+
+  clock-names:
+    description:
+      As any FIC connection combination is possible, the names should match the
+      order in the clocks property and take the form "ficN" where N is a number
+      0-3
+    minItems: 1
+    maxItems: 4
+
   interrupts:
     minItems: 1
     items:
-- 
2.37.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH v2 3/6] riscv: dts: microchip: mpfs: fix incorrect pcie child node name
  2022-08-16 18:25 [PATCH v2 0/6] Fix RISC-V/PCI dt-schema issues with dt-schema v2022.08 Conor Dooley
  2022-08-16 18:25 ` [PATCH v2 1/6] dt-bindings: PCI: fu740-pci: fix missing clock-names Conor Dooley
  2022-08-16 18:25 ` [PATCH v2 2/6] dt-bindings: PCI: microchip,pcie-host: fix missing clocks properties Conor Dooley
@ 2022-08-16 18:25 ` Conor Dooley
  2022-08-16 18:25 ` [PATCH v2 4/6] riscv: dts: microchip: mpfs: remove ti,fifo-depth property Conor Dooley
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 11+ messages in thread
From: Conor Dooley @ 2022-08-16 18:25 UTC (permalink / raw)
  To: Daire McNamara, Bjorn Helgaas, Rob Herring, Krzysztof Kozlowski,
	Paul Walmsley, Greentime Hu, Palmer Dabbelt, Albert Ou,
	Lorenzo Pieralisi, Conor Dooley
  Cc: linux-pci, devicetree, linux-kernel, linux-riscv

From: Conor Dooley <conor.dooley@microchip.com>

Recent versions of dt-schema complain about the PCIe controller's child
node name:
arch/riscv/boot/dts/microchip/mpfs-icicle-kit.dtb: pcie@2000000000: Unevaluated properties are not allowed ('clock-names', 'clocks', 'legacy-interrupt-controller', 'microchip,axi-m-atr0' were unexpected)
            From schema: Documentation/devicetree/bindings/pci/microchip,pcie-host.yaml
Make the dts match the correct property name in the dts.

Fixes: 528a5b1f2556 ("riscv: dts: microchip: add new peripherals to icicle kit device tree")
Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
---
v2022.08 of dt-schema is required to replicate.
---
 arch/riscv/boot/dts/microchip/mpfs.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/riscv/boot/dts/microchip/mpfs.dtsi b/arch/riscv/boot/dts/microchip/mpfs.dtsi
index 499c2e63ad35..e69322f56516 100644
--- a/arch/riscv/boot/dts/microchip/mpfs.dtsi
+++ b/arch/riscv/boot/dts/microchip/mpfs.dtsi
@@ -487,7 +487,7 @@ pcie: pcie@2000000000 {
 			msi-controller;
 			microchip,axi-m-atr0 = <0x10 0x0>;
 			status = "disabled";
-			pcie_intc: legacy-interrupt-controller {
+			pcie_intc: interrupt-controller {
 				#address-cells = <0>;
 				#interrupt-cells = <1>;
 				interrupt-controller;
-- 
2.37.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH v2 4/6] riscv: dts: microchip: mpfs: remove ti,fifo-depth property
  2022-08-16 18:25 [PATCH v2 0/6] Fix RISC-V/PCI dt-schema issues with dt-schema v2022.08 Conor Dooley
                   ` (2 preceding siblings ...)
  2022-08-16 18:25 ` [PATCH v2 3/6] riscv: dts: microchip: mpfs: fix incorrect pcie child node name Conor Dooley
@ 2022-08-16 18:25 ` Conor Dooley
  2022-08-16 18:25 ` [PATCH v2 5/6] riscv: dts: microchip: mpfs: remove bogus card-detect-delay Conor Dooley
  2022-08-16 18:25 ` [PATCH v2 6/6] riscv: dts: microchip: mpfs: remove pci axi address translation property Conor Dooley
  5 siblings, 0 replies; 11+ messages in thread
From: Conor Dooley @ 2022-08-16 18:25 UTC (permalink / raw)
  To: Daire McNamara, Bjorn Helgaas, Rob Herring, Krzysztof Kozlowski,
	Paul Walmsley, Greentime Hu, Palmer Dabbelt, Albert Ou,
	Lorenzo Pieralisi, Conor Dooley
  Cc: linux-pci, devicetree, linux-kernel, linux-riscv

From: Conor Dooley <conor.dooley@microchip.com>

Recent versions of dt-schema warn about a previously undetected
undocument property on the icicle & polarberry devicetrees:

arch/riscv/boot/dts/microchip/mpfs-icicle-kit.dtb: ethernet@20112000: ethernet-phy@8: Unevaluated properties are not allowed ('ti,fifo-depth' was unexpected)
        From schema: Documentation/devicetree/bindings/net/cdns,macb.yaml

I know what you're thinking, the binding doesn't look to be the problem
and I agree. I am not sure why a TI vendor property was ever actually
added since it has no meaning... just get rid of it.

Fixes: bc47b2217f24 ("riscv: dts: microchip: add the sundance polarberry")
Fixes: 0fa6107eca41 ("RISC-V: Initial DTS for Microchip ICICLE board")
Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
---
v2022.08 or later of dt-schema is required.
---
 arch/riscv/boot/dts/microchip/mpfs-icicle-kit.dts | 2 --
 arch/riscv/boot/dts/microchip/mpfs-polarberry.dts | 2 --
 2 files changed, 4 deletions(-)

diff --git a/arch/riscv/boot/dts/microchip/mpfs-icicle-kit.dts b/arch/riscv/boot/dts/microchip/mpfs-icicle-kit.dts
index 044982a11df5..ee548ab61a2a 100644
--- a/arch/riscv/boot/dts/microchip/mpfs-icicle-kit.dts
+++ b/arch/riscv/boot/dts/microchip/mpfs-icicle-kit.dts
@@ -84,12 +84,10 @@ &mac1 {
 
 	phy1: ethernet-phy@9 {
 		reg = <9>;
-		ti,fifo-depth = <0x1>;
 	};
 
 	phy0: ethernet-phy@8 {
 		reg = <8>;
-		ti,fifo-depth = <0x1>;
 	};
 };
 
diff --git a/arch/riscv/boot/dts/microchip/mpfs-polarberry.dts b/arch/riscv/boot/dts/microchip/mpfs-polarberry.dts
index 82c93c8f5c17..dc11bb8fc833 100644
--- a/arch/riscv/boot/dts/microchip/mpfs-polarberry.dts
+++ b/arch/riscv/boot/dts/microchip/mpfs-polarberry.dts
@@ -54,12 +54,10 @@ &mac1 {
 
 	phy1: ethernet-phy@5 {
 		reg = <5>;
-		ti,fifo-depth = <0x01>;
 	};
 
 	phy0: ethernet-phy@4 {
 		reg = <4>;
-		ti,fifo-depth = <0x01>;
 	};
 };
 
-- 
2.37.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH v2 5/6] riscv: dts: microchip: mpfs: remove bogus card-detect-delay
  2022-08-16 18:25 [PATCH v2 0/6] Fix RISC-V/PCI dt-schema issues with dt-schema v2022.08 Conor Dooley
                   ` (3 preceding siblings ...)
  2022-08-16 18:25 ` [PATCH v2 4/6] riscv: dts: microchip: mpfs: remove ti,fifo-depth property Conor Dooley
@ 2022-08-16 18:25 ` Conor Dooley
  2022-08-16 18:25 ` [PATCH v2 6/6] riscv: dts: microchip: mpfs: remove pci axi address translation property Conor Dooley
  5 siblings, 0 replies; 11+ messages in thread
From: Conor Dooley @ 2022-08-16 18:25 UTC (permalink / raw)
  To: Daire McNamara, Bjorn Helgaas, Rob Herring, Krzysztof Kozlowski,
	Paul Walmsley, Greentime Hu, Palmer Dabbelt, Albert Ou,
	Lorenzo Pieralisi, Conor Dooley
  Cc: linux-pci, devicetree, linux-kernel, linux-riscv

From: Conor Dooley <conor.dooley@microchip.com>

Recent versions of dt-schema warn about a previously undetected
undocumented property:
arch/riscv/boot/dts/microchip/mpfs-icicle-kit.dtb: mmc@20008000: Unevaluated properties are not allowed ('card-detect-delay' was unexpected)
        From schema: Documentation/devicetree/bindings/mmc/cdns,sdhci.yaml

There are no GPIOs connected to MSSIO6B4 pin K3 so adding the common
cd-debounce-delay-ms property makes no sense. The Cadence IP has a
register that sets the card detect delay as "DP * tclk". On MPFS, this
clock frequency is not configurable (it must be 200 MHz) & the FPGA
comes out of reset with this register already set.

Fixes: bc47b2217f24 ("riscv: dts: microchip: add the sundance polarberry")
Fixes: 0fa6107eca41 ("RISC-V: Initial DTS for Microchip ICICLE board")
Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
---
v2022.08 or later of dt-schema is required.
---
 arch/riscv/boot/dts/microchip/mpfs-icicle-kit.dts | 1 -
 arch/riscv/boot/dts/microchip/mpfs-polarberry.dts | 1 -
 2 files changed, 2 deletions(-)

diff --git a/arch/riscv/boot/dts/microchip/mpfs-icicle-kit.dts b/arch/riscv/boot/dts/microchip/mpfs-icicle-kit.dts
index ee548ab61a2a..f3f87ed2007f 100644
--- a/arch/riscv/boot/dts/microchip/mpfs-icicle-kit.dts
+++ b/arch/riscv/boot/dts/microchip/mpfs-icicle-kit.dts
@@ -100,7 +100,6 @@ &mmc {
 	disable-wp;
 	cap-sd-highspeed;
 	cap-mmc-highspeed;
-	card-detect-delay = <200>;
 	mmc-ddr-1_8v;
 	mmc-hs200-1_8v;
 	sd-uhs-sdr12;
diff --git a/arch/riscv/boot/dts/microchip/mpfs-polarberry.dts b/arch/riscv/boot/dts/microchip/mpfs-polarberry.dts
index dc11bb8fc833..c87cc2d8fe29 100644
--- a/arch/riscv/boot/dts/microchip/mpfs-polarberry.dts
+++ b/arch/riscv/boot/dts/microchip/mpfs-polarberry.dts
@@ -70,7 +70,6 @@ &mmc {
 	disable-wp;
 	cap-sd-highspeed;
 	cap-mmc-highspeed;
-	card-detect-delay = <200>;
 	mmc-ddr-1_8v;
 	mmc-hs200-1_8v;
 	sd-uhs-sdr12;
-- 
2.37.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH v2 6/6] riscv: dts: microchip: mpfs: remove pci axi address translation property
  2022-08-16 18:25 [PATCH v2 0/6] Fix RISC-V/PCI dt-schema issues with dt-schema v2022.08 Conor Dooley
                   ` (4 preceding siblings ...)
  2022-08-16 18:25 ` [PATCH v2 5/6] riscv: dts: microchip: mpfs: remove bogus card-detect-delay Conor Dooley
@ 2022-08-16 18:25 ` Conor Dooley
  5 siblings, 0 replies; 11+ messages in thread
From: Conor Dooley @ 2022-08-16 18:25 UTC (permalink / raw)
  To: Daire McNamara, Bjorn Helgaas, Rob Herring, Krzysztof Kozlowski,
	Paul Walmsley, Greentime Hu, Palmer Dabbelt, Albert Ou,
	Lorenzo Pieralisi, Conor Dooley
  Cc: linux-pci, devicetree, linux-kernel, linux-riscv

From: Conor Dooley <conor.dooley@microchip.com>

An AXI master address translation table property was inadvertently
added to the device tree & this was not caught by dtbs_check at the
time. Remove the property - it should not be in mpfs.dtsi anyway as
it would be more suitable in -fabric.dtsi nor does it actually apply
to the version of the reference design we are using for upstream.

Fixes: 528a5b1f2556 ("riscv: dts: microchip: add new peripherals to icicle kit device tree")
Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
---
 arch/riscv/boot/dts/microchip/mpfs.dtsi | 1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/riscv/boot/dts/microchip/mpfs.dtsi b/arch/riscv/boot/dts/microchip/mpfs.dtsi
index e69322f56516..a1176260086a 100644
--- a/arch/riscv/boot/dts/microchip/mpfs.dtsi
+++ b/arch/riscv/boot/dts/microchip/mpfs.dtsi
@@ -485,7 +485,6 @@ pcie: pcie@2000000000 {
 			ranges = <0x3000000 0x0 0x8000000 0x20 0x8000000 0x0 0x80000000>;
 			msi-parent = <&pcie>;
 			msi-controller;
-			microchip,axi-m-atr0 = <0x10 0x0>;
 			status = "disabled";
 			pcie_intc: interrupt-controller {
 				#address-cells = <0>;
-- 
2.37.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH v2 1/6] dt-bindings: PCI: fu740-pci: fix missing clock-names
  2022-08-16 18:25 ` [PATCH v2 1/6] dt-bindings: PCI: fu740-pci: fix missing clock-names Conor Dooley
@ 2022-08-16 21:05   ` Jessica Clarke
  2022-08-16 21:32     ` Conor.Dooley
  0 siblings, 1 reply; 11+ messages in thread
From: Jessica Clarke @ 2022-08-16 21:05 UTC (permalink / raw)
  To: Conor Dooley
  Cc: Daire McNamara, Bjorn Helgaas, Rob Herring, Krzysztof Kozlowski,
	Paul Walmsley, Greentime Hu, Palmer Dabbelt, Albert Ou,
	Lorenzo Pieralisi, Conor Dooley, linux-pci, devicetree,
	linux-kernel, linux-riscv

On 16 Aug 2022, at 19:25, Conor Dooley <mail@conchuod.ie> wrote:
> 
> From: Conor Dooley <conor.dooley@microchip.com>
> 
> The commit b92225b034c0 ("dt-bindings: PCI: designware: Fix
> 'unevaluatedProperties' warnings") removed the clock-names property as
> a requirement and from the example as it triggered unevaluatedProperty
> warnings. dtbs_check was not able to pick up on this at the time, but
> now can:
> 
> arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dtb: pcie@e00000000: Unevaluated properties are not allowed ('clock-names' was unexpected)
>        From schema: linux/Documentation/devicetree/bindings/pci/sifive,fu740-pcie.yaml
> 
> The property was already in use by the FU740 DTS and the clock must be
> enabled. The Linux driver does not use this property, but outside of
> the kernel this property may have users. Re-add the property and its
> "clocks" dependency.

Are you sure about this? I see a devm_clk_get("pcie_aux") that surely
won't without the property. FreeBSD’s similarly relies on the name,
though it also has a fallback to the U-Boot pcieaux name (because the
world is terrible and people can’t even agree on that) so it works
with the U-Boot-provided FDT (it would be nice if Linux had this as a
goal, and people worked with U-Boot devs to get everything needed for
newly-exposed devices merged back there so I don’t have to be the one
to notice and do it...).

Jess

> Fixes: b92225b034c0 ("dt-bindings: PCI: designware: Fix 'unevaluatedProperties' warnings")
> Fixes: 43cea116be0b ("dt-bindings: PCI: Add SiFive FU740 PCIe host controller")
> Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
> ---
> v2022.08 of dt-schema is required.
> ---
> .../devicetree/bindings/pci/sifive,fu740-pcie.yaml          | 6 ++++++
> 1 file changed, 6 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/pci/sifive,fu740-pcie.yaml b/Documentation/devicetree/bindings/pci/sifive,fu740-pcie.yaml
> index 195e6afeb169..c7a9a2dc0fa6 100644
> --- a/Documentation/devicetree/bindings/pci/sifive,fu740-pcie.yaml
> +++ b/Documentation/devicetree/bindings/pci/sifive,fu740-pcie.yaml
> @@ -51,6 +51,12 @@ properties:
>     description: A phandle to the PCIe power up reset line.
>     maxItems: 1
> 
> +  clocks:
> +    maxItems: 1
> +
> +  clock-names:
> +    const: pcie_aux
> +
>   pwren-gpios:
>     description: Should specify the GPIO for controlling the PCI bus device power on.
>     maxItems: 1
> -- 
> 2.37.1
> 
> 
> _______________________________________________
> linux-riscv mailing list
> linux-riscv@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-riscv


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v2 1/6] dt-bindings: PCI: fu740-pci: fix missing clock-names
  2022-08-16 21:05   ` Jessica Clarke
@ 2022-08-16 21:32     ` Conor.Dooley
  0 siblings, 0 replies; 11+ messages in thread
From: Conor.Dooley @ 2022-08-16 21:32 UTC (permalink / raw)
  To: jrtc27
  Cc: Daire.McNamara, bhelgaas, robh+dt, krzysztof.kozlowski+dt,
	paul.walmsley, greentime.hu, palmer, aou, lpieralisi,
	Conor.Dooley, linux-pci, devicetree, linux-kernel, linux-riscv

On 16/08/2022 22:05, Jessica Clarke wrote:
> On 16 Aug 2022, at 19:25, Conor Dooley <mail@conchuod.ie> wrote:
>>
>> From: Conor Dooley <conor.dooley@microchip.com>
>>
>> The commit b92225b034c0 ("dt-bindings: PCI: designware: Fix
>> 'unevaluatedProperties' warnings") removed the clock-names property as
>> a requirement and from the example as it triggered unevaluatedProperty
>> warnings. dtbs_check was not able to pick up on this at the time, but
>> now can:
>>
>> arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dtb: pcie@e00000000: Unevaluated properties are not allowed ('clock-names' was unexpected)
>>        From schema: linux/Documentation/devicetree/bindings/pci/sifive,fu740-pcie.yaml
>>
>> The property was already in use by the FU740 DTS and the clock must be
>> enabled. The Linux driver does not use this property, but outside of
>> the kernel this property may have users. Re-add the property and its
>> "clocks" dependency.
> 
> Are you sure about this? I see a devm_clk_get("pcie_aux") that surely
> won't without the property. FreeBSD’s similarly relies on the name,

I'm having a bit of a howler this week. I read that line of code and
for some reason came to the conclusion that it didn't match the one
in the dt. I even did it more than once given I re-wrote this commit
message. At least you're paying attention & my change is incomplete
rather than broken...

Since there's reliance on the property, it needs to become required.

> though it also has a fallback to the U-Boot pcieaux name (because the
> world is terrible and people can’t even agree on that) so it works
> with the U-Boot-provided FDT (it would be nice if Linux had this as a
> goal, and people worked with U-Boot devs to get everything needed for
> newly-exposed devices merged back there so I don’t have to be the one
> to notice and do it...).

For polarfire we are a little out of sync & plan on fixing that soonTM.

> 
> Jess
> 
>> Fixes: b92225b034c0 ("dt-bindings: PCI: designware: Fix 'unevaluatedProperties' warnings")
>> Fixes: 43cea116be0b ("dt-bindings: PCI: Add SiFive FU740 PCIe host controller")
>> Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
>> ---
>> v2022.08 of dt-schema is required.
>> ---
>> .../devicetree/bindings/pci/sifive,fu740-pcie.yaml          | 6 ++++++
>> 1 file changed, 6 insertions(+)
>>
>> diff --git a/Documentation/devicetree/bindings/pci/sifive,fu740-pcie.yaml b/Documentation/devicetree/bindings/pci/sifive,fu740-pcie.yaml
>> index 195e6afeb169..c7a9a2dc0fa6 100644
>> --- a/Documentation/devicetree/bindings/pci/sifive,fu740-pcie.yaml
>> +++ b/Documentation/devicetree/bindings/pci/sifive,fu740-pcie.yaml
>> @@ -51,6 +51,12 @@ properties:
>>     description: A phandle to the PCIe power up reset line.
>>     maxItems: 1
>>
>> +  clocks:
>> +    maxItems: 1
>> +
>> +  clock-names:
>> +    const: pcie_aux
>> +
>>   pwren-gpios:
>>     description: Should specify the GPIO for controlling the PCI bus device power on.
>>     maxItems: 1
>> -- 
>> 2.37.1
>>
>>
>> _______________________________________________
>> linux-riscv mailing list
>> linux-riscv@lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/linux-riscv
> 

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v2 2/6] dt-bindings: PCI: microchip,pcie-host: fix missing clocks properties
  2022-08-16 18:25 ` [PATCH v2 2/6] dt-bindings: PCI: microchip,pcie-host: fix missing clocks properties Conor Dooley
@ 2022-08-18 15:06   ` Rob Herring
  2022-08-18 15:34     ` Conor.Dooley
  0 siblings, 1 reply; 11+ messages in thread
From: Rob Herring @ 2022-08-18 15:06 UTC (permalink / raw)
  To: Conor Dooley
  Cc: Daire McNamara, Bjorn Helgaas, Krzysztof Kozlowski,
	Paul Walmsley, Greentime Hu, Palmer Dabbelt, Albert Ou,
	Lorenzo Pieralisi, Conor Dooley, linux-pci, devicetree,
	linux-kernel, linux-riscv

On Tue, Aug 16, 2022 at 07:25:44PM +0100, Conor Dooley wrote:
> From: Conor Dooley <conor.dooley@microchip.com>
> 
> Recent versions of dt-schema warn about unevaluatedProperties:
> arch/riscv/boot/dts/microchip/mpfs-icicle-kit.dtb: pcie@2000000000: Unevaluated properties are not allowed ('clock-names', 'clocks', 'legacy-interrupt-controller', 'microchip,axi-m-atr0' were unexpected)
>         From schema: Documentation/devicetree/bindings/pci/microchip,pcie-host.yaml
> 
> The clocks are required to enable interfaces between the FPGA fabric
> and the core complex, so add them to the binding.
> 
> Fixes: 6ee6c89aac35 ("dt-bindings: PCI: microchip: Add Microchip PolarFire host binding")
> Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
> ---
> dt-schema v2022.08 is required to replicate
> ---
>  .../bindings/pci/microchip,pcie-host.yaml     | 25 +++++++++++++++++++
>  1 file changed, 25 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/pci/microchip,pcie-host.yaml b/Documentation/devicetree/bindings/pci/microchip,pcie-host.yaml
> index edb4f81253c8..6bbde8693ef8 100644
> --- a/Documentation/devicetree/bindings/pci/microchip,pcie-host.yaml
> +++ b/Documentation/devicetree/bindings/pci/microchip,pcie-host.yaml
> @@ -25,6 +25,31 @@ properties:
>        - const: cfg
>        - const: apb
>  
> +  clocks:
> +    description:
> +      Fabric Interface Controllers, FICs, are the interface between the FPGA
> +      fabric and the core complex on PolarFire SoC. The FICs require two clocks,
> +      one from each side of the interface. The "FIC clocks" described by this
> +      property are on the core complex side & communication through a FIC is not
> +      possible unless it's corresponding clock is enabled. A clock must be
> +      enabled for each of the interfaces the root port is connected through.
> +      This could in theory be all 4 interfaces, one interface or any combination
> +      in between.
> +    minItems: 1
> +    items:
> +      - description: FIC0's clock
> +      - description: FIC1's clock
> +      - description: FIC2's clock
> +      - description: FIC3's clock
> +
> +  clock-names:
> +    description:
> +      As any FIC connection combination is possible, the names should match the
> +      order in the clocks property and take the form "ficN" where N is a number
> +      0-3
> +    minItems: 1
> +    maxItems: 4

items:
  pattern: '^fic[0-3]$'

> +
>    interrupts:
>      minItems: 1
>      items:
> -- 
> 2.37.1
> 
> 
> _______________________________________________
> linux-riscv mailing list
> linux-riscv@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v2 2/6] dt-bindings: PCI: microchip,pcie-host: fix missing clocks properties
  2022-08-18 15:06   ` Rob Herring
@ 2022-08-18 15:34     ` Conor.Dooley
  0 siblings, 0 replies; 11+ messages in thread
From: Conor.Dooley @ 2022-08-18 15:34 UTC (permalink / raw)
  To: robh, mail
  Cc: Daire.McNamara, bhelgaas, krzysztof.kozlowski+dt, paul.walmsley,
	greentime.hu, palmer, aou, lpieralisi, linux-pci, devicetree,
	linux-kernel, linux-riscv

On 18/08/2022 16:06, Rob Herring wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> 
> On Tue, Aug 16, 2022 at 07:25:44PM +0100, Conor Dooley wrote:
>> From: Conor Dooley <conor.dooley@microchip.com>
>>
>> Recent versions of dt-schema warn about unevaluatedProperties:
>> arch/riscv/boot/dts/microchip/mpfs-icicle-kit.dtb: pcie@2000000000: Unevaluated properties are not allowed ('clock-names', 'clocks', 'legacy-interrupt-controller', 'microchip,axi-m-atr0' were unexpected)
>>         From schema: Documentation/devicetree/bindings/pci/microchip,pcie-host.yaml
>>
>> The clocks are required to enable interfaces between the FPGA fabric
>> and the core complex, so add them to the binding.
>>
>> Fixes: 6ee6c89aac35 ("dt-bindings: PCI: microchip: Add Microchip PolarFire host binding")
>> Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
>> ---
>> dt-schema v2022.08 is required to replicate
>> ---
>>  .../bindings/pci/microchip,pcie-host.yaml     | 25 +++++++++++++++++++
>>  1 file changed, 25 insertions(+)
>>
>> diff --git a/Documentation/devicetree/bindings/pci/microchip,pcie-host.yaml b/Documentation/devicetree/bindings/pci/microchip,pcie-host.yaml
>> index edb4f81253c8..6bbde8693ef8 100644
>> --- a/Documentation/devicetree/bindings/pci/microchip,pcie-host.yaml
>> +++ b/Documentation/devicetree/bindings/pci/microchip,pcie-host.yaml
>> @@ -25,6 +25,31 @@ properties:
>>        - const: cfg
>>        - const: apb
>>
>> +  clocks:
>> +    description:
>> +      Fabric Interface Controllers, FICs, are the interface between the FPGA
>> +      fabric and the core complex on PolarFire SoC. The FICs require two clocks,
>> +      one from each side of the interface. The "FIC clocks" described by this
>> +      property are on the core complex side & communication through a FIC is not
>> +      possible unless it's corresponding clock is enabled. A clock must be
>> +      enabled for each of the interfaces the root port is connected through.
>> +      This could in theory be all 4 interfaces, one interface or any combination
>> +      in between.
>> +    minItems: 1
>> +    items:
>> +      - description: FIC0's clock
>> +      - description: FIC1's clock
>> +      - description: FIC2's clock
>> +      - description: FIC3's clock
>> +
>> +  clock-names:
>> +    description:
>> +      As any FIC connection combination is possible, the names should match the
>> +      order in the clocks property and take the form "ficN" where N is a number
>> +      0-3
>> +    minItems: 1
>> +    maxItems: 4
> 
> items:
>   pattern: '^fic[0-3]$'

I'm glad you wrote this one for me Rob!
I'll send another version next week.
Thanks,
Conor.

> 
>> +
>>    interrupts:
>>      minItems: 1
>>      items:
>> --
>> 2.37.1
>>
>>
>> _______________________________________________
>> linux-riscv mailing list
>> linux-riscv@lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/linux-riscv


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2022-08-18 15:34 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-16 18:25 [PATCH v2 0/6] Fix RISC-V/PCI dt-schema issues with dt-schema v2022.08 Conor Dooley
2022-08-16 18:25 ` [PATCH v2 1/6] dt-bindings: PCI: fu740-pci: fix missing clock-names Conor Dooley
2022-08-16 21:05   ` Jessica Clarke
2022-08-16 21:32     ` Conor.Dooley
2022-08-16 18:25 ` [PATCH v2 2/6] dt-bindings: PCI: microchip,pcie-host: fix missing clocks properties Conor Dooley
2022-08-18 15:06   ` Rob Herring
2022-08-18 15:34     ` Conor.Dooley
2022-08-16 18:25 ` [PATCH v2 3/6] riscv: dts: microchip: mpfs: fix incorrect pcie child node name Conor Dooley
2022-08-16 18:25 ` [PATCH v2 4/6] riscv: dts: microchip: mpfs: remove ti,fifo-depth property Conor Dooley
2022-08-16 18:25 ` [PATCH v2 5/6] riscv: dts: microchip: mpfs: remove bogus card-detect-delay Conor Dooley
2022-08-16 18:25 ` [PATCH v2 6/6] riscv: dts: microchip: mpfs: remove pci axi address translation property Conor Dooley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).