linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] arm64: dts: rockchip: add SPI controller aliases to RK3399
@ 2024-01-09 13:35 Quentin Schulz
  2024-01-09 13:35 ` [PATCH 1/2] arm64: dts: rockchip: add spi controller aliases on rk3399 Quentin Schulz
  2024-01-09 13:35 ` [PATCH 2/2] arm64: dts: rockchip: remove duplicate SPI aliases for helios64 Quentin Schulz
  0 siblings, 2 replies; 11+ messages in thread
From: Quentin Schulz @ 2024-01-09 13:35 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Heiko Stuebner
  Cc: Quentin Schulz, devicetree, linux-arm-kernel, linux-rockchip,
	linux-kernel, Quentin Schulz

There are 6 SPI controllers on RK3399 and they are all numbered in the
TRM, so let's add the appropriate aliases to the main DTSI so that any
RK3399-based board doesn't need to define the aliases themselves to
benefit from stable SPI indices in userspace.

Helios64 is the only RK3399-based device that defined aliases for SPI
controllers, but since they are now in RK3399 main DTSI, let's remove
the duplication.

Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
---
Quentin Schulz (2):
      arm64: dts: rockchip: add spi controller aliases on rk3399
      arm64: dts: rockchip: remove duplicate SPI aliases for helios64

 arch/arm64/boot/dts/rockchip/rk3399-kobol-helios64.dts | 3 ---
 arch/arm64/boot/dts/rockchip/rk3399.dtsi               | 6 ++++++
 2 files changed, 6 insertions(+), 3 deletions(-)
---
base-commit: 9f8413c4a66f2fb776d3dc3c9ed20bf435eb305e
change-id: 20240109-rk3399-spi-aliases-a2ce468a04a3

Best regards,
-- 
Quentin Schulz <quentin.schulz@theobroma-systems.com>


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

* [PATCH 1/2] arm64: dts: rockchip: add spi controller aliases on rk3399
  2024-01-09 13:35 [PATCH 0/2] arm64: dts: rockchip: add SPI controller aliases to RK3399 Quentin Schulz
@ 2024-01-09 13:35 ` Quentin Schulz
  2024-01-09 15:15   ` Krzysztof Kozlowski
  2024-01-09 13:35 ` [PATCH 2/2] arm64: dts: rockchip: remove duplicate SPI aliases for helios64 Quentin Schulz
  1 sibling, 1 reply; 11+ messages in thread
From: Quentin Schulz @ 2024-01-09 13:35 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Heiko Stuebner
  Cc: Quentin Schulz, devicetree, linux-arm-kernel, linux-rockchip,
	linux-kernel, Quentin Schulz

From: Quentin Schulz <quentin.schulz@theobroma-systems.com>

There are 6 SPI controllers on RK3399 and they are all numbered in the
TRM, so let's add the appropriate aliases to the main DTSI so that any
RK3399-based board doesn't need to define the aliases themselves to
benefit from stable SPI indices in userspace.

Cc: Quentin Schulz <foss+kernel@0leil.net>
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
---
 arch/arm64/boot/dts/rockchip/rk3399.dtsi | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arch/arm64/boot/dts/rockchip/rk3399.dtsi b/arch/arm64/boot/dts/rockchip/rk3399.dtsi
index da0dfb237f853..7b04ba526fd59 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3399.dtsi
@@ -34,6 +34,12 @@ aliases {
 		serial2 = &uart2;
 		serial3 = &uart3;
 		serial4 = &uart4;
+		spi0 = &spi0;
+		spi1 = &spi1;
+		spi2 = &spi2;
+		spi3 = &spi3;
+		spi4 = &spi4;
+		spi5 = &spi5;
 	};
 
 	cpus {

-- 
2.43.0


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

* [PATCH 2/2] arm64: dts: rockchip: remove duplicate SPI aliases for helios64
  2024-01-09 13:35 [PATCH 0/2] arm64: dts: rockchip: add SPI controller aliases to RK3399 Quentin Schulz
  2024-01-09 13:35 ` [PATCH 1/2] arm64: dts: rockchip: add spi controller aliases on rk3399 Quentin Schulz
@ 2024-01-09 13:35 ` Quentin Schulz
  2024-01-09 15:16   ` Krzysztof Kozlowski
  1 sibling, 1 reply; 11+ messages in thread
From: Quentin Schulz @ 2024-01-09 13:35 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Heiko Stuebner
  Cc: Quentin Schulz, devicetree, linux-arm-kernel, linux-rockchip,
	linux-kernel, Quentin Schulz

From: Quentin Schulz <quentin.schulz@theobroma-systems.com>

An earlier commit defined an alias for all SPI controllers found on the
RK3399, so there's no need to duplicate the aliases in helios64's device
tree.

Cc: Quentin Schulz <foss+kernel@0leil.net>
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
---
 arch/arm64/boot/dts/rockchip/rk3399-kobol-helios64.dts | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/arch/arm64/boot/dts/rockchip/rk3399-kobol-helios64.dts b/arch/arm64/boot/dts/rockchip/rk3399-kobol-helios64.dts
index 1eb287a3f8c03..d664ac18a941e 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-kobol-helios64.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3399-kobol-helios64.dts
@@ -21,9 +21,6 @@ / {
 	aliases {
 		mmc0 = &sdmmc;
 		mmc1 = &sdhci;
-		spi1 = &spi1;
-		spi2 = &spi2;
-		spi5 = &spi5;
 	};
 
 	avdd_0v9_s0: avdd-0v9-s0 {

-- 
2.43.0


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

* Re: [PATCH 1/2] arm64: dts: rockchip: add spi controller aliases on rk3399
  2024-01-09 13:35 ` [PATCH 1/2] arm64: dts: rockchip: add spi controller aliases on rk3399 Quentin Schulz
@ 2024-01-09 15:15   ` Krzysztof Kozlowski
  2024-01-09 15:22     ` Heiko Stübner
  0 siblings, 1 reply; 11+ messages in thread
From: Krzysztof Kozlowski @ 2024-01-09 15:15 UTC (permalink / raw)
  To: Quentin Schulz, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Heiko Stuebner
  Cc: devicetree, linux-arm-kernel, linux-rockchip, linux-kernel,
	Quentin Schulz

On 09/01/2024 14:35, Quentin Schulz wrote:
> From: Quentin Schulz <quentin.schulz@theobroma-systems.com>
> 
> There are 6 SPI controllers on RK3399 and they are all numbered in the
> TRM, so let's add the appropriate aliases to the main DTSI so that any
> RK3399-based board doesn't need to define the aliases themselves to
> benefit from stable SPI indices in userspace.

But that contradicts the point that board should define aliases for
exposable interfaces. Sorry, that's a NAK.

> 
> Cc: Quentin Schulz <foss+kernel@0leil.net>

No need to Cc yourself...

> Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
> ---

Best regards,
Krzysztof


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

* Re: [PATCH 2/2] arm64: dts: rockchip: remove duplicate SPI aliases for helios64
  2024-01-09 13:35 ` [PATCH 2/2] arm64: dts: rockchip: remove duplicate SPI aliases for helios64 Quentin Schulz
@ 2024-01-09 15:16   ` Krzysztof Kozlowski
  2024-01-09 15:23     ` Heiko Stübner
  0 siblings, 1 reply; 11+ messages in thread
From: Krzysztof Kozlowski @ 2024-01-09 15:16 UTC (permalink / raw)
  To: Quentin Schulz, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Heiko Stuebner
  Cc: devicetree, linux-arm-kernel, linux-rockchip, linux-kernel,
	Quentin Schulz

On 09/01/2024 14:35, Quentin Schulz wrote:
> From: Quentin Schulz <quentin.schulz@theobroma-systems.com>
> 
> An earlier commit defined an alias for all SPI controllers found on the
> RK3399, so there's no need to duplicate the aliases in helios64's device
> tree.

That's not what we want. Boards should define aliases for what is
available, according to the board labeling.

Best regards,
Krzysztof


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

* Re: [PATCH 1/2] arm64: dts: rockchip: add spi controller aliases on rk3399
  2024-01-09 15:15   ` Krzysztof Kozlowski
@ 2024-01-09 15:22     ` Heiko Stübner
  2024-01-09 16:14       ` Dragan Simic
  2024-01-09 19:13       ` Krzysztof Kozlowski
  0 siblings, 2 replies; 11+ messages in thread
From: Heiko Stübner @ 2024-01-09 15:22 UTC (permalink / raw)
  To: Quentin Schulz, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Krzysztof Kozlowski
  Cc: devicetree, linux-arm-kernel, linux-rockchip, linux-kernel,
	Quentin Schulz

Hi Krzysztof,

Am Dienstag, 9. Januar 2024, 16:15:30 CET schrieb Krzysztof Kozlowski:
> On 09/01/2024 14:35, Quentin Schulz wrote:
> > From: Quentin Schulz <quentin.schulz@theobroma-systems.com>
> > 
> > There are 6 SPI controllers on RK3399 and they are all numbered in the
> > TRM, so let's add the appropriate aliases to the main DTSI so that any
> > RK3399-based board doesn't need to define the aliases themselves to
> > benefit from stable SPI indices in userspace.
> 
> But that contradicts the point that board should define aliases for
> exposable interfaces. Sorry, that's a NAK.

didn't we have this same discussion some weeks ago? ;-) .

I.e. spi2 on Rockchip socs is called spi2 in _all_ SoC documentation,
lines in _all_ schematics are also always called spi2_foo , so as before
I really don't see any value in repeating the very same aliases in
_every_ board.

Same for i2c, uart .


It is of course different for non-numerable interfaces - like the mmcX
aliases - where the controller is named sdhci, sdmmc, sdio ... and
similar cases. These get to stay in the board dts files of course.


Heiko

> > Cc: Quentin Schulz <foss+kernel@0leil.net>
> 
> No need to Cc yourself...
> 
> > Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
> > ---
> 
> Best regards,
> Krzysztof
> 
> 





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

* Re: [PATCH 2/2] arm64: dts: rockchip: remove duplicate SPI aliases for helios64
  2024-01-09 15:16   ` Krzysztof Kozlowski
@ 2024-01-09 15:23     ` Heiko Stübner
  2024-01-09 19:14       ` Krzysztof Kozlowski
  0 siblings, 1 reply; 11+ messages in thread
From: Heiko Stübner @ 2024-01-09 15:23 UTC (permalink / raw)
  To: Quentin Schulz, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Krzysztof Kozlowski
  Cc: devicetree, linux-arm-kernel, linux-rockchip, linux-kernel,
	Quentin Schulz

Am Dienstag, 9. Januar 2024, 16:16:15 CET schrieb Krzysztof Kozlowski:
> On 09/01/2024 14:35, Quentin Schulz wrote:
> > From: Quentin Schulz <quentin.schulz@theobroma-systems.com>
> > 
> > An earlier commit defined an alias for all SPI controllers found on the
> > RK3399, so there's no need to duplicate the aliases in helios64's device
> > tree.
> 
> That's not what we want. Boards should define aliases for what is
> available, according to the board labeling.

and the board labeling for spi2 has always been spi2-miso, spi2-miso etc.
In the last 10 years of doing Rockchip stuff, I haven't seen any schematic
doing it differently.



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

* Re: [PATCH 1/2] arm64: dts: rockchip: add spi controller aliases on rk3399
  2024-01-09 15:22     ` Heiko Stübner
@ 2024-01-09 16:14       ` Dragan Simic
  2024-01-09 19:13       ` Krzysztof Kozlowski
  1 sibling, 0 replies; 11+ messages in thread
From: Dragan Simic @ 2024-01-09 16:14 UTC (permalink / raw)
  To: Heiko Stübner
  Cc: Quentin Schulz, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Krzysztof Kozlowski, devicetree, linux-arm-kernel,
	linux-rockchip, linux-kernel, Quentin Schulz

On 2024-01-09 16:22, Heiko Stübner wrote:
> Am Dienstag, 9. Januar 2024, 16:15:30 CET schrieb Krzysztof Kozlowski:
>> On 09/01/2024 14:35, Quentin Schulz wrote:
>> > From: Quentin Schulz <quentin.schulz@theobroma-systems.com>
>> >
>> > There are 6 SPI controllers on RK3399 and they are all numbered in the
>> > TRM, so let's add the appropriate aliases to the main DTSI so that any
>> > RK3399-based board doesn't need to define the aliases themselves to
>> > benefit from stable SPI indices in userspace.
>> 
>> But that contradicts the point that board should define aliases for
>> exposable interfaces. Sorry, that's a NAK.
> 
> didn't we have this same discussion some weeks ago? ;-) .
> 
> I.e. spi2 on Rockchip socs is called spi2 in _all_ SoC documentation,
> lines in _all_ schematics are also always called spi2_foo , so as 
> before
> I really don't see any value in repeating the very same aliases in
> _every_ board.
> 
> Same for i2c, uart .

Yes, and the RK356x SoC dtsi already defines the spiX aliases in the 
same way as Quentin proposed.  Taking that as an additional example, the 
RK3399 dtsi can do the same.

> It is of course different for non-numerable interfaces - like the mmcX
> aliases - where the controller is named sdhci, sdmmc, sdio ... and
> similar cases. These get to stay in the board dts files of course.
> 
> 
> Heiko
> 
>> > Cc: Quentin Schulz <foss+kernel@0leil.net>
>> 
>> No need to Cc yourself...
>> 
>> > Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
>> > ---
>> 
>> Best regards,
>> Krzysztof
>> 
>> 
> 
> 
> 
> 
> 
> _______________________________________________
> Linux-rockchip mailing list
> Linux-rockchip@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-rockchip

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

* Re: [PATCH 1/2] arm64: dts: rockchip: add spi controller aliases on rk3399
  2024-01-09 15:22     ` Heiko Stübner
  2024-01-09 16:14       ` Dragan Simic
@ 2024-01-09 19:13       ` Krzysztof Kozlowski
  1 sibling, 0 replies; 11+ messages in thread
From: Krzysztof Kozlowski @ 2024-01-09 19:13 UTC (permalink / raw)
  To: Heiko Stübner, Quentin Schulz, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley
  Cc: devicetree, linux-arm-kernel, linux-rockchip, linux-kernel,
	Quentin Schulz

On 09/01/2024 16:22, Heiko Stübner wrote:
> Hi Krzysztof,
> 
> Am Dienstag, 9. Januar 2024, 16:15:30 CET schrieb Krzysztof Kozlowski:
>> On 09/01/2024 14:35, Quentin Schulz wrote:
>>> From: Quentin Schulz <quentin.schulz@theobroma-systems.com>
>>>
>>> There are 6 SPI controllers on RK3399 and they are all numbered in the
>>> TRM, so let's add the appropriate aliases to the main DTSI so that any
>>> RK3399-based board doesn't need to define the aliases themselves to
>>> benefit from stable SPI indices in userspace.
>>
>> But that contradicts the point that board should define aliases for
>> exposable interfaces. Sorry, that's a NAK.
> 
> didn't we have this same discussion some weeks ago? ;-) .

We could have and my feedback might be repeated every time someone does
something against common policy or common sense without explaining it.

> 
> I.e. spi2 on Rockchip socs is called spi2 in _all_ SoC documentation,

This does not matter.

> lines in _all_ schematics are also always called spi2_foo , so as before

If you mean board schematics, then this matters.


> I really don't see any value in repeating the very same aliases in
> _every_ board.
> 
> Same for i2c, uart .
> 

The same as in all previous discussions: the board labels them and these
should match the board labeling.

https://lore.kernel.org/linux-rockchip/CAK8P3a25iYksubCnQb1-e5yj=crEsK37RB9Hn4ZGZMwcVVrG7g@mail.gmail.com/

https://lore.kernel.org/all/27455049.omNFrla0xU@wuerfel/

These are replies from your upstream maintainer, if you disagree with me.

Best regards,
Krzysztof


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

* Re: [PATCH 2/2] arm64: dts: rockchip: remove duplicate SPI aliases for helios64
  2024-01-09 15:23     ` Heiko Stübner
@ 2024-01-09 19:14       ` Krzysztof Kozlowski
  2024-01-10 11:18         ` Heiko Stübner
  0 siblings, 1 reply; 11+ messages in thread
From: Krzysztof Kozlowski @ 2024-01-09 19:14 UTC (permalink / raw)
  To: Heiko Stübner, Quentin Schulz, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley
  Cc: devicetree, linux-arm-kernel, linux-rockchip, linux-kernel,
	Quentin Schulz

On 09/01/2024 16:23, Heiko Stübner wrote:
> Am Dienstag, 9. Januar 2024, 16:16:15 CET schrieb Krzysztof Kozlowski:
>> On 09/01/2024 14:35, Quentin Schulz wrote:
>>> From: Quentin Schulz <quentin.schulz@theobroma-systems.com>
>>>
>>> An earlier commit defined an alias for all SPI controllers found on the
>>> RK3399, so there's no need to duplicate the aliases in helios64's device
>>> tree.
>>
>> That's not what we want. Boards should define aliases for what is
>> available, according to the board labeling.
> 
> and the board labeling for spi2 has always been spi2-miso, spi2-miso etc.
> In the last 10 years of doing Rockchip stuff, I haven't seen any schematic
> doing it differently.

OK, this could be a case... but then you add aliases for things which
are not labeled on the board.

Let's bring Arnd again:
https://lore.kernel.org/linux-rockchip/CAK8P3a0ALgbhTVJ7t3XRXALs9vBM=XBvkGhNKXxB+QTepo-3AQ@mail.gmail.com/

Best regards,
Krzysztof


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

* Re: [PATCH 2/2] arm64: dts: rockchip: remove duplicate SPI aliases for helios64
  2024-01-09 19:14       ` Krzysztof Kozlowski
@ 2024-01-10 11:18         ` Heiko Stübner
  0 siblings, 0 replies; 11+ messages in thread
From: Heiko Stübner @ 2024-01-10 11:18 UTC (permalink / raw)
  To: Quentin Schulz, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Krzysztof Kozlowski
  Cc: devicetree, linux-arm-kernel, linux-rockchip, linux-kernel,
	Quentin Schulz

Hi Krzysztof,

[I'll limit myself to this thread, as we're essentially discussing the same in both]

Am Dienstag, 9. Januar 2024, 20:14:38 CET schrieb Krzysztof Kozlowski:
> On 09/01/2024 16:23, Heiko Stübner wrote:
> > Am Dienstag, 9. Januar 2024, 16:16:15 CET schrieb Krzysztof Kozlowski:
> >> On 09/01/2024 14:35, Quentin Schulz wrote:
> >>> From: Quentin Schulz <quentin.schulz@theobroma-systems.com>
> >>>
> >>> An earlier commit defined an alias for all SPI controllers found on the
> >>> RK3399, so there's no need to duplicate the aliases in helios64's device
> >>> tree.
> >>
> >> That's not what we want. Boards should define aliases for what is
> >> available, according to the board labeling.
> > 
> > and the board labeling for spi2 has always been spi2-miso, spi2-miso etc.
> > In the last 10 years of doing Rockchip stuff, I haven't seen any schematic
> > doing it differently.
> 
> OK, this could be a case... but then you add aliases for things which
> are not labeled on the board.

On the other hand, we did this dance last year for some other SoCs.
And having to repeat the same list of never-changing aliases for every
board was a sore spot for a lot of people it seemed.
Most boards follow the reference schematics quite closely afterall.

Like very shortly after the last discussion I got patches moving the
aliases to their then agreed upon position. (numeric busses in the
soc dtsi, everything else in board dts).

And back in november we ended with [0] - Krzysztof saying that
"it is just generic guideline, so up to Heiko what to do with it" ;-) .


I also made sure to send the changes upwards way before christmas
to give soc maintainers time to complain if needed and especially did
point out that change in my pull request text [1] ;-) .


Heiko

> Let's bring Arnd again:
> https://lore.kernel.org/linux-rockchip/CAK8P3a0ALgbhTVJ7t3XRXALs9vBM=XBvkGhNKXxB+QTepo-3AQ@mail.gmail.com/


[0] https://lore.kernel.org/linux-rockchip/7b8a830d-42d0-4220-b9fe-3f5fff43e74d@linaro.org/
[1] https://patchwork.kernel.org/project/linux-soc/patch/3535836.iIbC2pHGDl@phil/



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

end of thread, other threads:[~2024-01-10 11:18 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-09 13:35 [PATCH 0/2] arm64: dts: rockchip: add SPI controller aliases to RK3399 Quentin Schulz
2024-01-09 13:35 ` [PATCH 1/2] arm64: dts: rockchip: add spi controller aliases on rk3399 Quentin Schulz
2024-01-09 15:15   ` Krzysztof Kozlowski
2024-01-09 15:22     ` Heiko Stübner
2024-01-09 16:14       ` Dragan Simic
2024-01-09 19:13       ` Krzysztof Kozlowski
2024-01-09 13:35 ` [PATCH 2/2] arm64: dts: rockchip: remove duplicate SPI aliases for helios64 Quentin Schulz
2024-01-09 15:16   ` Krzysztof Kozlowski
2024-01-09 15:23     ` Heiko Stübner
2024-01-09 19:14       ` Krzysztof Kozlowski
2024-01-10 11:18         ` Heiko Stübner

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).