diff mbox series

[V2,8/9] arm64: dts: rockchip: add gpio-ranges property to gpio nodes

Message ID 20230213222742.135093-9-macroalpha82@gmail.com
State Accepted
Commit e92754e20cca37dcd62e195499ade25186d5f5e5
Delegated to: Kever Yang
Headers show
Series Rockchip: Improve Support for RK3566 Devices | expand

Commit Message

Chris Morgan Feb. 13, 2023, 10:27 p.m. UTC
From: Chris Morgan <macromorgan@hotmail.com>

Add gpio-ranges property to GPIO nodes so that the bank ID can
be correctly derived for each GPIO bank.

Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
---
 arch/arm/dts/rk356x.dtsi | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Kever Yang Feb. 22, 2023, 7:47 a.m. UTC | #1
On 2023/2/14 06:27, Chris Morgan wrote:
> From: Chris Morgan <macromorgan@hotmail.com>
>
> Add gpio-ranges property to GPIO nodes so that the bank ID can
> be correctly derived for each GPIO bank.
>
> Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>

Thanks,
- Kever
> ---
>   arch/arm/dts/rk356x.dtsi | 5 +++++
>   1 file changed, 5 insertions(+)
>
> diff --git a/arch/arm/dts/rk356x.dtsi b/arch/arm/dts/rk356x.dtsi
> index 5706c3e24f..6492ace0de 100644
> --- a/arch/arm/dts/rk356x.dtsi
> +++ b/arch/arm/dts/rk356x.dtsi
> @@ -1806,6 +1806,7 @@
>   			interrupts = <GIC_SPI 33 IRQ_TYPE_LEVEL_HIGH>;
>   			clocks = <&pmucru PCLK_GPIO0>, <&pmucru DBCLK_GPIO0>;
>   			gpio-controller;
> +			gpio-ranges = <&pinctrl 0 0 32>;
>   			#gpio-cells = <2>;
>   			interrupt-controller;
>   			#interrupt-cells = <2>;
> @@ -1817,6 +1818,7 @@
>   			interrupts = <GIC_SPI 34 IRQ_TYPE_LEVEL_HIGH>;
>   			clocks = <&cru PCLK_GPIO1>, <&cru DBCLK_GPIO1>;
>   			gpio-controller;
> +			gpio-ranges = <&pinctrl 0 32 32>;
>   			#gpio-cells = <2>;
>   			interrupt-controller;
>   			#interrupt-cells = <2>;
> @@ -1828,6 +1830,7 @@
>   			interrupts = <GIC_SPI 35 IRQ_TYPE_LEVEL_HIGH>;
>   			clocks = <&cru PCLK_GPIO2>, <&cru DBCLK_GPIO2>;
>   			gpio-controller;
> +			gpio-ranges = <&pinctrl 0 64 32>;
>   			#gpio-cells = <2>;
>   			interrupt-controller;
>   			#interrupt-cells = <2>;
> @@ -1839,6 +1842,7 @@
>   			interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>;
>   			clocks = <&cru PCLK_GPIO3>, <&cru DBCLK_GPIO3>;
>   			gpio-controller;
> +			gpio-ranges = <&pinctrl 0 96 32>;
>   			#gpio-cells = <2>;
>   			interrupt-controller;
>   			#interrupt-cells = <2>;
> @@ -1850,6 +1854,7 @@
>   			interrupts = <GIC_SPI 37 IRQ_TYPE_LEVEL_HIGH>;
>   			clocks = <&cru PCLK_GPIO4>, <&cru DBCLK_GPIO4>;
>   			gpio-controller;
> +			gpio-ranges = <&pinctrl 0 128 32>;
>   			#gpio-cells = <2>;
>   			interrupt-controller;
>   			#interrupt-cells = <2>;
Vasily Khoruzhick Feb. 23, 2023, 9:12 p.m. UTC | #2
On Mon, Feb 13, 2023 at 2:30 PM Chris Morgan <macroalpha82@gmail.com> wrote:
>
> From: Chris Morgan <macromorgan@hotmail.com>
>
> Add gpio-ranges property to GPIO nodes so that the bank ID can
> be correctly derived for each GPIO bank.

Should not it be merged into linux first? Otherwise it will be
overwritten during the next dts sync with linux.

> Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
> ---
>  arch/arm/dts/rk356x.dtsi | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/arch/arm/dts/rk356x.dtsi b/arch/arm/dts/rk356x.dtsi
> index 5706c3e24f..6492ace0de 100644
> --- a/arch/arm/dts/rk356x.dtsi
> +++ b/arch/arm/dts/rk356x.dtsi
> @@ -1806,6 +1806,7 @@
>                         interrupts = <GIC_SPI 33 IRQ_TYPE_LEVEL_HIGH>;
>                         clocks = <&pmucru PCLK_GPIO0>, <&pmucru DBCLK_GPIO0>;
>                         gpio-controller;
> +                       gpio-ranges = <&pinctrl 0 0 32>;
>                         #gpio-cells = <2>;
>                         interrupt-controller;
>                         #interrupt-cells = <2>;
> @@ -1817,6 +1818,7 @@
>                         interrupts = <GIC_SPI 34 IRQ_TYPE_LEVEL_HIGH>;
>                         clocks = <&cru PCLK_GPIO1>, <&cru DBCLK_GPIO1>;
>                         gpio-controller;
> +                       gpio-ranges = <&pinctrl 0 32 32>;
>                         #gpio-cells = <2>;
>                         interrupt-controller;
>                         #interrupt-cells = <2>;
> @@ -1828,6 +1830,7 @@
>                         interrupts = <GIC_SPI 35 IRQ_TYPE_LEVEL_HIGH>;
>                         clocks = <&cru PCLK_GPIO2>, <&cru DBCLK_GPIO2>;
>                         gpio-controller;
> +                       gpio-ranges = <&pinctrl 0 64 32>;
>                         #gpio-cells = <2>;
>                         interrupt-controller;
>                         #interrupt-cells = <2>;
> @@ -1839,6 +1842,7 @@
>                         interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>;
>                         clocks = <&cru PCLK_GPIO3>, <&cru DBCLK_GPIO3>;
>                         gpio-controller;
> +                       gpio-ranges = <&pinctrl 0 96 32>;
>                         #gpio-cells = <2>;
>                         interrupt-controller;
>                         #interrupt-cells = <2>;
> @@ -1850,6 +1854,7 @@
>                         interrupts = <GIC_SPI 37 IRQ_TYPE_LEVEL_HIGH>;
>                         clocks = <&cru PCLK_GPIO4>, <&cru DBCLK_GPIO4>;
>                         gpio-controller;
> +                       gpio-ranges = <&pinctrl 0 128 32>;
>                         #gpio-cells = <2>;
>                         interrupt-controller;
>                         #interrupt-cells = <2>;
> --
> 2.34.1
>
Quentin Schulz Feb. 28, 2023, 11:26 a.m. UTC | #3
Hi Vasily,

On 2/23/23 22:12, Vasily Khoruzhick wrote:
> On Mon, Feb 13, 2023 at 2:30 PM Chris Morgan <macroalpha82@gmail.com> wrote:
>>
>> From: Chris Morgan <macromorgan@hotmail.com>
>>
>> Add gpio-ranges property to GPIO nodes so that the bank ID can
>> be correctly derived for each GPIO bank.
> 
> Should not it be merged into linux first? Otherwise it will be
> overwritten during the next dts sync with linux.
> 

Considering that Linux maintainers have just rejected this 
implementation, yes we should wait on it being merged before supporting 
it in U-Boot :)

Cheers,
Quentin
Kever Yang March 2, 2023, 2:49 a.m. UTC | #4
Hi Quentin, Vasily,

On 2023/2/28 19:26, Quentin Schulz wrote:
> Hi Vasily,
>
> On 2/23/23 22:12, Vasily Khoruzhick wrote:
>> On Mon, Feb 13, 2023 at 2:30 PM Chris Morgan <macroalpha82@gmail.com> 
>> wrote:
>>>
>>> From: Chris Morgan <macromorgan@hotmail.com>
>>>
>>> Add gpio-ranges property to GPIO nodes so that the bank ID can
>>> be correctly derived for each GPIO bank.
>>
>> Should not it be merged into linux first? Otherwise it will be
>> overwritten during the next dts sync with linux.
>>
>
> Considering that Linux maintainers have just rejected this 
> implementation, yes we should wait on it being merged before 
> supporting it in U-Boot :)


There are still some drivers are different with kernel, eg. 
pinctrl&GPIO, and clock driver and etc, and kernel driver also changes.

Since the gpio bank support issue has been a period, I would like to 
take one version driver at least can fix it and make U-Boot work with 
new kernel dts

and new device. The U-Boot only use small set of the devices, so we want 
to have a small enough but enough for U-Boot version driver.

So I have take this patch set, and we can improve later when kernel have 
a version and we have a better solution for U-Boot.


Thanks,

- Kever

>
> Cheers,
> Quentin
Vasily Khoruzhick March 7, 2023, 7:14 p.m. UTC | #5
On Wed, Mar 1, 2023 at 6:49 PM Kever Yang <kever.yang@rock-chips.com> wrote:

Hi Kever,

> So I have take this patch set, and we can improve later when kernel have
> a version and we have a better solution for U-Boot.

My concern is that dts will be overwritten during the next dts sync
with the kernel. U-boot specific properties should be moved into an
appropriate -u-boot.dtsi file.

Regards,
Vasily
diff mbox series

Patch

diff --git a/arch/arm/dts/rk356x.dtsi b/arch/arm/dts/rk356x.dtsi
index 5706c3e24f..6492ace0de 100644
--- a/arch/arm/dts/rk356x.dtsi
+++ b/arch/arm/dts/rk356x.dtsi
@@ -1806,6 +1806,7 @@ 
 			interrupts = <GIC_SPI 33 IRQ_TYPE_LEVEL_HIGH>;
 			clocks = <&pmucru PCLK_GPIO0>, <&pmucru DBCLK_GPIO0>;
 			gpio-controller;
+			gpio-ranges = <&pinctrl 0 0 32>;
 			#gpio-cells = <2>;
 			interrupt-controller;
 			#interrupt-cells = <2>;
@@ -1817,6 +1818,7 @@ 
 			interrupts = <GIC_SPI 34 IRQ_TYPE_LEVEL_HIGH>;
 			clocks = <&cru PCLK_GPIO1>, <&cru DBCLK_GPIO1>;
 			gpio-controller;
+			gpio-ranges = <&pinctrl 0 32 32>;
 			#gpio-cells = <2>;
 			interrupt-controller;
 			#interrupt-cells = <2>;
@@ -1828,6 +1830,7 @@ 
 			interrupts = <GIC_SPI 35 IRQ_TYPE_LEVEL_HIGH>;
 			clocks = <&cru PCLK_GPIO2>, <&cru DBCLK_GPIO2>;
 			gpio-controller;
+			gpio-ranges = <&pinctrl 0 64 32>;
 			#gpio-cells = <2>;
 			interrupt-controller;
 			#interrupt-cells = <2>;
@@ -1839,6 +1842,7 @@ 
 			interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>;
 			clocks = <&cru PCLK_GPIO3>, <&cru DBCLK_GPIO3>;
 			gpio-controller;
+			gpio-ranges = <&pinctrl 0 96 32>;
 			#gpio-cells = <2>;
 			interrupt-controller;
 			#interrupt-cells = <2>;
@@ -1850,6 +1854,7 @@ 
 			interrupts = <GIC_SPI 37 IRQ_TYPE_LEVEL_HIGH>;
 			clocks = <&cru PCLK_GPIO4>, <&cru DBCLK_GPIO4>;
 			gpio-controller;
+			gpio-ranges = <&pinctrl 0 128 32>;
 			#gpio-cells = <2>;
 			interrupt-controller;
 			#interrupt-cells = <2>;