diff mbox series

[v3,3/3] configs: rpi_4_32b_defconfig: enable SDHCI_SDMA config

Message ID 20200324225859.8462-4-jh80.chung@samsung.com
State New
Headers show
Series Support SDMA mode on RPI4 target - 32bit | expand

Commit Message

Jaehoon Chung March 24, 2020, 10:58 p.m. UTC
Enable SDHCI_SDMA configuration.

Signed-off-by: Jaehoon Chung <jh80.chung at samsung.com>
Reviewed-by: Peng Fan <peng.fan at nxp.com>
Reviewed-by: Minkyu Kang <mk7.kang at samsung.com>
---
 configs/rpi_4_32b_defconfig | 1 +
 1 file changed, 1 insertion(+)

Comments

Matthias Brugger March 25, 2020, 4:09 p.m. UTC | #1
On 24/03/2020 23:58, Jaehoon Chung wrote:
> Enable SDHCI_SDMA configuration.
> 
> Signed-off-by: Jaehoon Chung <jh80.chung at samsung.com>
> Reviewed-by: Peng Fan <peng.fan at nxp.com>
> Reviewed-by: Minkyu Kang <mk7.kang at samsung.com>
> ---
>  configs/rpi_4_32b_defconfig | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/configs/rpi_4_32b_defconfig b/configs/rpi_4_32b_defconfig
> index 72cda5d949..7189914606 100644
> --- a/configs/rpi_4_32b_defconfig
> +++ b/configs/rpi_4_32b_defconfig
> @@ -25,6 +25,7 @@ CONFIG_DFU_MMC=y
>  CONFIG_DM_KEYBOARD=y
>  CONFIG_DM_MMC=y
>  CONFIG_MMC_SDHCI=y
> +CONFIG_MMC_SDHCI_SDMA=y

RPi4 can only do DMA transfers to the first GiB of memory. I wasn't sucessfull
in understanding the mmc/sdhci code to see where we take the dma-ranges property
into account so that we don't use an address > 1 GiB.

Are we safe in this regard? If we are, then we can also enable this for
rpi_4_defconfig and rpi_arm64_defconfig I think.

Regards,
Matthias

>  CONFIG_MMC_SDHCI_BCM2835=y
>  CONFIG_DM_ETH=y
>  CONFIG_BCMGENET=y
>
Jaehoon Chung March 26, 2020, 4:51 a.m. UTC | #2
On 3/26/20 1:09 AM, Matthias Brugger wrote:
> 
> 
> On 24/03/2020 23:58, Jaehoon Chung wrote:
>> Enable SDHCI_SDMA configuration.
>>
>> Signed-off-by: Jaehoon Chung <jh80.chung at samsung.com>
>> Reviewed-by: Peng Fan <peng.fan at nxp.com>
>> Reviewed-by: Minkyu Kang <mk7.kang at samsung.com>
>> ---
>>  configs/rpi_4_32b_defconfig | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/configs/rpi_4_32b_defconfig b/configs/rpi_4_32b_defconfig
>> index 72cda5d949..7189914606 100644
>> --- a/configs/rpi_4_32b_defconfig
>> +++ b/configs/rpi_4_32b_defconfig
>> @@ -25,6 +25,7 @@ CONFIG_DFU_MMC=y
>>  CONFIG_DM_KEYBOARD=y
>>  CONFIG_DM_MMC=y
>>  CONFIG_MMC_SDHCI=y
>> +CONFIG_MMC_SDHCI_SDMA=y
> 
> RPi4 can only do DMA transfers to the first GiB of memory. I wasn't sucessfull
> in understanding the mmc/sdhci code to see where we take the dma-ranges property
> into account so that we don't use an address > 1 GiB.

Sorry i don't understand clearly what you said.

> 
> Are we safe in this regard? If we are, then we can also enable this for
> rpi_4_defconfig and rpi_arm64_defconfig I think.

I checked rpi_arm64_defconfig history. it's unified config for RPi3/RPI4.
As i know, RPi3 doesn't support SDMA mode. So i don't have a plan to apply rpi_arm64_defconfig.
(If i understood wrong, let me know,plz.)

I have tested SDMA mode With rpi_4_defconfig / rpi_4_32b_defconfig.
Test Environment
- Target : RPI4 (1G/2G/4G) target
- config : rpi_4_defconfig / rpi_4_32b_defconfig

Read/write some files from Sd-card.
Read/write performance is increased than before.

I will resend with rpi_4_defconfig, except rpi_arm64_defconfig.

Best Regards,
Jaehoon Chung

> 
> Regards,
> Matthias
> 
>>  CONFIG_MMC_SDHCI_BCM2835=y
>>  CONFIG_DM_ETH=y
>>  CONFIG_BCMGENET=y
>>
> 
>
Matthias Brugger March 26, 2020, 8:46 a.m. UTC | #3
On 26/03/2020 05:51, Jaehoon Chung wrote:
> On 3/26/20 1:09 AM, Matthias Brugger wrote:
>>
>>
>> On 24/03/2020 23:58, Jaehoon Chung wrote:
>>> Enable SDHCI_SDMA configuration.
>>>
>>> Signed-off-by: Jaehoon Chung <jh80.chung at samsung.com>
>>> Reviewed-by: Peng Fan <peng.fan at nxp.com>
>>> Reviewed-by: Minkyu Kang <mk7.kang at samsung.com>
>>> ---
>>>  configs/rpi_4_32b_defconfig | 1 +
>>>  1 file changed, 1 insertion(+)
>>>
>>> diff --git a/configs/rpi_4_32b_defconfig b/configs/rpi_4_32b_defconfig
>>> index 72cda5d949..7189914606 100644
>>> --- a/configs/rpi_4_32b_defconfig
>>> +++ b/configs/rpi_4_32b_defconfig
>>> @@ -25,6 +25,7 @@ CONFIG_DFU_MMC=y
>>>  CONFIG_DM_KEYBOARD=y
>>>  CONFIG_DM_MMC=y
>>>  CONFIG_MMC_SDHCI=y
>>> +CONFIG_MMC_SDHCI_SDMA=y
>>
>> RPi4 can only do DMA transfers to the first GiB of memory. I wasn't sucessfull
>> in understanding the mmc/sdhci code to see where we take the dma-ranges property
>> into account so that we don't use an address > 1 GiB.
> 
> Sorry i don't understand clearly what you said.
> 

I'll try to rephrase:
How do we make sure that DMA uses only addresses the in the first GiB of RAM for
it's transactions. That a limitation the RPi4 has.

>>
>> Are we safe in this regard? If we are, then we can also enable this for
>> rpi_4_defconfig and rpi_arm64_defconfig I think.
> 
> I checked rpi_arm64_defconfig history. it's unified config for RPi3/RPI4.
> As i know, RPi3 doesn't support SDMA mode. So i don't have a plan to apply rpi_arm64_defconfig.
> (If i understood wrong, let me know,plz.)
> 

Yes, well we have two different device tree compatibles for them. We have to
change the driver to make sure only sdhci of RPi4 does enable SDMA.

Regards,
Matthias

> I have tested SDMA mode With rpi_4_defconfig / rpi_4_32b_defconfig.
> Test Environment
> - Target : RPI4 (1G/2G/4G) target
> - config : rpi_4_defconfig / rpi_4_32b_defconfig
> 
> Read/write some files from Sd-card.
> Read/write performance is increased than before.
> 
> I will resend with rpi_4_defconfig, except rpi_arm64_defconfig.
> 
> Best Regards,
> Jaehoon Chung
> 
>>
>> Regards,
>> Matthias
>>
>>>  CONFIG_MMC_SDHCI_BCM2835=y
>>>  CONFIG_DM_ETH=y
>>>  CONFIG_BCMGENET=y
>>>
>>
>>
>
diff mbox series

Patch

diff --git a/configs/rpi_4_32b_defconfig b/configs/rpi_4_32b_defconfig
index 72cda5d949..7189914606 100644
--- a/configs/rpi_4_32b_defconfig
+++ b/configs/rpi_4_32b_defconfig
@@ -25,6 +25,7 @@  CONFIG_DFU_MMC=y
 CONFIG_DM_KEYBOARD=y
 CONFIG_DM_MMC=y
 CONFIG_MMC_SDHCI=y
+CONFIG_MMC_SDHCI_SDMA=y
 CONFIG_MMC_SDHCI_BCM2835=y
 CONFIG_DM_ETH=y
 CONFIG_BCMGENET=y