From patchwork Fri Jun 10 08:28:59 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Hunter X-Patchwork-Id: 9169039 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9DF546048F for ; Fri, 10 Jun 2016 08:33:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8E430281FE for ; Fri, 10 Jun 2016 08:33:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 802D328359; Fri, 10 Jun 2016 08:33:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 325C1281FE for ; Fri, 10 Jun 2016 08:33:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752563AbcFJIdE (ORCPT ); Fri, 10 Jun 2016 04:33:04 -0400 Received: from mga04.intel.com ([192.55.52.120]:62608 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752101AbcFJIdD (ORCPT ); Fri, 10 Jun 2016 04:33:03 -0400 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga104.fm.intel.com with ESMTP; 10 Jun 2016 01:33:02 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,449,1459839600"; d="scan'208";a="972852776" Received: from ahunter-desktop.fi.intel.com ([10.237.72.168]) by orsmga001.jf.intel.com with ESMTP; 10 Jun 2016 01:33:01 -0700 From: Adrian Hunter To: Chris Ball Cc: Ulf Hansson , linux-mmc Subject: [PATCH] mmc-utils: Add Command Queue fields to Extended CSD Date: Fri, 10 Jun 2016 11:28:59 +0300 Message-Id: <1465547339-10557-1-git-send-email-adrian.hunter@intel.com> X-Mailer: git-send-email 1.9.1 Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Reviewed-by: Ulf Hansson --- 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; }