Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp108126ybm; Mon, 20 May 2019 12:47:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqw4vuOz6wLm2DlCRSkjMxpKg5/88FHZN+LdZAkL4lXRi7QrWBrZV904zYE8TCe8/S1soAJ9 X-Received: by 2002:a17:902:d715:: with SMTP id w21mr62239501ply.234.1558381669657; Mon, 20 May 2019 12:47:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558381669; cv=none; d=google.com; s=arc-20160816; b=ftlwISRC6jArWpm0wNg0NQzQBRWnfcgQVIpHUyK7k55yLnDcwRlbjYJGtb8TcVpQU4 dp0fIBwJySdpTtEkJqZ+EU49mu/NFC4/ZGTpFaze84jCCMSPkeIu7eEvn2PbjIByLc3g 3XwLnwfWjyud9CoDkxDBdD+UzSc8gKoHVGDvO39aMqofUPDLfxM5VrPm5Ik8CvQj5XQi pI/nLlx+tWIRxrDBk5HsNDBbgL5IoHI5aR6DycvBZoy7ir06HNyJWiWYCrvh2jCciqlu FJ4ewiNQaLxXGngl546UpRaxLdA60brWLOHl0hhe9lg2uEku0c2G8RLBKEw1JMcOHQjq jX4A== 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=KMs69SqpDm0sXJkDWA59NUTbZBHKG2JWYxS4n2HPvY0=; b=az/Rl74LyCME8UwtPYqBE9ePB9dN5HqQfb9nzhbppxYYphhxuJM1+VE7Gi8qWNkCzX xj9jombV4eMq+kFPkgtrrJSfeLK96KJteQ07ruzcRxnPLtpplhzBYT8DKIFO2kL7U7Kr qyDq40pCiI2A7BqRl2j+USSVMvfKCPVaLYVKdFVTMeiXFOMGDdzaUEZ0QYwwxHVSGQTW 5lYg0dUnLJwc+kJvS9rZ1G4u4uQvoDe86fvA3FjZ+EmRYQEFZG+STM7kSKPJuz8oVofi iaCerYVrOACPvzMEGYA7ApLRYLd/lZVEfImpnMdk9wFSxAM0WAyJ4+Ev1RzvDui/LYzF YPEQ== 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 b5si18536623pgd.557.2019.05.20.12.47.34; Mon, 20 May 2019 12:47:49 -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 S1726761AbfETTpD (ORCPT + 99 others); Mon, 20 May 2019 15:45:03 -0400 Received: from mx.allycomm.com ([138.68.30.55]:63139 "EHLO mx.allycomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725554AbfETTpD (ORCPT ); Mon, 20 May 2019 15:45:03 -0400 Received: from allycomm.com (184-23-191-215.vpn.dynamic.sonic.net [184.23.191.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx.allycomm.com (Postfix) with ESMTPSA id 9BF963BCD5; Mon, 20 May 2019 12:45:01 -0700 (PDT) From: Jeff Kletsky To: Miquel Raynal , Boris Brezillon , Richard Weinberger , David Woodhouse , Brian Norris , Marek Vasut Cc: Jeff Kletsky , Frieder Schrempf , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 1/3] mtd: spinand: Define macros for page-read ops with three-byte addresses Date: Mon, 20 May 2019 12:44:52 -0700 Message-Id: <20190520194454.32175-2-lede@allycomm.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190520194454.32175-1-lede@allycomm.com> References: <20190520194454.32175-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 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