linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/3] Fix mainline support for rk3036 kylin board
@ 2023-12-18 10:55 Andy Yan
  2023-12-18 10:55 ` [PATCH v2 1/3] ARM: dts: rockchip: Add psci for rk3036 Andy Yan
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Andy Yan @ 2023-12-18 10:55 UTC (permalink / raw)
  To: heiko
  Cc: krzysztof.kozlowski+dt, robh+dt, devicetree, linux-arm-kernel,
	linux-kernel, linux-rockchip, zhengxing, Andy Yan

From: Andy Yan <andy.yan@rock-chips.com>


When I want to test some patch of inno hdmi driver on
mainline, I found the support of rk3036 kylin board
was broken by somehow:

PATCH 1 is add psci dt node, as we switch to psci for
cpu on/off for many yeas.
PATCH 2 add stdou-path for uart boot console.
PATCH 3 fix the emmc per board rockchip,default-sample-phase property
issue.

Changes in v2:
- Fix typo s/patch/path/
- Change subjet s/arm/ARM/

Andy Yan (3):
  ARM: dts: rockchip: Add psci for rk3036
  ARM: dts: rockchip: Add stdout-path for rk3036 kylin
  ARM: dts: rockchip: Remove rockchip,default-sample-phase from
    rk3036.dtsi

 arch/arm/boot/dts/rockchip/rk3036-kylin.dts | 4 ++++
 arch/arm/boot/dts/rockchip/rk3036.dtsi      | 6 +++++-
 2 files changed, 9 insertions(+), 1 deletion(-)

-- 
2.34.1


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

* [PATCH v2 1/3] ARM: dts: rockchip: Add psci for rk3036
  2023-12-18 10:55 [PATCH v2 0/3] Fix mainline support for rk3036 kylin board Andy Yan
@ 2023-12-18 10:55 ` Andy Yan
  2023-12-20 11:16   ` Alex Bee
  2023-12-18 10:55 ` [PATCH v2 2/3] ARM: dts: rockchip: Add stdout-path for rk3036 kylin Andy Yan
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 12+ messages in thread
From: Andy Yan @ 2023-12-18 10:55 UTC (permalink / raw)
  To: heiko
  Cc: krzysztof.kozlowski+dt, robh+dt, devicetree, linux-arm-kernel,
	linux-kernel, linux-rockchip, zhengxing, Andy Yan

From: Andy Yan <andy.yan@rock-chips.com>

The system will hang at bringup secondary CPUs
without psci node.

Signed-off-by: Andy Yan <andy.yan@rock-chips.com>

---

(no changes since v1)

 arch/arm/boot/dts/rockchip/rk3036.dtsi | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arch/arm/boot/dts/rockchip/rk3036.dtsi b/arch/arm/boot/dts/rockchip/rk3036.dtsi
index 78686fc72ce6..5344803442a1 100644
--- a/arch/arm/boot/dts/rockchip/rk3036.dtsi
+++ b/arch/arm/boot/dts/rockchip/rk3036.dtsi
@@ -67,6 +67,11 @@ display-subsystem {
 		ports = <&vop_out>;
 	};
 
