All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 0/15] Enhance SPI/SPI flash probing, add support for Intel ICH controller
@ 2012-12-26 22:28 Simon Glass
  2012-12-26 22:28 ` [U-Boot] [PATCH 01/15] fdt: Use sed instead of cpp to pre-process the dtc Simon Glass
                   ` (15 more replies)
  0 siblings, 16 replies; 23+ messages in thread
From: Simon Glass @ 2012-12-26 22:28 UTC (permalink / raw)
  To: u-boot

Adding new fields to struct spi_slave and struct spi_flash is painful,
because most drivers don't zero the fields they don't use. Anyway it
seems better to have the SPI/SPI flash infrastructure provide a simple
way of doing this that all drivers can use.

So the first part of this series adds spi_alloc_slave(), for SPI, and
spi_flash_alloc() for SPI flash.

Support is added for the Intel ICH SPI controller, possibly the oddest
SPI controller in U-Boot. It is designed for use with SPI flash only,
and has a number of high-level features which are dedicated to flash.
As such it is a bit of a challenge to get it to behave just like a
normal U-Boot SPI device.

The ICH driver has two interesting features. Firstly it is impossible
to read or write more than 64 bytes at a time! For SPI reading it is
possible to hide this within the SPI driver. For SPI writing it
unfortunately isn't, since the spi_flash layer has to send an unlock
command and a new address for every write. It would be an egregious
hack to try to fake this in the driver. So a new property is added
to spi_flash to allow the maximum transfer size to be set.

Secondly, the ICH SPI flash can be memory mapped. On a lot of x86
devices this improves performance significantly. For example, the standard
driver gets maybe 12Mbps throughput from a 33Mbps dual interface, roughly
20% utilisation. With memory mapping, many platforms can achieve about
40Mbps. To implement memory mapping, a new property is provided in the
device tree to set the memory map address, which varies by platform. Some
x86 platforms will see a speed increase with memory mapping, some won't.
The memory mapping feature only works for reading. When in use, the
spi_flash layer bypasses the SPI driver completely, and just copies the
flash data from the correct place in the memory map.


Simon Glass (15):
  fdt: Use sed instead of cpp to pre-process the dtc
  fdt: Add fdtdec_get_addr_size() to read reg properties
  spi: Add function to allocate a new SPI slave
  spi: Use spi_alloc_slave() in each SPI driver
  sf: Add spi_flash_alloc() to create a new SPI flash struct
  sf: Use spi_flash_alloc() in each SPI flash driver
  x86: spi: Add Intel ICH driver
  spi: Add parameter for maximum write size
  sf: Respect maximum SPI write size
  x86: spi: Set maximum write size for ICH
  sf: Enable FDT-based configuration and memory mapping
  x86: Move PCI init before SPI init
  x86: Add FDT SPI node for link
  x86: Enable SPI flash support for coreboot
  x86: Enable time command for coreboot

 arch/x86/lib/board.c              |    8 +-
 board/chromebook-x86/dts/link.dts |   11 +
 drivers/mtd/spi/atmel.c           |    8 +-
 drivers/mtd/spi/eon.c             |    8 +-
 drivers/mtd/spi/macronix.c        |    8 +-
 drivers/mtd/spi/ramtron.c         |    4 +-
 drivers/mtd/spi/spansion.c        |    8 +-
 drivers/mtd/spi/spi_flash.c       |   81 ++++-
 drivers/mtd/spi/sst.c             |    8 +-
 drivers/mtd/spi/stmicro.c         |    8 +-
 drivers/mtd/spi/winbond.c         |    8 +-
 drivers/spi/Makefile              |    4 +
 drivers/spi/altera_spi.c          |    4 +-
 drivers/spi/andes_spi.c           |    4 +-
 drivers/spi/armada100_spi.c       |    4 +-
 drivers/spi/atmel_spi.c           |    4 +-
 drivers/spi/bfin_spi.c            |    4 +-
 drivers/spi/cf_qspi.c             |    4 +-
 drivers/spi/cf_spi.c              |    4 +-
 drivers/spi/davinci_spi.c         |    4 +-
 drivers/spi/fsl_espi.c            |    4 +-
 drivers/spi/ich.c                 |  752 +++++++++++++++++++++++++++++++++++++
 drivers/spi/ich.h                 |  144 +++++++
 drivers/spi/kirkwood_spi.c        |    5 +-
 drivers/spi/mpc52xx_spi.c         |    5 +-
 drivers/spi/mpc8xxx_spi.c         |    5 +-
 drivers/spi/mxc_spi.c             |    4 +-
 drivers/spi/mxs_spi.c             |    4 +-
 drivers/spi/oc_tiny_spi.c         |    5 +-
 drivers/spi/omap3_spi.c           |   27 +-
 drivers/spi/sh_spi.c              |    4 +-
 drivers/spi/soft_spi.c            |    4 +-
 drivers/spi/spi.c                 |   39 ++
 drivers/spi/tegra_spi.c           |    4 +-
 drivers/spi/xilinx_spi.c          |    4 +-
 dts/Makefile                      |   10 +-
 include/configs/coreboot.h        |   13 +-
 include/fdtdec.h                  |   16 +
 include/spi.h                     |   44 +++
 include/spi_flash.h               |   39 ++
 lib/fdtdec.c                      |   27 ++-
 41 files changed, 1208 insertions(+), 147 deletions(-)
 create mode 100644 drivers/spi/ich.c
 create mode 100644 drivers/spi/ich.h
 create mode 100644 drivers/spi/spi.c

-- 
1.7.7.3

^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2013-03-08  4:30 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-26 22:28 [U-Boot] [PATCH 0/15] Enhance SPI/SPI flash probing, add support for Intel ICH controller Simon Glass
2012-12-26 22:28 ` [U-Boot] [PATCH 01/15] fdt: Use sed instead of cpp to pre-process the dtc Simon Glass
2012-12-28  0:03   ` Stephen Warren
2012-12-28 14:55     ` Simon Glass
2012-12-28 16:42       ` Mike Frysinger
2012-12-28 18:07         ` Simon Glass
2012-12-28 23:47           ` Stephen Warren
2012-12-29  0:34             ` Simon Glass
2012-12-26 22:28 ` [U-Boot] [PATCH 02/15] fdt: Add fdtdec_get_addr_size() to read reg properties Simon Glass
2012-12-26 22:28 ` [U-Boot] [PATCH 03/15] spi: Add function to allocate a new SPI slave Simon Glass
2012-12-26 22:28 ` [U-Boot] [PATCH 04/15] spi: Use spi_alloc_slave() in each SPI driver Simon Glass
2012-12-26 22:28 ` [U-Boot] [PATCH 05/15] sf: Add spi_flash_alloc() to create a new SPI flash struct Simon Glass
2012-12-26 22:28 ` [U-Boot] [PATCH 06/15] sf: Use spi_flash_alloc() in each SPI flash driver Simon Glass
2012-12-26 22:28 ` [U-Boot] [PATCH 07/15] x86: spi: Add Intel ICH driver Simon Glass
2012-12-26 22:28 ` [U-Boot] [PATCH 08/15] spi: Add parameter for maximum write size Simon Glass
2012-12-26 22:28 ` [U-Boot] [PATCH 09/15] sf: Respect maximum SPI " Simon Glass
2012-12-26 22:28 ` [U-Boot] [PATCH 10/15] x86: spi: Set maximum write size for ICH Simon Glass
2012-12-26 22:28 ` [U-Boot] [PATCH 11/15] sf: Enable FDT-based configuration and memory mapping Simon Glass
2012-12-26 22:28 ` [U-Boot] [PATCH 12/15] x86: Move PCI init before SPI init Simon Glass
2012-12-26 22:28 ` [U-Boot] [PATCH 13/15] x86: Add FDT SPI node for link Simon Glass
2012-12-26 22:28 ` [U-Boot] [PATCH 14/15] x86: Enable SPI flash support for coreboot Simon Glass
2012-12-26 22:28 ` [U-Boot] [PATCH 15/15] x86: Enable time command " Simon Glass
2013-03-08  4:30 ` [U-Boot] [PATCH 0/15] Enhance SPI/SPI flash probing, add support for Intel ICH controller Simon Glass

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.