2021-07-01 00:42:16

by Dennis Gilmore

[permalink] [raw]
Subject: [PATCH 1/4] arm64: dts: rockchip: helios64: fixup USB setup

Without the usbdrd_dwc3_1 node defined u-boot will throw an error and
reset the system. All other rk3399 systems use this format

Signed-off-by: Dennis Gilmore <[email protected]>
---
arch/arm64/boot/dts/rockchip/rk3399-kobol-helios64.dts | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm64/boot/dts/rockchip/rk3399-kobol-helios64.dts b/arch/arm64/boot/dts/rockchip/rk3399-kobol-helios64.dts
index 738cfd21df3e..aeedf098f67c 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-kobol-helios64.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3399-kobol-helios64.dts
@@ -490,9 +490,9 @@ &uart2 {

&usbdrd3_1 {
status = "okay";
+};

- usb@fe900000 {
- dr_mode = "host";
- status = "okay";
- };
+&usbdrd_dwc3_1 {
+ dr_mode = "host";
+ status = "okay";
};
--
2.31.1


2021-07-01 00:42:26

by Dennis Gilmore

[permalink] [raw]
Subject: [PATCH 2/4] arm64: dts: rockchip: helios64: set stdout-path

set the default output path to uart2

Signed-off-by: Dennis Gilmore <[email protected]>
---
arch/arm64/boot/dts/rockchip/rk3399-kobol-helios64.dts | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/arch/arm64/boot/dts/rockchip/rk3399-kobol-helios64.dts b/arch/arm64/boot/dts/rockchip/rk3399-kobol-helios64.dts
index aeedf098f67c..bdcf6472664c 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-kobol-helios64.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3399-kobol-helios64.dts
@@ -43,6 +43,10 @@ avdd_1v8_s0: avdd-1v8-s0 {
vin-supply = <&vcc3v3_sys_s3>;
};

+ chosen {
+ stdout-path = "serial2:1500000n8";
+ };
+
clkin_gmac: external-gmac-clock {
compatible = "fixed-clock";
clock-frequency = <125000000>;
--
2.31.1

2021-07-01 00:44:23

by Dennis Gilmore

[permalink] [raw]
Subject: [PATCH 4/4] arm64: dts: rockchip: helios64: enable tsadc on helios64

Enable the tsadc thermal controller on the helios64

Signed-off-by: Dennis Gilmore <[email protected]>
---
arch/arm64/boot/dts/rockchip/rk3399-kobol-helios64.dts | 8 ++++++++
1 file changed, 8 insertions(+)

diff --git a/arch/arm64/boot/dts/rockchip/rk3399-kobol-helios64.dts b/arch/arm64/boot/dts/rockchip/rk3399-kobol-helios64.dts
index 09c5a6fa11ff..b44e54571c31 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-kobol-helios64.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3399-kobol-helios64.dts
@@ -502,6 +502,14 @@ &tcphy1 {
status = "okay";
};

+&tsadc {
+ /* tshut mode 0:CRU 1:GPIO */
+ rockchip,hw-tshut-mode = <1>;
+ /* tshut polarity 0:LOW 1:HIGH */
+ rockchip,hw-tshut-polarity = <1>;
+ status = "okay";
+};
+
&u2phy1 {
status = "okay";

--
2.31.1

2021-07-01 00:44:54

by Dennis Gilmore

[permalink] [raw]
Subject: [PATCH 3/4] arm64: dts: rockchip: helios64: add SPI support

add SPI support for the helios64, u-boot can live in spi1, spi2 is user
accessible, spi5 is for the sata controller rom.
https://wiki.kobol.io/helios64/spi/

Signed-off-by: Dennis Gilmore <[email protected]>
---
.../dts/rockchip/rk3399-kobol-helios64.dts | 24 +++++++++++++++++++
1 file changed, 24 insertions(+)

diff --git a/arch/arm64/boot/dts/rockchip/rk3399-kobol-helios64.dts b/arch/arm64/boot/dts/rockchip/rk3399-kobol-helios64.dts
index bdcf6472664c..09c5a6fa11ff 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-kobol-helios64.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3399-kobol-helios64.dts
@@ -21,6 +21,9 @@ / {
aliases {
mmc0 = &sdmmc;
mmc1 = &sdhci;
+ spi1 = &spi1;
+ spi2 = &spi2;
+ spi5 = &spi5;
};

avdd_0v9_s0: avdd-0v9-s0 {
@@ -473,6 +476,27 @@ &sdmmc {
status = "okay";
};

+&spi1 {
+ status = "okay";
+
+ spiflash: flash@0 {
+ compatible = "jedec,spi-nor";
+ reg = <0x0>;
+ spi-max-frequency = <25000000>;
+ status = "okay";
+ m25p,fast-read;
+ };
+};
+
+/* UEXT connector */
+&spi2 {
+ status = "okay";
+};
+
+&spi5 {
+ status = "okay";
+};
+
&tcphy1 {
/* phy for &usbdrd_dwc3_1 */
status = "okay";
--
2.31.1

2021-07-01 09:32:42

by Uwe Kleine-König

[permalink] [raw]
Subject: Re: [PATCH 1/4] arm64: dts: rockchip: helios64: fixup USB setup

Hello,

On 7/1/21 2:40 AM, Dennis Gilmore wrote:
> Without the usbdrd_dwc3_1 node defined u-boot will throw an error and
> reset the system.

I wonder if this should better be fixed in u-boot then?!

> All other rk3399 systems use this format

This is true for the dwc nodes, however for the usb2 nodes there are
several that use this idiom (and even repeat the label name), see for
example the &u2phy0 node in
arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dtsi .

In my eyes it's a bit ugly to have the two nodes as separate entities
and on the same indentation level in the machine dts given that one is
the parent of the other and enabling USB needs both status settings.

Best regards
Uwe


Attachments:
OpenPGP_signature (499.00 B)
OpenPGP digital signature

2021-07-01 09:35:47

by Robin Murphy

[permalink] [raw]
Subject: Re: [PATCH 1/4] arm64: dts: rockchip: helios64: fixup USB setup

On 2021-07-01 01:40, Dennis Gilmore wrote:
> Without the usbdrd_dwc3_1 node defined u-boot will throw an error and
> reset the system. All other rk3399 systems use this format

This doesn't make much sense - the usbdrd_dwc3_1 label is defined in
rk3399.dtsi either way, and the compiled DTBs before and after are
identical :/

If U-Boot is doing something funny with labels and symbols to give
itself some kind of fragile dependency, that probably wants to be fixed
in U-Boot.

Robin.

> Signed-off-by: Dennis Gilmore <[email protected]>
> ---
> arch/arm64/boot/dts/rockchip/rk3399-kobol-helios64.dts | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/arch/arm64/boot/dts/rockchip/rk3399-kobol-helios64.dts b/arch/arm64/boot/dts/rockchip/rk3399-kobol-helios64.dts
> index 738cfd21df3e..aeedf098f67c 100644
> --- a/arch/arm64/boot/dts/rockchip/rk3399-kobol-helios64.dts
> +++ b/arch/arm64/boot/dts/rockchip/rk3399-kobol-helios64.dts
> @@ -490,9 +490,9 @@ &uart2 {
>
> &usbdrd3_1 {
> status = "okay";
> +};
>
> - usb@fe900000 {
> - dr_mode = "host";
> - status = "okay";
> - };
> +&usbdrd_dwc3_1 {
> + dr_mode = "host";
> + status = "okay";
> };
>

2021-07-01 13:04:02

by Dennis Gilmore

[permalink] [raw]
Subject: Re: [PATCH 1/4] arm64: dts: rockchip: helios64: fixup USB setup

On Thu, 2021-07-01 at 11:31 +0200, Uwe Kleine-König wrote:
> Hello,
>
> On 7/1/21 2:40 AM, Dennis Gilmore wrote:
> > Without the usbdrd_dwc3_1 node defined u-boot will throw an error
> > and
> > reset the system.
>
> I wonder if this should better be fixed in u-boot then?!
>
> > All other rk3399 systems use this format
>
> This is true for the dwc nodes, however for the usb2 nodes there are
> several that use this idiom (and even repeat the label name), see for
> example the &u2phy0 node in
> arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dtsi .
>

looking at that file is where I got the idea to set it up as I have
proposed, it follows the format I have submitted

Dennis

> In my eyes it's a bit ugly to have the two nodes as separate entities
> and on the same indentation level in the machine dts given that one
> is
> the parent of the other and enabling USB needs both status settings.
>
> Best regards
> Uwe
>


2021-07-01 13:39:50

by Uwe Kleine-König

[permalink] [raw]
Subject: Re: [PATCH 1/4] arm64: dts: rockchip: helios64: fixup USB setup

Hello Dennis,

On 7/1/21 2:59 PM, Dennis Gilmore wrote:
> On Thu, 2021-07-01 at 11:31 +0200, Uwe Kleine-König wrote:
>> Hello,
>>
>> On 7/1/21 2:40 AM, Dennis Gilmore wrote:
>>> Without the usbdrd_dwc3_1 node defined u-boot will throw an error
>>> and
>>> reset the system.
>>
>> I wonder if this should better be fixed in u-boot then?!
>>
>>> All other rk3399 systems use this format
>>
>> This is true for the dwc nodes, however for the usb2 nodes there are
>> several that use this idiom (and even repeat the label name), see for
>> example the &u2phy0 node in
>> arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dtsi .
>>
>
> looking at that file is where I got the idea to set it up as I have
> proposed, it follows the format I have submitted

I guess you didn't read exactly what I wrote and only looked at &usbdrd*
but not &u2phy0.

Best regards
Uwe


Attachments:
OpenPGP_signature (499.00 B)
OpenPGP digital signature

2021-07-01 18:16:17

by Dennis Gilmore

[permalink] [raw]
Subject: Re: [PATCH 1/4] arm64: dts: rockchip: helios64: fixup USB setup

On Thu, 2021-07-01 at 15:35 +0200, Uwe Kleine-König wrote:
> Hello Dennis,
>
> On 7/1/21 2:59 PM, Dennis Gilmore wrote:
> > On Thu, 2021-07-01 at 11:31 +0200, Uwe Kleine-König wrote:
> > > Hello,
> > >
> > > On 7/1/21 2:40 AM, Dennis Gilmore wrote:
> > > > Without the usbdrd_dwc3_1 node defined u-boot will throw an
> > > > error
> > > > and
> > > > reset the system.
> > >
> > > I wonder if this should better be fixed in u-boot then?!
> > >
> > > > All other rk3399 systems use this format
> > >
> > > This is true for the dwc nodes, however for the usb2 nodes there
> > > are
> > > several that use this idiom (and even repeat the label name), see
> > > for
> > > example the &u2phy0 node in
> > > arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dtsi .
> > >
> >
> > looking at that file is where I got the idea to set it up as I have
> > proposed, it follows the format I have submitted
>
> I guess you didn't read exactly what I wrote and only looked at
> &usbdrd*
> but not &u2phy0.

Hi Uwe,

I did read what you pointed at, the issue is that is already defined in
arch/arm64/boot/dts/rockchip/rk3399.dtsi and all that is needed it to
set the status to okay and minor enablement. as DTC merges all the
snippets together they end up in the right place and doing the right
thing, the approach you took is different to all the other boards I
looked at and seemingly causes issues in u-boot. I did not get far
enough in booting to verify the state in linux as I am updating u-boot
as I go and testing using u-boots dtb for simplicty sake. It quite
likely is a bug in u-boot that it resets the system, at the same time I
do not think that doing it differently to how the other boards are
implemented is right either. There is still a lot of the hardware in
the system that is not defined in the devicetree file, including a lot
of the usb stack.

Dennis