Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp6826445yba; Tue, 14 May 2019 14:31:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqwAoQ/QzNMzrXs+ISQ0s4G5qPq9ehvP38uWeHqxK1sJEyuqVlMs0d2yaPi1ElTHA1p1EeMJ X-Received: by 2002:a62:5a47:: with SMTP id o68mr18256782pfb.149.1557869519791; Tue, 14 May 2019 14:31:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557869519; cv=none; d=google.com; s=arc-20160816; b=UtRY8xRVMfrCojstxuIqik7VwSRcfu1pq1Ixk4r/geTX4zPP+m1RNdX0hoL40VcHq2 OTKrms1/plxNs2oQwEfm/CtOk7lk0aHYHXy6/uMEAXn8F5WxgP1uHua/zsUgM2E+BLUP 8pvOReSG/EOD+U4cz/2Ylb2yBg9Bx2sD39pfnBgGsrmE03Aq2dI+RUd7xieGHLcN/Sdz J3J199l7i9TbgI+Edrv8RCKNMz8UnQDYk/Ce8kVZXtf6be6Ybl4P7TXsaIF6XQTIp9w8 hZbgOJUUOmTwR+SzkR6011BHYTnWh6/apMjj3HBfF/7sQhvDxIvsFWtqHuV9dPK0f4H9 hGgQ== 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=cgkEufQR3ZTTeZWtR4Q0XYgb/uAOVrP8EdPfkh8T4bBY9E7LQjkBby605NEt0hoI7G udu0vIN7movZdix9J8nOGAm9ZD7Vf/ERhMIXMDLb9APODnwDmTFgIvvARqAzpyjyQwcK lcnauTemkc1iAJ5MAm0TMJvR4PiPdxAp4vZiVY01rtGopQdBoC6z2ZCwDzImsj6ZIGaD SYubYydWyQDbuUXgMsSGuCGIvIEDmpNiDOw2ns3LD6Sp74npLz09fQ8xhDuj5tfdZeVM JYbefYoNPyIikq19h5MsEJdN/u07h+4QcIfWLTGjawgRw8nYDs00/dv23ZV1gzR1+h9O zivw== 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 b13si9979042plz.194.2019.05.14.14.31.45; Tue, 14 May 2019 14:31:59 -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 S1726567AbfENV3v (ORCPT + 99 others); Tue, 14 May 2019 17:29:51 -0400 Received: from mx.allycomm.com ([138.68.30.55]:57133 "EHLO mx.allycomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726089AbfENV3u (ORCPT ); Tue, 14 May 2019 17:29:50 -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 336653B682; Tue, 14 May 2019 14:29:49 -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:29:39 -0700 Message-Id: <20190514212941.18794-2-lede@allycomm.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190514212941.18794-1-lede@allycomm.com> References: <20190514212941.18794-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