Received: by 10.223.185.116 with SMTP id b49csp3678004wrg; Tue, 13 Feb 2018 06:09:23 -0800 (PST) X-Google-Smtp-Source: AH8x226cjFnuBUP4KV+eZtgbVbqm+dnQgg6PPPUdhBmXFm7nwp+3Kau6MG9pDaDjtw9yP7TMROyc X-Received: by 2002:a17:902:4827:: with SMTP id s36-v6mr1250346pld.337.1518530963790; Tue, 13 Feb 2018 06:09:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518530963; cv=none; d=google.com; s=arc-20160816; b=NXPt+jxVpqhVKyRxg6gNR05LwDm5TNNlHtt7+oVAM8ygoCbT52fayg5CHwxexb5TVZ GlO5LcPQ9ukWSQNZZOkOoBm+04u1VOr9MQoY96Wc/woSaLwp28Bi7AejBArwzWzRHiWF 9zNA6DxWtq8oCp3L2ump9OF1zhkDh+cCNymr4AKkyw9c6RS+Lrc2Ns0Mm5l1XDHr97Md hw8ZF8Flm7AIrT+9wYhB5WIllfbcwzrfDyKt8Qjuk7ggMgcUFjwKnXlqCKtUEyAHw7TA 1Si5/KSEfjfpuoZN+fXV5agnVlN+/mer2j8WUpADZmXbKfnPRUGPryPUZIGpB9BUHXLA Sl1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=G6nSKnMAklrNRz6/ax/fHeNzZ7b+0slnB850lVcTyBM=; b=IHlpVqbdEa+72cDNMJahA/BnsjWY2p9vDD00Crf4AA+L8OS9ys070JQ3/zYV4ndFlO iJFObkOSpvE/dS/ubxlMHp8sr5v2lSYeD7BGTXkTeZjykyz+nRCvHSxJ8FCWoVKxzRpP MFQGtGqMFkDZl+DSS+Cw5PxBTbFhgJXedouYGAr8mC45Xo71KvyERM3jvsHAPHqWM2FG uxRAYnN9mmRlAKiIVuOZlPPc7EQtKPRS08apa5my3qxpWd4JrUF2e33pDPD8vQg+V+nq DZZUxObApaaEYOPRMLZ2dQW6Ld49LquFBrfzQ9Qa13LV1ZsgKllieaoNldoYzOQHTenx z8vQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lightnvm-io.20150623.gappssmtp.com header.s=20150623 header.b=V3rzNRaj; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z21si6177388pfl.96.2018.02.13.06.09.06; Tue, 13 Feb 2018 06:09:23 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@lightnvm-io.20150623.gappssmtp.com header.s=20150623 header.b=V3rzNRaj; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965158AbeBMOHI (ORCPT + 99 others); Tue, 13 Feb 2018 09:07:08 -0500 Received: from mail-wm0-f65.google.com ([74.125.82.65]:55670 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965022AbeBMOGV (ORCPT ); Tue, 13 Feb 2018 09:06:21 -0500 Received: by mail-wm0-f65.google.com with SMTP id a84so4960035wmi.5 for ; Tue, 13 Feb 2018 06:06:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lightnvm-io.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=G6nSKnMAklrNRz6/ax/fHeNzZ7b+0slnB850lVcTyBM=; b=V3rzNRajpCkUWED3rjO/sCC6dThzhFOJZ+osTQES8/KbQt/AFYQvelXKvHisTPdKgS YEen79eyI4GXYvO3mNClPuvRAoYkmDQpYd1vkRz0S9DOoSgmYPe3PUnAg7nU0x1MgNN3 jTbMzvwtG11SIeJn/op49c2gT/ilj/JpVPDcSzkg++/QVQxpVCV1qSa1CFIBtE6IAd2v qJ7PPoiUoPnFF0kiSv5NMpotCrFdmb8b0k+31lWMS506WLME5j89Zp7GlVeJeRgK5ZMp V6ox5w5e9kVqwbAtN6VMFiU5HlN4VWoSdFMp7bRP6c+WY9iJ6T/6QUAHMViYbU/iWyFb 8HPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=G6nSKnMAklrNRz6/ax/fHeNzZ7b+0slnB850lVcTyBM=; b=ZVUVutrK2fMGj5kaZssNYwIzQ+av/wFfFioQtVblaZnDd3KeQTeVUNGpYXZPuLzq7K WbkXW0JpFzhXFvjjGhWfjIC+3Vy+FhQzgG9g03MNjkBzyax2/8IsVXGOQ26S9fTOf8SF 2saOi8/IL8hZjZL8VSjiVBre401GbcFSEiyu4VlrhmMULZEX0f45q7FS83gM/aPlz57o KmKeOPLT0wSEB5RbOKRZfLxLtyMldmoO9oKiiN3bQNohHlU9yKEJa6wzMqx0vfI9KHFT XMLyXZJZn35xXWZih8/2VnYep5JmY/J4ChgsXGo9NLZoT5T27rq3YOglfuuf4+3YpI6J Nxog== X-Gm-Message-State: APf1xPCJvIvrRg9JvEUClaWyiUGoKE/G1dxC6GPbb+LJz+yxJJ27K4Mn dL6VbblqSp45eTauDM2u28FMQg== X-Received: by 10.80.186.5 with SMTP id g5mr2330396edc.12.1518530780100; Tue, 13 Feb 2018 06:06:20 -0800 (PST) Received: from uHalley.cnexlabs.com (6164211-cl69.boa.fiberby.dk. [193.106.164.211]) by smtp.gmail.com with ESMTPSA id k11sm6658850eda.22.2018.02.13.06.06.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 13 Feb 2018 06:06:19 -0800 (PST) From: "=?UTF-8?q?Javier=20Gonz=C3=A1lez?=" X-Google-Original-From: =?UTF-8?q?Javier=20Gonz=C3=A1lez?= To: mb@lightnvm.io Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, =?UTF-8?q?Javier=20Gonz=C3=A1lez?= Subject: [PATCH 3/8] lightnvm: add support for 2.0 address format Date: Tue, 13 Feb 2018 15:06:03 +0100 Message-Id: <1518530768-20956-4-git-send-email-javier@cnexlabs.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1518530768-20956-1-git-send-email-javier@cnexlabs.com> References: <1518530768-20956-1-git-send-email-javier@cnexlabs.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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