From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756186AbcAHSRd (ORCPT ); Fri, 8 Jan 2016 13:17:33 -0500 Received: from mail-wm0-f48.google.com ([74.125.82.48]:37636 "EHLO mail-wm0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932439AbcAHSOt (ORCPT ); Fri, 8 Jan 2016 13:14:49 -0500 From: =?UTF-8?q?Matias=20Bj=C3=B8rling?= To: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Cc: =?UTF-8?q?Matias=20Bj=C3=B8rling?= Subject: [PATCH 2/7] lightnvm: add mccap support Date: Fri, 8 Jan 2016 19:14:32 +0100 Message-Id: <1452276877-390-2-git-send-email-m@bjorling.me> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1452276877-390-1-git-send-email-m@bjorling.me> References: <1452276877-390-1-git-send-email-m@bjorling.me> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Some flash media has extended capabilities, such as programming SLC pages on MLC/TLC flash, erase/program suspend, scramble and encryption. MCCAP is introduced to detect support for these capabilities in the command set. Signed-off-by: Matias Bjørling --- drivers/lightnvm/core.c | 1 + include/linux/lightnvm.h | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/drivers/lightnvm/core.c b/drivers/lightnvm/core.c index e5e3963..5199c12 100644 --- a/drivers/lightnvm/core.c +++ b/drivers/lightnvm/core.c @@ -376,6 +376,7 @@ static int nvm_core_init(struct nvm_dev *dev) dev->sec_size = grp->csecs; dev->oob_size = grp->sos; dev->sec_per_pg = grp->fpg_sz / grp->csecs; + dev->mccap = grp->mccap; memcpy(&dev->ppaf, &id->ppaf, sizeof(struct nvm_addr_format)); dev->plane_mode = NVM_PLANE_SINGLE; diff --git a/include/linux/lightnvm.h b/include/linux/lightnvm.h index aa35907..b90d283 100644 --- a/include/linux/lightnvm.h +++ b/include/linux/lightnvm.h @@ -61,6 +61,12 @@ enum { NVM_BLK_T_GRWN_BAD = 0x2, NVM_BLK_T_DEV = 0x4, NVM_BLK_T_HOST = 0x8, + + /* Memory capabilities */ + NVM_ID_CAP_SLC = 0x1, + NVM_ID_CAP_CMD_SUSPEND = 0x2, + NVM_ID_CAP_SCRAMBLE = 0x4, + NVM_ID_CAP_ENCRYPT = 0x8, }; struct nvm_id_group { @@ -278,6 +284,7 @@ struct nvm_dev { int blks_per_lun; int sec_size; int oob_size; + int mccap; struct nvm_addr_format ppaf; /* Calculated/Cached values. These do not reflect the actual usable -- 2.1.4