[4/4] ARM: dts: bcm2837-rpi-3-b: add GPIO expander
diff mbox

Message ID a29df633ee568e150c150debde66c0783a57c70a.1514898134.git.baruch@tkos.co.il
State New, archived
Headers show

Commit Message

Baruch Siach Jan. 2, 2018, 1:19 p.m. UTC
Add a description of the RPi3 GPIO expander that the VC4 firmware controls.

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
---
 arch/arm/boot/dts/bcm2837-rpi-3-b.dts | 10 ++++++++++
 1 file changed, 10 insertions(+)

Comments

Stefan Wahren Jan. 2, 2018, 7:03 p.m. UTC | #1
Hi Baruch,

> Baruch Siach <baruch@tkos.co.il> hat am 2. Januar 2018 um 14:19 geschrieben:
> 
> 
> Add a description of the RPi3 GPIO expander that the VC4 firmware controls.
> 
> Signed-off-by: Baruch Siach <baruch@tkos.co.il>
> ---
>  arch/arm/boot/dts/bcm2837-rpi-3-b.dts | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/bcm2837-rpi-3-b.dts b/arch/arm/boot/dts/bcm2837-rpi-3-b.dts
> index b44b3b5af00d..09dca48da2bd 100644
> --- a/arch/arm/boot/dts/bcm2837-rpi-3-b.dts
> +++ b/arch/arm/boot/dts/bcm2837-rpi-3-b.dts
> @@ -23,6 +23,16 @@
>  			gpios = <&gpio 47 0>;
>  		};
>  	};
> +
> +	soc {

unfortunately this is a common issue of the RPi firmware drivers. These nodes shouldn't be child of the soc, because it's only bound for memory mapped IO. So please move it to the same level as soc. Otherwise we get more warnings with W=1 and Rob Herring gets unhappy.

> +		expgpio: expgpio {
> +			compatible = "brcm,bcm2835-expgpio";
> +			gpio-controller;
> +			#gpio-cells = <2>;
> +			firmware = <&firmware>;

Please add the gpio-line-names from Eric's patch [1].

Thanks
Stefan

[1] - https://patchwork.kernel.org/patch/9339857/

> +			status = "okay";
> +		};
> +	};
>  };
>  
>  /* uart0 communicates with the BT module */
> -- 
> 2.15.1
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Stefan Wahren Jan. 3, 2018, 8:17 p.m. UTC | #2
Hi Baruch,

> Stefan Wahren <stefan.wahren@i2se.com> hat am 2. Januar 2018 um 20:03 geschrieben:
> 
> 
> Hi Baruch,
> 
> > Baruch Siach <baruch@tkos.co.il> hat am 2. Januar 2018 um 14:19 geschrieben:
> 
> > +		expgpio: expgpio {
> > +			compatible = "brcm,bcm2835-expgpio";
> > +			gpio-controller;
> > +			#gpio-cells = <2>;
> > +			firmware = <&firmware>;
> 
> Please add the gpio-line-names from Eric's patch [1].
> 
> Thanks
> Stefan
> 
> [1] - https://patchwork.kernel.org/patch/9339857/
> 

sorry i missed the fact that the same GPIO expander is on the CM3. So please move the exgpio node to bcm2837.dtsi and only define the gpio-line-names in this file.

Thanks
Stefan
Phil Elwell Jan. 3, 2018, 8:29 p.m. UTC | #3
Hi Stefan,

On 03/01/2018 20:17, Stefan Wahren wrote:
> Hi Baruch,
> 
>> Stefan Wahren <stefan.wahren@i2se.com> hat am 2. Januar 2018 um 20:03 geschrieben:
>>
>>
>> Hi Baruch,
>>
>>> Baruch Siach <baruch@tkos.co.il> hat am 2. Januar 2018 um 14:19 geschrieben:
>>
>>> +		expgpio: expgpio {
>>> +			compatible = "brcm,bcm2835-expgpio";
>>> +			gpio-controller;
>>> +			#gpio-cells = <2>;
>>> +			firmware = <&firmware>;
>>
>> Please add the gpio-line-names from Eric's patch [1].
>>
>> Thanks
>> Stefan
>>
>> [1] - https://patchwork.kernel.org/patch/9339857/
>>
> 
> sorry i missed the fact that the same GPIO expander is on the CM3. So please move the exgpio node to bcm2837.dtsi and only define the gpio-line-names in this file.

The GPIO expander is not a part of the BCM2837 SoC, and not all BCM2837-based Pis have a GPIO expander - see the Pi 2+.

Phil
Peter Robinson Jan. 4, 2018, 3:06 a.m. UTC | #4
>>> Stefan Wahren <stefan.wahren@i2se.com> hat am 2. Januar 2018 um 20:03
>>> geschrieben:
>>>
>>>
>>> Hi Baruch,
>>>
>>>> Baruch Siach <baruch@tkos.co.il> hat am 2. Januar 2018 um 14:19
>>>> geschrieben:
>>>
>>>
>>>> +               expgpio: expgpio {
>>>> +                       compatible = "brcm,bcm2835-expgpio";
>>>> +                       gpio-controller;
>>>> +                       #gpio-cells = <2>;
>>>> +                       firmware = <&firmware>;
>>>
>>>
>>> Please add the gpio-line-names from Eric's patch [1].
>>>
>>> Thanks
>>> Stefan
>>>
>>> [1] - https://patchwork.kernel.org/patch/9339857/
>>>
>>
>> sorry i missed the fact that the same GPIO expander is on the CM3. So
>> please move the exgpio node to bcm2837.dtsi and only define the
>> gpio-line-names in this file.
>
>
> The GPIO expander is not a part of the BCM2837 SoC, and not all
> BCM2837-based Pis have a GPIO expander - see the Pi 2+.

There's two ways that's generally handled upstream, either just
duplicate across the two .dts files or to put it in a separate .dtsi
and include it in the relevant .dts files, see arch/arm/boot/dts/axp*
as relevant examples.

Peter

Patch
diff mbox

diff --git a/arch/arm/boot/dts/bcm2837-rpi-3-b.dts b/arch/arm/boot/dts/bcm2837-rpi-3-b.dts
index b44b3b5af00d..09dca48da2bd 100644
--- a/arch/arm/boot/dts/bcm2837-rpi-3-b.dts
+++ b/arch/arm/boot/dts/bcm2837-rpi-3-b.dts
@@ -23,6 +23,16 @@ 
 			gpios = <&gpio 47 0>;
 		};
 	};
+
+	soc {
+		expgpio: expgpio {
+			compatible = "brcm,bcm2835-expgpio";
+			gpio-controller;
+			#gpio-cells = <2>;
+			firmware = <&firmware>;
+			status = "okay";
+		};
+	};
 };
 
 /* uart0 communicates with the BT module */