Skip to contentSkip to conversation

powerpc: eSPI and eSPI controller support

PATCH New Shaohui Xie 2 participants 2 messages Apr 26, 2011 – Apr 29, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v5 1/1 powerpc: eSPI and eSPI controller support

From: Mingkai Hu <[email protected]>

---
changes for v2:
remove #ifdef wrapper and refactor spi_xfer by use SPI_XFER(BEGIN | END). remove 'volatile' use I/O accessors instead.

changes for v3:
move powerpc specific code to asm/config.h.
use spi_claim_bus() to setup hardware rather than spi_setup_slave(). use slave data rather than global.
drop useless return.

changes for v4:
use controller specific struct rather than put in common header. merge read more than 0xfffa bytes patch.

changes for v5:
fix code style.
drop flag check.
drop unnecessary copy right.

 arch/powerpc/include/asm/config.h |    7 +
 drivers/spi/Makefile              |    1 +
 drivers/spi/fsl_espi.c            |  334 +++++++++++++++++++++++++++++++++++++
 include/spi.h                     |    7 -
 4 files changed, 342 insertions(+), 7 deletions(-)
 create mode 100644 drivers/spi/fsl_espi.c
arch/powerpc/include/asm/config.h +7 -0
index 624d8c2..9aad9be 100644
@@ -29,6 +29,13 @@
 #include <asm/config_mpc86xx.h>
 #endif
 
+/* CONFIG_HARD_SPI triggers SPI bus initialization in PowerPC */
+#if defined(CONFIG_MPC8XXX_SPI) || defined(CONFIG_FSL_ESPI)
+# ifndef CONFIG_HARD_SPI
+#  define CONFIG_HARD_SPI
+# endif
+#endif
+
 #define CONFIG_LMB
 #define CONFIG_SYS_BOOT_RAMDISK_HIGH
 #define CONFIG_SYS_BOOT_GET_CMDLINE
drivers/spi/Makefile +1 -0
index d582fbb..74f1293 100644
@@ -38,6 +38,7 @@ COBJS-$(CONFIG_MXC_SPI) += mxc_spi.o
 COBJS-$(CONFIG_OMAP3_SPI) += omap3_spi.o
 COBJS-$(CONFIG_SOFT_SPI) += soft_spi.o
 COBJS-$(CONFIG_SH_SPI) += sh_spi.o
+COBJS-$(CONFIG_FSL_ESPI) += fsl_espi.o
 
 COBJS	:= $(COBJS-y)
 SRCS	:= $(COBJS:.o=.c)
drivers/spi/fsl_espi.c new file +334 -0

334 lines not on this page · raw message

include/spi.h +0 -7
index 320e50e..1eb31d9 100644
@@ -26,13 +26,6 @@
 
 /* Controller-specific definitions: */
 
-/* CONFIG_HARD_SPI triggers SPI bus initialization in PowerPC */
-#ifdef CONFIG_MPC8XXX_SPI
-# ifndef CONFIG_HARD_SPI
-#  define CONFIG_HARD_SPI
-# endif
-#endif
-
 /* SPI mode flags */
 #define	SPI_CPHA	0x01			/* clock phase */
 #define	SPI_CPOL	0x02			/* clock polarity */
Signature · 1 line
1.6.4
Applied
#1 lore raw

PATCH v5 1/1 powerpc: eSPI and eSPI controller support

Quoted 26 lines · Shaohui Xie

From: Mingkai Hu <[email protected]>

---
changes for v2:
remove #ifdef wrapper and refactor spi_xfer by use SPI_XFER(BEGIN | END). remove 'volatile' use I/O accessors instead.

changes for v3:
move powerpc specific code to asm/config.h.
use spi_claim_bus() to setup hardware rather than spi_setup_slave(). use slave data rather than global.
drop useless return.

changes for v4:
use controller specific struct rather than put in common header. merge read more than 0xfffa bytes patch.

changes for v5:
fix code style.
drop flag check.
drop unnecessary copy right.

Quoted 6 lines
arch/powerpc/include/asm/config.h |    7 +
drivers/spi/Makefile              |    1 +
drivers/spi/fsl_espi.c            |  334 +++++++++++++++++++++++++++++++++++++
include/spi.h                     |    7 -
4 files changed, 342 insertions(+), 7 deletions(-)

create mode 100644 drivers/spi/fsl_espi.c

applied to 85xx

- k