Skip to content

Commit 954b2b8

Browse files
drivers: sdhc: Add alif sdhc driver
Added initial version of alif sdhc driver. Supports SD/SDIO modes at 1,4 bit bus, 400khz, 25mhz, 50mhz speed. Signed-off-by: Deepak Kumar <deepak@alifsemi.com>
1 parent 913b885 commit 954b2b8

File tree

9 files changed

+1571
-7
lines changed

9 files changed

+1571
-7
lines changed

drivers/sdhc/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,5 @@ zephyr_library_sources_ifdef(CONFIG_CDNS_SDHC sdhc_cdns_ll.c sdhc_cdns.c)
1414
zephyr_library_sources_ifdef(CONFIG_SDHC_ESP32 sdhc_esp32.c)
1515
zephyr_library_sources_ifdef(CONFIG_SDHC_RENESAS_RA sdhc_renesas_ra.c)
1616
zephyr_library_sources_ifdef(CONFIG_SDHC_MAX32 sdhc_max32.c)
17+
zephyr_library_sources_ifdef(CONFIG_SDHC_ALIF sdhc_alif.c)
1718
endif()

drivers/sdhc/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ source "drivers/sdhc/Kconfig.sdhc_cdns"
1919
source "drivers/sdhc/Kconfig.esp32"
2020
source "drivers/sdhc/Kconfig.renesas_ra"
2121
source "drivers/sdhc/Kconfig.max32"
22+
source "drivers/sdhc/Kconfig.alif"
2223

2324
config SDHC_INIT_PRIORITY
2425
int "SDHC driver init priority"

drivers/sdhc/Kconfig.alif

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Copyright (c) 2024 Alif Semiconductor
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config SDHC_ALIF
5+
bool "Alif SDHC driver"
6+
default y
7+
depends on DT_HAS_ALIF_SDHC_ENABLED
8+
select SDHC_SUPPORTS_NATIVE_MODE
9+
select EVENTS
10+
help
11+
Enable Alif SDHC driver.
12+
13+
if SDHC_ALIF
14+
15+
config SDHC_BUFFER_ALIGNMENT
16+
int "SDHC buffer alignment"
17+
default 512
18+
19+
config SDHC_DESCRIPTOR_SECTION
20+
string
21+
default ".alif.ns"
22+
help
23+
Linker section for SDHC driver data including DMA descriptors.
24+
On Alif SoCs this is overridden to a non-secure region by the
25+
SoC Kconfig defconfig.
26+
27+
config SDHC_ALIF_SDMA
28+
bool "Use SDMA mode"
29+
help
30+
Use Single-operation DMA (SDMA) for data transfers. SDMA uses
31+
the SDMA System Address register and requires handling DMA
32+
boundary interrupts for transfers crossing 4 KB pages.
33+
34+
config SDHC_ALIF_ADMA
35+
bool "Use ADMA2 mode"
36+
default y
37+
depends on !SDHC_ALIF_SDMA
38+
help
39+
Use Advanced DMA 2 (ADMA2) for data transfers. ADMA2 uses a
40+
descriptor table that allows scatter-gather transfers without
41+
boundary interrupt handling. This is the recommended DMA mode.
42+
43+
config SDHC_ALIF_ADMA_MAX_DESC
44+
int "SDHC ALIF ADMA Maximum Descriptor count"
45+
depends on SDHC_ALIF_ADMA
46+
default 32
47+
help
48+
SDHC ALIF ADMA Maximum Descriptor count.
49+
50+
endif # SDHC_ALIF

0 commit comments

Comments
 (0)