diff --git a/boards/same54-xpro/Kconfig b/boards/same54-xpro/Kconfig index 7685b6626de0f..8dbdbd0b549cb 100644 --- a/boards/same54-xpro/Kconfig +++ b/boards/same54-xpro/Kconfig @@ -18,6 +18,7 @@ config BOARD_SAME54_XPRO select HAS_PERIPH_RTC select HAS_PERIPH_RTT select HAS_PERIPH_PWM + select HAS_PERIPH_SDMMC select HAS_PERIPH_SPI select HAS_PERIPH_TIMER select HAS_PERIPH_UART @@ -31,6 +32,7 @@ config BOARD_SAME54_XPRO select HAVE_SAM0_ETH select HAVE_SAM0_SDHC select HAVE_MTD_AT24CXXX + select HAVE_MTD_SDMMC_DEFAULT # This specific board requires SPI_ON_QSPI for the MTD_SPI_NOR select MODULE_PERIPH_SPI_ON_QSPI if MODULE_MTD_SPI_NOR diff --git a/boards/same54-xpro/Makefile.dep b/boards/same54-xpro/Makefile.dep index 7d9c8c2f51e54..d6036cb26ca7d 100644 --- a/boards/same54-xpro/Makefile.dep +++ b/boards/same54-xpro/Makefile.dep @@ -10,7 +10,10 @@ ifneq (,$(filter mtd,$(USEMODULE))) FEATURES_REQUIRED += periph_spi_on_qspi USEMODULE += mtd_spi_nor USEMODULE += mtd_at24cxxx at24mac - USEMODULE += sam0_sdhc + ifeq (,$(filter sam0_sdhc,$(USEMODULE))) + USEMODULE += mtd_sdmmc_default + USEMODULE += periph_sdmmc + endif endif # enables sam0_eth as default network device diff --git a/boards/same54-xpro/Makefile.features b/boards/same54-xpro/Makefile.features index e273dde02f177..076663ed2048e 100644 --- a/boards/same54-xpro/Makefile.features +++ b/boards/same54-xpro/Makefile.features @@ -8,6 +8,7 @@ FEATURES_PROVIDED += periph_i2c FEATURES_PROVIDED += periph_rtc FEATURES_PROVIDED += periph_rtt FEATURES_PROVIDED += periph_pwm +FEATURES_PROVIDED += periph_sdmmc FEATURES_PROVIDED += periph_spi FEATURES_PROVIDED += periph_timer FEATURES_PROVIDED += periph_uart diff --git a/boards/same54-xpro/include/board.h b/boards/same54-xpro/include/board.h index 63cb027927089..4669a736afc19 100644 --- a/boards/same54-xpro/include/board.h +++ b/boards/same54-xpro/include/board.h @@ -76,6 +76,8 @@ extern mtd_dev_t *mtd0, *mtd1, *mtd2; #define MTD_1 mtd1 #define MTD_2 mtd2 #define MTD_NUMOF 3 + +#define CONFIG_SDMMC_GENERIC_MTD_OFFSET 2 /**< mtd2 is used for SD Card */ /** @} */ /** diff --git a/boards/same54-xpro/include/periph_conf.h b/boards/same54-xpro/include/periph_conf.h index 63c44e7c827e5..ae85accbab127 100644 --- a/boards/same54-xpro/include/periph_conf.h +++ b/boards/same54-xpro/include/periph_conf.h @@ -369,6 +369,18 @@ static const adc_conf_chan_t adc_channels[] = { */ #define SDHC_DEV SDHC1 /**< The SDHC instance to use */ #define SDHC_DEV_ISR isr_sdhc1 /**< Interrupt service routing for SDHC1 */ + +/** SDHC devices */ +static const sdhc_conf_t sdhc_config[] = { + { + .sdhc = SDHC1, + .cd = GPIO_PIN(PD, 20), + .wp = GPIO_UNDEF, + }, +}; + +/** Number of configured SDHC devices */ +#define SDHC_CONFIG_NUMOF 1 /** @} */ /**