From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.7 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A167AC04EB9 for ; Mon, 3 Dec 2018 08:55:42 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6D30320881 for ; Mon, 3 Dec 2018 08:55:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="V0UAbEN+"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="XF6mRQak" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6D30320881 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ENe74D3YzYzWKA0JLVMs9Fb7isADDm7j5f7b4lZnQGs=; b=V0UAbEN+vKaGvR /CSNcBcv9Yzd/k4x33xfE62z6Clwnf/3GRiSkz5OnChlQ2Vo1fczxVk5y/X+SMUC0mUGw5aosCgIT e3Jh9up8JGK0Y5paaWJJYWX5JiAsfcxqP3c1TbVbs4n9DNJXwqAzb0Apla07xY5KmuGfkpbtKOJkh +BWWcyy/8cMz+9l+vSEaimNGY43bjTsNsNBwd9GYe6XNN+ZR+w7RgX4FdtnCUaqBxz0nEaqH3CKox QswQ4ib6m1XSi4jR8dVE2SYR/z1Pv+c8Q06lfmWqQdrSHbYdevL6MKcA3xpFNO/MVJLHGBiIAtCf8 LJsZOnWRQ9bLKWVazOrg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gTk0q-0007bz-Cq; Mon, 03 Dec 2018 08:55:32 +0000 Received: from mail-eopbgr40076.outbound.protection.outlook.com ([40.107.4.76] helo=EUR03-DB5-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gTjli-0004bV-A4; Mon, 03 Dec 2018 08:40:31 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=SUFIqMUmU7aVctiSrOoJnSAVup/dBqZmvL17Uyu0wD4=; b=XF6mRQakO2MnxJVLEusg0aNfmjN8JRifes0+FHJ0gWJXsDzKKVHMPDfZJteKpL7x0y2ZoWpid0iB+YhXoh5iyPbtO7EWTF3ciUo80LgZF6hUJcOeDNjnH8yFPVPq+RqKjrhGuz43H/soUXFZvxc4uhnr8UOGfNAK7QJ6teSsFtA= Received: from VI1PR04MB5726.eurprd04.prod.outlook.com (20.178.127.24) by VI1PR04MB4718.eurprd04.prod.outlook.com (20.177.48.159) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1382.22; Mon, 3 Dec 2018 08:39:29 +0000 Received: from VI1PR04MB5726.eurprd04.prod.outlook.com ([fe80::595a:9890:8397:5d51]) by VI1PR04MB5726.eurprd04.prod.outlook.com ([fe80::595a:9890:8397:5d51%4]) with mapi id 15.20.1382.020; Mon, 3 Dec 2018 08:39:29 +0000 From: Yogesh Narayan Gaur To: "linux-mtd@lists.infradead.org" , "boris.brezillon@bootlin.com" , "broonie@kernel.org" , "marek.vasut@gmail.com" , "vigneshr@ti.com" , "linux-spi@vger.kernel.org" , "devicetree@vger.kernel.org" Subject: [PATCH v5 3/7] mtd: spi-nor: add opcodes for octal Read/Write commands Thread-Topic: [PATCH v5 3/7] mtd: spi-nor: add opcodes for octal Read/Write commands Thread-Index: AQHUiuOuxIvwGhR/Ik2nR/UOeUIxtQ== Date: Mon, 3 Dec 2018 08:39:18 +0000 Message-ID: <1543826226-30898-4-git-send-email-yogeshnarayan.gaur@nxp.com> References: <1543826226-30898-1-git-send-email-yogeshnarayan.gaur@nxp.com> In-Reply-To: <1543826226-30898-1-git-send-email-yogeshnarayan.gaur@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: SG2PR04CA0143.apcprd04.prod.outlook.com (2603:1096:3:16::27) To VI1PR04MB5726.eurprd04.prod.outlook.com (2603:10a6:803:e4::24) authentication-results: spf=none (sender IP is ) smtp.mailfrom=yogeshnarayan.gaur@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [14.143.30.134] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; VI1PR04MB4718; 6:ScpS29w2hKBbO10PnIp1nMXhUmCILlOkcmfelVtcgkBS7peX+/Fqoj2jhoZyWQbvcRTXR2alN9HWOzm21+kaXlDK3UQo3NJKtmrVNdkxybx2JpbCeZdM/iEqPUQyxx9DWFKa4/ZbggRCan8CLtzkerYrORjh/Jp+RdymGOPwWoUFwsIKeCLdjNIqsOBFHj6oEhOyRIv36Z7KSKMMzK54ONF20qG6Lfc1i7slIsUl7PwSVYDyu6g0WiwvkUsU/e8IRrauD0F9s+xqJf+tqhlfFsLSddUdpC9yMYMEj+U6l6GgFudydS+1BGTw06hQdKB8/CYK/JZJdiigm1DPVC5JrbRj9DA/b7YaisYiX4aMIxvjk6frLgAXtv2YTPfLUBT5W8L9pu/k04URWAuBe+BU6Xl9BVb3mbtJZ0YAb+x1NX05fpQy1KNjT7TCxuUSqVmaRnlcNrII98UT4S3Od1ICrw==; 5:hQAiWoI7eFgohmjOpYH5nPsPdv1LeFIt34i42B2g8MHT7eOswOENrVTyyllQOafpbqxpjWXiXVKTB1obaI2TjNuz/ICF+60qjVWHQdZkw2TEgGHYA6gIu8+COjOoJxXn1/9cepjL5UwcEsvXtlcdq1v+JbQbx8HWs4FQ9DMj8cI=; 7:17BgCgL1NhdR2HuQlRuiicwrcanqG2Ko5K5eAas76bhlTB2efhqpypQE9RmSPQ0JpgfAAwNzp2pQn7l8ToYewcZBOvi+oVu8zIeI+kkLK4WIE8LV7qJB3x06tzCRhHWahxQ2vnZGZPqveI+NeJ568A== x-ms-office365-filtering-correlation-id: 1e4d7252-0144-4f82-a31a-08d658fad073 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390098)(7020095)(4652040)(8989299)(5600074)(711020)(4618075)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020); SRVR:VI1PR04MB4718; x-ms-traffictypediagnostic: VI1PR04MB4718: x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(3231455)(999002)(944501493)(52105112)(3002001)(10201501046)(6055026)(148016)(149066)(150057)(6041310)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123560045)(20161123558120)(201708071742011)(7699051)(76991095); SRVR:VI1PR04MB4718; BCL:0; PCL:0; RULEID:; SRVR:VI1PR04MB4718; x-forefront-prvs: 08756AC3C8 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(346002)(376002)(396003)(136003)(366004)(39860400002)(199004)(189003)(7736002)(99286004)(6486002)(76176011)(305945005)(6512007)(6506007)(53936002)(66066001)(386003)(105586002)(106356001)(68736007)(256004)(71190400001)(71200400001)(5660300001)(110136005)(55236004)(54906003)(7416002)(14454004)(86362001)(478600001)(575784001)(6116002)(3846002)(25786009)(186003)(6666004)(2201001)(2501003)(97736004)(2906002)(81156014)(81166006)(6436002)(8676002)(4326008)(486006)(78486014)(36756003)(102836004)(52116002)(26005)(39060400002)(2616005)(8936002)(446003)(11346002)(316002)(476003)(21314003); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR04MB4718; H:VI1PR04MB5726.eurprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: wEpH0U5EPJS0Ssdp4h0uT0wSHgqEu+FAocipzTYiKoCMnwXFjGewZ63oI+e3gTNxtIYNqDYgg/RppdkKC4LzEyCCUC6sH+tZ5Lg0GqMgrfp42KSwRhsL+DToJ910NDF3955fv8xYVKzqarictNq5rix/LhSqcI3zmsjCX+lUEWBOmsuZMgWSBd2rwlnIOEnqsG3BGmC2ggYItWI8jUQyQ6tGJYT6K1jgdGuCMFJJsYRO3OM6GBP48cHJiAxChbeTb+3koUkPkV3+QxPbcPRGUIcTccWm+SrkuWuhQ5depj7PwydZBJSSdJPYCgFTaNDggQXNMX39DOjYX6opt0yAPX8R6GpSDDJSCZEDsbG1lWY= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1e4d7252-0144-4f82-a31a-08d658fad073 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Dec 2018 08:39:18.5784 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB4718 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181203_003955_167159_B0064A2B X-CRM114-Status: GOOD ( 14.71 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "mark.rutland@arm.com" , "robh@kernel.org" , Yogesh Narayan Gaur , "linux-kernel@vger.kernel.org" , "frieder.schrempf@exceet.de" , "computersforpeace@gmail.com" , "shawnguo@kernel.org" , "linux-arm-kernel@lists.infradead.org" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org - Add opcodes for octal I/O commands * Read : 1-1-8 and 1-8-8 protocol * Write : 1-1-8 and 1-8-8 protocol * opcodes for 4-byte address mode command - Entry of macros in _convert_3to4_xxx function - Add flag specifying flash support octal read commands. Signed-off-by: Vignesh R Signed-off-by: Yogesh Gaur --- Changes for v5: - Modified string 'octo' with 'octal'. Changes for v4: - None Changes for v3: - Modified string 'octal' with 'octo'. Changes for v2: - Incorporated review comments of Boris and Vignesh drivers/mtd/spi-nor/spi-nor.c | 16 ++++++++++++++-- include/linux/mtd/spi-nor.h | 8 ++++++++ 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c index 398d273..7a2176d 100644 --- a/drivers/mtd/spi-nor/spi-nor.c +++ b/drivers/mtd/spi-nor/spi-nor.c @@ -90,6 +90,7 @@ struct flash_info { #define NO_CHIP_ERASE BIT(12) /* Chip does not support chip erase */ #define SPI_NOR_SKIP_SFDP BIT(13) /* Skip parsing of SFDP tables */ #define USE_CLSR BIT(14) /* use CLSR command */ +#define SPI_NOR_OCTAL_READ BIT(15) /* Flash supports Octal Read */ int (*quad_enable)(struct spi_nor *nor); }; @@ -209,6 +210,8 @@ static inline u8 spi_nor_convert_3to4_read(u8 opcode) { SPINOR_OP_READ_1_2_2, SPINOR_OP_READ_1_2_2_4B }, { SPINOR_OP_READ_1_1_4, SPINOR_OP_READ_1_1_4_4B }, { SPINOR_OP_READ_1_4_4, SPINOR_OP_READ_1_4_4_4B }, + { SPINOR_OP_READ_1_1_8, SPINOR_OP_READ_1_1_8_4B }, + { SPINOR_OP_READ_1_8_8, SPINOR_OP_READ_1_8_8_4B }, { SPINOR_OP_READ_1_1_1_DTR, SPINOR_OP_READ_1_1_1_DTR_4B }, { SPINOR_OP_READ_1_2_2_DTR, SPINOR_OP_READ_1_2_2_DTR_4B }, @@ -225,6 +228,8 @@ static inline u8 spi_nor_convert_3to4_program(u8 opcode) { SPINOR_OP_PP, SPINOR_OP_PP_4B }, { SPINOR_OP_PP_1_1_4, SPINOR_OP_PP_1_1_4_4B }, { SPINOR_OP_PP_1_4_4, SPINOR_OP_PP_1_4_4_4B }, + { SPINOR_OP_PP_1_1_8, SPINOR_OP_PP_1_1_8_4B }, + { SPINOR_OP_PP_1_8_8, SPINOR_OP_PP_1_8_8_4B }, }; return spi_nor_convert_opcode(opcode, spi_nor_3to4_program, @@ -2093,7 +2098,7 @@ enum spi_nor_read_command_index { SNOR_CMD_READ_4_4_4, SNOR_CMD_READ_1_4_4_DTR, - /* Octo SPI */ + /* Octal SPI */ SNOR_CMD_READ_1_1_8, SNOR_CMD_READ_1_8_8, SNOR_CMD_READ_8_8_8, @@ -2110,7 +2115,7 @@ enum spi_nor_pp_command_index { SNOR_CMD_PP_1_4_4, SNOR_CMD_PP_4_4_4, - /* Octo SPI */ + /* Octal SPI */ SNOR_CMD_PP_1_1_8, SNOR_CMD_PP_1_8_8, SNOR_CMD_PP_8_8_8, @@ -3195,6 +3200,13 @@ static int spi_nor_init_params(struct spi_nor *nor, SNOR_PROTO_1_1_4); } + if (info->flags & SPI_NOR_OCTAL_READ) { + params->hwcaps.mask |= SNOR_HWCAPS_READ_1_1_8; + spi_nor_set_read_settings(¶ms->reads[SNOR_CMD_READ_1_1_8], + 0, 8, SPINOR_OP_READ_1_1_8, + SNOR_PROTO_1_1_8); + } + /* Page Program settings. */ params->hwcaps.mask |= SNOR_HWCAPS_PP; spi_nor_set_pp_settings(¶ms->page_programs[SNOR_CMD_PP], diff --git a/include/linux/mtd/spi-nor.h b/include/linux/mtd/spi-nor.h index 8b1acf6..019f534 100644 --- a/include/linux/mtd/spi-nor.h +++ b/include/linux/mtd/spi-nor.h @@ -50,9 +50,13 @@ #define SPINOR_OP_READ_1_2_2 0xbb /* Read data bytes (Dual I/O SPI) */ #define SPINOR_OP_READ_1_1_4 0x6b /* Read data bytes (Quad Output SPI) */ #define SPINOR_OP_READ_1_4_4 0xeb /* Read data bytes (Quad I/O SPI) */ +#define SPINOR_OP_READ_1_1_8 0x8b /* Read data bytes (Octal Output SPI) */ +#define SPINOR_OP_READ_1_8_8 0xcb /* Read data bytes (Octal I/O SPI) */ #define SPINOR_OP_PP 0x02 /* Page program (up to 256 bytes) */ #define SPINOR_OP_PP_1_1_4 0x32 /* Quad page program */ #define SPINOR_OP_PP_1_4_4 0x38 /* Quad page program */ +#define SPINOR_OP_PP_1_1_8 0x82 /* Octal page program */ +#define SPINOR_OP_PP_1_8_8 0xc2 /* Octal page program */ #define SPINOR_OP_BE_4K 0x20 /* Erase 4KiB block */ #define SPINOR_OP_BE_4K_PMC 0xd7 /* Erase 4KiB block on PMC chips */ #define SPINOR_OP_BE_32K 0x52 /* Erase 32KiB block */ @@ -73,9 +77,13 @@ #define SPINOR_OP_READ_1_2_2_4B 0xbc /* Read data bytes (Dual I/O SPI) */ #define SPINOR_OP_READ_1_1_4_4B 0x6c /* Read data bytes (Quad Output SPI) */ #define SPINOR_OP_READ_1_4_4_4B 0xec /* Read data bytes (Quad I/O SPI) */ +#define SPINOR_OP_READ_1_1_8_4B 0x7c /* Read data bytes (Octal Output SPI) */ +#define SPINOR_OP_READ_1_8_8_4B 0xcc /* Read data bytes (Octal I/O SPI) */ #define SPINOR_OP_PP_4B 0x12 /* Page program (up to 256 bytes) */ #define SPINOR_OP_PP_1_1_4_4B 0x34 /* Quad page program */ #define SPINOR_OP_PP_1_4_4_4B 0x3e /* Quad page program */ +#define SPINOR_OP_PP_1_1_8_4B 0x84 /* Octal page program */ +#define SPINOR_OP_PP_1_8_8_4B 0x8e /* Octal page program */ #define SPINOR_OP_BE_4K_4B 0x21 /* Erase 4KiB block */ #define SPINOR_OP_BE_32K_4B 0x5c /* Erase 32KiB block */ #define SPINOR_OP_SE_4B 0xdc /* Sector erase (usually 64KiB) */ -- 2.7.4 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel