diff mbox series

[v3,2/7] arm64: dts: rockchip: add NanoPC-T6 LTS

Message ID 20240821-friendlyelec-nanopc-t6-lts-v3-2-3ecfa996bbe0@linaro.org (mailing list archive)
State Superseded, archived
Headers show
Series FriendlyELEC NanoPC-T6 improvements | expand

Commit Message

Marcin Juszkiewicz Aug. 21, 2024, 10:26 a.m. UTC
FriendlyELEC introduced a second version of NanoPC-T6 SBC.

The miniPCIe slot got removed and USB 2.0 configuration has changed.
There are two external accessible ports and two ports on the internal
header.

There is an on-board USB hub which provides:
- one external connector (bottom one)
- two internal ports on pin header
- one port for m.2 E connector

The top USB 2.0 connector comes directly from the SoC.

Signed-off-by: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
---
 arch/arm64/boot/dts/rockchip/Makefile              |  1 +
 .../boot/dts/rockchip/rk3588-nanopc-t6-lts.dts     | 61 ++++++++++++++++++++++
 2 files changed, 62 insertions(+)

Comments

Krzysztof Kozlowski Aug. 21, 2024, 1:13 p.m. UTC | #1
On 21/08/2024 12:26, Marcin Juszkiewicz wrote:
> FriendlyELEC introduced a second version of NanoPC-T6 SBC.
> 
> The miniPCIe slot got removed and USB 2.0 configuration has changed.
> There are two external accessible ports and two ports on the internal
> header.
> 
> There is an on-board USB hub which provides:
> - one external connector (bottom one)
> - two internal ports on pin header
> - one port for m.2 E connector
> 
> The top USB 2.0 connector comes directly from the SoC.
> 
> Signed-off-by: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
> ---
>  arch/arm64/boot/dts/rockchip/Makefile              |  1 +
>  .../boot/dts/rockchip/rk3588-nanopc-t6-lts.dts     | 61 ++++++++++++++++++++++
>  2 files changed, 62 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/rockchip/Makefile b/arch/arm64/boot/dts/rockchip/Makefile
> index fda1b980eb4b..0f982c741243 100644
> --- a/arch/arm64/boot/dts/rockchip/Makefile
> +++ b/arch/arm64/boot/dts/rockchip/Makefile
> @@ -128,6 +128,7 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-evb1-v10.dtb
>  dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-friendlyelec-cm3588-nas.dtb
>  dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-jaguar.dtb
>  dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-nanopc-t6.dtb
> +dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-nanopc-t6-lts.dtb
>  dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-ok3588-c.dtb
>  dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-orangepi-5-plus.dtb
>  dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-quartzpro64.dtb
> diff --git a/arch/arm64/boot/dts/rockchip/rk3588-nanopc-t6-lts.dts b/arch/arm64/boot/dts/rockchip/rk3588-nanopc-t6-lts.dts
> new file mode 100644
> index 000000000000..e950e40632cf
> --- /dev/null
> +++ b/arch/arm64/boot/dts/rockchip/rk3588-nanopc-t6-lts.dts
> @@ -0,0 +1,61 @@
> +// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
> +/*
> + * Copyright (c) 2021 Rockchip Electronics Co., Ltd.
> + * Copyright (c) 2023 Thomas McKahan
> + * Copyright (c) 2024 Linaro Ltd.
> + *
> + */
> +
> +/dts-v1/;
> +
> +#include "rk3588-nanopc-t6.dts"

Do not include DTS files. Please rename board to DTSI (which is for
includes) and then include it in respective boards. Remember to generate
patches with proper -M/-B/-C so the rename will be properly recognize.

Best regards,
Krzysztof
Dragan Simic Aug. 21, 2024, 2:39 p.m. UTC | #2
Hello Krzysztof,

On 2024-08-21 15:13, Krzysztof Kozlowski wrote:
> On 21/08/2024 12:26, Marcin Juszkiewicz wrote:
>> FriendlyELEC introduced a second version of NanoPC-T6 SBC.
>> 
>> The miniPCIe slot got removed and USB 2.0 configuration has changed.
>> There are two external accessible ports and two ports on the internal
>> header.
>> 
>> There is an on-board USB hub which provides:
>> - one external connector (bottom one)
>> - two internal ports on pin header
>> - one port for m.2 E connector
>> 
>> The top USB 2.0 connector comes directly from the SoC.
>> 
>> Signed-off-by: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
>> ---
>>  arch/arm64/boot/dts/rockchip/Makefile              |  1 +
>>  .../boot/dts/rockchip/rk3588-nanopc-t6-lts.dts     | 61 
>> ++++++++++++++++++++++
>>  2 files changed, 62 insertions(+)
>> 
>> diff --git a/arch/arm64/boot/dts/rockchip/Makefile 
>> b/arch/arm64/boot/dts/rockchip/Makefile
>> index fda1b980eb4b..0f982c741243 100644
>> --- a/arch/arm64/boot/dts/rockchip/Makefile
>> +++ b/arch/arm64/boot/dts/rockchip/Makefile
>> @@ -128,6 +128,7 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-evb1-v10.dtb
>>  dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-friendlyelec-cm3588-nas.dtb
>>  dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-jaguar.dtb
>>  dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-nanopc-t6.dtb
>> +dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-nanopc-t6-lts.dtb
>>  dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-ok3588-c.dtb
>>  dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-orangepi-5-plus.dtb
>>  dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-quartzpro64.dtb
>> diff --git a/arch/arm64/boot/dts/rockchip/rk3588-nanopc-t6-lts.dts 
>> b/arch/arm64/boot/dts/rockchip/rk3588-nanopc-t6-lts.dts
>> new file mode 100644
>> index 000000000000..e950e40632cf
>> --- /dev/null
>> +++ b/arch/arm64/boot/dts/rockchip/rk3588-nanopc-t6-lts.dts
>> @@ -0,0 +1,61 @@
>> +// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
>> +/*
>> + * Copyright (c) 2021 Rockchip Electronics Co., Ltd.
>> + * Copyright (c) 2023 Thomas McKahan
>> + * Copyright (c) 2024 Linaro Ltd.
>> + *
>> + */
>> +
>> +/dts-v1/;
>> +
>> +#include "rk3588-nanopc-t6.dts"
> 
> Do not include DTS files. Please rename board to DTSI (which is for
> includes) and then include it in respective boards. Remember to 
> generate
> patches with proper -M/-B/-C so the rename will be properly recognize.

This is perhaps a good opportunity to discuss this.  I already saw at
least half a dozen of instances where a board dts file is included in
another board dts file that modifies or extends it for another version
of the same board, or something like that.

Moreover, we'll most likely have to introduce quite a few new board dts
files, for board versions that use different type of DRAM and so far 
were
handled in U-Boot only. [1]

Thus, I think this is a good opportunity to conclude what to do there.
If you insist on converting already existing dts files into dtsi files,
we'll be introducing much more changes, which I'd be fine with, but I'd
then also like to convert _all_ existing cases of dts file inclusion 
into
proper inclusion of dtsi files, which will result in even more new files
being introduced, etc.

