public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Graham Moore <grmoore@opensource.altera.com>
To: Anurag Kumar Vulisha <anurag.kumar.vulisha@xilinx.com>
Cc: marex@denx.de, harinik@xilinx.com,
	mika.westerberg@linux.intel.com, ben@decadent.org.uk,
	broonie@kernel.org, zajec5@gmail.com,
	"Anurag Kumar Vulisha" <anuragku@xilinx.com>,
	linux-kernel@vger.kernel.org, svemula@xilinx.com,
	linux-mtd@lists.infradead.org, anirudh@xilinx.com,
	shijie.huang@intel.com, punnaia@xilinx.com,
	computersforpeace@gmail.com, dwmw2@infradead.org,
	"\"Bean Huo 霍斌斌 (beanhuo)\"" <beanhuo@micron.com>
Subject: Re: [RFC PATCH] mtd: spi-nor: Added flag check for quad io protocol for micron flash parts
Date: Fri, 19 Jun 2015 14:11:26 -0500	[thread overview]
Message-ID: <5584695E.1090906@opensource.altera.com> (raw)
In-Reply-To: <1434639539-7517-1-git-send-email-anuragku@xilinx.com>

Hi Anurag,

We're struggling with the same issue, our Cadence QSPI controller *does* 
handle four-line command, address, and data, but has to be configured 
for it.  The setting of quad-io-protocol mode in micron_quad_enable is 
really jacking up our code.  We have to snoop the command stream and 
configure the controller as soon as we see the quad-io-protocol command 
go to the Micron chip.  Ugly.

I'd like to point out that this flag is also dependent upon the 
particular controller in use, not just the Micron chip.  In fact, it may 
be more of a controller thing than a chip thing.

Maybe this flag should actually be an enum read_mode value, and passed 
into spi_nor_scan by the controller?

Thanks,
Graham


On 06/18/2015 09:58 AM, Anurag Kumar Vulisha wrote:
> 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@xilinx.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");
>

  reply	other threads:[~2015-06-19 19:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-18 14:58 [RFC PATCH] mtd: spi-nor: Added flag check for quad io protocol for micron flash parts Anurag Kumar Vulisha
2015-06-19 19:11 ` Graham Moore [this message]
2015-06-20  2:30   ` Punnaiah Choudary Kalluri
2015-06-20 19:13 ` Rafał Miłecki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5584695E.1090906@opensource.altera.com \
    --to=grmoore@opensource.altera.com \
    --cc=anirudh@xilinx.com \
    --cc=anurag.kumar.vulisha@xilinx.com \
    --cc=anuragku@xilinx.com \
    --cc=beanhuo@micron.com \
    --cc=ben@decadent.org.uk \
    --cc=broonie@kernel.org \
    --cc=computersforpeace@gmail.com \
    --cc=dwmw2@infradead.org \
    --cc=harinik@xilinx.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=marex@denx.de \
    --cc=mika.westerberg@linux.intel.com \
    --cc=punnaia@xilinx.com \
    --cc=shijie.huang@intel.com \
    --cc=svemula@xilinx.com \
    --cc=zajec5@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox