drivers: disk: Decouple SDMMC and MMC Kconfigs

MMC was using SDMMC kconfigs to build disk driver.
This is incorrect, MMC and SDMMC should not be sharing
Kconfigs. Split the drivers/disk/Kconfig.sdmmc into
drivers/disk/Kconfig.mmc and drivers/disk/Kconfig.sdmmc.

Also update disk tests to account for new MMC Kconfigs.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
This commit is contained in:
Declan Snyder 2023-02-07 11:26:38 -06:00 committed by Carles Cufí
parent bcd13af168
commit 0744e42e22
5 changed files with 44 additions and 16 deletions

View file

@ -11,5 +11,6 @@ if DISK_DRIVERS
source "drivers/disk/Kconfig.ram"
source "drivers/disk/Kconfig.flash"
source "drivers/disk/Kconfig.sdmmc"
source "drivers/disk/Kconfig.mmc"
endif # DISK_DRIVERS

37
drivers/disk/Kconfig.mmc Normal file
View file

@ -0,0 +1,37 @@
# Copyright 2023 NXP
# SPDX-License-Identifier: Apache-2.0
config DISK_DRIVER_MMC
bool "MMC card driver"
default y if DT_HAS_ZEPHYR_MMC_DISK_ENABLED
help
MMC card driver.
if DISK_DRIVER_MMC
config SD_INIT_PRIORITY
int "Init priority"
default 90
help
MMC controller driver initialization priority.
config MMC_VOLUME_NAME
string "MMC Disk mount point or drive name"
default "SD" if FAT_FILESYSTEM_ELM
default "MMC"
help
Disk name as per file system naming guidelines.
config MMC_SUBSYS
bool "MMC access via SD subsystem"
select MMC_STACK
default y
depends on DT_HAS_ZEPHYR_MMC_DISK_ENABLED
help
Enable MMC access via SD subsystem.
module = MMC
module-str = mmc
source "subsys/logging/Kconfig.template.log_config"
endif # DISK_DRIVER_MMC

View file

@ -6,7 +6,8 @@ DT_STM32_SDMMC_HAS_DMA := $(dt_nodelabel_has_prop,sdmmc,dmas)
config DISK_DRIVER_SDMMC
bool "SDMMC card driver"
default y if DT_HAS_ZEPHYR_SDMMC_DISK_ENABLED || DT_HAS_ZEPHYR_MMC_DISK_ENABLED
default y if DT_HAS_ZEPHYR_SDMMC_DISK_ENABLED || \
DT_HAS_ST_STM32_SDMMC_ENABLED
help
SDMMC card driver.
@ -18,13 +19,6 @@ config SD_INIT_PRIORITY
help
SDMMC controller driver initialization priority.
config MMC_VOLUME_NAME
string "MMC Disk mount point or drive name"
default "SD" if FAT_FILESYSTEM_ELM
default "SDMMC"
help
Disk name as per file system naming guidelines.
config SDMMC_VOLUME_NAME
string "SDMMC Disk mount point or drive name"
default "SD" if FAT_FILESYSTEM_ELM
@ -40,14 +34,6 @@ config SDMMC_SUBSYS
help
Enable SDMMC access via SD subsystem.
config MMC_SUBSYS
bool "MMC access via SD subsystem"
select MMC_STACK
default y
depends on DT_HAS_ZEPHYR_MMC_DISK_ENABLED
help
Enable MMC access via SD subsystem.
config SDMMC_STM32
bool "STM32 SDMMC driver"
default y

View file

@ -16,6 +16,8 @@
#if defined(CONFIG_DISK_DRIVER_SDMMC)
#define DISK_NAME CONFIG_SDMMC_VOLUME_NAME
#elif IS_ENABLED(CONFIG_DISK_DRIVER_MMC)
#define DISK_NAME CONFIG_MMC_VOLUME_NAME
#elif IS_ENABLED(CONFIG_DISK_DRIVER_RAM)
#define DISK_NAME CONFIG_DISK_RAM_VOLUME_NAME
#else

View file

@ -14,6 +14,8 @@
#if defined(CONFIG_DISK_DRIVER_SDMMC)
#define DISK_NAME CONFIG_SDMMC_VOLUME_NAME
#elif IS_ENABLED(CONFIG_DISK_DRIVER_MMC)
#define DISK_NAME CONFIG_MMC_VOLUME_NAME
#elif IS_ENABLED(CONFIG_DISK_DRIVER_RAM)
#define DISK_NAME CONFIG_DISK_RAM_VOLUME_NAME
#else