[1] 
https://lore.kernel.org/linux-rockchip/172408433165.1619643.7928785825448507704.robh@kernel.org/T/#m52de793f30579a8063f66eb2e64026776da55a66
Krzysztof Kozlowski Aug. 22, 2024, 6:31 a.m. UTC | #3
On 21/08/2024 16:39, Dragan Simic wrote:
> Hello Krzysztof,
> 
> On 2024-08-21 15:13, Krzysztof Kozlowski wrote:
>> On 21/08/2024 12:26, Marcin Juszkiewicz wrote:
>>> FriendlyELEC introduced a second version of NanoPC-T6 SBC.
>>>
>>> The miniPCIe slot got removed and USB 2.0 configuration has changed.
>>> There are two external accessible ports and two ports on the internal
>>> header.
>>>
>>> There is an on-board USB hub which provides:
>>> - one external connector (bottom one)
>>> - two internal ports on pin header
>>> - one port for m.2 E connector
>>>
>>> The top USB 2.0 connector comes directly from the SoC.
>>>
>>> Signed-off-by: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
>>> ---
>>>  arch/arm64/boot/dts/rockchip/Makefile              |  1 +
>>>  .../boot/dts/rockchip/rk3588-nanopc-t6-lts.dts     | 61 
>>> ++++++++++++++++++++++
>>>  2 files changed, 62 insertions(+)
>>>
>>> diff --git a/arch/arm64/boot/dts/rockchip/Makefile 
>>> b/arch/arm64/boot/dts/rockchip/Makefile
>>> index fda1b980eb4b..0f982c741243 100644
>>> --- a/arch/arm64/boot/dts/rockchip/Makefile
>>> +++ b/arch/arm64/boot/dts/rockchip/Makefile
>>> @@ -128,6 +128,7 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-evb1-v10.dtb
>>>  dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-friendlyelec-cm3588-nas.dtb
>>>  dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-jaguar.dtb
>>>  dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-nanopc-t6.dtb
>>> +dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-nanopc-t6-lts.dtb
>>>  dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-ok3588-c.dtb
>>>  dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-orangepi-5-plus.dtb
>>>  dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-quartzpro64.dtb
>>> diff --git a/arch/arm64/boot/dts/rockchip/rk3588-nanopc-t6-lts.dts 
>>> b/arch/arm64/boot/dts/rockchip/rk3588-nanopc-t6-lts.dts
>>> new file mode 100644
>>> index 000000000000..e950e40632cf
>>> --- /dev/null
>>> +++ b/arch/arm64/boot/dts/rockchip/rk3588-nanopc-t6-lts.dts
>>> @@ -0,0 +1,61 @@
>>> +// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
>>> +/*
>>> + * Copyright (c) 2021 Rockchip Electronics Co., Ltd.
>>> + * Copyright (c) 2023 Thomas McKahan
>>> + * Copyright (c) 2024 Linaro Ltd.
>>> + *
>>> + */
>>> +
>>> +/dts-v1/;
>>> +
>>> +#include "rk3588-nanopc-t6.dts"
>>
>> Do not include DTS files. Please rename board to DTSI (which is for
>> includes) and then include it in respective boards. Remember to 
>> generate
>> patches with proper -M/-B/-C so the rename will be properly recognize.
> 
> This is perhaps a good opportunity to discuss this.  I already saw at
> least half a dozen of instances where a board dts file is included in
> another board dts file that modifies or extends it for another version
> of the same board, or something like that.
> 
> Moreover, we'll most likely have to introduce quite a few new board dts
> files, for board versions that use different type of DRAM and so far 
> were
> handled in U-Boot only. [1]
> 
> Thus, I think this is a good opportunity to conclude what to do there.
> If you insist on converting already existing dts files into dtsi files,

I did not write anything about this.

> we'll be introducing much more changes, which I'd be fine with, but I'd
> then also like to convert _all_ existing cases of dts file inclusion 
> into

Don't understand. If I insist on converting already existing DTS, then
convert all existing DTS?

> proper inclusion of dtsi files, which will result in even more new files
> being introduced, etc.
> 
> [1] 
> https://lore.kernel.org/linux-rockchip/172408433165.1619643.7928785825448507704.robh@kernel.org/T/#m52de793f30579a8063f66eb2e64026776da55a66

Best regards,
Krzysztof
Dragan Simic Aug. 22, 2024, 7:41 a.m. UTC | #4
Hello Krzysztof,

