All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: u-boot@lists.denx.de
Subject: [PATCH] x86: spi: Only use the fast SPI peripheral when support
Date: Thu, 26 Mar 2020 10:19:57 -0600	[thread overview]
Message-ID: <CAPnjgZ0T1yRsuCv9yCysG9ykPA2fF6fYPD=KTjC2_Rt0t8pXzA@mail.gmail.com> (raw)
In-Reply-To: <CAEUhbmXe4nZQrsmonpmeQ6Be=zf+J6SRXGcRGZ7GvSkzycLEqQ@mail.gmail.com>

HI Bin,

On Wed, 25 Mar 2020 at 01:25, Bin Meng <bmeng.cn@gmail.com> wrote:
>
> Hi Simon,
>
> On Tue, Mar 24, 2020 at 9:45 PM Simon Glass <sjg@chromium.org> wrote:
> >
> > At present we query the memory map on boards which don't support it. Fix
> > this by only doing it on Apollo Lake.
> >
>
> I wonder isn't this check already covered in mrccache_get_region() below:
>
> ret = dm_spi_get_mmap(dev, &map_base, &map_size, &offset);
> if (!ret) {
> entry->base = map_base;
> } else {
> ret = dev_read_u32_array(dev, "memory-map", reg, 2);
> if (ret)
> return log_msg_ret("Cannot find memory map\n", ret);
> entry->base = reg[0];
> }

Yes it is, so long as dm_spi_get_mmap() returns an error, as it does
with my patch.


>
> > This fixes booting on chromebook_link.
> >
> > Signed-off-by: Simon Glass <sjg@chromium.org>
> > Fixes: 92842147c31 ("spi: ich: Add support for get_mmap() method")
> > ---
> >
> >  drivers/spi/ich.c | 3 +++
> >  1 file changed, 3 insertions(+)
> >
> > diff --git a/drivers/spi/ich.c b/drivers/spi/ich.c
> > index a9d7715a55..9f8af45242 100644
> > --- a/drivers/spi/ich.c
> > +++ b/drivers/spi/ich.c
> > @@ -637,7 +637,10 @@ static int ich_get_mmap(struct udevice *dev, ulong *map_basep, uint *map_sizep,
> >                         uint *offsetp)
> >  {
> >         struct udevice *bus = dev_get_parent(dev);
> > +       struct ich_spi_platdata *plat = dev_get_platdata(bus);
> >
> > +       if (plat->ich_version != ICHV_APL)
> > +               return -ENOENT;
> >         return ich_get_mmap_bus(bus, map_basep, map_sizep, offsetp);
> >  }
Regards,
Simon

  reply	other threads:[~2020-03-26 16:19 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-24 13:45 [PATCH] x86: spi: Only use the fast SPI peripheral when support Simon Glass
2020-03-25  7:25 ` Bin Meng
2020-03-26 16:19   ` Simon Glass [this message]
2020-03-26 16:22     ` Bin Meng
2020-03-28 20:04       ` Simon Glass
2020-03-28 20:58       ` Simon Glass
2020-03-30  9:41         ` Bin Meng
2020-03-30 23:56           ` Simon Glass
2020-03-31  9:49             ` Bin Meng
2020-03-31 13:16               ` Simon Glass
2020-04-19 19:14                 ` Simon Glass
2020-04-20 10:01                   ` Bin Meng
2020-04-23  7:36 ` Bin Meng

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='CAPnjgZ0T1yRsuCv9yCysG9ykPA2fF6fYPD=KTjC2_Rt0t8pXzA@mail.gmail.com' \
    --to=sjg@chromium.org \
    --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.