mmc-utils: Add Command Queue fields to Extended CSD
PATCH 1/1 mmc-utils: Add Command Queue fields to Extended CSD
Display Command Queue information when printing Extended CSD Example:
# mmc extcsd read /dev/mmcblk0 | grep CMDQ Command Queue Support [CMDQ_SUPPORT]: 0x01 Command Queue Depth [CMDQ_DEPTH]: 16 Command Enabled [CMDQ_MODE_EN]: 0x01
Signed-off-by Adrian Hunter <[email protected]>
--- mmc.h | 3 +++ mmc_cmds.c | 9 +++++++++ 2 files changed, 12 insertions(+)
mmc.h +3 -0
@@ -55,6 +55,8 @@#define EXT_CSD_FFU_ARG_2 489/* RO */ #define EXT_CSD_FFU_ARG_1 488/* RO */ #define EXT_CSD_FFU_ARG_0 487/* RO */ +#define EXT_CSD_CMDQ_DEPTH 307/* RO */ +#define EXT_CSD_CMDQ_SUPPORT 308/* RO */ #define EXT_CSD_NUM_OF_FW_SEC_PROG_3 305/* RO */ #define EXT_CSD_NUM_OF_FW_SEC_PROG_2 304/* RO */ #define EXT_CSD_NUM_OF_FW_SEC_PROG_1 303/* RO */
@@ -119,6 +121,7 @@#define EXT_CSD_MODE_CONFIG 30#define EXT_CSD_MODE_OPERATION_CODES 29/* W */ #define EXT_CSD_FFU_STATUS 26/* R */ +#define EXT_CSD_CMDQ_MODE_EN 15/* R/W */ /* * WR_REL_PARAM field definitions
mmc_cmds.c +9 -0
@@ -1723,6 +1723,15 @@ int do_read_extcsd(int nargs, char **argv)printf ("eMMC Firmware Version: %s\n" , (char *)&ext_csd[EXT_CSD_FIRMWARE_VERSION ]); } + +if (ext_csd_rev >=8 ) { +printf ("Command Queue Support [CMDQ_SUPPORT]: 0x%02x\n" , + ext_csd[EXT_CSD_CMDQ_SUPPORT ]); +printf ("Command Queue Depth [CMDQ_DEPTH]: %u\n" , + (ext_csd[EXT_CSD_CMDQ_DEPTH ] &0x1f ) +1 ); +printf ("Command Enabled [CMDQ_MODE_EN]: 0x%02x\n" , + ext_csd[EXT_CSD_CMDQ_MODE_EN ]); + } out_free:return ret; }
Signature · 1 line
1.9.1
Quoted 9 lines · Adrian Hunter
Display Command Queue information when printing Extended CSD Example:
# mmc extcsd read /dev/mmcblk0 | grep CMDQ Command Queue Support [CMDQ_SUPPORT]: 0x01 Command Queue Depth [CMDQ_DEPTH]: 16 Command Enabled [CMDQ_MODE_EN]: 0x01Signed-off-by Adrian Hunter <[email protected]>
Reviewed-by Ulf Hansson <[email protected]>
Kind regards
Uffe
Quoted 49 lines
--- mmc.h | 3 +++ mmc_cmds.c | 9 +++++++++ 2 files changed, 12 insertions(+)mmc.h +3
-0@@ -55,6 +55,8 @@#define EXT_CSD_FFU_ARG_2 489/* RO */ #define EXT_CSD_FFU_ARG_1 488/* RO */ #define EXT_CSD_FFU_ARG_0 487/* RO */ +#define EXT_CSD_CMDQ_DEPTH 307/* RO */ +#define EXT_CSD_CMDQ_SUPPORT 308/* RO */ #define EXT_CSD_NUM_OF_FW_SEC_PROG_3 305/* RO */ #define EXT_CSD_NUM_OF_FW_SEC_PROG_2 304/* RO */ #define EXT_CSD_NUM_OF_FW_SEC_PROG_1 303/* RO */ @@ -119,6 +121,7 @@#define EXT_CSD_MODE_CONFIG 30#define EXT_CSD_MODE_OPERATION_CODES 29/* W */ #define EXT_CSD_FFU_STATUS 26/* R */ +#define EXT_CSD_CMDQ_MODE_EN 15/* R/W */ /* * WR_REL_PARAM field definitions mmc_cmds.c +9
-1@@ -1723,6 +1723,15 @@ int do_read_extcsd(int nargs, char **argv)printf ("eMMC Firmware Version: %s\n" , (char *)&ext_csd[EXT_CSD_FIRMWARE_VERSION ]); } + +if (ext_csd_rev >=8 ) { +printf ("Command Queue Support [CMDQ_SUPPORT]: 0x%02x\n" , + ext_csd[EXT_CSD_CMDQ_SUPPORT ]); +printf ("Command Queue Depth [CMDQ_DEPTH]: %u\n" , + (ext_csd[EXT_CSD_CMDQ_DEPTH ] &0x1f ) +1 ); +printf ("Command Enabled [CMDQ_MODE_EN]: 0x%02x\n" , + ext_csd[EXT_CSD_CMDQ_MODE_EN ]); + } out_free:return ret; } --1.9.1