Skip to content

Support SDMA mode on RPI4 target - 32bit

Matthias Brugger u-boot 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest0 of 3 patches 0 repliesNew

Patches in v1 No applies recorded yet

None of the 3 patches the cover letter announces are in this archive.

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/3] Support SDMA mode on RPI4 target - 32bit
Quoted 41 lines · Jaehoon Chung
Quoted 33 lines · Matthias Brugger
Quoted 30 lines · Matthias Brugger
Quoted 4 lines · Jaehoon Chung

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:

configs/rpi_4_defconfig +1 -0
index 17ecad3aa5..6f5a2dd6e8 100644
@@ -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

Quoted 6 lines
Quoted 3 lines

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!

Quoted 3 lines

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

Quoted 65 lines

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

Quoted 30 lines

Regards,
Matthias

Quoted 24 lines

Regards,
Matthias

Quoted 20 lines

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