lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 18 Jun 2015 20:28:59 +0530
From:	Anurag Kumar Vulisha <anurag.kumar.vulisha@...inx.com>
To:	<dwmw2@...radead.org>, <computersforpeace@...il.com>,
	<marex@...x.de>, <shijie.huang@...el.com>, <zajec5@...il.com>,
	<ben@...adent.org.uk>, <mika.westerberg@...ux.intel.com>,
	<beanhuo@...ron.com>, <grmoore@...era.com>
CC:	<linux-mtd@...ts.infradead.org>, <linux-kernel@...r.kernel.org>,
	<broonie@...nel.org>, <punnaia@...inx.com>, <harinik@...inx.com>,
	<anirudh@...inx.com>, <svemula@...inx.com>,
	Anurag Kumar Vulisha <anuragku@...inx.com>
Subject: [RFC PATCH] mtd: spi-nor: Added flag check for quad io protocol for micron flash parts

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 <anuragku@...inx.com>
---
 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@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