From: "Matias Bjørling" <m@bjorling.me>
To: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: "Matias Bjørling" <m@bjorling.me>
Subject: [PATCH 2/7] lightnvm: add mccap support
Date: Fri, 8 Jan 2016 19:14:32 +0100 [thread overview]
Message-ID: <1452276877-390-2-git-send-email-m@bjorling.me> (raw)
In-Reply-To: <1452276877-390-1-git-send-email-m@bjorling.me>
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 <m@bjorling.me>
---
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
next prev parent reply other threads:[~2016-01-08 18:17 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-08 18:14 [PATCH 1/7] lightnvm: fix missing grown bad block type Matias Bjørling
2016-01-08 18:14 ` Matias Bjørling [this message]
2016-01-08 18:14 ` [PATCH 3/7] lightnvm: introduce mlc lower page table mappings Matias Bjørling
2016-01-08 18:14 ` [PATCH v2 4/7] lightnvm: core on-disk initialization Matias Bjørling
2016-01-08 18:14 ` [PATCH 5/7] lightnvm: introduce ioctl to initialize device Matias Bjørling
2016-01-08 18:14 ` [PATCH 6/7] lightnvm: use system block for mm initialization Matias Bjørling
2016-01-08 18:14 ` [PATCH 7/7] lightnvm: introduce factory reset Matias Bjørling
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1452276877-390-2-git-send-email-m@bjorling.me \
--to=m@bjorling.me \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®