[PATCH 0/3] Support SDMA mode on RPI4 target - 32bit

Matthias Brugger mbrugger at suse.com
Sat Feb 1 23:58:13 CET 2020



On 30/01/2020 23:14, Jaehoon Chung wrote:
> On 1/30/20 8:27 PM, Matthias Brugger wrote:
>>
>>
>> On 30/01/2020 12:24, Matthias Brugger wrote:
>>>
>>>
>>> On 23/01/2020 00:15, Jaehoon Chung wrote:
>>>> RPI4's SDHCI controller is supported SDMA mode. (Checked on kernel side)
>>>> But It doesn't use on u-boot side. Then it's too slow about read/write performance.
>>>> This patchset is supported SDMA mode on RPI4 target(32bit).
>>>> - I didn't test on RPI4 64bit.
>>>
>>> I tested it on RPi4 64bit:
>>> diff --git a/configs/rpi_4_defconfig b/configs/rpi_4_defconfig
>>> index 17ecad3aa5..6f5a2dd6e8 100644
>>> --- a/configs/rpi_4_defconfig
>>> +++ b/configs/rpi_4_defconfig
>>> @@ -26,6 +26,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
>>>
>>> Changed the debug to a printf and gave it a try:
>>> U-Boot 2020.04-rc1-00010-ga963cbc9e0-dirty (Jan 30 2020 - 12:18:02 +0100)
>>>
>>> DRAM:  1.9 GiB
>>> RPI 4 Model B (0xb03111)
>>> MMC:   sdhci_setup_cfg: Your controller doesn't support SDMA!!
>>> emmc2 at 7e340000: 0, mmcnr at 7e300000: 1
>>>
>>> That's at least surprising. Any idea why it should be supported on 32 bit but
>>> not on 64 bit?
>>> Or did you add DTS properties to enable SDMA?
>>
>> Ok, never mind. I realized that this is the other controller used for Wifi,
>> sorry for the noise!
> 
> Yes, It's used for WiFi. So it's displayed unnecessary log.
> It's possible to confuse whether SDMA is not supported or not.
> So i changed from printf to debug. 

Hm I'm not sure which is the best way to go.
Actually in the RPi4 we have two sdhci controllers with two different
compatibles. So one support SDMA (brcm,bcm2711-emmc2) while the other
(brcm,bcm2815-sdhci) does not. So I see two possible ways to fix this.

First, add a sdhci-caps-mask to the bcm2835-sdhci device tree node to disable
the SDMA flag.

A second posibility would be to add a flag to disable (S)DMA caps in
sdhci_setup_cfg().

On the other hand the kernel only prints in the debug mode that the SDMA
controller is not present. Peng what's the background that you want to keep it a
printf?

Regards,
Matthias

> Instead, i will also send patch about displaying host controller information.
> like the below..(I'm making patches.)
> 
> U-Boot> mmcinfo
> Device: emmc2 at 7e340000
> Manufacturer ID: 3
> OEM: 5344
> Name: SC16G
> Bus Speed: 50000000
> Mode: SD High Speed (50MHz)
> Rd Block Len: 512
> SD version 3.0
> High Capacity: Yes
> Capacity: 14.8 GiB
> Bus Width: 4-bit
> Erase Group Size: 512 Bytes
> **Host Controller Information**
> Host Controller: SDHCI
> Mode : PIO
> SDHCI version : 2
> Host max clock : 100000000
> 
> Then it doesn't need to display "sdhci_setup_cfg: Your controller doesn't support SDMA!!".
> How about?
> 
> And my next step is the enabling UHS speed mode.(if it's possible.) But i don't have enough RPI4 information.
> - SD card's vmmc regulator information, etc...
> 
> Anyway, Peng and you want to keep "printf" instead of "debug".
> I will resend patch.
> 
> Best Regards,
> Jaehoon Chung
> 
>>
>> Regards,
>> Matthias
>>
>>>
>>> Regards,
>>> Matthias
>>>
>>>>
>>>> Read/write time about 8MB file
>>>> Before
>>>> - Read : 1.472 seconds
>>>> - Write : 4.690 seconds
>>>> After
>>>> - Read : 0.359 seconds
>>>> - Write : 0.574 seconds
>>>>
>>>> This patch is based on my RFC's patches.
>>>>
>>>> Jaehoon Chung (3):
>>>>   mmc: sdhci: use phys2bus macro when dma address is accessed
>>>>   mmc: sdhci: not return error when SDMA is not supported
>>>>   configs: rpi_4_32b_defconfig: enable SDHCI_SDMA config
>>>>
>>>>  configs/rpi_4_32b_defconfig |  1 +
>>>>  drivers/mmc/sdhci.c         | 16 +++++++++-------
>>>>  2 files changed, 10 insertions(+), 7 deletions(-)
>>>>
>>
>>
> 


More information about the U-Boot mailing list