Skip to contentSkip to conversation

eSPI and Intel E1000 support for P1/P2 RDB

PATCH New Poonam Aggrwal 4 participants 5 messages Jun 23, 2010 – Sep 15, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 eSPI and Intel E1000 support for P1/P2 RDB

This patch enables the eSPI configuration to use
the Spansion Flash on P1 and P2 RDB Platforms

This also enables the Intel Pro/1000 PT Gb Ethernet PCI-E Network Adapter configuration support

---
 include/configs/P1_P2_RDB.h |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)
include/configs/P1_P2_RDB.h +15 -0
index a01bc49..1ec57e3 100644
@@ -93,6 +93,21 @@
 #define CONFIG_TSEC_ENET		/* tsec ethernet support */
 #define CONFIG_ENV_OVERWRITE
 
+#define CONFIG_E1000		1	/* Defind e1000 pci Ethernet card*/
+
+/*
+ * eSPI - Enhanced SPI
+ */
+#define CONFIG_SPI_FLASH
+#define CONFIG_SPI_FLASH_SPANSION
+
+#define CONFIG_HARD_SPI
+#define CONFIG_FSL_ESPI
+
+#define CONFIG_CMD_SF
+#define CONFIG_SF_DEFAULT_SPEED 10000000
+#define CONFIG_SF_DEFAULT_MODE 0
+
 #ifndef __ASSEMBLY__
 extern unsigned long get_board_sys_clk(unsigned long dummy);
 #endif
Signature · 1 line
1.5.6.5
Applied
#1 lore raw

PATCH 1/1 eSPI and Intel E1000 support for P1/P2 RDB

Quoted 10 lines · Poonam Aggrwal

This patch enables the eSPI configuration to use
the Spansion Flash on P1 and P2 RDB Platforms

This also enables the Intel Pro/1000 PT Gb Ethernet PCI-E Network Adapter configuration support

---
include/configs/P1_P2_RDB.h | 15 +++++++++++++++

1 files changed, 15 insertions(+), 0 deletions(-)

applied to 85xx

- k

#2 lore raw

PATCH 1/1 eSPI and Intel E1000 support for P1/P2 RDB

Dear Kumar Gala,

Quoted 9 lines · In message <[email protected]> you wrote:
Quoted 6 lines · Poonam Aggrwal

This patch enables the eSPI configuration to use
the Spansion Flash on P1 and P2 RDB Platforms

This also enables the Intel Pro/1000 PT Gb Ethernet PCI-E Network Adapter configuration support

Quoted 6 lines
Quoted 4 lines

---
include/configs/P1_P2_RDB.h | 15 +++++++++++++++

1 files changed, 15 insertions(+), 0 deletions(-)

applied to 85xx

I think I haven't seen this in a pull request yet?

Best regards,

Wolfgang Denk

Signature · 6 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Uncontrolled power will turn even saints into savages. And we can all
be counted on to live down to our lowest impulses.
	-- Parmen, "Plato's Stepchildren", stardate 5784.3
#3 lore raw

PATCH 1/1 eSPI and Intel E1000 support for P1/P2 RDB

Quoted 17 lines · Wolfgang Denk

Dear Kumar Gala,

Quoted 14 lines · In message <[email protected]> you wrote:
Quoted 10 lines · Poonam Aggrwal

This patch enables the eSPI configuration to use
the Spansion Flash on P1 and P2 RDB Platforms

This also enables the Intel Pro/1000 PT Gb Ethernet PCI-E Network Adapter configuration support

---
include/configs/P1_P2_RDB.h | 15 +++++++++++++++

1 files changed, 15 insertions(+), 0 deletions(-)
Quoted 7 lines
Quoted 1 line

applied to 85xx

I think I haven't seen this in a pull request yet?

Best regards,

Wolfgang Denk

I think there was some issue with SPI change so I dropped this patch and replaced with:

commit ddac6f08db3d539d05fad5400ed3dc815b1a196b

Author: Poonam Aggrwal <[email protected]>
Date:   Thu Jul 1 14:24:36 2010 +0530
    85xx/p1_p2_rdb: PCIe E1000 card support added.

which is already in your tree.

- k

#4 lore raw

PATCH 1/1 eSPI and Intel E1000 support for P1/P2 RDB

In reply to Wolfgang Denk
Quoted 15 lines · Wolfgang Denk

Dear Kumar Gala,

Quoted 12 lines · In message<[email protected]> you wrote:
Quoted 10 lines · Poonam Aggrwal

This patch enables the eSPI configuration to use
the Spansion Flash on P1 and P2 RDB Platforms

This also enables the Intel Pro/1000 PT Gb Ethernet PCI-E Network Adapter configuration support

---
include/configs/P1_P2_RDB.h | 15 +++++++++++++++

1 files changed, 15 insertions(+), 0 deletions(-)
Quoted 7 lines
Quoted 1 line

applied to 85xx

I think I haven't seen this in a pull request yet?

