All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bin Meng <bmeng.cn@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3 013/108] x86: spi: Add helper functions for Intel Fast SPI
Date: Sun, 3 Nov 2019 07:18:39 +0800	[thread overview]
Message-ID: <CAEUhbmW+3f3BQNFNJ40vOZyvNomsjgr_YYTYaa2ErNgF_D2PTw@mail.gmail.com> (raw)
In-Reply-To: <CAPnjgZ1+sCz2gPOHzMzfnvN8FmSzfM5j0Z9ryQxSKU1ut2+EbA@mail.gmail.com>

Hi Simon,

On Sun, Nov 3, 2019 at 5:04 AM Simon Glass <sjg@chromium.org> wrote:
>
> Hi Bin,
>
> On Fri, 1 Nov 2019 at 22:14, Bin Meng <bmeng.cn@gmail.com> wrote:
> >
> > On Mon, Oct 21, 2019 at 11:33 AM Simon Glass <sjg@chromium.org> wrote:
> > >
> > > Most x86 CPUs use a mechanism where the SPI flash is mapped into the very
> > > top of 32-bit address space, so that it can be executed in place and read
> > > simply by copying from memory. For an 8MB ROM the mapping starts at
> > > 0xff800000.
> > >
> > > However some recent Intel CPUs do not use a simple 1:1 memory map. Instead
> > > the map starts at a different address and not all of the SPI flash is
> > > accessible through the map. This 'Fast SPI' feature requires that U-Boot
> > > check the location of the map. It is also possible (optionally) to read
> > > from the SPI flash using a driver.
> > >
> > > Add support for booting from Fast SPI. The memory-mapped version is used
> > > by both TPL and SPL on apollolake.
> > >
> > > In respect of a SPI flash driver, the actual SPI driver is ich.c - this
> > > just adds a few helper functions and definitions.
> > >
> > > This is used by Apollolake.
> > >
> > > Signed-off-by: Simon Glass <sjg@chromium.org>
> > > ---
> > >
> > > Changes in v3:
> > > - Add support for of-platdata for TPL
> > > - Add the missing header file
> > > - Change Fast-SPI driver into a helper file used by ICH SPI
> > > - Don't include write() and erase() in TPL
> > > - Merge in patch "x86: Add support for booting from Fast SPI"
> > > - Reorder file so that write() and erase() are together
> > > - Use pci_get_devfn()
> > >
> > > Changes in v2: None
> > >
> > >  arch/x86/cpu/intel_common/Makefile   |  1 +
> > >  arch/x86/cpu/intel_common/fast_spi.c | 73 ++++++++++++++++++++++++++++
> > >  arch/x86/include/asm/fast_spi.h      | 68 ++++++++++++++++++++++++++
> > >  arch/x86/include/asm/spl.h           |  1 +
> > >  4 files changed, 143 insertions(+)
> > >  create mode 100644 arch/x86/cpu/intel_common/fast_spi.c
> > >  create mode 100644 arch/x86/include/asm/fast_spi.h
> [..]
>
> > > +/* Register offsets from the MMIO region base (PCI_BASE_ADDRESS_0) */
> > > +struct fast_spi_regs {
> > > +       u32 bfp;
> > > +       u32 hsfsts_ctl;
> > > +       u32 faddr;
> > > +       u32 dlock;
> > > +
> > > +       u32 fdata[0x10];
> > > +
> > > +       u32 fracc;
> > > +       u32 freg[12];
> > > +       u32 fpr[5];
> > > +       u32 gpr0;
> > > +       u32 spare2;
> > > +       u32 sts_ctl;
> > > +       u16 preop;              /* a4 */
> >
> > I assume a4 is the offset of preop? Leaving it causes confusion and it
> > can be dropped, I think.
> >
>
> Will do.
>
> I'm rebasing on your applied patches and moving the code around to
> address Andy's comments. I'll send a new version v4 by Monday.

Or maybe you can wait until I looked at all v3 patches. I just wanted
to send a PR for a collection of good patches so far, instead of
giving Tom a huge list :)

Regards,
Bin

  reply	other threads:[~2019-11-02 23:18 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-21  3:31 [U-Boot] [PATCH v3 001/108] binman: Correct symbol calculation with non-zero image base Simon Glass
2019-10-21  3:31 ` [U-Boot] [PATCH v3 002/108] binman: Add support for Intel FSP-S Simon Glass
2019-10-28  3:27   ` Bin Meng
2019-11-02  9:38     ` Bin Meng
2019-10-21  3:31 ` [U-Boot] [PATCH v3 003/108] binman: Add support for Intel FSP-T Simon Glass
2019-10-28  3:27   ` Bin Meng
2019-11-02  9:38     ` Bin Meng
2019-10-21  3:31 ` [U-Boot] [PATCH v3 004/108] binman: Fix up comment in intel-fsp-m Simon Glass
2019-10-28  3:27   ` Bin Meng
2019-11-02  9:38     ` Bin Meng
2019-10-21  3:31 ` [U-Boot] [PATCH v3 005/108] binman: Add a library to access binman entries Simon Glass
2019-10-28  3:27   ` Bin Meng
2019-10-21  3:31 ` [U-Boot] [PATCH v3 006/108] dm: gpio: Allow control of GPIO uclass in SPL Simon Glass
2019-10-28  4:45   ` Bin Meng
2019-11-02  9:38     ` Bin Meng
2019-11-02 23:10       ` Bin Meng
2019-10-21  3:31 ` [U-Boot] [PATCH v3 007/108] dm: core: Fix offset_to_ofnode() with invalid offset Simon Glass
2019-10-28  4:45   ` Bin Meng
2019-10-21  3:31 ` [U-Boot] [PATCH v3 008/108] dm: pci: Delay auto-config until after relocation Simon Glass
2019-10-28  4:45   ` Bin Meng
2019-10-21  3:31 ` [U-Boot] [PATCH v3 009/108] dm: pci: Move pci_get_devfn() into a common file Simon Glass
2019-10-28  4:45   ` Bin Meng
2019-10-21  3:31 ` [U-Boot] [PATCH v3 010/108] net: Move the checksum functions to lib/ Simon Glass
2019-10-28  4:45   ` Bin Meng
2019-10-21  3:31 ` [U-Boot] [PATCH v3 011/108] i2c: Tidy up designware PCI support Simon Glass
2019-10-28  4:40   ` Heiko Schocher
2019-10-28  5:54   ` Bin Meng
2019-10-28 10:43   ` Stefan Roese
2019-10-21  3:31 ` [U-Boot] [PATCH v3 012/108] spl: Correct priority selection for image loaders Simon Glass
2019-10-28  5:54   ` Bin Meng
2019-11-02  9:42     ` Bin Meng
2019-10-21  3:31 ` [U-Boot] [PATCH v3 013/108] x86: spi: Add helper functions for Intel Fast SPI Simon Glass
2019-11-02  4:13   ` Bin Meng
2019-11-02 21:04     ` Simon Glass
2019-11-02 23:18       ` Bin Meng [this message]
2019-11-03 14:36         ` Simon Glass
2019-11-03 23:40           ` Simon Glass
2019-10-21  3:31 ` [U-Boot] [PATCH v3 014/108] spi: Add support for memory-mapped flash Simon Glass
2019-11-02  4:13   ` Bin Meng
2019-11-02  9:42     ` Bin Meng
2019-10-21  3:31 ` [U-Boot] [PATCH v3 015/108] dm: doc: Correct of-platdata driver name Simon Glass
2019-10-28  5:59   ` Bin Meng
2019-11-02  9:42     ` Bin Meng
2019-10-21  3:31 ` [U-Boot] [PATCH v3 016/108] fdt: Show the preprocessed .dts file on error Simon Glass
2019-10-28  6:47   ` Bin Meng
2019-11-02 18:02     ` Simon Glass
2019-11-04  8:28       ` Bin Meng
2019-10-21  3:31 ` [U-Boot] [PATCH v3 017/108] RFC: sandbox: net: Suppress the MAC-address warnings Simon Glass
2019-10-21  3:31 ` [U-Boot] [PATCH v3 018/108] Revert "RFC: sandbox: net: Suppress the MAC-address warnings" Simon Glass
2019-10-28  6:16   ` Bin Meng
2019-11-02 18:07     ` Simon Glass
2019-10-21  3:31 ` [U-Boot] [PATCH v3 019/108] spl: Add a size check for TPL Simon Glass
2019-10-28  6:34   ` Bin Meng
2019-11-02  9:47     ` Bin Meng
2019-10-21  3:31 ` [U-Boot] [PATCH v3 020/108] sandbox: pci: Create a new sandbox_pci_read_bar() function Simon Glass
2019-10-28  6:36   ` Bin Meng
2019-10-21  3:31 ` [U-Boot] [PATCH v3 021/108] x86: timer: Set up the timer in timer_early_get_count() Simon Glass
2019-10-28  7:12   ` Bin Meng
2019-11-02  9:47     ` Bin Meng
2019-10-28  3:27 ` [U-Boot] [PATCH v3 001/108] binman: Correct symbol calculation with non-zero image base Bin Meng
2019-11-02  9:38   ` 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=CAEUhbmW+3f3BQNFNJ40vOZyvNomsjgr_YYTYaa2ErNgF_D2PTw@mail.gmail.com \
    --to=bmeng.cn@gmail.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.