All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chin Liang See <clsee@altera.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] spi: cadence_qspi: Enable quad mode for read and programming
Date: Wed, 26 Aug 2015 08:58:28 -0500	[thread overview]
Message-ID: <1440597508.2211.43.camel@clsee-VirtualBox> (raw)
In-Reply-To: <CAD6G_RQxRnCcyy913vODbB4nOTbcT167t6km1Y0Q19jx0TVszQ@mail.gmail.com>

On Wed, 2015-08-26 at 19:17 +0530, Jagan Teki wrote:
> On 26 August 2015 at 13:00, Chin Liang See <clsee@altera.com> wrote:
> > On Wed, 2015-08-26 at 08:57 +0200, marex at denx.de wrote:
> >> On Wednesday, August 26, 2015 at 02:09:55 AM, Chin Liang See wrote:
> >> > Enable the quad output fast read and quad input fast program
> >> > support. Quad mode is supported by Cadence QSPI controller.
> >> >
> >> > Signed-off-by: Chin Liang See <clsee@altera.com>
> >> > Cc: Dinh Nguyen <dinguyen@opensource.altera.com>
> >> > Cc: Stefan Roese <sr@denx.de>
> >> > Cc: Vikas Manocha <vikas.manocha@st.com>
> >> > Cc: Jagannadh Teki <jteki@openedev.com>
> >> > Cc: Pavel Machek <pavel@denx.de>
> >> > Cc: Marek Vasut <marex@denx.de>
> >> > ---
> >> >  drivers/spi/cadence_qspi.c     |   11 +++++++++++
> >> >  drivers/spi/cadence_qspi_apb.c |   16 ++++++++++++----
> >> >  2 files changed, 23 insertions(+), 4 deletions(-)
> >> >
> >> > diff --git a/drivers/spi/cadence_qspi.c b/drivers/spi/cadence_qspi.c
> >> > index 34a0f46..c6b69c4 100644
> >> > --- a/drivers/spi/cadence_qspi.c
> >> > +++ b/drivers/spi/cadence_qspi.c
> >> > @@ -318,6 +318,16 @@ static int cadence_spi_ofdata_to_platdata(struct
> >> > udevice *bus) return 0;
> >> >  }
> >> >
> >> > +static int cadence_spi_child_pre_probe(struct udevice *dev)
> >> > +{
> >> > +   struct spi_slave *slave = dev_get_parentdata(dev);
> >> > +
> >> > +   /* Cadence QSPI controller can support quad read and program */
> >> > +   slave->op_mode_rx = SPI_OPM_RX_QOF;
> >> > +   slave->op_mode_tx = SPI_OPM_TX_QPP;
> >> > +   return 0;
> >> > +}
> >> > +
> >> >  static const struct dm_spi_ops cadence_spi_ops = {
> >> >     .xfer           = cadence_spi_xfer,
> >> >     .set_speed      = cadence_spi_set_speed,
> >> > @@ -341,5 +351,6 @@ U_BOOT_DRIVER(cadence_spi) = {
> >> >     .ofdata_to_platdata = cadence_spi_ofdata_to_platdata,
> >> >     .platdata_auto_alloc_size = sizeof(struct cadence_spi_platdata),
> >> >     .priv_auto_alloc_size = sizeof(struct cadence_spi_priv),
> >> > +   .child_pre_probe = cadence_spi_child_pre_probe,
> >> >     .probe = cadence_spi_probe,
> >> >  };
> >>
> >> Simon, can you please check if this DM bit is correct ?
> >>
> >> > diff --git a/drivers/spi/cadence_qspi_apb.c
> >> > b/drivers/spi/cadence_qspi_apb.c index d053407..deffb6b 100644
> >> > --- a/drivers/spi/cadence_qspi_apb.c
> >> > +++ b/drivers/spi/cadence_qspi_apb.c
> >> > @@ -29,6 +29,9 @@
> >> >  #include <asm/io.h>
> >> >  #include <asm/errno.h>
> >> >  #include "cadence_qspi.h"
> >> > +#include <spi.h>
> >> > +#include <spi_flash.h>
> >> > +#include "../mtd/spi/sf_internal.h"
> >>
> >> Why do you need this include ?
> >>
> >
> > Actually I am comparing the opcode to determine whether its a quad
> > command. If yes, we need to setup the controller accordingly.
> 
> Sorry, this I wouldn't recommend as of now please assign quad directly
> instead setting up controller based on the flash stuff, Yes things
> need to change it on u-boot like spi-nor framework and currently we
> are working on it[1] will defiantly back with proper solution.
> 
> [1] http://git.denx.de/?p=u-boot/u-boot-spi.git;a=shortlog;h=refs/heads/spi-nor
> 

In this case, I shall use the spi-nor for proper long term solution. Let
me take a look and work that out with you.

Thanks
Chin Liang

> thanks!

  reply	other threads:[~2015-08-26 13:58 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-26  0:09 [U-Boot] [PATCH] spi: cadence_qspi: Enable quad mode for read and programming Chin Liang See
2015-08-26  6:57 ` Marek Vasut
2015-08-26  7:30   ` Chin Liang See
2015-08-26  7:57     ` Marek Vasut
2015-08-26  8:42       ` Chin Liang See
2015-08-26  9:07         ` Marek Vasut
2015-08-26 13:13           ` Chin Liang See
2015-08-26 13:37             ` Marek Vasut
2015-08-26 13:42               ` Chin Liang See
2015-08-26 13:58                 ` Marek Vasut
2015-08-27  5:14                   ` Chin Liang See
2015-08-27  8:30                     ` Marek Vasut
2015-08-26 13:47     ` Jagan Teki
2015-08-26 13:58       ` Chin Liang See [this message]
2015-08-26 13:59       ` Marek Vasut
2015-08-26 14:39         ` Jagan Teki
2015-08-26 14:44           ` Marek Vasut
2015-08-26 14:52             ` Jagan Teki
2015-08-26 15:57       ` Tom Rini
2015-08-26 16:55         ` Jagan Teki
2015-08-26 13:19   ` Simon Glass
2015-08-26 13:38     ` Marek Vasut

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=1440597508.2211.43.camel@clsee-VirtualBox \
    --to=clsee@altera.com \
    --cc=u-boot@lists.denx.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.