drivers: sdhc: add support of Renesas MMC driver

Add basic functionality of Renesas SD/MMC driver. It can be used
for both gen3 and gen4 R-car boards, but tested only with H3ULCB,
Salvator XS M3 and Spider boards. This driver working with SDHC
subsystem.

The driver supports regularal reading/writing throught SD/MMC
controller buffer, DMA mode w/o interrupts and timing tuning.

Add gpio5 and sd0 nodes to h3ulcb and salvator xs which are needed
for working with SD cards. The GPIO node is needed for switching
voltage on SD card through gpio regulator driver.

Notes:
    * the driver doesn't support SPI mode;
    * SCC tuning and DMA mode based on IRQs are enabled by default;
    * an address of a data buffer has to be aligned to 128 bytes if it
      is not, driver will use non-DMA mode automatically;
    * Renesas MMC DMAC doesn't support 64-bit DMA addresses, so for
      case when we have 64-bit xref data address we use non-DMA mode;
    * SD/MMC controller supports block size between 512 and 1 with
      a lot of restrictions, more details you can find in code;
    * support of HS400 mode isn't implemented inside driver.

Signed-off-by: Mykola Kvach <mykola_kvach@epam.com>
This commit is contained in:
Mykola Kvach 2023-07-12 09:53:03 +03:00 committed by Anas Nashif
commit b8f7fc3cc3
7 changed files with 2596 additions and 2 deletions

View file

@ -0,0 +1,63 @@
description: Renesas R-Car eMMC
compatible: "renesas,rcar-mmc"
include: [sdhc.yaml, mmc.yaml, pinctrl-device.yaml, reset-device.yaml]
properties:
clocks:
required: true
reg:
required: true
pinctrl-0:
required: true
pinctrl-names:
required: true
max-bus-freq:
required: true
non-removable:
type: boolean
description: |
Non-removable slots (like eMMC), which are assumed to always be present,
will affect the `sdhc_card_present` call. This call will always return
true if this property exists for the node.
mmc-sdr104-support:
type: boolean
cd-gpios:
type: phandle-array
description: Card Detect pin
pwr-gpios:
type: phandle-array
description: Power pin
vmmc-supply:
type: phandle
description: |
Supply for the card power
vqmmc-supply:
type: phandle
description: |
Supply for the bus IO line power, such as a level shifter.
If the level shifter is controlled by a GPIO line, this shall
be modeled as a "regulator-fixed" with a GPIO line for
switching the level shifter on/off.
bus-width:
type: int
default: 1
description: |
Bus width for SDMMC access, defaults to the minimum necessary
number of bus lines
enum:
- 1
- 4
- 8