Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp980132ybm; Wed, 22 May 2019 15:07:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqw9UbnJCuZ2cyXak00AVSF03+JbAKb1y+sG2B+QY46EhraeZyaqX1VCDYH5UfK6Lr2jBDgI X-Received: by 2002:a63:5d23:: with SMTP id r35mr4409078pgb.435.1558562866506; Wed, 22 May 2019 15:07:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558562866; cv=none; d=google.com; s=arc-20160816; b=krP36NMrigVkBHjmiD5mLJSlpd/Quevgi5iCfLMMtPWf58EoT6D+bzzOvwc1UDEk9r x16wfefWCbZWa+JoEHqc0cssEjZWyNaoUqIgmRE96e3K+6ZQrbf5Yq+pkHtoJnlnrbF/ pjUkr7vDAuCljk16Sg9jI6mTCFRbodvQm/kCWQ5iMi/2+46mhJrcwvBEd0Mh/i+OKGWj XQgERKRCFaZsndQf9oUyDlWxkdrG3lopuIDjhwM2VXq8eFNp/dem3rHhHLakEcO161N4 mzFM3zBqaBiBkDN6scMMGnkdfA8c+KOOJE4TuvZajV2aNPqV8P4WfA8msLntaYcyYzDF DgQA== 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=PrwZFjxLvT21GdvMdQM5Oo21Zeyttc4gOLYGNNXMj/w=; b=zBJ22ETPAvV5IYHBeXuBNEOqi2aM9/jJg2/Qwa2Ju1b7O/N5wAC+qHZMhQKrYcAl7P fC2E8i0wxA/Dt5KA5O3MPO1x96oSokScpL1HyDVkiExtdHiQypZ5uCoBD9rDH5DLX2o3 Fnu4a782HfG01L41iOpLxr7Abwghomx7GcCK8UvZgsNqDshoD8tea3RMoQwNgwuJcK3G 3+Qbx+QeSxVkAr9n/CZRQizu0d+LJKZ7ZcwpTWWO5RG0Tdep2V7tVYjYysoEKeUll1mG 4CgQEB9IyQIiH0kht0HYTPIEtRIMqhunBnbpuDcKhWJMH7LjTlxcbzfIF30p+kaoG+ZI YMzg== 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 195si26502679pgb.327.2019.05.22.15.07.30; Wed, 22 May 2019 15:07:46 -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 S1728109AbfEVWGL (ORCPT + 99 others); Wed, 22 May 2019 18:06:11 -0400 Received: from mx.allycomm.com ([138.68.30.55]:13329 "EHLO mx.allycomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726390AbfEVWGK (ORCPT ); Wed, 22 May 2019 18:06:10 -0400 Received: from allycomm.com (unknown [IPv6:2601:647:5401:2210::49]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx.allycomm.com (Postfix) with ESMTPSA id 2E3713CB15; Wed, 22 May 2019 15:06:08 -0700 (PDT) From: Jeff Kletsky To: Miquel Raynal , Richard Weinberger , David Woodhouse , Brian Norris , Marek Vasut , Vignesh Raghavendra Cc: Jeff Kletsky , Frieder Schrempf , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 1/3] mtd: spinand: Define macros for page-read ops with three-byte addresses Date: Wed, 22 May 2019 15:05:53 -0700 Message-Id: <20190522220555.11626-2-lede@allycomm.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190522220555.11626-1-lede@allycomm.com> References: <20190522220555.11626-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 Reviewed-by: Frieder Schrempf --- 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 507f7e289bd1..8aa39ac41e8e 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