aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatias Bjørling <m@bjorling.me>2016-01-12 01:49:34 -0500
committerJens Axboe <axboe@fb.com>2016-01-12 10:21:17 -0500
commitf9a9995072904f2d67d649545f17f81e00f4985e (patch)
tree774660b123ea0de223f1bdccaa5de92b8d412834
parentff0e498bfa185fad5e86c4c7a2db4f9648d2344f (diff)
lightnvm: add mccap support
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> Signed-off-by: Jens Axboe <axboe@fb.com>
-rw-r--r--drivers/lightnvm/core.c1
-rw-r--r--include/linux/lightnvm.h7
2 files changed, 8 insertions, 0 deletions
diff --git a/drivers/lightnvm/core.c b/drivers/lightnvm/core.c
index e5e396338319..5199c12fead0 100644
--- a/drivers/lightnvm/core.c
+++ b/drivers/lightnvm/core.c
@@ -376,6 +376,7 @@ static int nvm_core_init(struct nvm_dev *dev)
376 dev->sec_size = grp->csecs; 376 dev->sec_size = grp->csecs;
377 dev->oob_size = grp->sos; 377 dev->oob_size = grp->sos;
378 dev->sec_per_pg = grp->fpg_sz / grp->csecs; 378 dev->sec_per_pg = grp->fpg_sz / grp->csecs;
379 dev->mccap = grp->mccap;
379 memcpy(&dev->ppaf, &id->ppaf, sizeof(struct nvm_addr_format)); 380 memcpy(&dev->ppaf, &id->ppaf, sizeof(struct nvm_addr_format));
380 381
381 dev->plane_mode = NVM_PLANE_SINGLE; 382 dev->plane_mode = NVM_PLANE_SINGLE;
diff --git a/include/linux/lightnvm.h b/include/linux/lightnvm.h
index aa35907714b8..b90d28344e3d 100644
--- a/include/linux/lightnvm.h
+++ b/include/linux/lightnvm.h
@@ -61,6 +61,12 @@ enum {
61 NVM_BLK_T_GRWN_BAD = 0x2, 61 NVM_BLK_T_GRWN_BAD = 0x2,
62 NVM_BLK_T_DEV = 0x4, 62 NVM_BLK_T_DEV = 0x4,
63 NVM_BLK_T_HOST = 0x8, 63 NVM_BLK_T_HOST = 0x8,
64
65 /* Memory capabilities */
66 NVM_ID_CAP_SLC = 0x1,
67 NVM_ID_CAP_CMD_SUSPEND = 0x2,
68 NVM_ID_CAP_SCRAMBLE = 0x4,
69 NVM_ID_CAP_ENCRYPT = 0x8,
64}; 70};
65 71
66struct nvm_id_group { 72struct nvm_id_group {
@@ -278,6 +284,7 @@ struct nvm_dev {
278 int blks_per_lun; 284 int blks_per_lun;
279 int sec_size; 285 int sec_size;
280 int oob_size; 286 int oob_size;
287 int mccap;
281 struct nvm_addr_format ppaf; 288 struct nvm_addr_format ppaf;
282 289
283 /* Calculated/Cached values. These do not reflect the actual usable 290 /* Calculated/Cached values. These do not reflect the actual usable