From d07e73e684aabf60ba6d2e79f0c73272ce7f2796 Mon Sep 17 00:00:00 2001 From: Windrow14 Date: Mon, 19 Aug 2024 11:26:14 +0800 Subject: [PATCH] drivers/mmcsd/mmcsd_sdio.c: show eMMC information after initialization is completed Prompts for capacity, speed mode and bus width after eMMC initialization is completed. Signed-off-by: Yinzhe Wu Reviewed-by: Yuezhang Mo Reviewed-by: Jacky Cao Tested-by: Yinzhe Wu --- drivers/mmcsd/mmcsd_sdio.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/drivers/mmcsd/mmcsd_sdio.c b/drivers/mmcsd/mmcsd_sdio.c index ddba0cd4bb..eacdb09e60 100644 --- a/drivers/mmcsd/mmcsd_sdio.c +++ b/drivers/mmcsd/mmcsd_sdio.c @@ -4084,6 +4084,24 @@ static void mmcsd_hwuninitialize(FAR struct mmcsd_state_s *priv) SDIO_RESET(priv->dev); } +static const char *mmc_get_mode_name(uint8_t mode) +{ + switch (mode) + { + case EXT_CSD_HS_TIMING_BC: + return "backwards compatibility"; + case EXT_CSD_HS_TIMING_HS: + return "high speed"; + case EXT_CSD_HS_TIMING_HS200: + return "HS200"; + case EXT_CSD_HS_TIMING_HS400: + return "HS400"; + default: + ferr("Unknown mode: %u\n", mode); + return "Unknown"; + } +} + /**************************************************************************** * Public Functions ****************************************************************************/ @@ -4187,6 +4205,11 @@ int mmcsd_slotinitialize(int minor, FAR struct sdio_dev_s *dev) mmcsd_initialize_procfs(); #endif + finfo("MMC: %s %" PRIu64 "KB %s %s mode\n", devname, + ((uint64_t)priv->nblocks << priv->blockshift) >> 10, + priv->widebus ? "4-bits" : "1-bit", + mmc_get_mode_name(priv->mode)); + return OK; errout_with_hwinit: