mbox series

[v2,0/3] mmc: xenon: Fix 2G DMA limitation on AC5 SoC

Message ID 20221130133747.3777340-1-vadym.kochan@plvision.eu
Headers show
Series mmc: xenon: Fix 2G DMA limitation on AC5 SoC | expand

Message

Vadym Kochan Nov. 30, 2022, 1:37 p.m. UTC
There is a limitation on AC5 SoC that mmc controller
can't have DMA access over 2G memory, so use SDMA with
a bounce buffer. Swiotlb can't help because on arm64 arch
it reserves memblock's at the end of the memory.

Additionally set mask to 34 bit since on AC5 SoC RAM starts
at 0x2_00000000.

Also add compatible string for AC5 SoC.

v2:
   #1 Add compatible string for dt-bindings

   #2 Use SDMA with a bounce buffer instead of PIO.

Vadym Kochan (3):
  dt-bindings: mmc: xenon: Add compatible string for AC5 SoC
  mmc: sdhci: Export sdhci_set_dma_mask to be used by the drivers
  mmc: xenon: Fix 2G limitation on AC5 SoC

 .../bindings/mmc/marvell,xenon-sdhci.yaml     |  1 +
 drivers/mmc/host/sdhci-xenon.c                | 38 +++++++++++++++++++
 drivers/mmc/host/sdhci-xenon.h                |  3 +-
 drivers/mmc/host/sdhci.c                      |  2 +-
 drivers/mmc/host/sdhci.h                      |  2 +
 5 files changed, 44 insertions(+), 2 deletions(-)

Comments

Krzysztof Kozlowski Nov. 30, 2022, 3:06 p.m. UTC | #1
On 30/11/2022 14:37, Vadym Kochan wrote:
> AC5 SoC has Xenon SDHCI IP, but with a limitation of maximum
> 2G DMA address range.
> 
> Signed-off-by: Vadym Kochan <vadym.kochan@plvision.eu>
> ---
>  Documentation/devicetree/bindings/mmc/marvell,xenon-sdhci.yaml | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/Documentation/devicetree/bindings/mmc/marvell,xenon-sdhci.yaml b/Documentation/devicetree/bindings/mmc/marvell,xenon-sdhci.yaml
> index 3ee758886558..e1178a49f264 100644
> --- a/Documentation/devicetree/bindings/mmc/marvell,xenon-sdhci.yaml
> +++ b/Documentation/devicetree/bindings/mmc/marvell,xenon-sdhci.yaml
> @@ -25,6 +25,7 @@ properties:
>        - enum:
>            - marvell,armada-cp110-sdhci
>            - marvell,armada-ap806-sdhci
> +          - marvell,ac5-sdhci

Don't drop entries at the end, it's easy to create conflicts which is
also easy to avoid by putting them in alphabetical order.

Best regards,
Krzysztof