* [PATCH] mmc-utils: Add Command Queue fields to Extended CSD
@ 2016-06-10 8:28 Adrian Hunter
2016-06-22 10:26 ` Ulf Hansson
0 siblings, 1 reply; 2+ messages in thread
From: Adrian Hunter @ 2016-06-10 8:28 UTC (permalink / raw)
To: Chris Ball; +Cc: Ulf Hansson, linux-mmc
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 <adrian.hunter@intel.com>
---
mmc.h | 3 +++
mmc_cmds.c | 9 +++++++++
2 files changed, 12 insertions(+)
diff --git a/mmc.h b/mmc.h
index 8c77fd5572eb..a3d732c7215c 100644
--- a/mmc.h
+++ b/mmc.h
@@ -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
diff --git a/mmc_cmds.c b/mmc_cmds.c
index 36276106b7bf..295d50541dee 100644
--- a/mmc_cmds.c
+++ b/mmc_cmds.c
@@ -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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] mmc-utils: Add Command Queue fields to Extended CSD
2016-06-10 8:28 [PATCH] mmc-utils: Add Command Queue fields to Extended CSD Adrian Hunter
@ 2016-06-22 10:26 ` Ulf Hansson
0 siblings, 0 replies; 2+ messages in thread
From: Ulf Hansson @ 2016-06-22 10:26 UTC (permalink / raw)
To: Adrian Hunter; +Cc: Chris Ball, linux-mmc
On 10 June 2016 at 10:28, Adrian Hunter <adrian.hunter@intel.com> wrote:
> 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 <adrian.hunter@intel.com>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Kind regards
Uffe
> ---
> mmc.h | 3 +++
> mmc_cmds.c | 9 +++++++++
> 2 files changed, 12 insertions(+)
>
> diff --git a/mmc.h b/mmc.h
> index 8c77fd5572eb..a3d732c7215c 100644
> --- a/mmc.h
> +++ b/mmc.h
> @@ -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
> diff --git a/mmc_cmds.c b/mmc_cmds.c
> index 36276106b7bf..295d50541dee 100644
> --- a/mmc_cmds.c
> +++ b/mmc_cmds.c
> @@ -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
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-06-22 10:32 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-10 8:28 [PATCH] mmc-utils: Add Command Queue fields to Extended CSD Adrian Hunter
2016-06-22 10:26 ` Ulf Hansson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).