2021-08-27 07:06:56

by Richard Zhu

[permalink] [raw]
Subject: [PATCH v2 0/3] dt-bindings: PCI: imx6: convert the imx pcie

Changes V1 --> V2:
- Add "Reviewed-by: Lucas Stach <[email protected]>" and update
the commit message.
- Apply changes refer to Rob's review comments.
- remove num-viewport totally, since it's not required anymore, and so on.

This patch-set aims to convert the imx pcie controller bindings from
fsl,imx6q-pcie.txt to json schema file fsl,imx6q-pcie.yaml.

And fix according errors on imx6qdl.dtsi, imx6qp.dtsi, imx6sx.dtsi,
imx7d.dtsi and imx8mq.dtsi found by dt_binding_check and dtbs_check.

Documentation/devicetree/bindings/pci/fsl,imx6q-pcie.txt | 100 -----------------------------------------
Documentation/devicetree/bindings/pci/fsl,imx6q-pcie.yaml | 202 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
MAINTAINERS | 2 +-
arch/arm/boot/dts/imx6qdl.dtsi | 7 ++-
arch/arm/boot/dts/imx6qp.dtsi | 2 +-
arch/arm/boot/dts/imx6sx.dtsi | 6 +--
arch/arm/boot/dts/imx7d.dtsi | 7 ++-
arch/arm64/boot/dts/freescale/imx8mq.dtsi | 10 ++---
8 files changed, 217 insertions(+), 119 deletions(-)
delete mode 100644 Documentation/devicetree/bindings/pci/fsl,imx6q-pcie.txt
create mode 100644 Documentation/devicetree/bindings/pci/fsl,imx6q-pcie.yaml

[PATCH v2 1/3] dt-bindings: PCI: imx6: convert the imx pcie
[PATCH v2 2/3] arm: dts: imx: fix the schema check errors
[PATCH v2 3/3] arm64: dts: imx8mq: fix the schema check errors


2021-08-27 07:07:10

by Richard Zhu

[permalink] [raw]
Subject: [PATCH v2 2/3] arm: dts: imx: fix the schema check errors

- ranges property should be grouped by region, with no functional
changes. Otherwise, schema dtbs_check would report the following errors.
"linux-imx/arch/arm/boot/dts/imx6qp-vicutp.dt.yaml: pcie@1ffc000: ranges: 'oneOf' conditional failed, one must be fixed:
linux-imx/arch/arm/boot/dts/imx6qp-vicutp.dt.yaml: pcie@1ffc000: ranges: 'oneOf' conditional failed, one must be fixed:
[[2164260864, 0, 0, 33030144, 0, 65536, 2181038080, 0, 16777216, 16777216, 0, 15728640]] is not of type 'boolean'
True was expected
[[2164260864, 0, 0, 33030144, 0, 65536, 2181038080, 0, 16777216, 16777216, 0, 15728640]] is not of type 'null'
[2164260864, 0, 0, 33030144, 0, 65536, 2181038080, 0, 16777216, 16777216, 0, 15728640] is too long
From schema: linux-imx/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie.yaml"
- refer to commit 281f1f99cf3a ("PCI: dwc: Detect number of iATU windows").
The num-viewport is not required anymore, remove them totally.
- dt_binding_check complains "compatible: ['fsl,imx6qp-pcie', 'snps,dw-pcie']
is too long", remove "snps,dw-pcie" from the compatible string.

Signed-off-by: Richard Zhu <[email protected]>
Reviewed-by: Lucas Stach <[email protected]>
---
arch/arm/boot/dts/imx6qdl.dtsi | 7 +++----
arch/arm/boot/dts/imx6qp.dtsi | 2 +-
arch/arm/boot/dts/imx6sx.dtsi | 6 +++---
arch/arm/boot/dts/imx7d.dtsi | 7 +++----
4 files changed, 10 insertions(+), 12 deletions(-)

