Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp6825725yba; Tue, 14 May 2019 14:31:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqw2ak8XBCvfrMoiMFLK3NJcwXYKetF0mfbkLYitAh2Bsmd8SFMSUjANHpNqO7wLyQAm3b5e X-Received: by 2002:aa7:9e51:: with SMTP id z17mr42312304pfq.212.1557869468226; Tue, 14 May 2019 14:31:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557869468; cv=none; d=google.com; s=arc-20160816; b=tqJX/NqIjyhIhqzai8gAornqcti/D0A/pKOGyISxTCy3KnWaJX+GL+Rb7EqsjjhaEV m2WoonoeKqynCSI/uaKmysccLzTmqibcGYiCDTkbD+G/gInS4qWvlg/nbEVvW9rj7aBq XSaKIhTl27mIzNrysEUFpbvYN+LSZgpql7HLm/UQZXdORktHIxcDM5DdYPNkVK2KFMUF o6WZPQpi+41pTkM1zsPApYlf2A1Ig2issqTL0skqUGO+LPHVJTsRQF3J1evt/qrwxJto LLUE9L0PobpFtxvt4zClNdWEPK981wf66k/WBu/wNdg0d/TVAufCw9EuPLAw1DsCnWhR rC6A== 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; bh=ToLIYQA9AOs3NRmJtYB1nUvbJ5+wMtzCufARbGE6IGA=; b=UVzIQC61L8ReLNIR9il+18rNpADEsjyy90uBair/d3cG37MJrzqO6Je5hPIhe546aQ nZXHr5YD2Ntu/TRC296ZNphNO8wGSw7sGP17alB10iPpuPIKC9VV5aaB06F9jKWTRHih ALJ0d/yuZ0F3ITI8qbNfvmDlAEJODLkGcvmw4202MTg1ABGztjGEddB/dMs53Wkgr5Xr lP8dK4CI21Wujv7bHnGzG0NA3YVVNE+A4Y3NhDXze4mhw+svwAovQ0OFbkxXADKFax5x eMuAL9nKe272yUJ2PhEARV+6bxcw9JJdQs2KGiTUmJ4XtTeB2V79cgeg0NrfaAAtS243 vm0g== ARC-Authentication-Results: i=1; mx.google.com; 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 q14si20975690pls.327.2019.05.14.14.30.53; Tue, 14 May 2019 14:31:08 -0700 (PDT) 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; 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 S1726603AbfENV2I (ORCPT + 99 others); Tue, 14 May 2019 17:28:08 -0400 Received: from mx.allycomm.com ([138.68.30.55]:57101 "EHLO mx.allycomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726089AbfENV2H (ORCPT ); Tue, 14 May 2019 17:28:07 -0400 Received: from allycomm.com (inet.guidewire.com [199.91.42.30]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx.allycomm.com (Postfix) with ESMTPSA id C107A3B676; Tue, 14 May 2019 14:28:05 -0700 (PDT) From: Jeff Kletsky To: Boris Brezillon , Miquel Raynal , Richard Weinberger , David Woodhouse , Brian Norris , Marek Vasut Cc: linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 1/3] mtd: spinand: Add #define-s for page-read ops with three-byte addresses Date: Tue, 14 May 2019 14:27:49 -0700 Message-Id: <20190514212751.18684-2-lede@allycomm.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190514212751.18684-1-lede@allycomm.com> References: <20190514212751.18684-1-lede@allycomm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jeff Kletsky The GigaDevice GD5F1GQ4UFxxG SPI NAND utilizes three-byte addresses for its page-read ops. http://www.gigadevice.com/datasheet/gd5f1gq4xfxxg/ Signed-off-by: Jeff Kletsky --- include/linux/mtd/spinand.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/include/linux/mtd/spinand.h b/include/linux/mtd/spinand.h index b92e2aa955b6..05fe98eebe27 100644 --- a/include/linux/mtd/spinand.h +++ b/include/linux/mtd/spinand.h @@ -68,30 +68,60 @@ SPI_MEM_OP_DUMMY(ndummy, 1), \ SPI_MEM_OP_DATA_IN(len, buf, 1)) +#define SPINAND_PAGE_READ_FROM_CACHE_OP_3A(fast, addr, ndummy, buf, len) \ + SPI_MEM_OP(SPI_MEM_OP_CMD(fast ? 0x0b : 0x03, 1), \ + SPI_MEM_OP_ADDR(3, addr, 1), \ + SPI_MEM_OP_DUMMY(ndummy, 1), \ + SPI_MEM_OP_DATA_IN(len, buf, 1)) + #define SPINAND_PAGE_READ_FROM_CACHE_X2_OP(addr, ndummy, buf, len) \ SPI_MEM_OP(SPI_MEM_OP_CMD(0x3b, 1), \ SPI_MEM_OP_ADDR(2, addr, 1), \ SPI_MEM_OP_DUMMY(ndummy, 1), \ SPI_MEM_OP_DATA_IN(len, buf, 2)) +#define SPINAND_PAGE_READ_FROM_CACHE_X2_OP_3A(addr, ndummy, buf, len) \ + SPI_MEM_OP(SPI_MEM_OP_CMD(0x3b, 1), \ + SPI_MEM_OP_ADDR(3, addr, 1), \ + SPI_MEM_OP_DUMMY(ndummy, 1), \ + SPI_MEM_OP_DATA_IN(len, buf, 2)) + #define SPINAND_PAGE_READ_FROM_CACHE_X4_OP(addr, ndummy, buf, len) \ SPI_MEM_OP(SPI_MEM_OP_CMD(0x6b, 1), \ SPI_MEM_OP_ADDR(2, addr, 1), \ SPI_MEM_OP_DUMMY(ndummy, 1), \ SPI_MEM_OP_DATA_IN(len, buf, 4)) +#define SPINAND_PAGE_READ_FROM_CACHE_X4_OP_3A(addr, ndummy, buf, len) \ + SPI_MEM_OP(SPI_MEM_OP_CMD(0x6b, 1), \ + SPI_MEM_OP_ADDR(3, addr, 1), \ + SPI_MEM_OP_DUMMY(ndummy, 1), \ + SPI_MEM_OP_DATA_IN(len, buf, 4)) + #define SPINAND_PAGE_READ_FROM_CACHE_DUALIO_OP(addr, ndummy, buf, len) \ SPI_MEM_OP(SPI_MEM_OP_CMD(0xbb, 1), \ SPI_MEM_OP_ADDR(2, addr, 2), \ SPI_MEM_OP_DUMMY(ndummy, 2), \ SPI_MEM_OP_DATA_IN(len, buf, 2)) +#define SPINAND_PAGE_READ_FROM_CACHE_DUALIO_OP_3A(addr, ndummy, buf, len) \ + SPI_MEM_OP(SPI_MEM_OP_CMD(0xbb, 1), \ + SPI_MEM_OP_ADDR(3, addr, 2), \ + SPI_MEM_OP_DUMMY(ndummy, 2), \ + SPI_MEM_OP_DATA_IN(len, buf, 2)) + #define SPINAND_PAGE_READ_FROM_CACHE_QUADIO_OP(addr, ndummy, buf, len) \ SPI_MEM_OP(SPI_MEM_OP_CMD(0xeb, 1), \ SPI_MEM_OP_ADDR(2, addr, 4), \ SPI_MEM_OP_DUMMY(ndummy, 4), \ SPI_MEM_OP_DATA_IN(len, buf, 4)) +#define SPINAND_PAGE_READ_FROM_CACHE_QUADIO_OP_3A(addr, ndummy, buf, len) \ + SPI_MEM_OP(SPI_MEM_OP_CMD(0xeb, 1), \ + SPI_MEM_OP_ADDR(3, addr, 4), \ + SPI_MEM_OP_DUMMY(ndummy, 4), \ + SPI_MEM_OP_DATA_IN(len, buf, 4)) + #define SPINAND_PROG_EXEC_OP(addr) \ SPI_MEM_OP(SPI_MEM_OP_CMD(0x10, 1), \ SPI_MEM_OP_ADDR(3, addr, 1), \ -- 2.20.1