Best regards,

Wolfgang Denk

I've been looking at past messages and I don't think the Freescale eSPI controller patch ever made it in.

The most recent discussion I could find was here:
http://lists.denx.de/pipermail/u-boot/2009-March/049114.html

I'm not sure why exactly a driver like this needs the activate and deactivate functions as it's for a SoC, so I was wondering whether something like the below would not work? (this is just for discussion purposes so please disregard formatting).

u-boot/include/configs/P1_P2_RDB.h +15 -0
Index: a/u-boot/include/configs/P1_P2_RDB.h
===================================================================
@@ -97,6 +97,21 @@
  #define CONFIG_TSEC_ENET        /* tsec ethernet support */
  #define CONFIG_ENV_OVERWRITE
 
+#define CONFIG_E1000        1    /* Defind e1000 pci Ethernet card*/
+
+/*
+ * eSPI - Enhanced SPI
+ */
+#define CONFIG_SPI_FLASH
+#define CONFIG_SPI_FLASH_SPANSION
+
+#define CONFIG_HARD_SPI
+#define CONFIG_FSL_ESPI
+
+#define CONFIG_CMD_SF
+#define CONFIG_SF_DEFAULT_SPEED 10000000
+#define CONFIG_SF_DEFAULT_MODE 0
+
  #ifndef __ASSEMBLY__
  extern unsigned long get_board_sys_clk(unsigned long dummy);
  #endif
u-boot/drivers/spi/fsl_espi.c new file +143 -0

143 lines not on this page · raw message

*dout,
+ void *din, unsigned long flags)
+{

+    volatile ccsr_espi_t *espi = (void *)(CONFIG_SYS_MPC85xx_ESPI_ADDR);
+    unsigned int tmpdout, tmpdin, event;
+    unsigned int len = bitlen / 8 + ( bitlen % 4 ? 1 : 0 );
+    int numBlks = bitlen / 32 + (bitlen % 32 ? 1 : 0);
+    unsigned char charsize = 32;

+
+ debug("spi_xfer: slave %u:%u dout %08X(%08x) din %08X(%08x) len %u\n",
+ slave->bus, slave->cs, *(uint *) dout, dout, *(uint *) din,
din, len);
+
+ if (flags & SPI_XFER_BEGIN)
+ {

+        unsigned int com = 0;
+        com &= ~(ESPI_COM_CS(0x3) | ESPI_COM_TRANLEN(0xFFFF));
+        com |= ESPI_COM_CS(espi_cs_state.cs);
+        com |= ESPI_COM_TRANLEN(len - 1);
+        espi->com = com;

+ }
+
+ /* Clear all eSPI events */
+ espi->event = 0xffffffff;
+
+ /* handle data in 32-bit chunks */
+ while (numBlks--) {
+ charsize = (bitlen >= 32 ? 32 : bitlen);
+
+ event = espi->event;
+ if (event & ESPI_EV_TNF) {
+ tmpdout = *(u32 *)dout;
+
+ /* Set up the next iteration if sending > 4 bytes */
+ if (len > 4) {
+ len -= 4;
+ dout += 4;
+ }
+
+ espi->tx = tmpdout;
+ espi->event |= ESPI_EV_TNF;
+ }
+ debug("*** spi_xfer: ... %08x written\n", tmpdout);
+
+ /* Wait for eSPI transmit to get out */
+ udelay(80);
+
+ event = espi->event;
+ if (event & ESPI_EV_RNE) {
+ tmpdin = espi->rx;
+ *(u32 *) din = tmpdin;
+
+ if (charsize == 32) {
+ din += 4;
+ }
+
+ espi->event |= ESPI_EV_RNE;
+ }
+ debug("*** spi_xfer: ... %08x readed\n", tmpdin);
+ }
+
+ if (flags & SPI_XFER_END) {
+

+        /* clear the RXCNT and TXCNT */
+        espi->mode &= ~ESPI_MODE_EN;
+        espi->mode |= ESPI_MODE_EN;

+ }
+
+ return 0;
+}
+
+int spi_cs_is_valid(unsigned int bus, unsigned int cs) +{
+ return bus == 0 && cs < ESPI_MAX_CS_NUM;
+}
+
+void spi_cs_activate(struct spi_slave *slave) +{
+
+}
+
+void spi_cs_deactivate(struct spi_slave *slave) +{
+
+}

u-boot/drivers/spi/Makefile +1 -0
Index: a/u-boot/drivers/spi/Makefile
===================================================================
@@ -36,6 +36,7 @@
  COBJS-$(CONFIG_MPC8XXX_SPI) += mpc8xxx_spi.o
  COBJS-$(CONFIG_MXC_SPI) += mxc_spi.o
  COBJS-$(CONFIG_SOFT_SPI) += soft_spi.o
+COBJS-$(CONFIG_FSL_ESPI) += fsl_espi.o
 
  COBJS    := $(COBJS-y)
  SRCS    := $(COBJS:.o=.c)