diff --git a/arch/arm/boot/dts/imx6qdl.dtsi b/arch/arm/boot/dts/imx6qdl.dtsi
index 82e01ce026ea..d5477406401a 100644
--- a/arch/arm/boot/dts/imx6qdl.dtsi
+++ b/arch/arm/boot/dts/imx6qdl.dtsi
@@ -264,7 +264,7 @@ L2: cache-controller@a02000 {
};

pcie: pcie@1ffc000 {
- compatible = "fsl,imx6q-pcie", "snps,dw-pcie";
+ compatible = "fsl,imx6q-pcie";
reg = <0x01ffc000 0x04000>,
<0x01f00000 0x80000>;
reg-names = "dbi", "config";
@@ -272,10 +272,9 @@ pcie: pcie@1ffc000 {
#size-cells = <2>;
device_type = "pci";
bus-range = <0x00 0xff>;
- ranges = <0x81000000 0 0 0x01f80000 0 0x00010000 /* downstream I/O */
- 0x82000000 0 0x01000000 0x01000000 0 0x00f00000>; /* non-prefetchable memory */
+ ranges = <0x81000000 0 0 0x01f80000 0 0x00010000>, /* downstream I/O */
+ <0x82000000 0 0x01000000 0x01000000 0 0x00f00000>; /* non-prefetchable memory */
num-lanes = <1>;
- num-viewport = <4>;
interrupts = <GIC_SPI 120 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "msi";
#interrupt-cells = <1>;
diff --git a/arch/arm/boot/dts/imx6qp.dtsi b/arch/arm/boot/dts/imx6qp.dtsi
index b310f13a53f2..050365513836 100644
--- a/arch/arm/boot/dts/imx6qp.dtsi
+++ b/arch/arm/boot/dts/imx6qp.dtsi
@@ -110,5 +110,5 @@ &mmdc0 {
};

&pcie {
- compatible = "fsl,imx6qp-pcie", "snps,dw-pcie";
+ compatible = "fsl,imx6qp-pcie";
};
diff --git a/arch/arm/boot/dts/imx6sx.dtsi b/arch/arm/boot/dts/imx6sx.dtsi
index 8516730778df..fc6334336b3d 100644
--- a/arch/arm/boot/dts/imx6sx.dtsi
+++ b/arch/arm/boot/dts/imx6sx.dtsi
@@ -1395,15 +1395,15 @@ pwm8: pwm@22b0000 {
};

pcie: pcie@8ffc000 {
- compatible = "fsl,imx6sx-pcie", "snps,dw-pcie";
+ compatible = "fsl,imx6sx-pcie";
reg = <0x08ffc000 0x04000>, <0x08f00000 0x80000>;
reg-names = "dbi", "config";
#address-cells = <3>;
#size-cells = <2>;
device_type = "pci";
bus-range = <0x00 0xff>;
- ranges = <0x81000000 0 0 0x08f80000 0 0x00010000 /* downstream I/O */
- 0x82000000 0 0x08000000 0x08000000 0 0x00f00000>; /* non-prefetchable memory */
+ ranges = <0x81000000 0 0 0x08f80000 0 0x00010000>, /* downstream I/O */
+ <0x82000000 0 0x08000000 0x08000000 0 0x00f00000>; /* non-prefetchable memory */
num-lanes = <1>;
interrupts = <GIC_SPI 120 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "msi";
diff --git a/arch/arm/boot/dts/imx7d.dtsi b/arch/arm/boot/dts/imx7d.dtsi
index b0bcfa9094a3..b7735979b7e4 100644
--- a/arch/arm/boot/dts/imx7d.dtsi
+++ b/arch/arm/boot/dts/imx7d.dtsi
@@ -164,7 +164,7 @@ fec2: ethernet@30bf0000 {
};

pcie: pcie@33800000 {
- compatible = "fsl,imx7d-pcie", "snps,dw-pcie";
+ compatible = "fsl,imx7d-pcie";
reg = <0x33800000 0x4000>,
<0x4ff00000 0x80000>;
reg-names = "dbi", "config";
@@ -172,10 +172,9 @@ pcie: pcie@33800000 {
#size-cells = <2>;
device_type = "pci";
bus-range = <0x00 0xff>;
- ranges = <0x81000000 0 0 0x4ff80000 0 0x00010000 /* downstream I/O */
- 0x82000000 0 0x40000000 0x40000000 0 0x0ff00000>; /* non-prefetchable memory */
+ ranges = <0x81000000 0 0 0x4ff80000 0 0x00010000>, /* downstream I/O */
+ <0x82000000 0 0x40000000 0x40000000 0 0x0ff00000>; /* non-prefetchable memory */
num-lanes = <1>;
- num-viewport = <4>;
interrupts = <GIC_SPI 122 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "msi";
#interrupt-cells = <1>;
--
2.25.1

2021-08-27 07:07:13

by Richard Zhu

[permalink] [raw]
Subject: [PATCH v2 3/3] arm64: dts: imx8mq: fix the schema check errors

No functional changes, but the ranges should be grouped by region.
Otherwise, schema dtbs_check would report the following errors.

"/linux-imx/arch/arm64/boot/dts/freescale/imx8mq-evk.dt.yaml: pcie@33800000: ranges: 'oneOf' conditional failed, one must be fixed:
/linux-imx/arch/arm64/boot/dts/freescale/imx8mq-evk.dt.yaml: pcie@33800000: ranges: 'oneOf' conditional failed, one must be fixed:
[[2164260864, 0, 0, 536346624, 0, 65536, 2181038080, 0, 402653184, 402653184, 0, 133169152]] is not of type 'boolean'
True was expected
[[2164260864, 0, 0, 536346624, 0, 65536, 2181038080, 0, 402653184, 402653184, 0, 133169152]] is not of type 'null'
[2164260864, 0, 0, 536346624, 0, 65536, 2181038080, 0, 402653184, 402653184, 0, 133169152] is too long
From schema: //linux-imx/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie.yaml"

Refer to commit 281f1f99cf3a ("PCI: dwc: Detect number of iATU windows").
The num-viewport is not required anymore, remove them totally.

Signed-off-by: Richard Zhu <[email protected]>
Reviewed-by: Lucas Stach <[email protected]>
---
arch/arm64/boot/dts/freescale/imx8mq.dtsi | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/arch/arm64/boot/dts/freescale/imx8mq.dtsi b/arch/arm64/boot/dts/freescale/imx8mq.dtsi
index 91df9c5350ae..c6dba9b92edd 100644
--- a/arch/arm64/boot/dts/freescale/imx8mq.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8mq.dtsi
@@ -1364,10 +1364,9 @@ pcie0: pcie@33800000 {
#size-cells = <2>;
device_type = "pci";
bus-range = <0x00 0xff>;
- ranges = <0x81000000 0 0x00000000 0x1ff80000 0 0x00010000 /* downstream I/O 64KB */
- 0x82000000 0 0x18000000 0x18000000 0 0x07f00000>; /* non-prefetchable memory */
+ ranges = <0x81000000 0 0x00000000 0x1ff80000 0 0x00010000>, /* downstream I/O 64KB */
+ <0x82000000 0 0x18000000 0x18000000 0 0x07f00000>; /* non-prefetchable memory */
num-lanes = <1>;
- num-viewport = <4>;
interrupts = <GIC_SPI 122 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "msi";
#interrupt-cells = <1>;
@@ -1402,10 +1401,9 @@ pcie1: pcie@33c00000 {
#address-cells = <3>;
#size-cells = <2>;
device_type = "pci";
- ranges = <0x81000000 0 0x00000000 0x27f80000 0 0x00010000 /* downstream I/O 64KB */
- 0x82000000 0 0x20000000 0x20000000 0 0x07f00000>; /* non-prefetchable memory */
+ ranges = <0x81000000 0 0x00000000 0x27f80000 0 0x00010000>, /* downstream I/O 64KB */
+ <0x82000000 0 0x20000000 0x20000000 0 0x07f00000>; /* non-prefetchable memory */
num-lanes = <1>;
- num-viewport = <4>;
interrupts = <GIC_SPI 74 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "msi";
#interrupt-cells = <1>;
--
2.25.1

2021-09-15 05:23:08

by Richard Zhu

[permalink] [raw]
Subject: RE: [PATCH v2 3/3] arm64: dts: imx8mq: fix the schema check errors

Hi Shawn:
Can you help to merge the following patch?
Since the first one of this patch-set had been applied by Rob Herring.
https://patchwork.ozlabs.org/project/devicetree-bindings/patch/[email protected]/
Thanks in advanced.


Best Regards
Richard Zhu

> -----Original Message-----
> From: Richard Zhu <[email protected]>
> Sent: Friday, August 27, 2021 2:43 PM
> To: [email protected]; [email protected]; [email protected];
> [email protected]
> Cc: [email protected]; [email protected];
> [email protected]; dl-linux-imx <[email protected]>;
> [email protected]; Richard Zhu <[email protected]>
> Subject: [PATCH v2 3/3] arm64: dts: imx8mq: fix the schema check errors
>
> No functional changes, but the ranges should be grouped by region.
> Otherwise, schema dtbs_check would report the following errors.
>
> "/linux-imx/arch/arm64/boot/dts/freescale/imx8mq-evk.dt.yaml:
> pcie@33800000: ranges: 'oneOf' conditional failed, one must be fixed:
> /linux-imx/arch/arm64/boot/dts/freescale/imx8mq-evk.dt.yaml:
> pcie@33800000: ranges: 'oneOf' conditional failed, one must be fixed:
> [[2164260864, 0, 0, 536346624, 0, 65536, 2181038080, 0,
> 402653184, 402653184, 0, 133169152]] is not of type 'boolean'
> True was expected
> [[2164260864, 0, 0, 536346624, 0, 65536, 2181038080, 0,
> 402653184, 402653184, 0, 133169152]] is not of type 'null'
> [2164260864, 0, 0, 536346624, 0, 65536, 2181038080, 0,
> 402653184, 402653184, 0, 133169152] is too long
> From schema:
> //linux-imx/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie.yaml"
>
> Refer to commit 281f1f99cf3a ("PCI: dwc: Detect number of iATU windows").
> The num-viewport is not required anymore, remove them totally.
>
> Signed-off-by: Richard Zhu <[email protected]>
> Reviewed-by: Lucas Stach <[email protected]>
> ---
> arch/arm64/boot/dts/freescale/imx8mq.dtsi | 10 ++++------
> 1 file changed, 4 insertions(+), 6 deletions(-)
>
> diff --git a/arch/arm64/boot/dts/freescale/imx8mq.dtsi
> b/arch/arm64/boot/dts/freescale/imx8mq.dtsi
> index 91df9c5350ae..c6dba9b92edd 100644
> --- a/arch/arm64/boot/dts/freescale/imx8mq.dtsi
> +++ b/arch/arm64/boot/dts/freescale/imx8mq.dtsi
> @@ -1364,10 +1364,9 @@ pcie0: pcie@33800000 {
> #size-cells = <2>;
> device_type = "pci";
> bus-range = <0x00 0xff>;
> - ranges = <0x81000000 0 0x00000000 0x1ff80000 0
> 0x00010000 /* downstream I/O 64KB */
> - 0x82000000 0 0x18000000 0x18000000 0
> 0x07f00000>; /* non-prefetchable memory */
> + ranges = <0x81000000 0 0x00000000 0x1ff80000 0
> 0x00010000>, /* downstream I/O 64KB */
> + <0x82000000 0 0x18000000 0x18000000 0 0x07f00000>;
> /* non-prefetchable memory */
> num-lanes = <1>;
> - num-viewport = <4>;
> interrupts = <GIC_SPI 122 IRQ_TYPE_LEVEL_HIGH>;
> interrupt-names = "msi";
> #interrupt-cells = <1>;
> @@ -1402,10 +1401,9 @@ pcie1: pcie@33c00000 {
> #address-cells = <3>;
> #size-cells = <2>;
> device_type = "pci";
> - ranges = <0x81000000 0 0x00000000 0x27f80000 0
> 0x00010000 /* downstream I/O 64KB */
> - 0x82000000 0 0x20000000 0x20000000 0
> 0x07f00000>; /* non-prefetchable memory */
> + ranges = <0x81000000 0 0x00000000 0x27f80000 0
> 0x00010000>, /* downstream I/O 64KB */
> + <0x82000000 0 0x20000000 0x20000000 0
> 0x07f00000>; /* non-prefetchable memory */
> num-lanes = <1>;
> - num-viewport = <4>;
> interrupts = <GIC_SPI 74 IRQ_TYPE_LEVEL_HIGH>;
> interrupt-names = "msi";
> #interrupt-cells = <1>;
> --
> 2.25.1

2021-09-22 06:49:31

by Shawn Guo

[permalink] [raw]
Subject: Re: [PATCH v2 2/3] arm: dts: imx: fix the schema check errors

On Fri, Aug 27, 2021 at 02:42:59PM +0800, Richard Zhu wrote:
> - ranges property should be grouped by region, with no functional
> changes. Otherwise, schema dtbs_check would report the following errors.
> "linux-imx/arch/arm/boot/dts/imx6qp-vicutp.dt.yaml: pcie@1ffc000: ranges: 'oneOf' conditional failed, one must be fixed:
> linux-imx/arch/arm/boot/dts/imx6qp-vicutp.dt.yaml: pcie@1ffc000: ranges: 'oneOf' conditional failed, one must be fixed:
> [[2164260864, 0, 0, 33030144, 0, 65536, 2181038080, 0, 16777216, 16777216, 0, 15728640]] is not of type 'boolean'
> True was expected
> [[2164260864, 0, 0, 33030144, 0, 65536, 2181038080, 0, 16777216, 16777216, 0, 15728640]] is not of type 'null'
> [2164260864, 0, 0, 33030144, 0, 65536, 2181038080, 0, 16777216, 16777216, 0, 15728640] is too long
> From schema: linux-imx/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie.yaml"
> - refer to commit 281f1f99cf3a ("PCI: dwc: Detect number of iATU windows").
> The num-viewport is not required anymore, remove them totally.
> - dt_binding_check complains "compatible: ['fsl,imx6qp-pcie', 'snps,dw-pcie']
> is too long", remove "snps,dw-pcie" from the compatible string.
>
> Signed-off-by: Richard Zhu <[email protected]>
> Reviewed-by: Lucas Stach <[email protected]>

Applied, thanks!

2021-09-22 06:49:57

by Shawn Guo

[permalink] [raw]
Subject: Re: [PATCH v2 3/3] arm64: dts: imx8mq: fix the schema check errors

On Fri, Aug 27, 2021 at 02:43:00PM +0800, Richard Zhu wrote:
> No functional changes, but the ranges should be grouped by region.
> Otherwise, schema dtbs_check would report the following errors.
>
> "/linux-imx/arch/arm64/boot/dts/freescale/imx8mq-evk.dt.yaml: pcie@33800000: ranges: 'oneOf' conditional failed, one must be fixed:
> /linux-imx/arch/arm64/boot/dts/freescale/imx8mq-evk.dt.yaml: pcie@33800000: ranges: 'oneOf' conditional failed, one must be fixed:
> [[2164260864, 0, 0, 536346624, 0, 65536, 2181038080, 0, 402653184, 402653184, 0, 133169152]] is not of type 'boolean'
> True was expected
> [[2164260864, 0, 0, 536346624, 0, 65536, 2181038080, 0, 402653184, 402653184, 0, 133169152]] is not of type 'null'
> [2164260864, 0, 0, 536346624, 0, 65536, 2181038080, 0, 402653184, 402653184, 0, 133169152] is too long
> From schema: //linux-imx/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie.yaml"
>
> Refer to commit 281f1f99cf3a ("PCI: dwc: Detect number of iATU windows").
> The num-viewport is not required anymore, remove them totally.
>
> Signed-off-by: Richard Zhu <[email protected]>
> Reviewed-by: Lucas Stach <[email protected]>

Applied, thanks!