From d8cc1fd76d5b8356cd71490334ac3712e8ce4f6f Mon Sep 17 00:00:00 2001 From: Jukka Laitinen Date: Fri, 13 May 2022 15:37:09 +0400 Subject: [PATCH] arch/riscv/mpfs: Add a config flag to select SD mux state This has been previously hard-coded to SD-card. Make it build time configurable. Signed-off-by: Jukka Laitinen --- arch/risc-v/src/mpfs/Kconfig | 11 +++++++++++ arch/risc-v/src/mpfs/mpfs_emmcsd.c | 6 +++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/arch/risc-v/src/mpfs/Kconfig b/arch/risc-v/src/mpfs/Kconfig index 0dbc6e24f5..d731e6458a 100755 --- a/arch/risc-v/src/mpfs/Kconfig +++ b/arch/risc-v/src/mpfs/Kconfig @@ -132,6 +132,17 @@ config MPFS_EMMCSD_MUX_GPIO ---help--- External mux GPIO between e.MMC and SD-card +choice MPFS_EMMCSD_MUX + prompt "Configure SD/eMMC mux" + +config MPFS_EMMCSD_MUX_SDCARD + bool "SD card" + +config MPFS_EMMCSD_MUX_EMMC + bool "eMMC" + +endchoice + config MPFS_ROMFS_MOUNT bool "Mount the ROMFS file system" depends on FS_ROMFS diff --git a/arch/risc-v/src/mpfs/mpfs_emmcsd.c b/arch/risc-v/src/mpfs/mpfs_emmcsd.c index 10a72ec34b..49cf058ca9 100755 --- a/arch/risc-v/src/mpfs/mpfs_emmcsd.c +++ b/arch/risc-v/src/mpfs/mpfs_emmcsd.c @@ -442,7 +442,11 @@ struct mpfs_dev_s g_emmcsd_dev = }, .hw_base = MPFS_EMMC_SD_BASE, .plic_irq = MPFS_IRQ_MMC_MAIN, - .emmc = false, /* Set true for emmc operation */ +#ifdef CONFIG_MPFS_EMMCSD_MUX_EMMC + .emmc = true, +#else + .emmc = false, +#endif .blocksize = 512, .onebit = false, .polltransfer = true,