+	psci {
+		compatible = "arm,psci-1.0";
+		method = "smc";
+	};
+
 	timer {
 		compatible = "arm,armv7-timer";
 		arm,cpu-registers-not-fw-configured;
-- 
2.34.1


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

* [PATCH v2 2/3] ARM: dts: rockchip: Add stdout-path for rk3036 kylin
  2023-12-18 10:55 [PATCH v2 0/3] Fix mainline support for rk3036 kylin board Andy Yan
  2023-12-18 10:55 ` [PATCH v2 1/3] ARM: dts: rockchip: Add psci for rk3036 Andy Yan
@ 2023-12-18 10:55 ` Andy Yan
  2023-12-18 10:55 ` [PATCH v2 3/3] ARM: dts: rockchip: Remove rockchip,default-sample-phase from rk3036.dtsi Andy Yan
  2023-12-24 19:54 ` (subset) [PATCH v2 0/3] Fix mainline support for rk3036 kylin board Heiko Stuebner
  3 siblings, 0 replies; 12+ messages in thread
From: Andy Yan @ 2023-12-18 10:55 UTC (permalink / raw)
  To: heiko
  Cc: krzysztof.kozlowski+dt, robh+dt, devicetree, linux-arm-kernel,
	linux-kernel, linux-rockchip, zhengxing, Andy Yan

From: Andy Yan <andy.yan@rock-chips.com>

Add stdout-path to get a uart console when system boot.

Signed-off-by: Andy Yan <andy.yan@rock-chips.com>

---

Changes in v2:
- Fix typo s/patch/path/
- Change subjet s/arm/ARM/

 arch/arm/boot/dts/rockchip/rk3036-kylin.dts | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/boot/dts/rockchip/rk3036-kylin.dts b/arch/arm/boot/dts/rockchip/rk3036-kylin.dts
index 67e1e04139e7..f12fa3831bbf 100644
--- a/arch/arm/boot/dts/rockchip/rk3036-kylin.dts
+++ b/arch/arm/boot/dts/rockchip/rk3036-kylin.dts
@@ -8,6 +8,10 @@ / {
 	model = "Rockchip RK3036 KylinBoard";
 	compatible = "rockchip,rk3036-kylin", "rockchip,rk3036";
 
+	chosen {
+		stdout-path = "serial2:115200n8";
+	};
+
 	memory@60000000 {
 		device_type = "memory";
 		reg = <0x60000000 0x20000000>;
-- 
2.34.1


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

* [PATCH v2 3/3] ARM: dts: rockchip: Remove rockchip,default-sample-phase from rk3036.dtsi
  2023-12-18 10:55 [PATCH v2 0/3] Fix mainline support for rk3036 kylin board Andy Yan
  2023-12-18 10:55 ` [PATCH v2 1/3] ARM: dts: rockchip: Add psci for rk3036 Andy Yan
  2023-12-18 10:55 ` [PATCH v2 2/3] ARM: dts: rockchip: Add stdout-path for rk3036 kylin Andy Yan
@ 2023-12-18 10:55 ` Andy Yan
  2023-12-19 10:01   ` Shawn Lin
  2023-12-24 19:54 ` (subset) [PATCH v2 0/3] Fix mainline support for rk3036 kylin board Heiko Stuebner
  3 siblings, 1 reply; 12+ messages in thread
From: Andy Yan @ 2023-12-18 10:55 UTC (permalink / raw)
  To: heiko
  Cc: krzysztof.kozlowski+dt, robh+dt, devicetree, linux-arm-kernel,
	linux-kernel, linux-rockchip, zhengxing, Andy Yan

From: Andy Yan <andy.yan@rock-chips.com>

This should be a per board property, should not be put in
a soc core dtsi.

And when this property convert from default-sample-phase
in linux-5.7 by commit 8a385eb57296 ("ARM: dts: rockchip: fix
rockchip,default-sample-phase property names"), the emmc
on rk3036 kylin board get a initialising error:

[    4.512797] Freeing unused kernel memory: 8192K
[    4.519500] mmc_host mmc1: Bus speed (slot 0) = 37125000Hz (slot req 37500000Hz, actual 37125000HZ div = 0)
[    4.530971] mmc1: error -84 whilst initialising MMC card
[    4.537277] Run /init as init process
[    4.550932] mmc_host mmc1: Bus speed (slot 0) = 300000Hz (slot req 300000Hz, actual 300000HZ div = 0)
[    4.664717] mmc_host mmc1: Bus speed (slot 0) = 37125000Hz (slot req 37500000Hz, actual 37125000HZ div = 0)
[    4.676156] mmc1: error -84 whilst initialising MMC card

I think the reason why the emmc on rk3036 kylin board was able
to work before linux-5.7 was that the illegal property was not
correctly identified by the rockchip dw_mmc driver.

Fixes: faea098e1808 ("ARM: dts: rockchip: add core rk3036 dtsi")
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
---

(no changes since v1)

 arch/arm/boot/dts/rockchip/rk3036.dtsi | 1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/arm/boot/dts/rockchip/rk3036.dtsi b/arch/arm/boot/dts/rockchip/rk3036.dtsi
index 5344803442a1..466952bf9db4 100644
--- a/arch/arm/boot/dts/rockchip/rk3036.dtsi
+++ b/arch/arm/boot/dts/rockchip/rk3036.dtsi
@@ -287,7 +287,6 @@ emmc: mmc@1021c000 {
 		clocks = <&cru HCLK_EMMC>, <&cru SCLK_EMMC>,
 			 <&cru SCLK_EMMC_DRV>, <&cru SCLK_EMMC_SAMPLE>;
 		clock-names = "biu", "ciu", "ciu-drive", "ciu-sample";
-		rockchip,default-sample-phase = <158>;
 		disable-wp;
 		dmas = <&pdma 12>;
 		dma-names = "rx-tx";
-- 
2.34.1


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

* Re: [PATCH v2 3/3] ARM: dts: rockchip: Remove rockchip,default-sample-phase from rk3036.dtsi
  2023-12-18 10:55 ` [PATCH v2 3/3] ARM: dts: rockchip: Remove rockchip,default-sample-phase from rk3036.dtsi Andy Yan
@ 2023-12-19 10:01   ` Shawn Lin
  0 siblings, 0 replies; 12+ messages in thread
From: Shawn Lin @ 2023-12-19 10:01 UTC (permalink / raw)
  To: Andy Yan
  Cc: shawn.lin, krzysztof.kozlowski+dt, robh+dt, devicetree,
	linux-arm-kernel, linux-kernel, linux-rockchip, zhengxing,
	Andy Yan, heiko


On 2023/12/18 18:55, Andy Yan wrote:
> From: Andy Yan <andy.yan@rock-chips.com>
> 
> This should be a per board property, should not be put in
> a soc core dtsi.
> 
> And when this property convert from default-sample-phase
> in linux-5.7 by commit 8a385eb57296 ("ARM: dts: rockchip: fix
> rockchip,default-sample-phase property names"), the emmc
> on rk3036 kylin board get a initialising error:
> 
> [    4.512797] Freeing unused kernel memory: 8192K
> [    4.519500] mmc_host mmc1: Bus speed (slot 0) = 37125000Hz (slot req 37500000Hz, actual 37125000HZ div = 0)
> [    4.530971] mmc1: error -84 whilst initialising MMC card
> [    4.537277] Run /init as init process
> [    4.550932] mmc_host mmc1: Bus speed (slot 0) = 300000Hz (slot req 300000Hz, actual 300000HZ div = 0)
> [    4.664717] mmc_host mmc1: Bus speed (slot 0) = 37125000Hz (slot req 37500000Hz, actual 37125000HZ div = 0)
> [    4.676156] mmc1: error -84 whilst initialising MMC card
> 
> I think the reason why the emmc on rk3036 kylin board was able
> to work before linux-5.7 was that the illegal property was not
> correctly identified by the rockchip dw_mmc driver.
> 
> Fixes: faea098e1808 ("ARM: dts: rockchip: add core rk3036 dtsi")
> Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
> ---
> 

Reviewed-by: Shawn Lin <shawn.lin@rock-chips.com>

> (no changes since v1)
> 
>   arch/arm/boot/dts/rockchip/rk3036.dtsi | 1 -
>   1 file changed, 1 deletion(-)
> 
> diff --git a/arch/arm/boot/dts/rockchip/rk3036.dtsi b/arch/arm/boot/dts/rockchip/rk3036.dtsi
> index 5344803442a1..466952bf9db4 100644
> --- a/arch/arm/boot/dts/rockchip/rk3036.dtsi
> +++ b/arch/arm/boot/dts/rockchip/rk3036.dtsi
> @@ -287,7 +287,6 @@ emmc: mmc@1021c000 {
>   		clocks = <&cru HCLK_EMMC>, <&cru SCLK_EMMC>,
>   			 <&cru SCLK_EMMC_DRV>, <&cru SCLK_EMMC_SAMPLE>;
>   		clock-names = "biu", "ciu", "ciu-drive", "ciu-sample";
> -		rockchip,default-sample-phase = <158>;
>   		disable-wp;
>   		dmas = <&pdma 12>;
>   		dma-names = "rx-tx";

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

* Re: [PATCH v2 1/3] ARM: dts: rockchip: Add psci for rk3036
  2023-12-18 10:55 ` [PATCH v2 1/3] ARM: dts: rockchip: Add psci for rk3036 Andy Yan
@ 2023-12-20 11:16   ` Alex Bee
  2023-12-21  1:07     ` Andy Yan
  0 siblings, 1 reply; 12+ messages in thread
From: Alex Bee @ 2023-12-20 11:16 UTC (permalink / raw)
  To: Andy Yan, heiko
  Cc: krzysztof.kozlowski+dt, robh+dt, devicetree, linux-arm-kernel,
	linux-kernel, linux-rockchip, zhengxing, Andy Yan

Hi Andy,
Am 18.12.23 um 11:55 schrieb Andy Yan:
> From: Andy Yan <andy.yan@rock-chips.com>
> 
> The system will hang at bringup secondary CPUs
> without psci node.
> 
> Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
> 
> ---
> 
> (no changes since v1)
> 
>   arch/arm/boot/dts/rockchip/rk3036.dtsi | 5 +++++
>   1 file changed, 5 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/rockchip/rk3036.dtsi b/arch/arm/boot/dts/rockchip/rk3036.dtsi
> index 78686fc72ce6..5344803442a1 100644
> --- a/arch/arm/boot/dts/rockchip/rk3036.dtsi
> +++ b/arch/arm/boot/dts/rockchip/rk3036.dtsi
> @@ -67,6 +67,11 @@ display-subsystem {
>   		ports = <&vop_out>;
>   	};
>   
> +	psci {
> +		compatible = "arm,psci-1.0";
> +		method = "smc";
> +	};
> +
I don't think that's an good idea. You most likely need that because you 
have downstream bootloader installed on this board. PSCI implementation 
takes place in TEE-OS for Rockchips ARM SoCs. There is no support for 
RK3036 in upstream op-tee OS. It's pretty much the same for RK3128 and 
RK3288.
If you use upstream u-boot it should be good as-is.

Alex
>   	timer {
>   		compatible = "arm,armv7-timer";
>   		arm,cpu-registers-not-fw-configured;


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

* Re: [PATCH v2 1/3] ARM: dts: rockchip: Add psci for rk3036
  2023-12-20 11:16   ` Alex Bee
@ 2023-12-21  1:07     ` Andy Yan
  2023-12-21 15:58       ` Alex Bee
  0 siblings, 1 reply; 12+ messages in thread
From: Andy Yan @ 2023-12-21  1:07 UTC (permalink / raw)
  To: Alex Bee, Andy Yan, heiko
  Cc: krzysztof.kozlowski+dt, robh+dt, devicetree, linux-arm-kernel,
	linux-kernel, linux-rockchip, zhengxing

Hi Alex:

On 12/20/23 19:16, Alex Bee wrote:
> Hi Andy,
> Am 18.12.23 um 11:55 schrieb Andy Yan:
>> From: Andy Yan <andy.yan@rock-chips.com>
>>
>> The system will hang at bringup secondary CPUs
>> without psci node.
>>
>> Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
>>
>> ---
>>
>> (no changes since v1)
>>
>>   arch/arm/boot/dts/rockchip/rk3036.dtsi | 5 +++++
>>   1 file changed, 5 insertions(+)
>>
>> diff --git a/arch/arm/boot/dts/rockchip/rk3036.dtsi b/arch/arm/boot/dts/rockchip/rk3036.dtsi
>> index 78686fc72ce6..5344803442a1 100644
>> --- a/arch/arm/boot/dts/rockchip/rk3036.dtsi
>> +++ b/arch/arm/boot/dts/rockchip/rk3036.dtsi
>> @@ -67,6 +67,11 @@ display-subsystem {
>>           ports = <&vop_out>;
>>       };
>> +    psci {
>> +        compatible = "arm,psci-1.0";
>> +        method = "smc";
>> +    };
>> +
> I don't think that's an good idea. 

Why?

>You most likely need that because you have downstream bootloader installed on this board. PSCI implementation takes place in TEE-OS for Rockchips ARM SoCs. There is no support for RK3036 in upstream op-tee OS. It's pretty much the same for RK3128 and RK3288.
> If you use upstream u-boot it should be good as-is.

Unfortunately, upstream u-boot also cannot boot up on this board.
At present, I haven't had time to debug what is going on.

Another reason I want to use downstream u-boot it is: I try run
this board with mainline just because i want to test some community
patches about inno-hdmi driver, as you said "the inno-hdmi driver currently gets a lot of attention"[0]

With a downstream u-boot I can easy switch between upstream kernel and downstream kernel(no need to replace other components)
if I found some function is not work as expected.


[0]https://patchwork.kernel.org/project/linux-rockchip/cover/20231219170100.188800-1-knaerzche@gmail.com/
> 
> Alex
>>       timer {
>>           compatible = "arm,armv7-timer";
>>           arm,cpu-registers-not-fw-configured;
> 
> 
> _______________________________________________
> Linux-rockchip mailing list
> Linux-rockchip@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-rockchip

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

* Re: [PATCH v2 1/3] ARM: dts: rockchip: Add psci for rk3036
  2023-12-21  1:07     ` Andy Yan
@ 2023-12-21 15:58       ` Alex Bee
  2023-12-22 10:37         ` Andy Yan
  0 siblings, 1 reply; 12+ messages in thread
From: Alex Bee @ 2023-12-21 15:58 UTC (permalink / raw)
  To: Andy Yan, Andy Yan, heiko
  Cc: krzysztof.kozlowski+dt, robh+dt, devicetree, linux-arm-kernel,
	linux-kernel, linux-rockchip, zhengxing

Hi Andy,

Am 21.12.23 um 02:07 schrieb Andy Yan:
> Hi Alex:
>
> On 12/20/23 19:16, Alex Bee wrote:
>> Hi Andy,
>> Am 18.12.23 um 11:55 schrieb Andy Yan:
>>> From: Andy Yan <andy.yan@rock-chips.com>
>>>
>>> The system will hang at bringup secondary CPUs
>>> without psci node.
>>>
>>> Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
>>>
>>> ---
>>>
>>> (no changes since v1)
>>>
>>>   arch/arm/boot/dts/rockchip/rk3036.dtsi | 5 +++++
>>>   1 file changed, 5 insertions(+)
>>>
>>> diff --git a/arch/arm/boot/dts/rockchip/rk3036.dtsi 
>>> b/arch/arm/boot/dts/rockchip/rk3036.dtsi
>>> index 78686fc72ce6..5344803442a1 100644
>>> --- a/arch/arm/boot/dts/rockchip/rk3036.dtsi
>>> +++ b/arch/arm/boot/dts/rockchip/rk3036.dtsi
>>> @@ -67,6 +67,11 @@ display-subsystem {
>>>           ports = <&vop_out>;
>>>       };
>>> +    psci {
>>> +        compatible = "arm,psci-1.0";
>>> +        method = "smc";
>>> +    };
>>> +
>> I don't think that's an good idea. 
>
> Why?
It's only what I've been told before: We shoudn't add properties which
depend on non-upstream software (if an upstream alternative exists). Also
I'm not sure what happens if somebody doesn't use downstream bootloader
and PSCI can't be found: Would the board still be able to boot?
>
>> You most likely need that because you have downstream bootloader 
>> installed on this board. PSCI implementation takes place in TEE-OS 
>> for Rockchips ARM SoCs. There is no support for RK3036 in upstream 
>> op-tee OS. It's pretty much the same for RK3128 and RK3288.
>> If you use upstream u-boot it should be good as-is.
>
> Unfortunately, upstream u-boot also cannot boot up on this board.
> At present, I haven't had time to debug what is going on.
>
> Another reason I want to use downstream u-boot it is: I try run
> this board with mainline just because i want to test some community
> patches about inno-hdmi driver, as you said "the inno-hdmi driver 
> currently gets a lot of attention"[0]
>
Thanks for helping testing this.

Alex

> With a downstream u-boot I can easy switch between upstream kernel and 
> downstream kernel(no need to replace other components)
> if I found some function is not work as expected.
>
>
> [0]https://patchwork.kernel.org/project/linux-rockchip/cover/20231219170100.188800-1-knaerzche@gmail.com/ 
>
>>
>> Alex
>>>       timer {
>>>           compatible = "arm,armv7-timer";
>>>           arm,cpu-registers-not-fw-configured;
>>
>>
>> _______________________________________________
>> Linux-rockchip mailing list
>> Linux-rockchip@lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/linux-rockchip

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

* Re: [PATCH v2 1/3] ARM: dts: rockchip: Add psci for rk3036
  2023-12-21 15:58       ` Alex Bee
@ 2023-12-22 10:37         ` Andy Yan
  2023-12-22 15:37           ` Alex Bee
  0 siblings, 1 reply; 12+ messages in thread
From: Andy Yan @ 2023-12-22 10:37 UTC (permalink / raw)
  To: Alex Bee, Andy Yan, heiko
  Cc: krzysztof.kozlowski+dt, robh+dt, devicetree, linux-arm-kernel,
	linux-kernel, linux-rockchip, zhengxing

Hi Alex,

On 12/21/23 23:58, Alex Bee wrote:
> Hi Andy,
> 
> Am 21.12.23 um 02:07 schrieb Andy Yan:
>> Hi Alex:
>>
>> On 12/20/23 19:16, Alex Bee wrote:
>>> Hi Andy,
>>> Am 18.12.23 um 11:55 schrieb Andy Yan:
>>>> From: Andy Yan <andy.yan@rock-chips.com>
>>>>
>>>> The system will hang at bringup secondary CPUs
>>>> without psci node.
>>>>
>>>> Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
>>>>
>>>> ---
>>>>
>>>> (no changes since v1)
>>>>
>>>>   arch/arm/boot/dts/rockchip/rk3036.dtsi | 5 +++++
>>>>   1 file changed, 5 insertions(+)
>>>>
>>>> diff --git a/arch/arm/boot/dts/rockchip/rk3036.dtsi b/arch/arm/boot/dts/rockchip/rk3036.dtsi
>>>> index 78686fc72ce6..5344803442a1 100644
>>>> --- a/arch/arm/boot/dts/rockchip/rk3036.dtsi
>>>> +++ b/arch/arm/boot/dts/rockchip/rk3036.dtsi
>>>> @@ -67,6 +67,11 @@ display-subsystem {
>>>>           ports = <&vop_out>;
>>>>       };
>>>> +    psci {
>>>> +        compatible = "arm,psci-1.0";
>>>> +        method = "smc";
>>>> +    };
>>>> +
>>> I don't think that's an good idea. 
>>
>> Why?
> It's only what I've been told before: We shoudn't add properties which
> depend on non-upstream software (if an upstream alternative exists). Also

> I'm not sure what happens if somebody doesn't use downstream bootloader
> and PSCI can't be found: Would the board still be able to boot?

The psci is released herel[0].
And also, there are only two rk3036 based boards in mainline:
rk3036-evb,rk3036-keylin, both of them from rockchip.
And the mainline support of these boards broken from linux 5.7(2020, see PATCH 3),
no one report this broken until I try to run this board now.
So maybe there is no such somebody will run into this situation.


[0]https://github.com/rockchip-linux/rkbin/tree/master/bin/rk30

>>
>>> You most likely need that because you have downstream bootloader installed on this board. PSCI implementation takes place in TEE-OS for Rockchips ARM SoCs. There is no support for RK3036 in upstream op-tee OS. It's pretty much the same for RK3128 and RK3288.
>>> If you use upstream u-boot it should be good as-is.
>>
>> Unfortunately, upstream u-boot also cannot boot up on this board.
>> At present, I haven't had time to debug what is going on.
>>
>> Another reason I want to use downstream u-boot it is: I try run
>> this board with mainline just because i want to test some community
>> patches about inno-hdmi driver, as you said "the inno-hdmi driver currently gets a lot of attention"[0]
>>
> Thanks for helping testing this.
> 
> Alex
> 
>> With a downstream u-boot I can easy switch between upstream kernel and downstream kernel(no need to replace other components)
>> if I found some function is not work as expected.
>>
>>
>> [0]https://patchwork.kernel.org/project/linux-rockchip/cover/20231219170100.188800-1-knaerzche@gmail.com/
>>>
>>> Alex
>>>>       timer {
>>>>           compatible = "arm,armv7-timer";
>>>>           arm,cpu-registers-not-fw-configured;
>>>
>>>
>>> _______________________________________________
>>> Linux-rockchip mailing list
>>> Linux-rockchip@lists.infradead.org
>>> http://lists.infradead.org/mailman/listinfo/linux-rockchip

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

* Re: [PATCH v2 1/3] ARM: dts: rockchip: Add psci for rk3036
  2023-12-22 10:37         ` Andy Yan
@ 2023-12-22 15:37           ` Alex Bee
  2023-12-23 11:14             ` Andy Yan
  0 siblings, 1 reply; 12+ messages in thread
From: Alex Bee @ 2023-12-22 15:37 UTC (permalink / raw)
  To: Andy Yan, Andy Yan, heiko
  Cc: krzysztof.kozlowski+dt, robh+dt, devicetree, linux-arm-kernel,
	linux-kernel, linux-rockchip, zhengxing

Hi Andy,

Am 22.12.23 um 11:37 schrieb Andy Yan:
> Hi Alex,
>
> On 12/21/23 23:58, Alex Bee wrote:
>> Hi Andy,
>>
>> Am 21.12.23 um 02:07 schrieb Andy Yan:
>>> Hi Alex:
>>>
>>> On 12/20/23 19:16, Alex Bee wrote:
>>>> Hi Andy,
>>>> Am 18.12.23 um 11:55 schrieb Andy Yan:
>>>>> From: Andy Yan <andy.yan@rock-chips.com>
>>>>>
>>>>> The system will hang at bringup secondary CPUs
>>>>> without psci node.
>>>>>
>>>>> Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
>>>>>
>>>>> ---
>>>>>
>>>>> (no changes since v1)
>>>>>
>>>>>   arch/arm/boot/dts/rockchip/rk3036.dtsi | 5 +++++
>>>>>   1 file changed, 5 insertions(+)
>>>>>
>>>>> diff --git a/arch/arm/boot/dts/rockchip/rk3036.dtsi 
>>>>> b/arch/arm/boot/dts/rockchip/rk3036.dtsi
>>>>> index 78686fc72ce6..5344803442a1 100644
>>>>> --- a/arch/arm/boot/dts/rockchip/rk3036.dtsi
>>>>> +++ b/arch/arm/boot/dts/rockchip/rk3036.dtsi
>>>>> @@ -67,6 +67,11 @@ display-subsystem {
>>>>>           ports = <&vop_out>;
>>>>>       };
>>>>> +    psci {
>>>>> +        compatible = "arm,psci-1.0";
>>>>> +        method = "smc";
>>>>> +    };
>>>>> +
>>>> I don't think that's an good idea. 
>>>
>>> Why?
>> It's only what I've been told before: We shoudn't add properties which
>> depend on non-upstream software (if an upstream alternative exists). 
>> Also
>
>> I'm not sure what happens if somebody doesn't use downstream bootloader
>> and PSCI can't be found: Would the board still be able to boot?
>
> The psci is released herel[0].
> And also, there are only two rk3036 based boards in mainline:
> rk3036-evb,rk3036-keylin, both of them from rockchip.
> And the mainline support of these boards broken from linux 5.7(2020, 
> see PATCH 3),
> no one report this broken until I try to run this board now.
> So maybe there is no such somebody will run into this situation.
>
>
> [0]https://github.com/rockchip-linux/rkbin/tree/master/bin/rk30
>
Yeah sure, there are binary release for downstream optee implementations,
but the won't work with upstream u-boot, since they are using a calling
convention different from upstream optee os. I tried to add support for
those, but it was rejected [0].

Upstream bootflow doesn't implement/need PSCI as it uses a SMP bringup
method which is done in kernel only (see enable-method in cpu section). I
guess that it doesn't work for you is most likely because the downstream
tee os makes the cpu registers the upstream enable-method uses only
accessible in a higher exception level.

I can undust my RK3036 evb board during christmas holidays and check whats
broken for RK3036 in u-boot. Everything was working fine (including SMP
bringup w/o PSCI and upstream u-boot) when I was adding VPU support in 5.14
[1]. I likely booted from TF-card rather than eMMC.

[0] 
https://patchwork.ozlabs.org/project/uboot/patch/20230718145715.1280201-6-knaerzche@gmail.com/
[1] 
https://patchwork.kernel.org/project/linux-rockchip/patch/20210527154455.358869-11-knaerzche@gmail.com/

Nice holidays!

Alex

>>>
>>>> You most likely need that because you have downstream bootloader 
>>>> installed on this board. PSCI implementation takes place in TEE-OS 
>>>> for Rockchips ARM SoCs. There is no support for RK3036 in upstream 
>>>> op-tee OS. It's pretty much the same for RK3128 and RK3288.
>>>> If you use upstream u-boot it should be good as-is.
>>>
>>> Unfortunately, upstream u-boot also cannot boot up on this board.
>>> At present, I haven't had time to debug what is going on.
>>>
>>> Another reason I want to use downstream u-boot it is: I try run
>>> this board with mainline just because i want to test some community
>>> patches about inno-hdmi driver, as you said "the inno-hdmi driver 
>>> currently gets a lot of attention"[0]
>>>
>> Thanks for helping testing this.
>>
>> Alex
>>
>>> With a downstream u-boot I can easy switch between upstream kernel 
>>> and downstream kernel(no need to replace other components)
>>> if I found some function is not work as expected.
>>>
>>>
>>> [0]https://patchwork.kernel.org/project/linux-rockchip/cover/20231219170100.188800-1-knaerzche@gmail.com/ 
>>>
>>>>
>>>> Alex
>>>>>       timer {
>>>>>           compatible = "arm,armv7-timer";
>>>>>           arm,cpu-registers-not-fw-configured;
>>>>
>>>>
>>>> _______________________________________________
>>>> Linux-rockchip mailing list
>>>> Linux-rockchip@lists.infradead.org
>>>> http://lists.infradead.org/mailman/listinfo/linux-rockchip

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

* Re: [PATCH v2 1/3] ARM: dts: rockchip: Add psci for rk3036
  2023-12-22 15:37           ` Alex Bee
@ 2023-12-23 11:14             ` Andy Yan
  0 siblings, 0 replies; 12+ messages in thread
From: Andy Yan @ 2023-12-23 11:14 UTC (permalink / raw)
  To: Alex Bee, Andy Yan, heiko, Kever Yang
  Cc: krzysztof.kozlowski+dt, robh+dt, devicetree, linux-arm-kernel,
	linux-kernel, linux-rockchip, zhengxing

Hi Alex,

On 12/22/23 23:37, Alex Bee wrote:
> Hi Andy,
> 
> Am 22.12.23 um 11:37 schrieb Andy Yan:
>> Hi Alex,
>>
>> On 12/21/23 23:58, Alex Bee wrote:
>>> Hi Andy,
>>>
>>> Am 21.12.23 um 02:07 schrieb Andy Yan:
>>>> Hi Alex:
>>>>
>>>> On 12/20/23 19:16, Alex Bee wrote:
>>>>> Hi Andy,
>>>>> Am 18.12.23 um 11:55 schrieb Andy Yan:
>>>>>> From: Andy Yan <andy.yan@rock-chips.com>
>>>>>>
>>>>>> The system will hang at bringup secondary CPUs
>>>>>> without psci node.
>>>>>>
>>>>>> Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
>>>>>>
>>>>>> ---
>>>>>>
>>>>>> (no changes since v1)
>>>>>>
>>>>>>   arch/arm/boot/dts/rockchip/rk3036.dtsi | 5 +++++
>>>>>>   1 file changed, 5 insertions(+)
>>>>>>
>>>>>> diff --git a/arch/arm/boot/dts/rockchip/rk3036.dtsi b/arch/arm/boot/dts/rockchip/rk3036.dtsi
>>>>>> index 78686fc72ce6..5344803442a1 100644
>>>>>> --- a/arch/arm/boot/dts/rockchip/rk3036.dtsi
>>>>>> +++ b/arch/arm/boot/dts/rockchip/rk3036.dtsi
>>>>>> @@ -67,6 +67,11 @@ display-subsystem {
>>>>>>           ports = <&vop_out>;
>>>>>>       };
>>>>>> +    psci {
>>>>>> +        compatible = "arm,psci-1.0";
>>>>>> +        method = "smc";
>>>>>> +    };
>>>>>> +
>>>>> I don't think that's an good idea. 
>>>>
>>>> Why?
>>> It's only what I've been told before: We shoudn't add properties which
>>> depend on non-upstream software (if an upstream alternative exists). Also
>>
>>> I'm not sure what happens if somebody doesn't use downstream bootloader
>>> and PSCI can't be found: Would the board still be able to boot?
>>
>> The psci is released herel[0].
>> And also, there are only two rk3036 based boards in mainline:
>> rk3036-evb,rk3036-keylin, both of them from rockchip.
>> And the mainline support of these boards broken from linux 5.7(2020, see PATCH 3),
>> no one report this broken until I try to run this board now.
>> So maybe there is no such somebody will run into this situation.
>>
>>
>> [0]https://github.com/rockchip-linux/rkbin/tree/master/bin/rk30
>>
> Yeah sure, there are binary release for downstream optee implementations,
> but the won't work with upstream u-boot, since they are using a calling
> convention different from upstream optee os. I tried to add support for
> those, but it was rejected [0].
> 
> Upstream bootflow doesn't implement/need PSCI as it uses a SMP bringup
> method which is done in kernel only (see enable-method in cpu section). I
> guess that it doesn't work for you is most likely because the downstream
> tee os makes the cpu registers the upstream enable-method uses only
> accessible in a higher exception level.
> 
> I can undust my RK3036 evb board during christmas holidays and check whats
> broken for RK3036 in u-boot. Everything was working fine (including SMP

With one day bisect, I finally fond the mainline u-boot support for rk3036
was broken by this commit f113d7d30346 (" Convert CONFIG_SPL_STACK to Kconfig")

It makes rk3036 can't set SPL_STACK as rk3036 can't enable SPL_FRAMEWORK(very small sram)

I still don't have a proper patch to fix this issue.

Thank you very much for you explanation.
I think i should not add psci to mainline before the tee binary can be used by mainline u-boot.

Nice holidays!
> bringup w/o PSCI and upstream u-boot) when I was adding VPU support in 5.14
> [1]. I likely booted from TF-card rather than eMMC.
> 
> [0] https://patchwork.ozlabs.org/project/uboot/patch/20230718145715.1280201-6-knaerzche@gmail.com/
> [1] https://patchwork.kernel.org/project/linux-rockchip/patch/20210527154455.358869-11-knaerzche@gmail.com/
> 
> Nice holidays!
> 
> Alex
> 
>>>>
>>>>> You most likely need that because you have downstream bootloader installed on this board. PSCI implementation takes place in TEE-OS for Rockchips ARM SoCs. There is no support for RK3036 in upstream op-tee OS. It's pretty much the same for RK3128 and RK3288.
>>>>> If you use upstream u-boot it should be good as-is.
>>>>
>>>> Unfortunately, upstream u-boot also cannot boot up on this board.
>>>> At present, I haven't had time to debug what is going on.
>>>>
>>>> Another reason I want to use downstream u-boot it is: I try run
>>>> this board with mainline just because i want to test some community
>>>> patches about inno-hdmi driver, as you said "the inno-hdmi driver currently gets a lot of attention"[0]
>>>>
>>> Thanks for helping testing this.
>>>
>>> Alex
>>>
>>>> With a downstream u-boot I can easy switch between upstream kernel and downstream kernel(no need to replace other components)
>>>> if I found some function is not work as expected.
>>>>
>>>>
>>>> [0]https://patchwork.kernel.org/project/linux-rockchip/cover/20231219170100.188800-1-knaerzche@gmail.com/
>>>>>
>>>>> Alex
>>>>>>       timer {
>>>>>>           compatible = "arm,armv7-timer";
>>>>>>           arm,cpu-registers-not-fw-configured;
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> Linux-rockchip mailing list
>>>>> Linux-rockchip@lists.infradead.org
>>>>> http://lists.infradead.org/mailman/listinfo/linux-rockchip

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

* Re: (subset) [PATCH v2 0/3] Fix mainline support for rk3036 kylin board
  2023-12-18 10:55 [PATCH v2 0/3] Fix mainline support for rk3036 kylin board Andy Yan
                   ` (2 preceding siblings ...)
  2023-12-18 10:55 ` [PATCH v2 3/3] ARM: dts: rockchip: Remove rockchip,default-sample-phase from rk3036.dtsi Andy Yan
@ 2023-12-24 19:54 ` Heiko Stuebner
  3 siblings, 0 replies; 12+ messages in thread
From: Heiko Stuebner @ 2023-12-24 19:54 UTC (permalink / raw)
  To: Andy Yan
  Cc: Heiko Stuebner, Andy Yan, linux-rockchip, linux-arm-kernel,
	krzysztof.kozlowski+dt, robh+dt, linux-kernel, devicetree,
	zhengxing

On Mon, 18 Dec 2023 18:55:20 +0800, Andy Yan wrote:
> From: Andy Yan <andy.yan@rock-chips.com>
> 
> 
> When I want to test some patch of inno hdmi driver on
> mainline, I found the support of rk3036 kylin board
> was broken by somehow:
> 
> [...]

Applied, thanks!

[2/3] ARM: dts: rockchip: Add stdout-path for rk3036 kylin
      commit: 1df4bc6908b2739f7ff28a1775729730d1addf16
[3/3] ARM: dts: rockchip: Remove rockchip,default-sample-phase from rk3036.dtsi
      commit: bb0b255fb6f14b1620566d7d32c43adaca09c5e5

Best regards,
-- 
Heiko Stuebner <heiko@sntech.de>

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

end of thread, other threads:[~2023-12-24 19:54 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-18 10:55 [PATCH v2 0/3] Fix mainline support for rk3036 kylin board Andy Yan
2023-12-18 10:55 ` [PATCH v2 1/3] ARM: dts: rockchip: Add psci for rk3036 Andy Yan
2023-12-20 11:16   ` Alex Bee
2023-12-21  1:07     ` Andy Yan
2023-12-21 15:58       ` Alex Bee
2023-12-22 10:37         ` Andy Yan
2023-12-22 15:37           ` Alex Bee
2023-12-23 11:14             ` Andy Yan
2023-12-18 10:55 ` [PATCH v2 2/3] ARM: dts: rockchip: Add stdout-path for rk3036 kylin Andy Yan
2023-12-18 10:55 ` [PATCH v2 3/3] ARM: dts: rockchip: Remove rockchip,default-sample-phase from rk3036.dtsi Andy Yan
2023-12-19 10:01   ` Shawn Lin
2023-12-24 19:54 ` (subset) [PATCH v2 0/3] Fix mainline support for rk3036 kylin board Heiko Stuebner

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