diff mbox series

[v2,1/5] ARM: dts: Cygnus: Fixed iProc PCIe controller properties

Message ID 20211206185242.2098683-2-f.fainelli@gmail.com (mailing list archive)
State Superseded
Headers show
Series Convert iProc PCIe binding to YAML | expand

Commit Message

Florian Fainelli Dec. 6, 2021, 6:52 p.m. UTC
Rename the msi controller unit name to 'msi' to avoid collisions
with the 'msi-controller' boolean property and add the missing
'interrupt-controller' property which is necessary. We also need to
re-arrange the 'ranges' property to show the two cells as being separate
instead of combined since the DT checker is not able to differentiate
otherwise.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 arch/arm/boot/dts/bcm-cygnus.dtsi | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

Comments

Rob Herring Dec. 7, 2021, 1:49 p.m. UTC | #1
On Mon, Dec 6, 2021 at 12:52 PM Florian Fainelli <f.fainelli@gmail.com> wrote:
>
> Rename the msi controller unit name to 'msi' to avoid collisions
> with the 'msi-controller' boolean property and add the missing
> 'interrupt-controller' property which is necessary. We also need to
> re-arrange the 'ranges' property to show the two cells as being separate
> instead of combined since the DT checker is not able to differentiate
> otherwise.
>
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
> ---
>  arch/arm/boot/dts/bcm-cygnus.dtsi | 14 ++++++++------
>  1 file changed, 8 insertions(+), 6 deletions(-)
>
> diff --git a/arch/arm/boot/dts/bcm-cygnus.dtsi b/arch/arm/boot/dts/bcm-cygnus.dtsi
> index 8ecb7861ce10..ea19d1b56400 100644
> --- a/arch/arm/boot/dts/bcm-cygnus.dtsi
> +++ b/arch/arm/boot/dts/bcm-cygnus.dtsi
> @@ -263,6 +263,7 @@ pcie0: pcie@18012000 {
>                         compatible = "brcm,iproc-pcie";
>                         reg = <0x18012000 0x1000>;
>
> +                       interrupt-controller;

How is this a fix? This doesn't even work before v5.16 with commit
041284181226 ("of/irq: Allow matching of an interrupt-map local to an
interrupt controller").


>                         #interrupt-cells = <1>;
>                         interrupt-map-mask = <0 0 0 0>;
>                         interrupt-map = <0 0 0 0 &gic GIC_SPI 100 IRQ_TYPE_LEVEL_HIGH>;
> @@ -274,8 +275,8 @@ pcie0: pcie@18012000 {
>                         #address-cells = <3>;
>                         #size-cells = <2>;
>                         device_type = "pci";
> -                       ranges = <0x81000000 0 0          0x28000000 0 0x00010000
> -                                 0x82000000 0 0x20000000 0x20000000 0 0x04000000>;
> +                       ranges = <0x81000000 0 0          0x28000000 0 0x00010000>,
> +                                <0x82000000 0 0x20000000 0x20000000 0 0x04000000>;
>
>                         phys = <&pcie0_phy>;
>                         phy-names = "pcie-phy";
> @@ -283,7 +284,7 @@ pcie0: pcie@18012000 {
>                         status = "disabled";
>
>                         msi-parent = <&msi0>;
> -                       msi0: msi-controller {
> +                       msi0: msi {
>                                 compatible = "brcm,iproc-msi";
>                                 msi-controller;
>                                 interrupt-parent = <&gic>;
> @@ -298,6 +299,7 @@ pcie1: pcie@18013000 {
>                         compatible = "brcm,iproc-pcie";
>                         reg = <0x18013000 0x1000>;
>
> +                       interrupt-controller;
>                         #interrupt-cells = <1>;
>                         interrupt-map-mask = <0 0 0 0>;
>                         interrupt-map = <0 0 0 0 &gic GIC_SPI 106 IRQ_TYPE_LEVEL_HIGH>;
> @@ -309,8 +311,8 @@ pcie1: pcie@18013000 {
>                         #address-cells = <3>;
>                         #size-cells = <2>;
>                         device_type = "pci";
> -                       ranges = <0x81000000 0 0          0x48000000 0 0x00010000
> -                                 0x82000000 0 0x40000000 0x40000000 0 0x04000000>;
> +                       ranges = <0x81000000 0 0          0x48000000 0 0x00010000>,
> +                                <0x82000000 0 0x40000000 0x40000000 0 0x04000000>;
>
>                         phys = <&pcie1_phy>;
>                         phy-names = "pcie-phy";
> @@ -318,7 +320,7 @@ pcie1: pcie@18013000 {
>                         status = "disabled";
>
>                         msi-parent = <&msi1>;
> -                       msi1: msi-controller {
> +                       msi1: msi {
>                                 compatible = "brcm,iproc-msi";
>                                 msi-controller;
>                                 interrupt-parent = <&gic>;
> --
> 2.25.1
>
Florian Fainelli Dec. 7, 2021, 5:44 p.m. UTC | #2
On 12/7/21 5:49 AM, Rob Herring wrote:
> On Mon, Dec 6, 2021 at 12:52 PM Florian Fainelli <f.fainelli@gmail.com> wrote:
>>
>> Rename the msi controller unit name to 'msi' to avoid collisions
>> with the 'msi-controller' boolean property and add the missing
>> 'interrupt-controller' property which is necessary. We also need to
>> re-arrange the 'ranges' property to show the two cells as being separate
>> instead of combined since the DT checker is not able to differentiate
>> otherwise.
>>
>> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
>> ---
>>  arch/arm/boot/dts/bcm-cygnus.dtsi | 14 ++++++++------
>>  1 file changed, 8 insertions(+), 6 deletions(-)
>>
>> diff --git a/arch/arm/boot/dts/bcm-cygnus.dtsi b/arch/arm/boot/dts/bcm-cygnus.dtsi
>> index 8ecb7861ce10..ea19d1b56400 100644
>> --- a/arch/arm/boot/dts/bcm-cygnus.dtsi
>> +++ b/arch/arm/boot/dts/bcm-cygnus.dtsi
>> @@ -263,6 +263,7 @@ pcie0: pcie@18012000 {
>>                         compatible = "brcm,iproc-pcie";
>>                         reg = <0x18012000 0x1000>;
>>
>> +                       interrupt-controller;
> 
> How is this a fix? This doesn't even work before v5.16 with commit
> 041284181226 ("of/irq: Allow matching of an interrupt-map local to an
> interrupt controller").

What is the path forward? I suppose I could make the
interrupt-controller property not required for this controller but then
the default interrupt-controller schema is not terribly happy about
seeing an interrupt-map/interrupt-map-mask properties without
interrupt-controller.
Rob Herring Dec. 7, 2021, 8:08 p.m. UTC | #3
On Tue, Dec 7, 2021 at 11:44 AM Florian Fainelli <f.fainelli@gmail.com> wrote:
>
> On 12/7/21 5:49 AM, Rob Herring wrote:
> > On Mon, Dec 6, 2021 at 12:52 PM Florian Fainelli <f.fainelli@gmail.com> wrote:
> >>
> >> Rename the msi controller unit name to 'msi' to avoid collisions
> >> with the 'msi-controller' boolean property and add the missing
> >> 'interrupt-controller' property which is necessary. We also need to
> >> re-arrange the 'ranges' property to show the two cells as being separate
> >> instead of combined since the DT checker is not able to differentiate
> >> otherwise.
> >>
> >> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
> >> ---
> >>  arch/arm/boot/dts/bcm-cygnus.dtsi | 14 ++++++++------
> >>  1 file changed, 8 insertions(+), 6 deletions(-)
> >>
> >> diff --git a/arch/arm/boot/dts/bcm-cygnus.dtsi b/arch/arm/boot/dts/bcm-cygnus.dtsi
> >> index 8ecb7861ce10..ea19d1b56400 100644
> >> --- a/arch/arm/boot/dts/bcm-cygnus.dtsi
> >> +++ b/arch/arm/boot/dts/bcm-cygnus.dtsi
> >> @@ -263,6 +263,7 @@ pcie0: pcie@18012000 {
> >>                         compatible = "brcm,iproc-pcie";
> >>                         reg = <0x18012000 0x1000>;
> >>
> >> +                       interrupt-controller;
> >
> > How is this a fix? This doesn't even work before v5.16 with commit
> > 041284181226 ("of/irq: Allow matching of an interrupt-map local to an
> > interrupt controller").
>
> What is the path forward? I suppose I could make the
> interrupt-controller property not required for this controller but then
> the default interrupt-controller schema is not terribly happy about
> seeing an interrupt-map/interrupt-map-mask properties without
> interrupt-controller.

There's certainly no requirement for having 'interrupt-controller'.
What error are you getting?

Rob
Florian Fainelli Dec. 7, 2021, 10:49 p.m. UTC | #4
On 12/7/21 12:08 PM, Rob Herring wrote:
> On Tue, Dec 7, 2021 at 11:44 AM Florian Fainelli <f.fainelli@gmail.com> wrote:
>>
>> On 12/7/21 5:49 AM, Rob Herring wrote:
>>> On Mon, Dec 6, 2021 at 12:52 PM Florian Fainelli <f.fainelli@gmail.com> wrote:
>>>>
>>>> Rename the msi controller unit name to 'msi' to avoid collisions
>>>> with the 'msi-controller' boolean property and add the missing
>>>> 'interrupt-controller' property which is necessary. We also need to
>>>> re-arrange the 'ranges' property to show the two cells as being separate
>>>> instead of combined since the DT checker is not able to differentiate
>>>> otherwise.
>>>>
>>>> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
>>>> ---
>>>>  arch/arm/boot/dts/bcm-cygnus.dtsi | 14 ++++++++------
>>>>  1 file changed, 8 insertions(+), 6 deletions(-)
>>>>
>>>> diff --git a/arch/arm/boot/dts/bcm-cygnus.dtsi b/arch/arm/boot/dts/bcm-cygnus.dtsi
>>>> index 8ecb7861ce10..ea19d1b56400 100644
>>>> --- a/arch/arm/boot/dts/bcm-cygnus.dtsi
>>>> +++ b/arch/arm/boot/dts/bcm-cygnus.dtsi
>>>> @@ -263,6 +263,7 @@ pcie0: pcie@18012000 {
>>>>                         compatible = "brcm,iproc-pcie";
>>>>                         reg = <0x18012000 0x1000>;
>>>>
>>>> +                       interrupt-controller;
>>>
>>> How is this a fix? This doesn't even work before v5.16 with commit
>>> 041284181226 ("of/irq: Allow matching of an interrupt-map local to an
>>> interrupt controller").
>>
>> What is the path forward? I suppose I could make the
>> interrupt-controller property not required for this controller but then
>> the default interrupt-controller schema is not terribly happy about
>> seeing an interrupt-map/interrupt-map-mask properties without
>> interrupt-controller.
> 
> There's certainly no requirement for having 'interrupt-controller'.
> What error are you getting?

This was the error I was getting because I had made the
'interrupt-controller' a required property in the brcm,iproc-pcie.yaml
binding, silly me:

/home/fainelli/dev/linux/arch/arm/boot/dts/bcm958300k.dt.yaml:
pcie@18012000: 'interrupt-controller' is a required property
        From schema:
/home/fainelli/dev/linux/Documentation/devicetree/bindings/pci/brcm,iproc-pcie.yaml

after taking it out from the required property there are no more
warnings, I will spin a v3 with the changes, thanks!
diff mbox series

Patch

diff --git a/arch/arm/boot/dts/bcm-cygnus.dtsi b/arch/arm/boot/dts/bcm-cygnus.dtsi
index 8ecb7861ce10..ea19d1b56400 100644
--- a/arch/arm/boot/dts/bcm-cygnus.dtsi
+++ b/arch/arm/boot/dts/bcm-cygnus.dtsi
@@ -263,6 +263,7 @@  pcie0: pcie@18012000 {
 			compatible = "brcm,iproc-pcie";
 			reg = <0x18012000 0x1000>;
 
+			interrupt-controller;
 			#interrupt-cells = <1>;
 			interrupt-map-mask = <0 0 0 0>;
 			interrupt-map = <0 0 0 0 &gic GIC_SPI 100 IRQ_TYPE_LEVEL_HIGH>;
@@ -274,8 +275,8 @@  pcie0: pcie@18012000 {
 			#address-cells = <3>;
 			#size-cells = <2>;
 			device_type = "pci";
-			ranges = <0x81000000 0 0	  0x28000000 0 0x00010000
-				  0x82000000 0 0x20000000 0x20000000 0 0x04000000>;
+			ranges = <0x81000000 0 0	  0x28000000 0 0x00010000>,
+				 <0x82000000 0 0x20000000 0x20000000 0 0x04000000>;
 
 			phys = <&pcie0_phy>;
 			phy-names = "pcie-phy";
@@ -283,7 +284,7 @@  pcie0: pcie@18012000 {
 			status = "disabled";
 
 			msi-parent = <&msi0>;
-			msi0: msi-controller {
+			msi0: msi {
 				compatible = "brcm,iproc-msi";
 				msi-controller;
 				interrupt-parent = <&gic>;
@@ -298,6 +299,7 @@  pcie1: pcie@18013000 {
 			compatible = "brcm,iproc-pcie";
 			reg = <0x18013000 0x1000>;
 
+			interrupt-controller;
 			#interrupt-cells = <1>;
 			interrupt-map-mask = <0 0 0 0>;
 			interrupt-map = <0 0 0 0 &gic GIC_SPI 106 IRQ_TYPE_LEVEL_HIGH>;
@@ -309,8 +311,8 @@  pcie1: pcie@18013000 {
 			#address-cells = <3>;
 			#size-cells = <2>;
 			device_type = "pci";
-			ranges = <0x81000000 0 0	  0x48000000 0 0x00010000
-				  0x82000000 0 0x40000000 0x40000000 0 0x04000000>;
+			ranges = <0x81000000 0 0	  0x48000000 0 0x00010000>,
+				 <0x82000000 0 0x40000000 0x40000000 0 0x04000000>;
 
 			phys = <&pcie1_phy>;
 			phy-names = "pcie-phy";
@@ -318,7 +320,7 @@  pcie1: pcie@18013000 {
 			status = "disabled";
 
 			msi-parent = <&msi1>;
-			msi1: msi-controller {
+			msi1: msi {
 				compatible = "brcm,iproc-msi";
 				msi-controller;
 				interrupt-parent = <&gic>;