On 2024-08-22 08:31, Krzysztof Kozlowski wrote:
> On 21/08/2024 16:39, Dragan Simic wrote:
>> On 2024-08-21 15:13, Krzysztof Kozlowski wrote:
>>> On 21/08/2024 12:26, Marcin Juszkiewicz wrote:
>>>> FriendlyELEC introduced a second version of NanoPC-T6 SBC.
>>>> 
>>>> The miniPCIe slot got removed and USB 2.0 configuration has changed.
>>>> There are two external accessible ports and two ports on the 
>>>> internal
>>>> header.
>>>> 
>>>> There is an on-board USB hub which provides:
>>>> - one external connector (bottom one)
>>>> - two internal ports on pin header
>>>> - one port for m.2 E connector
>>>> 
>>>> The top USB 2.0 connector comes directly from the SoC.
>>>> 
>>>> Signed-off-by: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
>>>> ---
>>>>  arch/arm64/boot/dts/rockchip/Makefile              |  1 +
>>>>  .../boot/dts/rockchip/rk3588-nanopc-t6-lts.dts     | 61
>>>> ++++++++++++++++++++++
>>>>  2 files changed, 62 insertions(+)
>>>> 
>>>> diff --git a/arch/arm64/boot/dts/rockchip/Makefile
>>>> b/arch/arm64/boot/dts/rockchip/Makefile
>>>> index fda1b980eb4b..0f982c741243 100644
>>>> --- a/arch/arm64/boot/dts/rockchip/Makefile
>>>> +++ b/arch/arm64/boot/dts/rockchip/Makefile
>>>> @@ -128,6 +128,7 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += 
>>>> rk3588-evb1-v10.dtb
>>>>  dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-friendlyelec-cm3588-nas.dtb
>>>>  dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-jaguar.dtb
>>>>  dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-nanopc-t6.dtb
>>>> +dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-nanopc-t6-lts.dtb
>>>>  dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-ok3588-c.dtb
>>>>  dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-orangepi-5-plus.dtb
>>>>  dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-quartzpro64.dtb
>>>> diff --git a/arch/arm64/boot/dts/rockchip/rk3588-nanopc-t6-lts.dts
>>>> b/arch/arm64/boot/dts/rockchip/rk3588-nanopc-t6-lts.dts
>>>> new file mode 100644
>>>> index 000000000000..e950e40632cf
>>>> --- /dev/null
>>>> +++ b/arch/arm64/boot/dts/rockchip/rk3588-nanopc-t6-lts.dts
>>>> @@ -0,0 +1,61 @@
>>>> +// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
>>>> +/*
>>>> + * Copyright (c) 2021 Rockchip Electronics Co., Ltd.
>>>> + * Copyright (c) 2023 Thomas McKahan
>>>> + * Copyright (c) 2024 Linaro Ltd.
>>>> + *
>>>> + */
>>>> +
>>>> +/dts-v1/;
>>>> +
>>>> +#include "rk3588-nanopc-t6.dts"
>>> 
>>> Do not include DTS files. Please rename board to DTSI (which is for
>>> includes) and then include it in respective boards. Remember to
>>> generate
>>> patches with proper -M/-B/-C so the rename will be properly 
>>> recognize.
>> 
>> This is perhaps a good opportunity to discuss this.  I already saw at
>> least half a dozen of instances where a board dts file is included in
>> another board dts file that modifies or extends it for another version
>> of the same board, or something like that.
>> 
>> Moreover, we'll most likely have to introduce quite a few new board 
>> dts
>> files, for board versions that use different type of DRAM and so far
>> were
>> handled in U-Boot only. [1]
>> 
>> Thus, I think this is a good opportunity to conclude what to do there.
>> If you insist on converting already existing dts files into dtsi 
>> files,
> 
> I did not write anything about this.

True, but I thought it was a good opportunity to discuss that in 
advance,
because it's going to be pretty much the same thing as what we're having
currently with the NanoPC-T6 LTS as a board variant.

>> we'll be introducing much more changes, which I'd be fine with, but 
>> I'd
>> then also like to convert _all_ existing cases of dts file inclusion
>> into
> 
> Don't understand. If I insist on converting already existing DTS, then
> convert all existing DTS?

Let me clarify, please.  With the NanoPC-T6 LTS, you asked for the 
current
NanoPC-T6 board dts file to be converted into a dtsi, from which the two
board variant dts files (the original and the LTS) will descend from.

Then I noticed that we already have board dts files that descend from 
other
board dts files (so, not from dtsi files as they should). [2][3][4]  
Based
on that, I asked do you insist on converting the current NanoPC-T6 dts 
into
a dtsi, because if you do, then we should fix other instances of the dts
inclusion as well.  Which I'm willing to do, by the way.

I hope it all makes more sense now.

