Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753156AbbFRPPA (ORCPT ); Thu, 18 Jun 2015 11:15:00 -0400 Received: from mail-bn1on0060.outbound.protection.outlook.com ([157.56.110.60]:60516 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751955AbbFRPOw (ORCPT ); Thu, 18 Jun 2015 11:14:52 -0400 Authentication-Results: spf=pass (sender IP is 149.199.60.100) smtp.mailfrom=xilinx.com; vger.kernel.org; dkim=none (message not signed) header.d=none; From: Anurag Kumar Vulisha To: , , , , , , , , CC: , , , , , , , Anurag Kumar Vulisha Subject: [RFC PATCH] mtd: spi-nor: Added flag check for quad io protocol for micron flash parts Date: Thu, 18 Jun 2015 20:28:59 +0530 Message-ID: <1434639539-7517-1-git-send-email-anuragku@xilinx.com> X-Mailer: git-send-email 1.7.4 X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.0.0.1202-21620.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1;BL2FFO11FD007;1:1qiCd1uS5q0HXJimuRYzvtxTlj8/xWE2BldzqRZaP3rLAH7+JUQegmo7XekG+VDr1t++xYNiaYApcl5n4bDxuz6JG9j7tKOt/V4m8pKUj913LUvlmrgAp0l2tqirEILdxB2YzYoZuoX8SF+zGInS+pSjVQxXQtZTQMeb3Dv/8XJgAJuCgNPC+l2nZReIKBQD6kiB1/QV/RQwCOGK5yug+1AfsWIEEzs0lTlsQTjqhB0YivQvNDbU5x6yln7yrbOFoirskSQG8384R1B6W89oBUcu7Q36v4QEWVQt9tle+D8ETlk9k2Sh8iV1UUEpj5RREHJUpcV8WE7iWHycAYdl8ZvaKhfKSor3rD/dj+81AHc= X-Forefront-Antispam-Report: CIP:149.199.60.100;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10009020)(6009001)(2980300002)(438002)(189002)(199003)(103686003)(50466002)(36756003)(19580395003)(86362001)(2201001)(52956003)(5001770100001)(87936001)(50986999)(42186005)(48376002)(63266004)(46102003)(50226001)(47776003)(6806004)(45336002)(46386002)(19580405001)(77156002)(229853001)(62966003)(36386004)(92566002)(33646002)(5001920100001)(106466001)(107886002)(5001960100002)(189998001)(7059030)(107986001)(90966001)(4001430100001);DIR:OUT;SFP:1101;SCL:1;SRVR:BL2FFO11HUB024;H:xsj-pvapsmtpgw02;FPR:;SPF:Pass;MLV:ovrnspm;MX:1;A:1;PTR:unknown-60-100.xilinx.com,xapps1.xilinx.com;LANG:en; MIME-Version: 1.0 Content-Type: text/plain X-Microsoft-Exchange-Diagnostics: 1;BL2FFO11HUB024;2:5isKu1lmv21Y24qJ2gIawTXZpR2fZl/zeXMMrGeksZAoCLSwCEMYpgfKmMVE1r9y;2:oe0U6oWgl0ZcXzYl0I09AERyI8+YoxQq7fjKsrBgVxc4XBzvSaPu8vgrncLrnYJu4Jg1BRsKiVKf3abGcK2CZnk3JoKkZw10x/Vpi4cT95yX99zDJfb4FAksL4hHV8Mqjd2qc+VBoNmuJ8+OOR9pslGhu6vgA4XyVdN3ys79sAtNufKkKgenImitpgHZaMXjR8lJx50ZCCldy2etDnlMmENO8+DICE8jsxG9bZ80mDWEJ8QQThWWb90xYh/H/E3p;6:NBISqpk+mrQzF9xlB2wW8yD2pgfJLk00PJr1SZTYH0+sbtsOkP/J+Lhmy7fgj2VlHoGSuN4IorMaB8/lFIxYJR/nApx59gIiSeYCUTqKXgT9VE/Xo2YXR2Xp4mdqMP+fPsxCQzwTwz8QyDaVSRrmzhDwgiw/7BHxUP1nMfzHW6TVh6xyD9AMlsgIb9/6aG+ecLf60WTEV243VcjSYAnfSa7VqLJj6yi/RPs4v+0+UwvmzTQN3YLADv56wkqie/MOiUfzxlp7GCagmzDt1S+jPE5qxIlLulbSoQ/JF+ke7nxdlNj6wOlchEshWD/M+MKQJOTQ7i7V9y+EPEwkzDF0DjkzTmA5w8S+/GrM+C+m+W96IzJQeWl0M14+rNoXxeu/fyDmV3lnXYPtK8LYHDS2TCyqZpasv+bk8Q4QW1dD3YfRdrElAYAj5HFM7HQpTIs38Lr9A2/4WhnHnTebilszALRq0HUtOpxBRAk3RL+jcHPLuLCT9hbjM+RoIctDInOn X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BL2FFO11HUB024; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(520003)(5005006)(3002001);SRVR:BL2FFO11HUB024;BCL:0;PCL:0;RULEID:;SRVR:BL2FFO11HUB024; X-Microsoft-Exchange-Diagnostics: 1;BL2FFO11HUB024;3:Y9we3kRwItTK+DJvxqJ7oXJPXTZSQtSyGkAw2yVSkkUG2T+a+qzVbeKeJmMd78ZY6Eqhu+3TbIlPxpMY7E2ZjEFewMjlX21fP6/dRccZtQ+sU+GleskDhNqkfoixzsuDz8ECKJOPCM1uf5vlNy+9KWrnCdrZDdF1JXBXNT2/RsJxMTp+HAUtGUybaUkhRZLxQfGdm5vswhDO3pbtL0uSFJ1BwfITR9lL/h1dMcgXUCqeBrkCfWxdYDSa2o4e080Xx17ir/Fpr6gIN6RnDboYsPY+HCgpjOfSE7de7rd7Tra5HquSHNdXt7DCXy+fCKK3 X-Forefront-PRVS: 0611A21987 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BL2FFO11HUB024;9:8zmAkHZE8dN+bUL8eX3N/mP43fKLF7t3SViuGFo57?= =?us-ascii?Q?ZKLwnlkeMSvjM9QWruFEb4LPV68zJcj5jc04Snmqf/O+H+KYmb287jjjFPe8?= =?us-ascii?Q?XuPlM4uDdCdUFUxvjegspO9ToFZmZ9hzFNoHdvMF2ZEV+YiECM+DS85d/OKX?= =?us-ascii?Q?Q9W+sRi1+XS+jEsYpZxtiKUR9de+mMhCe1nD413vx671PHo1Yuim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ostics: 1;BL2FFO11HUB024;3:i8mzqgkjCBFW9YNcTUOd4FHA1oV9/foZ0VDnQ2pO2e83kh6i25xN8kYchsho5BvlHPVYfpfFXwEnhEdl7RHgaSprlR+bUuNQ1G7F7Rjcr6cYOEtGQl25ZA2kEA8qBcRSORhXXvdbPMivLCLE88C0NQ==;10:DBo63vMEPCeOEpZo7DERTBWsSIKiuJf9asLyPXrEEJaHEgIvTUD/9aExM1M1+cc+JJ738EernHx54bNEVhLxuH8TxqxyzUP9SOQXhUdHZso= X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jun 2015 14:59:05.9132 (UTC) X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c;Ip=[149.199.60.100];Helo=[xsj-pvapsmtpgw02] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL2FFO11HUB024 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1859 Lines: 45 micron flash parts by default operates in extended spi protocol,which accepts command on single line and can accept address & data on one,two and four lines depending on the command sent.In set_quad_enable() we are enabling the quad io protocol for micron flash parts by updating the EVCR register,in this method the flash expects the command,address and data to be transmitted on all four data lines which may not be supported on all qspi controllers.So READ_1_1_4 command does not necessarily go out using those bus widths. So i have added SPI_QUAD_IO_PROTOCOL flag,which should be checked before enabling the quad io protocol. Signed-off-by: Anurag Kumar Vulisha --- drivers/mtd/spi-nor/spi-nor.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c index 14a5d23..a6fa8dc 100644 --- a/drivers/mtd/spi-nor/spi-nor.c +++ b/drivers/mtd/spi-nor/spi-nor.c @@ -55,6 +55,7 @@ struct flash_info { #define SPI_NOR_DUAL_READ 0x20 /* Flash supports Dual Read */ #define SPI_NOR_QUAD_READ 0x40 /* Flash supports Quad Read */ #define USE_FSR 0x80 /* use flag status register */ +#define SPI_QUAD_IO_PROTOCOL 0x100 /* use quad io protocol */ }; #define JEDEC_MFR(info) ((info)->id[0]) @@ -962,6 +963,8 @@ static int set_quad_mode(struct spi_nor *nor, struct flash_info *info) } return status; case CFI_MFR_ST: + if (!(info->flags & SPI_QUAD_IO_PROTOCOL)) + return 0; status = micron_quad_enable(nor); if (status) { dev_err(nor->dev, "Micron quad-read not enabled\n"); -- 1.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/