Re: [PATCH v2 3/5] rockchip: rockpro64: Use SDMA to boost eMMC performance

2023-05-17 Thread Jonas Karlman
Hi Peter,

On 2023-05-17 21:07, Peter Robinson wrote:
> On Wed, May 17, 2023 at 7:41 PM Jonas Karlman  wrote:
>>
>> Enable the use of SDMA mode to boost eMMC performance on RockPro64.
>> Also add missing flags to indicate the supported MMC modes.
>>
>> Using mmc read command to read 32 MiB data shows following improvement:
>>
>>   => time mmc read 1000 2000 1
>>
>> Before: time: 3.178 seconds
>> After: time: 0.402 seconds
>>
>> This also enables CONFIG_SPL_FIT_SIGNATURE option to help discover
>> any possible future issue with loading TF-A into DRAM/SRAM.
>>
>> Signed-off-by: Jonas Karlman 
>> Reviewed-by: Kever Yang 
>> ---
>> v2:
>> - Collect r-b tag
>>
>>  arch/arm/dts/rk3399-rockpro64-u-boot.dtsi | 5 +
>>  configs/rockpro64-rk3399_defconfig| 2 ++
>>  2 files changed, 7 insertions(+)
>>
>> diff --git a/arch/arm/dts/rk3399-rockpro64-u-boot.dtsi 
>> b/arch/arm/dts/rk3399-rockpro64-u-boot.dtsi
>> index 32a83b2855ac..bd864d067018 100644
>> --- a/arch/arm/dts/rk3399-rockpro64-u-boot.dtsi
>> +++ b/arch/arm/dts/rk3399-rockpro64-u-boot.dtsi
>> @@ -15,6 +15,11 @@
>> };
>>  };
>>
>> +&sdhci {
>> +   cap-mmc-highspeed;
>> +   mmc-ddr-1_8v;
>> +};
> 
> Has this been submitted for the upstream Linux kernel DT? The
> u-boot.dtsi isn't meant to be a general dumping ground for things that
> should be going upstream. Does it work with the Linux kernel as well
> as those people that boot using firmware provided DT will get this as
> well.

It has not been submitted for upstream linux device tree yet. I have
patches pending for rk3399-rockpro64 and some rk35xx devices in my local
tree, hoping to have them submitted any day now.

This should work with linux, however linux should pick the hs200 mode
over ddr52 mode.

With hs200 mode Kconfig enabled in u-boot the above test cmd result
in ~0.2 seconds.

Regards,
Jonas

> 
> Peter
> 
>>  &spi1 {
>> spi_flash: flash@0 {
>> bootph-all;
>> diff --git a/configs/rockpro64-rk3399_defconfig 
>> b/configs/rockpro64-rk3399_defconfig
>> index 2b89b1baba51..0ca2cecade25 100644
>> --- a/configs/rockpro64-rk3399_defconfig
>> +++ b/configs/rockpro64-rk3399_defconfig
>> @@ -20,6 +20,7 @@ CONFIG_SPL_SPI=y
>>  CONFIG_SYS_LOAD_ADDR=0x800800
>>  CONFIG_PCI=y
>>  CONFIG_DEBUG_UART=y
>> +CONFIG_SPL_FIT_SIGNATURE=y
>>  CONFIG_BOOTSTAGE=y
>>  CONFIG_BOOTSTAGE_REPORT=y
>>  CONFIG_USE_PREBOOT=y
>> @@ -63,6 +64,7 @@ CONFIG_ROCKCHIP_EFUSE=y
>>  CONFIG_MMC_DW=y
>>  CONFIG_MMC_DW_ROCKCHIP=y
>>  CONFIG_MMC_SDHCI=y
>> +CONFIG_MMC_SDHCI_SDMA=y
>>  CONFIG_MMC_SDHCI_ROCKCHIP=y
>>  CONFIG_SF_DEFAULT_BUS=1
>>  CONFIG_SPI_FLASH_GIGADEVICE=y
>> --
>> 2.40.1
>>



Re: [PATCH v2 3/5] rockchip: rockpro64: Use SDMA to boost eMMC performance

2023-05-17 Thread Peter Robinson
On Wed, May 17, 2023 at 7:41 PM Jonas Karlman  wrote:
>
> Enable the use of SDMA mode to boost eMMC performance on RockPro64.
> Also add missing flags to indicate the supported MMC modes.
>
> Using mmc read command to read 32 MiB data shows following improvement:
>
>   => time mmc read 1000 2000 1
>
> Before: time: 3.178 seconds
> After: time: 0.402 seconds
>
> This also enables CONFIG_SPL_FIT_SIGNATURE option to help discover
> any possible future issue with loading TF-A into DRAM/SRAM.
>
> Signed-off-by: Jonas Karlman 
> Reviewed-by: Kever Yang 
> ---
> v2:
> - Collect r-b tag
>
>  arch/arm/dts/rk3399-rockpro64-u-boot.dtsi | 5 +
>  configs/rockpro64-rk3399_defconfig| 2 ++
>  2 files changed, 7 insertions(+)
>
> diff --git a/arch/arm/dts/rk3399-rockpro64-u-boot.dtsi 
> b/arch/arm/dts/rk3399-rockpro64-u-boot.dtsi
> index 32a83b2855ac..bd864d067018 100644
> --- a/arch/arm/dts/rk3399-rockpro64-u-boot.dtsi
> +++ b/arch/arm/dts/rk3399-rockpro64-u-boot.dtsi
> @@ -15,6 +15,11 @@
> };
>  };
>
> +&sdhci {
> +   cap-mmc-highspeed;
> +   mmc-ddr-1_8v;
> +};

Has this been submitted for the upstream Linux kernel DT? The
u-boot.dtsi isn't meant to be a general dumping ground for things that
should be going upstream. Does it work with the Linux kernel as well
as those people that boot using firmware provided DT will get this as
well.

Peter

>  &spi1 {
> spi_flash: flash@0 {
> bootph-all;
> diff --git a/configs/rockpro64-rk3399_defconfig 
> b/configs/rockpro64-rk3399_defconfig
> index 2b89b1baba51..0ca2cecade25 100644
> --- a/configs/rockpro64-rk3399_defconfig
> +++ b/configs/rockpro64-rk3399_defconfig
> @@ -20,6 +20,7 @@ CONFIG_SPL_SPI=y
>  CONFIG_SYS_LOAD_ADDR=0x800800
>  CONFIG_PCI=y
>  CONFIG_DEBUG_UART=y
> +CONFIG_SPL_FIT_SIGNATURE=y
>  CONFIG_BOOTSTAGE=y
>  CONFIG_BOOTSTAGE_REPORT=y
>  CONFIG_USE_PREBOOT=y
> @@ -63,6 +64,7 @@ CONFIG_ROCKCHIP_EFUSE=y
>  CONFIG_MMC_DW=y
>  CONFIG_MMC_DW_ROCKCHIP=y
>  CONFIG_MMC_SDHCI=y
> +CONFIG_MMC_SDHCI_SDMA=y
>  CONFIG_MMC_SDHCI_ROCKCHIP=y
>  CONFIG_SF_DEFAULT_BUS=1
>  CONFIG_SPI_FLASH_GIGADEVICE=y
> --
> 2.40.1
>