Re: [PATCH 28/31] rockchip: rk3399-rock-pi-4: Sync device tree from linux v6.8

2024-04-23 Thread Kever Yang



On 2024/4/1 04:28, Jonas Karlman wrote:

Sync rk3399-rock-pi-4 related device tree from linux v6.8.

Add SPI flash related options to support booting from SPI flash.

Add AHCI=y, SCSI_AHCI=y, AHCI_PCI=y and SCSI=y to support PCIe SATA boot.

Change to SPL_MAX_SIZE=0x4, SPL can be up to 256 KiB.

Add ROCKCHIP_IODOMAIN=y to configure io-domain voltage.

Add PHY_REALTEK=y and DM_ETH_PHY=y to support ethernet PHY.

Remove SPL_TINY_MEMSET=y to use full memset in SPL.

Signed-off-by: Jonas Karlman 

Reviewed-by: Kever Yang 

Thanks,
- Kever

---
  arch/arm/dts/rk3399-rock-4c-plus-u-boot.dtsi | 12 ++
  arch/arm/dts/rk3399-rock-4c-plus.dts |  1 +
  arch/arm/dts/rk3399-rock-4se-u-boot.dtsi | 12 ++
  arch/arm/dts/rk3399-rock-pi-4.dtsi   |  4 +++-
  arch/arm/dts/rk3399-rock-pi-4c-u-boot.dtsi   |  7 ++
  arch/arm/dts/rk3399-rock-pi-4c.dts   | 10 
  configs/rock-4c-plus-rk3399_defconfig| 24 +++-
  configs/rock-4se-rk3399_defconfig| 23 +--
  configs/rock-pi-4-rk3399_defconfig   |  8 +++
  configs/rock-pi-4c-rk3399_defconfig  | 24 ++--
  10 files changed, 114 insertions(+), 11 deletions(-)

diff --git a/arch/arm/dts/rk3399-rock-4c-plus-u-boot.dtsi 
b/arch/arm/dts/rk3399-rock-4c-plus-u-boot.dtsi
index 9785b97b9eea..b5ee644a83dd 100644
--- a/arch/arm/dts/rk3399-rock-4c-plus-u-boot.dtsi
+++ b/arch/arm/dts/rk3399-rock-4c-plus-u-boot.dtsi
@@ -11,3 +11,15 @@
  _pull_up_8ma {
bootph-pre-ram;
  };
+
+ {
+   status = "okay";
+
+   flash@0 {
+   bootph-pre-ram;
+   bootph-some-ram;
+   compatible = "jedec,spi-nor";
+   reg = <0>;
+   spi-max-frequency = <1000>;
+   };
+};
diff --git a/arch/arm/dts/rk3399-rock-4c-plus.dts 
b/arch/arm/dts/rk3399-rock-4c-plus.dts
index 8bfd5f88d1ef..7baf9d1b22fd 100644
--- a/arch/arm/dts/rk3399-rock-4c-plus.dts
+++ b/arch/arm/dts/rk3399-rock-4c-plus.dts
@@ -15,6 +15,7 @@
compatible = "radxa,rock-4c-plus", "rockchip,rk3399";
  
  	aliases {

+   ethernet0 = 
mmc0 = 
mmc1 = 
};
diff --git a/arch/arm/dts/rk3399-rock-4se-u-boot.dtsi 
b/arch/arm/dts/rk3399-rock-4se-u-boot.dtsi
index 85ee5770add0..2213d0093052 100644
--- a/arch/arm/dts/rk3399-rock-4se-u-boot.dtsi
+++ b/arch/arm/dts/rk3399-rock-4se-u-boot.dtsi
@@ -4,3 +4,15 @@
   */
  
  #include "rk3399-rock-pi-4-u-boot.dtsi"

