From: jg@lightnvm.io (Javier González)
Subject: [PATCH 3/8] lightnvm: add support for 2.0 address format
Date: Tue, 13 Feb 2018 15:06:03 +0100 [thread overview]
Message-ID: <1518530768-20956-4-git-send-email-javier@cnexlabs.com> (raw)
In-Reply-To: <1518530768-20956-1-git-send-email-javier@cnexlabs.com>
Add support for 2.0 address format. Also, align address bits for 1.2 and 2.0 to
align.
Signed-off-by: Javier Gonz?lez <javier at cnexlabs.com>
---
include/linux/lightnvm.h | 45 ++++++++++++++++++++++++++++++++-------------
1 file changed, 32 insertions(+), 13 deletions(-)
diff --git a/include/linux/lightnvm.h b/include/linux/lightnvm.h
index 6a567bd19b73..e035ae4c9acc 100644
--- a/include/linux/lightnvm.h
+++ b/include/linux/lightnvm.h
@@ -16,12 +16,21 @@ enum {
NVM_IOTYPE_GC = 1,
};
-#define NVM_BLK_BITS (16)
-#define NVM_PG_BITS (16)
-#define NVM_SEC_BITS (8)
-#define NVM_PL_BITS (8)
-#define NVM_LUN_BITS (8)
-#define NVM_CH_BITS (7)
+/* 1.2 format */
+#define NVM_12_CH_BITS (8)
+#define NVM_12_LUN_BITS (8)
+#define NVM_12_BLK_BITS (16)
+#define NVM_12_PG_BITS (16)
+#define NVM_12_PL_BITS (4)
+#define NVM_12_SEC_BITS (4)
+#define NVM_12_RESERVED (8)
+
+/* 2.0 format */
+#define NVM_20_CH_BITS (8)
+#define NVM_20_LUN_BITS (8)
+#define NVM_20_CHK_BITS (16)
+#define NVM_20_SEC_BITS (24)
+#define NVM_20_RESERVED (8)
enum {
NVM_OCSSD_SPEC_12 = 12,
@@ -31,16 +40,26 @@ enum {
struct ppa_addr {
/* Generic structure for all addresses */
union {
+ /* 1.2 device format */
struct {
- u64 blk : NVM_BLK_BITS;
- u64 pg : NVM_PG_BITS;
- u64 sec : NVM_SEC_BITS;
- u64 pl : NVM_PL_BITS;
- u64 lun : NVM_LUN_BITS;
- u64 ch : NVM_CH_BITS;
- u64 reserved : 1;
+ u64 ch : NVM_12_CH_BITS;
+ u64 lun : NVM_12_LUN_BITS;
+ u64 blk : NVM_12_BLK_BITS;
+ u64 pg : NVM_12_PG_BITS;
+ u64 pl : NVM_12_PL_BITS;
+ u64 sec : NVM_12_SEC_BITS;
+ u64 reserved : NVM_12_RESERVED;
} g;
+ /* 2.0 device format */
+ struct {
+ u64 ch : NVM_20_CH_BITS;
+ u64 lun : NVM_20_LUN_BITS;
+ u64 chk : NVM_20_CHK_BITS;
+ u64 sec : NVM_20_SEC_BITS;
+ u64 reserved : NVM_20_RESERVED;
+ } m;
+
struct {
u64 line : 63;
u64 is_cached : 1;
--
2.7.4
next prev parent reply other threads:[~2018-02-13 14:06 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-13 14:06 [PATCH 0/8] lightnvm: pblk: implement support for 2.0 Javier González
2018-02-13 14:06 ` [PATCH 1/8] lightnvm: exposed generic geometry to targets Javier González
2018-02-15 10:13 ` Matias Bjørling
2018-02-15 18:32 ` Javier Gonzalez
2018-02-13 14:06 ` [PATCH 2/8] lightnvm: show generic geometry in sysfs Javier González
2018-02-15 10:20 ` Matias Bjørling
2018-02-16 6:35 ` Javier Gonzalez
2018-02-19 7:27 ` Matias Bjørling
2018-02-19 13:40 ` Javier González
2018-02-13 14:06 ` Javier González [this message]
2018-02-15 10:21 ` [PATCH 3/8] lightnvm: add support for 2.0 address format Matias Bjørling
2018-02-13 14:06 ` [PATCH 4/8] lightnvm: convert address based on spec. version Javier González
2018-02-13 14:06 ` [PATCH 5/8] lightnvm: implement get log report chunk helpers Javier González
2018-02-15 12:51 ` Matias Bjørling
2018-02-16 7:03 ` Javier González
2018-02-13 14:06 ` [PATCH 6/8] lightnvm: pblk: implement get log report chunk Javier González
2018-02-15 10:59 ` Matias Bjørling
2018-02-16 6:38 ` Javier González
2018-02-13 14:06 ` [PATCH 7/8] lightnvm: pblk: refactor init/exit sequences Javier González
2018-02-13 14:06 ` [PATCH 8/8] lightnvm: pblk: implement 2.0 support Javier González
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=1518530768-20956-4-git-send-email-javier@cnexlabs.com \
--to=jg@lightnvm.io \
/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