[2] 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2c-plus.dts?h=v6.11-rc4#n10
[3] 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2c.dts?h=v6.11-rc4#n10
[4] 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm64/boot/dts/rockchip/rk3588s-nanopi-r6c.dts?h=v6.11-rc4#n5

>> proper inclusion of dtsi files, which will result in even more new 
>> files
>> being introduced, etc.
>> 
>> [1]
>> https://lore.kernel.org/linux-rockchip/172408433165.1619643.7928785825448507704.robh@kernel.org/T/#m52de793f30579a8063f66eb2e64026776da55a66
Marcin Juszkiewicz Aug. 22, 2024, 7:55 a.m. UTC | #5
On 21.08.2024 15:13, Krzysztof Kozlowski wrote:
>> +#include "rk3588-nanopc-t6.dts"
> Do not include DTS files. Please rename board to DTSI (which is for
> includes) and then include it in respective boards. Remember to generate
> patches with proper -M/-B/-C so the rename will be properly recognize.

Thanks, done that locally for v4 series (will wait with sending to 
gather feedback on v3 one first).

This way NanoPC-T6 has 4g_lte_pwren and NanoPC-T6 LTS has 
usb_host20_pwren defined separately in their own dts files.
diff mbox series

Patch

diff --git a/arch/arm64/boot/dts/rockchip/Makefile b/arch/arm64/boot/dts/rockchip/Makefile
index fda1b980eb4b..0f982c741243 100644
--- a/arch/arm64/boot/dts/rockchip/Makefile
+++ b/arch/arm64/boot/dts/rockchip/Makefile
@@ -128,6 +128,7 @@  dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-evb1-v10.dtb
 dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-friendlyelec-cm3588-nas.dtb
 dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-jaguar.dtb
 dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-nanopc-t6.dtb
+dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-nanopc-t6-lts.dtb
 dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-ok3588-c.dtb
 dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-orangepi-5-plus.dtb
 dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-quartzpro64.dtb
diff --git a/arch/arm64/boot/dts/rockchip/rk3588-nanopc-t6-lts.dts b/arch/arm64/boot/dts/rockchip/rk3588-nanopc-t6-lts.dts
new file mode 100644
index 000000000000..e950e40632cf
--- /dev/null
+++ b/arch/arm64/boot/dts/rockchip/rk3588-nanopc-t6-lts.dts
@@ -0,0 +1,61 @@ 
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (c) 2021 Rockchip Electronics Co., Ltd.
+ * Copyright (c) 2023 Thomas McKahan
+ * Copyright (c) 2024 Linaro Ltd.
+ *
+ */
+
+/dts-v1/;
+
+#include "rk3588-nanopc-t6.dts"
+
+/ {
+	model = "FriendlyElec NanoPC-T6 LTS";
+	compatible = "friendlyarm,nanopc-t6-lts", "rockchip,rk3588";
+
+	/* provide power for on-board USB 2.0 hub */
+	vcc5v0_usb20_host: vcc5v0-usb20-host-regulator {
+		compatible = "regulator-fixed";
+		enable-active-high;
+		gpio = <&gpio1 RK_PA4 GPIO_ACTIVE_HIGH>;
+		pinctrl-0 = <&usb20_host_pwren>;
+		pinctrl-names = "default";
+		regulator-always-on;
+		regulator-boot-on;
+		regulator-max-microvolt = <5000000>;
+		regulator-min-microvolt = <5000000>;
+		regulator-name = "vcc5v0_usb20_host";
+		vin-supply = <&vcc5v0_sys>;
+	};
+};
+
+&pinctrl {
+	usb {
+		usb20_host_pwren: usb20-host-pwren {
+			rockchip,pins = <1 RK_PA4 RK_FUNC_GPIO &pcfg_pull_none>;
+		};
+	};
+};
+
+&u2phy1 {
+	status = "okay";
+};
+
+&u2phy1_otg {
+	status = "okay";
+};
+
+&u2phy2_host {
+	phy-supply = <&vcc5v0_usb20_host>;
+	status = "okay";
+};
+
+&usbdp_phy1 {
+	status = "okay";
+};
+
+&usb_host1_xhci {
+	dr_mode = "host";
+	status = "okay";
+};