+
+ {
+   status = "okay";
+
+   flash@0 {
+   bootph-pre-ram;
+   bootph-some-ram;
+   compatible = "jedec,spi-nor";
+   reg = <0>;
+   spi-max-frequency = <1000>;
+   };
+};
diff --git a/arch/arm/dts/rk3399-rock-pi-4.dtsi 
b/arch/arm/dts/rk3399-rock-pi-4.dtsi
index b1b7f4ffb1d4..281a12180703 100644
--- a/arch/arm/dts/rk3399-rock-pi-4.dtsi
+++ b/arch/arm/dts/rk3399-rock-pi-4.dtsi
@@ -12,6 +12,7 @@
  
  / {

aliases {
+   ethernet0 = 
mmc0 = 
mmc1 = 
};
@@ -44,7 +45,7 @@
sdio_pwrseq: sdio-pwrseq {
compatible = "mmc-pwrseq-simple";
clocks = < 1>;
-   clock-names = "ext_clock";
+   clock-names = "lpo";
pinctrl-names = "default";
pinctrl-0 = <_enable_h>;
reset-gpios = < RK_PB2 GPIO_ACTIVE_LOW>;
@@ -492,6 +493,7 @@
  
   {

pinctrl-0 = <_2ch_bus>;
+   pinctrl-1 = <_2ch_bus_bclk_off>;
rockchip,capture-channels = <2>;
rockchip,playback-channels = <2>;
status = "okay";
diff --git a/arch/arm/dts/rk3399-rock-pi-4c-u-boot.dtsi 
b/arch/arm/dts/rk3399-rock-pi-4c-u-boot.dtsi
index 85ee5770add0..38385621deb1 100644
--- a/arch/arm/dts/rk3399-rock-pi-4c-u-boot.dtsi
+++ b/arch/arm/dts/rk3399-rock-pi-4c-u-boot.dtsi
@@ -4,3 +4,10 @@
   */
  
  #include "rk3399-rock-pi-4-u-boot.dtsi"

+
+ {
+   flash@0 {
+   bootph-pre-ram;
+   bootph-some-ram;
+   };
+};
diff --git a/arch/arm/dts/rk3399-rock-pi-4c.dts 
b/arch/arm/dts/rk3399-rock-pi-4c.dts
index d32efab74e94..de2ebe4cb4f3 100644
--- a/arch/arm/dts/rk3399-rock-pi-4c.dts
+++ b/arch/arm/dts/rk3399-rock-pi-4c.dts
@@ -43,6 +43,16 @@
hp-det-gpio = < RK_PA0 GPIO_ACTIVE_HIGH>;
  };
  
+ {

+   status = "okay";
+
+   flash@0 {
+   compatible = "jedec,spi-nor";
+   reg = <0>;
+   spi-max-frequency = <1000>;
+   };
+};
+
   {
status = "okay";
  
diff --git a/configs/rock-4c-plus-rk3399_defconfig b/configs/rock-4c-plus-rk3399_defconfig

index 2024defb2bf0..e97fde17acc2 100644
--- a/configs/rock-4c-plus-rk3399_defconfig
+++ b/configs/rock-4c-plus-rk3399_defconfig
@@ -3,22 +3,27 @@ CONFIG_SKIP_LOWLEVEL_INIT=y
  CONFIG_COUNTER_FREQUENCY=2400
  CONFIG_ARCH_ROCKCHIP=y
  CONFIG_NR_DRAM_BANKS=1
+CONFIG_SF_DEFAULT_SPEED=1000
  

Re: [PATCH 28/31] rockchip: rk3399-rock-pi-4: Sync device tree from linux v6.8

2024-04-02 Thread Christopher Obbard
Hi Jonas,

On Sun, 2024-03-31 at 20:28 +, Jonas Karlman wrote:
> Sync rk3399-rock-pi-4 related device tree from linux v6.8.
> 
> Add SPI flash related options to support booting from SPI flash.
> 
> Add AHCI=y, SCSI_AHCI=y, AHCI_PCI=y and SCSI=y to support PCIe SATA boot.
> 
> Change to SPL_MAX_SIZE=0x4, SPL can be up to 256 KiB.
> 
> Add ROCKCHIP_IODOMAIN=y to configure io-domain voltage.
> 
> Add PHY_REALTEK=y and DM_ETH_PHY=y to support ethernet PHY.
> 
> Remove SPL_TINY_MEMSET=y to use full memset in SPL.
> 
> Signed-off-by: Jonas Karlman 

Thank you for taking care of this.

Reviewed-by: Christopher Obbard 

> ---
>  arch/arm/dts/rk3399-rock-4c-plus-u-boot.dtsi | 12 ++
>  arch/arm/dts/rk3399-rock-4c-plus.dts |  1 +
>  arch/arm/dts/rk3399-rock-4se-u-boot.dtsi | 12 ++
>  arch/arm/dts/rk3399-rock-pi-4.dtsi   |  4 +++-
>  arch/arm/dts/rk3399-rock-pi-4c-u-boot.dtsi   |  7 ++
>  arch/arm/dts/rk3399-rock-pi-4c.dts   | 10 
>  configs/rock-4c-plus-rk3399_defconfig    | 24 +++-
>  configs/rock-4se-rk3399_defconfig    | 23 +--
>  configs/rock-pi-4-rk3399_defconfig   |  8 +++
>  configs/rock-pi-4c-rk3399_defconfig  | 24 ++--
>  10 files changed, 114 insertions(+), 11 deletions(-)
> 
> diff --git a/arch/arm/dts/rk3399-rock-4c-plus-u-boot.dtsi
> b/arch/arm/dts/rk3399-rock-4c-plus-u-boot.dtsi
> index 9785b97b9eea..b5ee644a83dd 100644
> --- a/arch/arm/dts/rk3399-rock-4c-plus-u-boot.dtsi
> +++ b/arch/arm/dts/rk3399-rock-4c-plus-u-boot.dtsi
> @@ -11,3 +11,15 @@
>  _pull_up_8ma {
>   bootph-pre-ram;
>  };
> +
> + {
> + status = "okay";
> +
> + flash@0 {
> + bootph-pre-ram;
> + bootph-some-ram;
> + compatible = "jedec,spi-nor";
> + reg = <0>;
> + spi-max-frequency = <1000>;
> + };
> +};
> diff --git a/arch/arm/dts/rk3399-rock-4c-plus.dts b/arch/arm/dts/rk3399-
> rock-4c-plus.dts
> index 8bfd5f88d1ef..7baf9d1b22fd 100644
> --- a/arch/arm/dts/rk3399-rock-4c-plus.dts
> +++ b/arch/arm/dts/rk3399-rock-4c-plus.dts
> @@ -15,6 +15,7 @@
>   compatible = "radxa,rock-4c-plus", "rockchip,rk3399";
>  
>   aliases {
> + ethernet0 = 
>   mmc0 = 
>   mmc1 = 
>   };
> diff --git a/arch/arm/dts/rk3399-rock-4se-u-boot.dtsi b/arch/arm/dts/rk3399-
> rock-4se-u-boot.dtsi
> index 85ee5770add0..2213d0093052 100644
> --- a/arch/arm/dts/rk3399-rock-4se-u-boot.dtsi
> +++ b/arch/arm/dts/rk3399-rock-4se-u-boot.dtsi
> @@ -4,3 +4,15 @@
>   */
>  
>  #include "rk3399-rock-pi-4-u-boot.dtsi"
> +
> + {
> + status = "okay";
> +
> + flash@0 {
> + bootph-pre-ram;
> + bootph-some-ram;
> + compatible = "jedec,spi-nor";
> + reg = <0>;
> + spi-max-frequency = <1000>;
> + };
> +};
> diff --git a/arch/arm/dts/rk3399-rock-pi-4.dtsi b/arch/arm/dts/rk3399-rock-
> pi-4.dtsi
> index b1b7f4ffb1d4..281a12180703 100644
> --- a/arch/arm/dts/rk3399-rock-pi-4.dtsi
> +++ b/arch/arm/dts/rk3399-rock-pi-4.dtsi
> @@ -12,6 +12,7 @@
>  
>  / {
>   aliases {
> + ethernet0 = 
>   mmc0 = 
>   mmc1 = 
>   };
> @@ -44,7 +45,7 @@
>   sdio_pwrseq: sdio-pwrseq {
>   compatible = "mmc-pwrseq-simple";
>   clocks = < 1>;
> - clock-names = "ext_clock";
> + clock-names = "lpo";
>   pinctrl-names = "default";
>   pinctrl-0 = <_enable_h>;
>   reset-gpios = < RK_PB2 GPIO_ACTIVE_LOW>;
> @@ -492,6 +493,7 @@
>  
>   {
>   pinctrl-0 = <_2ch_bus>;
> + pinctrl-1 = <_2ch_bus_bclk_off>;
>   rockchip,capture-channels = <2>;
>   rockchip,playback-channels = <2>;
>   status = "okay";
> diff --git a/arch/arm/dts/rk3399-rock-pi-4c-u-boot.dtsi
> b/arch/arm/dts/rk3399-rock-pi-4c-u-boot.dtsi
> index 85ee5770add0..38385621deb1 100644
> --- a/arch/arm/dts/rk3399-rock-pi-4c-u-boot.dtsi
> +++ b/arch/arm/dts/rk3399-rock-pi-4c-u-boot.dtsi
> @@ -4,3 +4,10 @@
>   */
>  
>  #include "rk3399-rock-pi-4-u-boot.dtsi"
> +
> + {
> + flash@0 {
> + bootph-pre-ram;
> + bootph-some-ram;
> + };
> +};
> diff --git a/arch/arm/dts/rk3399-rock-pi-4c.dts b/arch/arm/dts/rk3399-rock-
> pi-4c.dts
> index d32efab74e94..de2ebe4cb4f3 100644
> --- a/arch/arm/dts/rk3399-rock-pi-4c.dts
> +++ b/arch/arm/dts/rk3399-rock-pi-4c.dts
> @@ -43,6 +43,16 @@
>   hp-det-gpio = < RK_PA0 GPIO_ACTIVE_HIGH>;
>  };
>  
> + {
> + status = "okay";
> +
> + flash@0 {
> + compatible = "jedec,spi-nor";
> + reg = <0>;
> + spi-max-frequency = <1000>;
> + };
> +};
> +
>   {
>   status = "okay";
>  
> diff --git a/configs/rock-4c-plus-rk3399_defconfig b/configs/rock-4c-plus-
> rk3399_defconfig
> index 2024defb2bf0..e97fde17acc2 100644
> --- a/configs/rock-4c-plus-rk3399_defconfig
> +++ 

Re: [PATCH 28/31] rockchip: rk3399-rock-pi-4: Sync device tree from linux v6.8

2024-03-31 Thread Dragan Simic

On 2024-04-01 01:41, Jonas Karlman wrote:

On 2024-04-01 01:30, Dragan Simic wrote:

On 2024-04-01 01:14, Jonas Karlman wrote:

On 2024-04-01 00:53, Dragan Simic wrote:

Please see my comments below.

On 2024-03-31 22:28, Jonas Karlman wrote:

Sync rk3399-rock-pi-4 related device tree from linux v6.8.

Add SPI flash related options to support booting from SPI flash.

Add AHCI=y, SCSI_AHCI=y, AHCI_PCI=y and SCSI=y to support PCIe SATA
boot.


As we know, these boards have no standard connectors for PCI Express
expansion cards, which makes me wonder how many users actually use 
M.2

PCI Express modules with SATA controllers on them with these boards,
and need support for them in U-Boot?

I mean, it can't hurt, but frankly, I'm not 100% sure about it.


With the M.2 Extension Board [1] and a M.2 to PCIe X4 adapter it is
very
easy to convert the M.2 slot into a standard PCIe X4 slot and use it
with a PCIe SATA card. At least that is how I have tested and used
this.


I was aware of the M.2 extension board sold by Radxa, but frankly,
using it together with another adapter (M.2 to standard PCIe x4 slot)
is a cumbersome setup.  The whole thing becomes at least three times
the size of the SBC, with cables and a dangling PCIe card. :)


I know, it is not ideal, but works for my testing and development
proposes :-)

I had in mind an M.2 module with a PCIe SATA controller. [2]  
Something

like that, used together with the M.2 extension board, would actually
make a rather neat setup.


I guess the Radxa Penta SATA HAT [3] is most likely use case for having
PCIe AHCI enabled.


Ah, thanks for reminding me about this hat!  I saw it once or twice,
but I somehow forgot about it.  Yes, that's very nice, and surely a use
case for having AHCI support enabled.


[3] https://radxa.com/products/accessories/penta-sata-hat/

Regards,
Jonas



[2]
https://www.reddit.com/r/selfhosted/comments/s0bf1d/m2_sata_expansion_anyone_use_something_like_this/


I do think there will be many users of PCIe AHCI/SATA, but with this
series I try to get all boards to have same feature set as long as
there
is some way to use a feature.


I guess it can't hurt in the end.


[1] https://radxa.com/products/accessories/m2-extension-board


Change to SPL_MAX_SIZE=0x4, SPL can be up to 256 KiB.

Add ROCKCHIP_IODOMAIN=y to configure io-domain voltage.

Add PHY_REALTEK=y and DM_ETH_PHY=y to support ethernet PHY.

Remove SPL_TINY_MEMSET=y to use full memset in SPL.

Signed-off-by: Jonas Karlman 


Otherwise, looking good to me.

Reviewed-by: Dragan Simic 


Thanks!

Regards,
Jonas


---
 arch/arm/dts/rk3399-rock-4c-plus-u-boot.dtsi | 12 ++
 arch/arm/dts/rk3399-rock-4c-plus.dts |  1 +
 arch/arm/dts/rk3399-rock-4se-u-boot.dtsi | 12 ++
 arch/arm/dts/rk3399-rock-pi-4.dtsi   |  4 +++-
 arch/arm/dts/rk3399-rock-pi-4c-u-boot.dtsi   |  7 ++
 arch/arm/dts/rk3399-rock-pi-4c.dts   | 10 
 configs/rock-4c-plus-rk3399_defconfig| 24
+++-
 configs/rock-4se-rk3399_defconfig| 23
+--
 configs/rock-pi-4-rk3399_defconfig   |  8 +++
 configs/rock-pi-4c-rk3399_defconfig  | 24
++--
 10 files changed, 114 insertions(+), 11 deletions(-)


[snip]


Re: [PATCH 28/31] rockchip: rk3399-rock-pi-4: Sync device tree from linux v6.8

2024-03-31 Thread Jonas Karlman
On 2024-04-01 01:30, Dragan Simic wrote:
> On 2024-04-01 01:14, Jonas Karlman wrote:
>> On 2024-04-01 00:53, Dragan Simic wrote:
>>> Please see my comments below.
>>>
>>> On 2024-03-31 22:28, Jonas Karlman wrote:
 Sync rk3399-rock-pi-4 related device tree from linux v6.8.

 Add SPI flash related options to support booting from SPI flash.

 Add AHCI=y, SCSI_AHCI=y, AHCI_PCI=y and SCSI=y to support PCIe SATA
 boot.
>>>
>>> As we know, these boards have no standard connectors for PCI Express
>>> expansion cards, which makes me wonder how many users actually use M.2
>>> PCI Express modules with SATA controllers on them with these boards,
>>> and need support for them in U-Boot?
>>>
>>> I mean, it can't hurt, but frankly, I'm not 100% sure about it.
>>
>> With the M.2 Extension Board [1] and a M.2 to PCIe X4 adapter it is 
>> very
>> easy to convert the M.2 slot into a standard PCIe X4 slot and use it
>> with a PCIe SATA card. At least that is how I have tested and used 
>> this.
> 
> I was aware of the M.2 extension board sold by Radxa, but frankly,
> using it together with another adapter (M.2 to standard PCIe x4 slot)
> is a cumbersome setup.  The whole thing becomes at least three times
> the size of the SBC, with cables and a dangling PCIe card. :)

I know, it is not ideal, but works for my testing and development
proposes :-)

> 
> I had in mind an M.2 module with a PCIe SATA controller. [2]  Something
> like that, used together with the M.2 extension board, would actually
> make a rather neat setup.

I guess the Radxa Penta SATA HAT [3] is most likely use case for having
PCIe AHCI enabled.

[3] https://radxa.com/products/accessories/penta-sata-hat/

Regards,
Jonas

> 
> [2] 
> https://www.reddit.com/r/selfhosted/comments/s0bf1d/m2_sata_expansion_anyone_use_something_like_this/
> 
>> I do think there will be many users of PCIe AHCI/SATA, but with this
>> series I try to get all boards to have same feature set as long as 
>> there
>> is some way to use a feature.
> 
> I guess it can't hurt in the end.
> 
>> [1] https://radxa.com/products/accessories/m2-extension-board
>>
 Change to SPL_MAX_SIZE=0x4, SPL can be up to 256 KiB.

 Add ROCKCHIP_IODOMAIN=y to configure io-domain voltage.

 Add PHY_REALTEK=y and DM_ETH_PHY=y to support ethernet PHY.

 Remove SPL_TINY_MEMSET=y to use full memset in SPL.

 Signed-off-by: Jonas Karlman 
>>>
>>> Otherwise, looking good to me.
>>>
>>> Reviewed-by: Dragan Simic 
>>
>> Thanks!
>>
>> Regards,
>> Jonas
>>
 ---
  arch/arm/dts/rk3399-rock-4c-plus-u-boot.dtsi | 12 ++
  arch/arm/dts/rk3399-rock-4c-plus.dts |  1 +
  arch/arm/dts/rk3399-rock-4se-u-boot.dtsi | 12 ++
  arch/arm/dts/rk3399-rock-pi-4.dtsi   |  4 +++-
  arch/arm/dts/rk3399-rock-pi-4c-u-boot.dtsi   |  7 ++
  arch/arm/dts/rk3399-rock-pi-4c.dts   | 10 
  configs/rock-4c-plus-rk3399_defconfig| 24 
 +++-
  configs/rock-4se-rk3399_defconfig| 23 
 +--
  configs/rock-pi-4-rk3399_defconfig   |  8 +++
  configs/rock-pi-4c-rk3399_defconfig  | 24 
 ++--
  10 files changed, 114 insertions(+), 11 deletions(-)

>> [snip]



Re: [PATCH 28/31] rockchip: rk3399-rock-pi-4: Sync device tree from linux v6.8

2024-03-31 Thread Dragan Simic

On 2024-04-01 01:14, Jonas Karlman wrote:

On 2024-04-01 00:53, Dragan Simic wrote:

Please see my comments below.

On 2024-03-31 22:28, Jonas Karlman wrote:

Sync rk3399-rock-pi-4 related device tree from linux v6.8.

Add SPI flash related options to support booting from SPI flash.

Add AHCI=y, SCSI_AHCI=y, AHCI_PCI=y and SCSI=y to support PCIe SATA
boot.


As we know, these boards have no standard connectors for PCI Express
expansion cards, which makes me wonder how many users actually use M.2
PCI Express modules with SATA controllers on them with these boards,
and need support for them in U-Boot?

I mean, it can't hurt, but frankly, I'm not 100% sure about it.


With the M.2 Extension Board [1] and a M.2 to PCIe X4 adapter it is 
very

easy to convert the M.2 slot into a standard PCIe X4 slot and use it
with a PCIe SATA card. At least that is how I have tested and used 
this.


I was aware of the M.2 extension board sold by Radxa, but frankly,
using it together with another adapter (M.2 to standard PCIe x4 slot)
is a cumbersome setup.  The whole thing becomes at least three times
the size of the SBC, with cables and a dangling PCIe card. :)

I had in mind an M.2 module with a PCIe SATA controller. [2]  Something
like that, used together with the M.2 extension board, would actually
make a rather neat setup.

[2] 
https://www.reddit.com/r/selfhosted/comments/s0bf1d/m2_sata_expansion_anyone_use_something_like_this/



I do think there will be many users of PCIe AHCI/SATA, but with this
series I try to get all boards to have same feature set as long as 
there

is some way to use a feature.


I guess it can't hurt in the end.


[1] https://radxa.com/products/accessories/m2-extension-board


Change to SPL_MAX_SIZE=0x4, SPL can be up to 256 KiB.

Add ROCKCHIP_IODOMAIN=y to configure io-domain voltage.

Add PHY_REALTEK=y and DM_ETH_PHY=y to support ethernet PHY.

Remove SPL_TINY_MEMSET=y to use full memset in SPL.

Signed-off-by: Jonas Karlman 


Otherwise, looking good to me.

Reviewed-by: Dragan Simic 


Thanks!

Regards,
Jonas


---
 arch/arm/dts/rk3399-rock-4c-plus-u-boot.dtsi | 12 ++
 arch/arm/dts/rk3399-rock-4c-plus.dts |  1 +
 arch/arm/dts/rk3399-rock-4se-u-boot.dtsi | 12 ++
 arch/arm/dts/rk3399-rock-pi-4.dtsi   |  4 +++-
 arch/arm/dts/rk3399-rock-pi-4c-u-boot.dtsi   |  7 ++
 arch/arm/dts/rk3399-rock-pi-4c.dts   | 10 
 configs/rock-4c-plus-rk3399_defconfig| 24 
+++-
 configs/rock-4se-rk3399_defconfig| 23 
+--

 configs/rock-pi-4-rk3399_defconfig   |  8 +++
 configs/rock-pi-4c-rk3399_defconfig  | 24 
++--

 10 files changed, 114 insertions(+), 11 deletions(-)


[snip]


Re: [PATCH 28/31] rockchip: rk3399-rock-pi-4: Sync device tree from linux v6.8

2024-03-31 Thread Jonas Karlman
Hi Dragan,

On 2024-04-01 00:53, Dragan Simic wrote:
> Hello Jonas,
> 
> Please see my comments below.
> 
> On 2024-03-31 22:28, Jonas Karlman wrote:
>> Sync rk3399-rock-pi-4 related device tree from linux v6.8.
>>
>> Add SPI flash related options to support booting from SPI flash.
>>
>> Add AHCI=y, SCSI_AHCI=y, AHCI_PCI=y and SCSI=y to support PCIe SATA 
>> boot.
> 
> As we know, these boards have no standard connectors for PCI Express
> expansion cards, which makes me wonder how many users actually use M.2
> PCI Express modules with SATA controllers on them with these boards,
> and need support for them in U-Boot?
> 
> I mean, it can't hurt, but frankly, I'm not 100% sure about it.

With the M.2 Extension Board [1] and a M.2 to PCIe X4 adapter it is very
easy to convert the M.2 slot into a standard PCIe X4 slot and use it
with a PCIe SATA card. At least that is how I have tested and used this.

I do think there will be many users of PCIe AHCI/SATA, but with this
series I try to get all boards to have same feature set as long as there
is some way to use a feature.

[1] https://radxa.com/products/accessories/m2-extension-board

> 
>> Change to SPL_MAX_SIZE=0x4, SPL can be up to 256 KiB.
>>
>> Add ROCKCHIP_IODOMAIN=y to configure io-domain voltage.
>>
>> Add PHY_REALTEK=y and DM_ETH_PHY=y to support ethernet PHY.
>>
>> Remove SPL_TINY_MEMSET=y to use full memset in SPL.
>>
>> Signed-off-by: Jonas Karlman 
> 
> Otherwise, looking good to me.
> 
> Reviewed-by: Dragan Simic 

Thanks!

Regards,
Jonas

> 
>> ---
>>  arch/arm/dts/rk3399-rock-4c-plus-u-boot.dtsi | 12 ++
>>  arch/arm/dts/rk3399-rock-4c-plus.dts |  1 +
>>  arch/arm/dts/rk3399-rock-4se-u-boot.dtsi | 12 ++
>>  arch/arm/dts/rk3399-rock-pi-4.dtsi   |  4 +++-
>>  arch/arm/dts/rk3399-rock-pi-4c-u-boot.dtsi   |  7 ++
>>  arch/arm/dts/rk3399-rock-pi-4c.dts   | 10 
>>  configs/rock-4c-plus-rk3399_defconfig| 24 +++-
>>  configs/rock-4se-rk3399_defconfig| 23 +--
>>  configs/rock-pi-4-rk3399_defconfig   |  8 +++
>>  configs/rock-pi-4c-rk3399_defconfig  | 24 ++--
>>  10 files changed, 114 insertions(+), 11 deletions(-)
>>
[snip]


Re: [PATCH 28/31] rockchip: rk3399-rock-pi-4: Sync device tree from linux v6.8

2024-03-31 Thread Dragan Simic

Hello Jonas,

Please see my comments below.

On 2024-03-31 22:28, Jonas Karlman wrote:

Sync rk3399-rock-pi-4 related device tree from linux v6.8.

Add SPI flash related options to support booting from SPI flash.

Add AHCI=y, SCSI_AHCI=y, AHCI_PCI=y and SCSI=y to support PCIe SATA 
boot.


As we know, these boards have no standard connectors for PCI Express
expansion cards, which makes me wonder how many users actually use M.2
PCI Express modules with SATA controllers on them with these boards,
and need support for them in U-Boot?

I mean, it can't hurt, but frankly, I'm not 100% sure about it.


Change to SPL_MAX_SIZE=0x4, SPL can be up to 256 KiB.

Add ROCKCHIP_IODOMAIN=y to configure io-domain voltage.

Add PHY_REALTEK=y and DM_ETH_PHY=y to support ethernet PHY.

Remove SPL_TINY_MEMSET=y to use full memset in SPL.

Signed-off-by: Jonas Karlman 


Otherwise, looking good to me.

Reviewed-by: Dragan Simic 


---
 arch/arm/dts/rk3399-rock-4c-plus-u-boot.dtsi | 12 ++
 arch/arm/dts/rk3399-rock-4c-plus.dts |  1 +
 arch/arm/dts/rk3399-rock-4se-u-boot.dtsi | 12 ++
 arch/arm/dts/rk3399-rock-pi-4.dtsi   |  4 +++-
 arch/arm/dts/rk3399-rock-pi-4c-u-boot.dtsi   |  7 ++
 arch/arm/dts/rk3399-rock-pi-4c.dts   | 10 
 configs/rock-4c-plus-rk3399_defconfig| 24 +++-
 configs/rock-4se-rk3399_defconfig| 23 +--
 configs/rock-pi-4-rk3399_defconfig   |  8 +++
 configs/rock-pi-4c-rk3399_defconfig  | 24 ++--
 10 files changed, 114 insertions(+), 11 deletions(-)

diff --git a/arch/arm/dts/rk3399-rock-4c-plus-u-boot.dtsi
b/arch/arm/dts/rk3399-rock-4c-plus-u-boot.dtsi
index 9785b97b9eea..b5ee644a83dd 100644
--- a/arch/arm/dts/rk3399-rock-4c-plus-u-boot.dtsi
+++ b/arch/arm/dts/rk3399-rock-4c-plus-u-boot.dtsi
@@ -11,3 +11,15 @@
 _pull_up_8ma {
bootph-pre-ram;
 };
+
+ {
+   status = "okay";
+
+   flash@0 {
+   bootph-pre-ram;
+   bootph-some-ram;
+   compatible = "jedec,spi-nor";
+   reg = <0>;
+   spi-max-frequency = <1000>;
+   };
+};
diff --git a/arch/arm/dts/rk3399-rock-4c-plus.dts
b/arch/arm/dts/rk3399-rock-4c-plus.dts
index 8bfd5f88d1ef..7baf9d1b22fd 100644
--- a/arch/arm/dts/rk3399-rock-4c-plus.dts
+++ b/arch/arm/dts/rk3399-rock-4c-plus.dts
@@ -15,6 +15,7 @@
compatible = "radxa,rock-4c-plus", "rockchip,rk3399";

aliases {
+   ethernet0 = 
mmc0 = 
mmc1 = 
};
diff --git a/arch/arm/dts/rk3399-rock-4se-u-boot.dtsi
b/arch/arm/dts/rk3399-rock-4se-u-boot.dtsi
index 85ee5770add0..2213d0093052 100644
--- a/arch/arm/dts/rk3399-rock-4se-u-boot.dtsi
+++ b/arch/arm/dts/rk3399-rock-4se-u-boot.dtsi
@@ -4,3 +4,15 @@
  */

 #include "rk3399-rock-pi-4-u-boot.dtsi"
+
+ {
+   status = "okay";
+
+   flash@0 {
+   bootph-pre-ram;
+   bootph-some-ram;
+   compatible = "jedec,spi-nor";
+   reg = <0>;
+   spi-max-frequency = <1000>;
+   };
+};
diff --git a/arch/arm/dts/rk3399-rock-pi-4.dtsi
b/arch/arm/dts/rk3399-rock-pi-4.dtsi
index b1b7f4ffb1d4..281a12180703 100644
--- a/arch/arm/dts/rk3399-rock-pi-4.dtsi
+++ b/arch/arm/dts/rk3399-rock-pi-4.dtsi
@@ -12,6 +12,7 @@

 / {
aliases {
+   ethernet0 = 
mmc0 = 
mmc1 = 
};
@@ -44,7 +45,7 @@
sdio_pwrseq: sdio-pwrseq {
compatible = "mmc-pwrseq-simple";
clocks = < 1>;
-   clock-names = "ext_clock";
+   clock-names = "lpo";
pinctrl-names = "default";
pinctrl-0 = <_enable_h>;
reset-gpios = < RK_PB2 GPIO_ACTIVE_LOW>;
@@ -492,6 +493,7 @@

  {
pinctrl-0 = <_2ch_bus>;
+   pinctrl-1 = <_2ch_bus_bclk_off>;
rockchip,capture-channels = <2>;
rockchip,playback-channels = <2>;
status = "okay";
diff --git a/arch/arm/dts/rk3399-rock-pi-4c-u-boot.dtsi
b/arch/arm/dts/rk3399-rock-pi-4c-u-boot.dtsi
index 85ee5770add0..38385621deb1 100644
--- a/arch/arm/dts/rk3399-rock-pi-4c-u-boot.dtsi
+++ b/arch/arm/dts/rk3399-rock-pi-4c-u-boot.dtsi
@@ -4,3 +4,10 @@
  */

 #include "rk3399-rock-pi-4-u-boot.dtsi"
+
+ {
+   flash@0 {
+   bootph-pre-ram;
+   bootph-some-ram;
+   };
+};
diff --git a/arch/arm/dts/rk3399-rock-pi-4c.dts
b/arch/arm/dts/rk3399-rock-pi-4c.dts
index d32efab74e94..de2ebe4cb4f3 100644
--- a/arch/arm/dts/rk3399-rock-pi-4c.dts
+++ b/arch/arm/dts/rk3399-rock-pi-4c.dts
@@ -43,6 +43,16 @@
hp-det-gpio = < RK_PA0 GPIO_ACTIVE_HIGH>;
 };

+ {
+   status = "okay";
+
+   flash@0 {
+   compatible = "jedec,spi-nor";
+   reg = <0>;
+   spi-max-frequency = <1000>;
+   };
+};
+
  {
status = "okay";

diff --git a/configs/rock-4c-plus-rk3399_defconfig

[PATCH 28/31] rockchip: rk3399-rock-pi-4: Sync device tree from linux v6.8

2024-03-31 Thread Jonas Karlman
Sync rk3399-rock-pi-4 related device tree from linux v6.8.

Add SPI flash related options to support booting from SPI flash.

Add AHCI=y, SCSI_AHCI=y, AHCI_PCI=y and SCSI=y to support PCIe SATA boot.

Change to SPL_MAX_SIZE=0x4, SPL can be up to 256 KiB.

Add ROCKCHIP_IODOMAIN=y to configure io-domain voltage.

Add PHY_REALTEK=y and DM_ETH_PHY=y to support ethernet PHY.

Remove SPL_TINY_MEMSET=y to use full memset in SPL.

Signed-off-by: Jonas Karlman 
---
 arch/arm/dts/rk3399-rock-4c-plus-u-boot.dtsi | 12 ++
 arch/arm/dts/rk3399-rock-4c-plus.dts |  1 +
 arch/arm/dts/rk3399-rock-4se-u-boot.dtsi | 12 ++
 arch/arm/dts/rk3399-rock-pi-4.dtsi   |  4 +++-
 arch/arm/dts/rk3399-rock-pi-4c-u-boot.dtsi   |  7 ++
 arch/arm/dts/rk3399-rock-pi-4c.dts   | 10 
 configs/rock-4c-plus-rk3399_defconfig| 24 +++-
 configs/rock-4se-rk3399_defconfig| 23 +--
 configs/rock-pi-4-rk3399_defconfig   |  8 +++
 configs/rock-pi-4c-rk3399_defconfig  | 24 ++--
 10 files changed, 114 insertions(+), 11 deletions(-)

diff --git a/arch/arm/dts/rk3399-rock-4c-plus-u-boot.dtsi 
b/arch/arm/dts/rk3399-rock-4c-plus-u-boot.dtsi
index 9785b97b9eea..b5ee644a83dd 100644
--- a/arch/arm/dts/rk3399-rock-4c-plus-u-boot.dtsi
+++ b/arch/arm/dts/rk3399-rock-4c-plus-u-boot.dtsi
@@ -11,3 +11,15 @@
 _pull_up_8ma {
bootph-pre-ram;
 };
+
+ {
+   status = "okay";
+
+   flash@0 {
+   bootph-pre-ram;
+   bootph-some-ram;
+   compatible = "jedec,spi-nor";
+   reg = <0>;
+   spi-max-frequency = <1000>;
+   };
+};
diff --git a/arch/arm/dts/rk3399-rock-4c-plus.dts 
b/arch/arm/dts/rk3399-rock-4c-plus.dts
index 8bfd5f88d1ef..7baf9d1b22fd 100644
--- a/arch/arm/dts/rk3399-rock-4c-plus.dts
+++ b/arch/arm/dts/rk3399-rock-4c-plus.dts
@@ -15,6 +15,7 @@
compatible = "radxa,rock-4c-plus", "rockchip,rk3399";
 
aliases {
+   ethernet0 = 
mmc0 = 
mmc1 = 
};
diff --git a/arch/arm/dts/rk3399-rock-4se-u-boot.dtsi 
b/arch/arm/dts/rk3399-rock-4se-u-boot.dtsi
index 85ee5770add0..2213d0093052 100644
--- a/arch/arm/dts/rk3399-rock-4se-u-boot.dtsi
+++ b/arch/arm/dts/rk3399-rock-4se-u-boot.dtsi
@@ -4,3 +4,15 @@
  */
 
 #include "rk3399-rock-pi-4-u-boot.dtsi"
+
+ {
+   status = "okay";
+
+   flash@0 {
+   bootph-pre-ram;
+   bootph-some-ram;
+   compatible = "jedec,spi-nor";
+   reg = <0>;
+   spi-max-frequency = <1000>;
+   };
+};
diff --git a/arch/arm/dts/rk3399-rock-pi-4.dtsi 
b/arch/arm/dts/rk3399-rock-pi-4.dtsi
index b1b7f4ffb1d4..281a12180703 100644
--- a/arch/arm/dts/rk3399-rock-pi-4.dtsi
+++ b/arch/arm/dts/rk3399-rock-pi-4.dtsi
@@ -12,6 +12,7 @@
 
 / {
aliases {
+   ethernet0 = 
mmc0 = 
mmc1 = 
};
@@ -44,7 +45,7 @@
sdio_pwrseq: sdio-pwrseq {
compatible = "mmc-pwrseq-simple";
clocks = < 1>;
-   clock-names = "ext_clock";
+   clock-names = "lpo";
pinctrl-names = "default";
pinctrl-0 = <_enable_h>;
reset-gpios = < RK_PB2 GPIO_ACTIVE_LOW>;
@@ -492,6 +493,7 @@
 
  {
pinctrl-0 = <_2ch_bus>;
+   pinctrl-1 = <_2ch_bus_bclk_off>;
rockchip,capture-channels = <2>;
rockchip,playback-channels = <2>;
status = "okay";
diff --git a/arch/arm/dts/rk3399-rock-pi-4c-u-boot.dtsi 
b/arch/arm/dts/rk3399-rock-pi-4c-u-boot.dtsi
index 85ee5770add0..38385621deb1 100644
--- a/arch/arm/dts/rk3399-rock-pi-4c-u-boot.dtsi
+++ b/arch/arm/dts/rk3399-rock-pi-4c-u-boot.dtsi
@@ -4,3 +4,10 @@
  */
 
 #include "rk3399-rock-pi-4-u-boot.dtsi"
+
+ {
+   flash@0 {
+   bootph-pre-ram;
+   bootph-some-ram;
+   };
+};
diff --git a/arch/arm/dts/rk3399-rock-pi-4c.dts 
b/arch/arm/dts/rk3399-rock-pi-4c.dts
index d32efab74e94..de2ebe4cb4f3 100644
--- a/arch/arm/dts/rk3399-rock-pi-4c.dts
+++ b/arch/arm/dts/rk3399-rock-pi-4c.dts
@@ -43,6 +43,16 @@
hp-det-gpio = < RK_PA0 GPIO_ACTIVE_HIGH>;
 };
 
+ {
+   status = "okay";
+
+   flash@0 {
+   compatible = "jedec,spi-nor";
+   reg = <0>;
+   spi-max-frequency = <1000>;
+   };
+};
+
  {
status = "okay";
 
diff --git a/configs/rock-4c-plus-rk3399_defconfig 
b/configs/rock-4c-plus-rk3399_defconfig
index 2024defb2bf0..e97fde17acc2 100644
--- a/configs/rock-4c-plus-rk3399_defconfig
+++ b/configs/rock-4c-plus-rk3399_defconfig
@@ -3,22 +3,27 @@ CONFIG_SKIP_LOWLEVEL_INIT=y
 CONFIG_COUNTER_FREQUENCY=2400
 CONFIG_ARCH_ROCKCHIP=y
 CONFIG_NR_DRAM_BANKS=1
+CONFIG_SF_DEFAULT_SPEED=1000
 CONFIG_ENV_OFFSET=0x3F8000
 CONFIG_DEFAULT_DEVICE_TREE="rk3399-rock-4c-plus"
 CONFIG_DM_RESET=y
 CONFIG_ROCKCHIP_RK3399=y