Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp6843516yba; Tue, 14 May 2019 14:56:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqxxhxy9Oq7WXhgejqtuOBMMAG8N5kLr9SCMgYCcrwfy+U8m3+xDwL57tOElbgyw/Jm6RiJS X-Received: by 2002:a63:c02:: with SMTP id b2mr23720895pgl.5.1557870962490; Tue, 14 May 2019 14:56:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557870962; cv=none; d=google.com; s=arc-20160816; b=vEtaUD7aAIsFBOU52/g5U7Xf5FV3+W45tywxnor42CspzgfyEoYLi3ZnhSLa5kq5KC rRKw0nUWn5241JGZ0w0GyCbfz9D8vwYJtisVhj0FyrB7kkAcfIlaFm2pz48aPKM5adu5 8PsPyPApNa9kJ//gZ7FS2K4Cm0VEH22uKMxLi2NrFZudwT2JVOsuax8n2kyIy1m8gdy3 U+O+7mKnf5/I9V1T8RLWoDwNFA1MU5hqipWV9ueKdGYY8C8bACYxuM7WbY/Ahsjm2+zs 02l9kDeewvkA6ijw0ghSLeUrEqwtUQDuF30Mrb6+TCt9RZk3CCsmWzZhjvO2VFNZVjpd WDWQ== 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=NkBEw8LmoTfjCWrzYM9CGcEC4qTG+h4umiSdYrQor9FFLRGMDOMx4lpyqhNF33tTaA Df0ug3xLZdX/NBxcn7klVSTWH/Qi+YdTriyCBP8BC9r9VFX3D9eeRNTVt5cmwM+c1jjQ UOrsKO4DR4QIxzjF6Q+/7bXzr1uBvDNaMXe6Qy0bjcdhdnfdTRrxAlTX6vOAQFJ7X7Ku qrAiArEjgA4ZD2ikg4C0idt+gtalxSfKYOF9L9otd+j8YM3fseudQXKCv1GMQx22BA46 RrFvJTXk/Hfxbxd1h6V9rI7+Huw3AwgwA5LTgVC/vuVIZAL0nbTYxGOYMTC5d2dJZ702 lFzg== 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 p22si8127pgj.567.2019.05.14.14.55.47; Tue, 14 May 2019 14:56:02 -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 S1726279AbfENVyG (ORCPT + 99 others); Tue, 14 May 2019 17:54:06 -0400 Received: from mx.allycomm.com ([138.68.30.55]:19870 "EHLO mx.allycomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726134AbfENVyG (ORCPT ); Tue, 14 May 2019 17:54:06 -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 2633E3B813; Tue, 14 May 2019 14:54:04 -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:53:13 -0700 Message-Id: <20190514215315.19228-2-lede@allycomm.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190514215315.19228-1-lede@allycomm.com> References: <20190514215315.19228-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