Skip to content

Commit f9a9995

Browse files
MatiasBjorlingaxboe
authored andcommitted
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 <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent ff0e498 commit f9a9995

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

drivers/lightnvm/core.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,7 @@ static int nvm_core_init(struct nvm_dev *dev)
376376
dev->sec_size = grp->csecs;
377377
dev->oob_size = grp->sos;
378378
dev->sec_per_pg = grp->fpg_sz / grp->csecs;
379+
dev->mccap = grp->mccap;
379380
memcpy(&dev->ppaf, &id->ppaf, sizeof(struct nvm_addr_format));
380381

381382
dev->plane_mode = NVM_PLANE_SINGLE;

include/linux/lightnvm.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,12 @@ enum {
6161
NVM_BLK_T_GRWN_BAD = 0x2,
6262
NVM_BLK_T_DEV = 0x4,
6363
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,
6470
};
6571

6672
struct nvm_id_group {
@@ -278,6 +284,7 @@ struct nvm_dev {
278284
int blks_per_lun;
279285
int sec_size;
280286
int oob_size;
287+
int mccap;
281288
struct nvm_addr_format ppaf;
282289

283290
/* Calculated/Cached values. These do not reflect the actual usable

0 commit comments

Comments
 (0)