All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] Adds driver for Xilinx' xps_spi SPI controller.
@ 2010-08-03 15:47 Graeme Smecher
  2010-08-03 17:59 ` Mike Frysinger
  0 siblings, 1 reply; 12+ messages in thread
From: Graeme Smecher @ 2010-08-03 15:47 UTC (permalink / raw)
  To: u-boot

This code differs in only trivial ways from the altera_spi driver. It plays
nice with Thomas Chou's mmc_spi driver, as well as with SPI flash.

Documentation for the SPI core is available here:

   http://www.xilinx.com/support/documentation/ip_documentation/xps_spi.pdf

Signed-off-by: Graeme Smecher <graeme.smecher@mail.mcgill.ca>
---
 drivers/spi/Makefile     |    1 +
 drivers/spi/xilinx_spi.c |  173 ++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 174 insertions(+), 0 deletions(-)
 create mode 100644 drivers/spi/xilinx_spi.c

diff --git a/drivers/spi/Makefile b/drivers/spi/Makefile
index dfcbb8b..34e0f31 100644
--- a/drivers/spi/Makefile
+++ b/drivers/spi/Makefile
@@ -26,6 +26,7 @@ include $(TOPDIR)/config.mk
 LIB	:= $(obj)libspi.a
 
 COBJS-$(CONFIG_ALTERA_SPI) += altera_spi.o
+COBJS-$(CONFIG_XILINX_SPI) += xilinx_spi.o
 COBJS-$(CONFIG_ATMEL_DATAFLASH_SPI) += atmel_dataflash_spi.o
 COBJS-$(CONFIG_ATMEL_SPI) += atmel_spi.o
 COBJS-$(CONFIG_BFIN_SPI) += bfin_spi.o
diff --git a/drivers/spi/xilinx_spi.c b/drivers/spi/xilinx_spi.c
new file mode 100644
index 0000000..bda7c5b
--- /dev/null
+++ b/drivers/spi/xilinx_spi.c
@@ -0,0 +1,173 @@
+/*
+ * Xilinx SPI driver
+ *
+ * based on bfin_spi.c, by way of altera_spi.c
+ * Copyright (c) 2005-2008 Analog Devices Inc.
+ * Copyright (c) 2010 Thomas Chou <thomas@wytron.com.tw>
+ * Copyright (c) 2010 Graeme Smecher <graeme.smecher@mail.mcgill.ca>
+ *
+ * Licensed under the GPL-2 or later.
+ */
+#include <common.h>
+#include <asm/io.h>
+#include <malloc.h>
+#include <spi.h>
+
+#define XILINX_SPI_RR			0x6c
+#define XILINX_SPI_TR			0x68
+#define XILINX_SPI_SR			0x64
+#define XILINX_SPI_CR			0x60
+#define XILINX_SPI_SSR			0x70
+
+#define XILINX_SPI_SR_RX_EMPTY_MSK	0x01
+
+#define XILINX_SPI_CR_DEFAULT		(0x0006)
+#define XILINX_SPI_CR_MSS_MSK		(0x0080)
+
+#if XPAR_XSPI_NUM_INSTANCES > 4
+# warning "The xilinx_spi driver will ignore some of your SPI peripherals!"
+#endif
+
+static ulong xilinx_spi_base_list[] = {
+#ifdef XPAR_SPI_0_BASEADDR
+	XPAR_SPI_0_BASEADDR,
+#endif
+#ifdef XPAR_SPI_1_BASEADDR
+	XPAR_SPI_1_BASEADDR,
+#endif
+#ifdef XPAR_SPI_2_BASEADDR
+	XPAR_SPI_2_BASEADDR,
+#endif
+#ifdef XPAR_SPI_3_BASEADDR
+	XPAR_SPI_3_BASEADDR,
+#endif
+};
+
+struct xilinx_spi_slave {
+	struct spi_slave slave;
+	ulong base;
+};
+#define to_xilinx_spi_slave(s) container_of(s, struct xilinx_spi_slave, slave)
+
+__attribute__((weak))
+int spi_cs_is_valid(unsigned int bus, unsigned int cs)
+{
+	return bus < ARRAY_SIZE(xilinx_spi_base_list) && cs < 32;
+}
+
+__attribute__((weak))
+void spi_cs_activate(struct spi_slave *slave)
+{
+	struct xilinx_spi_slave *xilspi = to_xilinx_spi_slave(slave);
+	writel(~(1 << slave->cs), xilspi->base + XILINX_SPI_SSR);
+	writel(XILINX_SPI_CR_DEFAULT | XILINX_SPI_CR_MSS_MSK,
+		xilspi->base + XILINX_SPI_CR);
+}
+
+__attribute__((weak))
+void spi_cs_deactivate(struct spi_slave *slave)
+{
+	struct xilinx_spi_slave *xilspi = to_xilinx_spi_slave(slave);
+
+	writel(XILINX_SPI_CR_DEFAULT, xilspi->base + XILINX_SPI_CR);
+	writel(~0, xilspi->base + XILINX_SPI_SSR);
+}
+
+void spi_init(void)
+{
+}
+
+struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs,
+				  unsigned int max_hz, unsigned int mode)
+{
+	struct xilinx_spi_slave *xilspi;
+
+	if (!spi_cs_is_valid(bus, cs))
+		return NULL;
+
+	xilspi = malloc(sizeof(*xilspi));
+	if (!xilspi)
+		return NULL;
+
+	xilspi->slave.bus = bus;
+	xilspi->slave.cs = cs;
+	xilspi->base = xilinx_spi_base_list[bus];
+	debug("%s: bus:%i cs:%i base:%lx\n", __func__,
+		bus, cs, xilspi->base);
+
+	return &xilspi->slave;
+}
+
+void spi_free_slave(struct spi_slave *slave)
+{
+	struct xilinx_spi_slave *xilspi = to_xilinx_spi_slave(slave);
+	free(xilspi);
+}
+
+int spi_claim_bus(struct spi_slave *slave)
+{
+	struct xilinx_spi_slave *xilspi = to_xilinx_spi_slave(slave);
+
+	debug("%s: bus:%i cs:%i\n", __func__, slave->bus, slave->cs);
+	writel(XILINX_SPI_CR_DEFAULT, xilspi->base + XILINX_SPI_CR);
+	writel(~0, xilspi->base + XILINX_SPI_SSR);
+	return 0;
+}
+
+void spi_release_bus(struct spi_slave *slave)
+{
+	struct xilinx_spi_slave *xilspi = to_xilinx_spi_slave(slave);
+
+	debug("%s: bus:%i cs:%i\n", __func__, slave->bus, slave->cs);
+	writel(~0, xilspi->base + XILINX_SPI_SSR);
+}
+
+#ifndef CONFIG_XILINX_SPI_IDLE_VAL
+# define CONFIG_XILINX_SPI_IDLE_VAL 0xff
+#endif
+
+int spi_xfer(struct spi_slave *slave, unsigned int bitlen, const void *dout,
+	     void *din, unsigned long flags)
+{
+	struct xilinx_spi_slave *xilspi = to_xilinx_spi_slave(slave);
+	/* assume spi core configured to do 8 bit transfers */
+	uint bytes = bitlen / 8;
+	const uchar *txp = dout;
+	uchar *rxp = din;
+
+	debug("%s: bus:%i cs:%i bitlen:%i bytes:%i flags:%lx\n", __func__,
+		slave->bus, slave->cs, bitlen, bytes, flags);
+	if (bitlen == 0)
+		goto done;
+
+	if (bitlen % 8) {
+		flags |= SPI_XFER_END;
+		goto done;
+	}
+
+	/* empty read buffer */
+	while (!(readl(xilspi->base + XILINX_SPI_SR) &
+	    XILINX_SPI_SR_RX_EMPTY_MSK))
+		readl(xilspi->base + XILINX_SPI_RR);
+
+	if (flags & SPI_XFER_BEGIN)
+		spi_cs_activate(slave);
+
+	while (bytes--) {
+		uchar d = txp ? *txp++ : CONFIG_XILINX_SPI_IDLE_VAL;
+		debug("%s: tx:%x ", __func__, d);
+		writel(d, xilspi->base + XILINX_SPI_TR);
+		while (readl(xilspi->base + XILINX_SPI_SR) &
+			 XILINX_SPI_SR_RX_EMPTY_MSK)
+			;
+		d = readl(xilspi->base + XILINX_SPI_RR);
+		if (rxp)
+			*rxp++ = d;
+		debug("rx:%x\n", d);
+	}
+ done:
+	if (flags & SPI_XFER_END)
+		spi_cs_deactivate(slave);
+
+	return 0;
+}
-- 
1.6.3.3

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

* [U-Boot] [PATCH] Adds driver for Xilinx' xps_spi SPI controller.
  2010-08-03 15:47 [U-Boot] [PATCH] Adds driver for Xilinx' xps_spi SPI controller Graeme Smecher
@ 2010-08-03 17:59 ` Mike Frysinger
  2010-08-04 21:01   ` Graeme Smecher
  2010-08-04 21:04   ` [U-Boot] [PATCH V2] " Graeme Smecher
  0 siblings, 2 replies; 12+ messages in thread
From: Mike Frysinger @ 2010-08-03 17:59 UTC (permalink / raw)
  To: u-boot

On Tuesday, August 03, 2010 11:47:42 Graeme Smecher wrote:
> --- a/drivers/spi/Makefile
> +++ b/drivers/spi/Makefile
> 
>  COBJS-$(CONFIG_ALTERA_SPI) += altera_spi.o
> +COBJS-$(CONFIG_XILINX_SPI) += xilinx_spi.o
>  COBJS-$(CONFIG_ATMEL_DATAFLASH_SPI) += atmel_dataflash_spi.o

this is a sorted list.  please keep it that way

> --- /dev/null
> +++ b/drivers/spi/xilinx_spi.c
> 
> +static ulong xilinx_spi_base_list[] = {
> +#ifdef XPAR_SPI_0_BASEADDR
> +	XPAR_SPI_0_BASEADDR,
> +#endif
> +#ifdef XPAR_SPI_1_BASEADDR
> +	XPAR_SPI_1_BASEADDR,
> +#endif
> +#ifdef XPAR_SPI_2_BASEADDR
> +	XPAR_SPI_2_BASEADDR,
> +#endif
> +#ifdef XPAR_SPI_3_BASEADDR
> +	XPAR_SPI_3_BASEADDR,
> +#endif
> +};

if this is only ever read, you might want to declare it const so it ends up in 
the rodata section.

what if someone defines just XPAR_SPI_3_BASEADDR ?  do you want to be 
consistent in bus id 3 always corresponds to XPAR_SPI_3_BASEADDR ?  or are you 
OK with the numbers always being relative ?  doesnt matter to me, just 
highlighting some things that might have been missed.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20100803/1987da11/attachment.pgp 

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

* [U-Boot] [PATCH] Adds driver for Xilinx' xps_spi SPI controller.
  2010-08-03 17:59 ` Mike Frysinger
@ 2010-08-04 21:01   ` Graeme Smecher
  2010-08-04 21:04   ` [U-Boot] [PATCH V2] " Graeme Smecher
  1 sibling, 0 replies; 12+ messages in thread
From: Graeme Smecher @ 2010-08-04 21:01 UTC (permalink / raw)
  To: u-boot

Hi Mike,

Thanks again for reviewing! Comments in-line; an updated patch will follow.

On 03/08/10 10:59 AM, Mike Frysinger wrote:
> On Tuesday, August 03, 2010 11:47:42 Graeme Smecher wrote:
>    
>> --- a/drivers/spi/Makefile
>> +++ b/drivers/spi/Makefile
>>
>>   COBJS-$(CONFIG_ALTERA_SPI) += altera_spi.o
>> +COBJS-$(CONFIG_XILINX_SPI) += xilinx_spi.o
>>   COBJS-$(CONFIG_ATMEL_DATAFLASH_SPI) += atmel_dataflash_spi.o
>>      
> this is a sorted list.  please keep it that way
>    

Whoops -- OK.

>> --- /dev/null
>> +++ b/drivers/spi/xilinx_spi.c
>>
>> +static ulong xilinx_spi_base_list[] = {
>> +#ifdef XPAR_SPI_0_BASEADDR
>> +	XPAR_SPI_0_BASEADDR,
>> +#endif
>> +#ifdef XPAR_SPI_1_BASEADDR
>> +	XPAR_SPI_1_BASEADDR,
>> +#endif
>> +#ifdef XPAR_SPI_2_BASEADDR
>> +	XPAR_SPI_2_BASEADDR,
>> +#endif
>> +#ifdef XPAR_SPI_3_BASEADDR
>> +	XPAR_SPI_3_BASEADDR,
>> +#endif
>> +};
>>      
> if this is only ever read, you might want to declare it const so it ends up in
> the rodata section.
>    

Done.

> what if someone defines just XPAR_SPI_3_BASEADDR ?  do you want to be
> consistent in bus id 3 always corresponds to XPAR_SPI_3_BASEADDR ?  or are you
> OK with the numbers always being relative ?  doesnt matter to me, just
> highlighting some things that might have been missed.
>    

These numbers come from autogenerated headers and are (as far as I know) 
always numbered from 0. Offhand, the above code seems like the least 
confusing approach. I don't have a particularly strong opinion either.

cheers,
Graeme

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

* [U-Boot] [PATCH V2] Adds driver for Xilinx' xps_spi SPI controller.
  2010-08-03 17:59 ` Mike Frysinger
  2010-08-04 21:01   ` Graeme Smecher
@ 2010-08-04 21:04   ` Graeme Smecher
  2010-08-17 16:27     ` Graeme Smecher
  2010-09-18 20:02     ` Wolfgang Denk
  1 sibling, 2 replies; 12+ messages in thread
From: Graeme Smecher @ 2010-08-04 21:04 UTC (permalink / raw)
  To: u-boot

This code differs in only trivial ways from the altera_spi driver. It plays
nice with Thomas Chou's mmc_spi driver, as well as with SPI flash.

Documentation for the SPI core is available here:

   http://www.xilinx.com/support/documentation/ip_documentation/xps_spi.pdf

Signed-off-by: Graeme Smecher <graeme.smecher@mail.mcgill.ca>
---
 drivers/spi/Makefile     |    1 +
 drivers/spi/xilinx_spi.c |  173 ++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 174 insertions(+), 0 deletions(-)
 create mode 100644 drivers/spi/xilinx_spi.c

diff --git a/drivers/spi/Makefile b/drivers/spi/Makefile
index dfcbb8b..eeba5ef 100644
--- a/drivers/spi/Makefile
+++ b/drivers/spi/Makefile
@@ -36,6 +36,7 @@ COBJS-$(CONFIG_MPC52XX_SPI) += mpc52xx_spi.o
 COBJS-$(CONFIG_MPC8XXX_SPI) += mpc8xxx_spi.o
 COBJS-$(CONFIG_MXC_SPI) += mxc_spi.o
 COBJS-$(CONFIG_SOFT_SPI) += soft_spi.o
+COBJS-$(CONFIG_XILINX_SPI) += xilinx_spi.o
 
 COBJS	:= $(COBJS-y)
 SRCS	:= $(COBJS:.o=.c)
diff --git a/drivers/spi/xilinx_spi.c b/drivers/spi/xilinx_spi.c
new file mode 100644
index 0000000..281c369
--- /dev/null
+++ b/drivers/spi/xilinx_spi.c
@@ -0,0 +1,173 @@
+/*
+ * Xilinx SPI driver
+ *
+ * based on bfin_spi.c, by way of altera_spi.c
+ * Copyright (c) 2005-2008 Analog Devices Inc.
+ * Copyright (c) 2010 Thomas Chou <thomas@wytron.com.tw>
+ * Copyright (c) 2010 Graeme Smecher <graeme.smecher@mail.mcgill.ca>
+ *
+ * Licensed under the GPL-2 or later.
+ */
+#include <common.h>
+#include <asm/io.h>
+#include <malloc.h>
+#include <spi.h>
+
+#define XILINX_SPI_RR			0x6c
+#define XILINX_SPI_TR			0x68
+#define XILINX_SPI_SR			0x64
+#define XILINX_SPI_CR			0x60
+#define XILINX_SPI_SSR			0x70
+
+#define XILINX_SPI_SR_RX_EMPTY_MSK	0x01
+
+#define XILINX_SPI_CR_DEFAULT		(0x0006)
+#define XILINX_SPI_CR_MSS_MSK		(0x0080)
+
+#if XPAR_XSPI_NUM_INSTANCES > 4
+# warning "The xilinx_spi driver will ignore some of your SPI peripherals!"
+#endif
+
+static const ulong xilinx_spi_base_list[] = {
+#ifdef XPAR_SPI_0_BASEADDR
+	XPAR_SPI_0_BASEADDR,
+#endif
+#ifdef XPAR_SPI_1_BASEADDR
+	XPAR_SPI_1_BASEADDR,
+#endif
+#ifdef XPAR_SPI_2_BASEADDR
+	XPAR_SPI_2_BASEADDR,
+#endif
+#ifdef XPAR_SPI_3_BASEADDR
+	XPAR_SPI_3_BASEADDR,
+#endif
+};
+
+struct xilinx_spi_slave {
+	struct spi_slave slave;
+	ulong base;
+};
+#define to_xilinx_spi_slave(s) container_of(s, struct xilinx_spi_slave, slave)
+
+__attribute__((weak))
+int spi_cs_is_valid(unsigned int bus, unsigned int cs)
+{
+	return bus < ARRAY_SIZE(xilinx_spi_base_list) && cs < 32;
+}
+
+__attribute__((weak))
+void spi_cs_activate(struct spi_slave *slave)
+{
+	struct xilinx_spi_slave *xilspi = to_xilinx_spi_slave(slave);
+	writel(~(1 << slave->cs), xilspi->base + XILINX_SPI_SSR);
+	writel(XILINX_SPI_CR_DEFAULT | XILINX_SPI_CR_MSS_MSK,
+		xilspi->base + XILINX_SPI_CR);
+}
+
+__attribute__((weak))
+void spi_cs_deactivate(struct spi_slave *slave)
+{
+	struct xilinx_spi_slave *xilspi = to_xilinx_spi_slave(slave);
+
+	writel(XILINX_SPI_CR_DEFAULT, xilspi->base + XILINX_SPI_CR);
+	writel(~0, xilspi->base + XILINX_SPI_SSR);
+}
+
+void spi_init(void)
+{
+}
+
+struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs,
+				  unsigned int max_hz, unsigned int mode)
+{
+	struct xilinx_spi_slave *xilspi;
+
+	if (!spi_cs_is_valid(bus, cs))
+		return NULL;
+
+	xilspi = malloc(sizeof(*xilspi));
+	if (!xilspi)
+		return NULL;
+
+	xilspi->slave.bus = bus;
+	xilspi->slave.cs = cs;
+	xilspi->base = xilinx_spi_base_list[bus];
+	debug("%s: bus:%i cs:%i base:%lx\n", __func__,
+		bus, cs, xilspi->base);
+
+	return &xilspi->slave;
+}
+
+void spi_free_slave(struct spi_slave *slave)
+{
+	struct xilinx_spi_slave *xilspi = to_xilinx_spi_slave(slave);
+	free(xilspi);
+}
+
+int spi_claim_bus(struct spi_slave *slave)
+{
+	struct xilinx_spi_slave *xilspi = to_xilinx_spi_slave(slave);
+
+	debug("%s: bus:%i cs:%i\n", __func__, slave->bus, slave->cs);
+	writel(XILINX_SPI_CR_DEFAULT, xilspi->base + XILINX_SPI_CR);
+	writel(~0, xilspi->base + XILINX_SPI_SSR);
+	return 0;
+}
+
+void spi_release_bus(struct spi_slave *slave)
+{
+	struct xilinx_spi_slave *xilspi = to_xilinx_spi_slave(slave);
+
+	debug("%s: bus:%i cs:%i\n", __func__, slave->bus, slave->cs);
+	writel(~0, xilspi->base + XILINX_SPI_SSR);
+}
+
+#ifndef CONFIG_XILINX_SPI_IDLE_VAL
+# define CONFIG_XILINX_SPI_IDLE_VAL 0xff
+#endif
+
+int spi_xfer(struct spi_slave *slave, unsigned int bitlen, const void *dout,
+	     void *din, unsigned long flags)
+{
+	struct xilinx_spi_slave *xilspi = to_xilinx_spi_slave(slave);
+	/* assume spi core configured to do 8 bit transfers */
+	uint bytes = bitlen / 8;
+	const uchar *txp = dout;
+	uchar *rxp = din;
+
+	debug("%s: bus:%i cs:%i bitlen:%i bytes:%i flags:%lx\n", __func__,
+		slave->bus, slave->cs, bitlen, bytes, flags);
+	if (bitlen == 0)
+		goto done;
+
+	if (bitlen % 8) {
+		flags |= SPI_XFER_END;
+		goto done;
+	}
+
+	/* empty read buffer */
+	while (!(readl(xilspi->base + XILINX_SPI_SR) &
+	    XILINX_SPI_SR_RX_EMPTY_MSK))
+		readl(xilspi->base + XILINX_SPI_RR);
+
+	if (flags & SPI_XFER_BEGIN)
+		spi_cs_activate(slave);
+
+	while (bytes--) {
+		uchar d = txp ? *txp++ : CONFIG_XILINX_SPI_IDLE_VAL;
+		debug("%s: tx:%x ", __func__, d);
+		writel(d, xilspi->base + XILINX_SPI_TR);
+		while (readl(xilspi->base + XILINX_SPI_SR) &
+			 XILINX_SPI_SR_RX_EMPTY_MSK)
+			;
+		d = readl(xilspi->base + XILINX_SPI_RR);
+		if (rxp)
+			*rxp++ = d;
+		debug("rx:%x\n", d);
+	}
+ done:
+	if (flags & SPI_XFER_END)
+		spi_cs_deactivate(slave);
+
+	return 0;
+}
-- 
1.7.0.4

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

* [U-Boot] [PATCH V2] Adds driver for Xilinx' xps_spi SPI controller.
  2010-08-04 21:04   ` [U-Boot] [PATCH V2] " Graeme Smecher
@ 2010-08-17 16:27     ` Graeme Smecher
  2010-08-17 17:25       ` Anatolij Gustschin
  2010-09-18 20:02     ` Wolfgang Denk
  1 sibling, 1 reply; 12+ messages in thread
From: Graeme Smecher @ 2010-08-17 16:27 UTC (permalink / raw)
  To: u-boot

Hi all,

On 04/08/10 02:04 PM, Graeme Smecher wrote:
> This code differs in only trivial ways from the altera_spi driver. It plays
> nice with Thomas Chou's mmc_spi driver, as well as with SPI flash.
>
> Documentation for the SPI core is available here:
>
>     http://www.xilinx.com/support/documentation/ip_documentation/xps_spi.pdf
>
> Signed-off-by: Graeme Smecher<graeme.smecher@mail.mcgill.ca>
> ---
>   drivers/spi/Makefile     |    1 +
>   drivers/spi/xilinx_spi.c |  173 ++++++++++++++++++++++++++++++++++++++++++++++
>   2 files changed, 174 insertions(+), 0 deletions(-)
>   create mode 100644 drivers/spi/xilinx_spi.c
>    

Just a friendly reminder -- I'd be really happy to see this, and my 
other patch (July 29, "Add support for Winbond W25Q64 SPI flash"), 
integrated into the tree. Please let me know if there's anything I can 
do to grease the skids.

cheers,
Graeme

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

* [U-Boot] [PATCH V2] Adds driver for Xilinx' xps_spi SPI controller.
  2010-08-17 16:27     ` Graeme Smecher
@ 2010-08-17 17:25       ` Anatolij Gustschin
  2010-08-17 17:34         ` Graeme Smecher
  0 siblings, 1 reply; 12+ messages in thread
From: Anatolij Gustschin @ 2010-08-17 17:25 UTC (permalink / raw)
  To: u-boot

Hi,

On Tue, 17 Aug 2010 09:27:10 -0700
Graeme Smecher <graeme.smecher@mail.mcgill.ca> wrote:

> On 04/08/10 02:04 PM, Graeme Smecher wrote:
> > This code differs in only trivial ways from the altera_spi driver. It plays
> > nice with Thomas Chou's mmc_spi driver, as well as with SPI flash.
> >
> > Documentation for the SPI core is available here:
> >
> >     http://www.xilinx.com/support/documentation/ip_documentation/xps_spi.pdf
> >
> > Signed-off-by: Graeme Smecher<graeme.smecher@mail.mcgill.ca>
> > ---
> >   drivers/spi/Makefile     |    1 +
> >   drivers/spi/xilinx_spi.c |  173 ++++++++++++++++++++++++++++++++++++++++++++++
> >   2 files changed, 174 insertions(+), 0 deletions(-)
> >   create mode 100644 drivers/spi/xilinx_spi.c
> >    
> 
> Just a friendly reminder -- I'd be really happy to see this, and my 
> other patch (July 29, "Add support for Winbond W25Q64 SPI flash"), 
> integrated into the tree. Please let me know if there's anything I can 
> do to grease the skids.

Thanks! But both, this and your other patch have been submitted when
the merge window for next v2010.09 release was closed. So the patches
probably won't be integrated before the next merge window opens,
since these are not bug fixes. Normally you do not have to resubmit
the patches when the next merge window opens again, maybe send a
reminder again. Some info about release cycle can be found here [1].

Best regards,
Anatolij

[1] http://www.denx.de/wiki/U-Boot/ReleaseCycle

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

* [U-Boot] [PATCH V2] Adds driver for Xilinx' xps_spi SPI controller.
  2010-08-17 17:25       ` Anatolij Gustschin
@ 2010-08-17 17:34         ` Graeme Smecher
  0 siblings, 0 replies; 12+ messages in thread
From: Graeme Smecher @ 2010-08-17 17:34 UTC (permalink / raw)
  To: u-boot

Hi Anatolij,

On 17/08/10 10:25 AM, Anatolij Gustschin wrote:
> Hi,
>
> On Tue, 17 Aug 2010 09:27:10 -0700
> Graeme Smecher<graeme.smecher@mail.mcgill.ca>  wrote:
>
>    
>> On 04/08/10 02:04 PM, Graeme Smecher wrote:
>>      
>>> This code differs in only trivial ways from the altera_spi driver. It plays
>>> nice with Thomas Chou's mmc_spi driver, as well as with SPI flash.
>>>
>>> Documentation for the SPI core is available here:
>>>
>>>      http://www.xilinx.com/support/documentation/ip_documentation/xps_spi.pdf
>>>
>>> Signed-off-by: Graeme Smecher<graeme.smecher@mail.mcgill.ca>
>>> ---
>>>    drivers/spi/Makefile     |    1 +
>>>    drivers/spi/xilinx_spi.c |  173 ++++++++++++++++++++++++++++++++++++++++++++++
>>>    2 files changed, 174 insertions(+), 0 deletions(-)
>>>    create mode 100644 drivers/spi/xilinx_spi.c
>>>
>>>        
>> Just a friendly reminder -- I'd be really happy to see this, and my
>> other patch (July 29, "Add support for Winbond W25Q64 SPI flash"),
>> integrated into the tree. Please let me know if there's anything I can
>> do to grease the skids.
>>      
> Thanks! But both, this and your other patch have been submitted when
> the merge window for next v2010.09 release was closed. So the patches
> probably won't be integrated before the next merge window opens,
> since these are not bug fixes. Normally you do not have to resubmit
> the patches when the next merge window opens again, maybe send a
> reminder again. Some info about release cycle can be found here [1].
>
> Best regards,
> Anatolij
>
> [1] http://www.denx.de/wiki/U-Boot/ReleaseCycle
>    

Ah, of course -- I should have guessed. I'll send along another prod 
next month if it's necessary.

thanks,
Graeme

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

* [U-Boot] [PATCH V2] Adds driver for Xilinx' xps_spi SPI controller.
  2010-08-04 21:04   ` [U-Boot] [PATCH V2] " Graeme Smecher
  2010-08-17 16:27     ` Graeme Smecher
@ 2010-09-18 20:02     ` Wolfgang Denk
  2010-09-20 14:43       ` Graeme Smecher
  1 sibling, 1 reply; 12+ messages in thread
From: Wolfgang Denk @ 2010-09-18 20:02 UTC (permalink / raw)
  To: u-boot

Dear Graeme Smecher,

In message <1280955847-2999-1-git-send-email-graeme.smecher@mail.mcgill.ca> you wrote:
> This code differs in only trivial ways from the altera_spi driver. It plays
> nice with Thomas Chou's mmc_spi driver, as well as with SPI flash.

Hm... if the core really differs in only trivial ways from the
altera_spi driver, then why do we need a duplication of that code?

Can we plase have a single driver source that supports both instead?

Best regards,

Wolfgang Denk

-- 
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
Harrisberger's Fourth Law of the Lab:
	Experience is directly proportional to the
	amount of equipment ruined.

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

* [U-Boot] [PATCH V2] Adds driver for Xilinx' xps_spi SPI controller.
  2010-09-18 20:02     ` Wolfgang Denk
@ 2010-09-20 14:43       ` Graeme Smecher
  2012-03-31 19:42         ` Marek Vasut
  0 siblings, 1 reply; 12+ messages in thread
From: Graeme Smecher @ 2010-09-20 14:43 UTC (permalink / raw)
  To: u-boot

Hi Wolfgang,

On 18/09/10 01:02 PM, Wolfgang Denk wrote:
> Dear Graeme Smecher,
>
> In message<1280955847-2999-1-git-send-email-graeme.smecher@mail.mcgill.ca>  you wrote:
>    
>> This code differs in only trivial ways from the altera_spi driver. It plays
>> nice with Thomas Chou's mmc_spi driver, as well as with SPI flash.
>>      
> Hm... if the core really differs in only trivial ways from the
> altera_spi driver, then why do we need a duplication of that code?
>
> Can we plase have a single driver source that supports both instead?
>    

Hm... It's possible to combine xilinx_spi.c and altera_spi.c. However, I 
suspect joining them will make maintenance more complicated rather than 
simpler. I can't, for example, test a combined driver on Altera hardware 
(and the Altera maintainer will likely have the same problem with Xilinx 
hardware.)

My guess is that most SPI interfaces are nearly identical at a register 
level, especially for drivers that don't support interrupts and other 
complications. (See mxc_spi.c for another example.) Xilinx and Altera's 
SPI interfaces are just two examples that happen to both be FPGA-based 
-- I could probably have adapted any of the other SPI drivers instead.

Are you sure combining drivers is the most logical approach? Let me 
know, and I'll have a crack at it.

thanks,
Graeme

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

* [U-Boot] [PATCH V2] Adds driver for Xilinx' xps_spi SPI controller.
  2010-09-20 14:43       ` Graeme Smecher
@ 2012-03-31 19:42         ` Marek Vasut
  2012-04-02 15:56           ` Graeme Smecher
  0 siblings, 1 reply; 12+ messages in thread
From: Marek Vasut @ 2012-03-31 19:42 UTC (permalink / raw)
  To: u-boot

Dear Graeme Smecher,

> Hi Wolfgang,
> 
> On 18/09/10 01:02 PM, Wolfgang Denk wrote:
> > Dear Graeme Smecher,
> > 
> > In message<1280955847-2999-1-git-send-email-graeme.smecher@mail.mcgill.ca>  
you wrote:
> >> This code differs in only trivial ways from the altera_spi driver. It
> >> plays nice with Thomas Chou's mmc_spi driver, as well as with SPI
> >> flash.
> > 
> > Hm... if the core really differs in only trivial ways from the
> > altera_spi driver, then why do we need a duplication of that code?
> > 
> > Can we plase have a single driver source that supports both instead?
> 
> Hm... It's possible to combine xilinx_spi.c and altera_spi.c. However, I
> suspect joining them will make maintenance more complicated rather than
> simpler. I can't, for example, test a combined driver on Altera hardware
> (and the Altera maintainer will likely have the same problem with Xilinx
> hardware.)
> 
> My guess is that most SPI interfaces are nearly identical at a register
> level, especially for drivers that don't support interrupts and other
> complications. (See mxc_spi.c for another example.) Xilinx and Altera's
> SPI interfaces are just two examples that happen to both be FPGA-based
> -- I could probably have adapted any of the other SPI drivers instead.
> 
> Are you sure combining drivers is the most logical approach? Let me
> know, and I'll have a crack at it.
> 
> thanks,
> Graeme

What was the conclusion here? Shall I drop the patch or will you submit a 
rebased version?

Best regards,
Marek Vasut

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

* [U-Boot] [PATCH V2] Adds driver for Xilinx' xps_spi SPI controller.
  2012-03-31 19:42         ` Marek Vasut
@ 2012-04-02 15:56           ` Graeme Smecher
  2012-04-02 16:34             ` Marek Vasut
  0 siblings, 1 reply; 12+ messages in thread
From: Graeme Smecher @ 2012-04-02 15:56 UTC (permalink / raw)
  To: u-boot

Hi Marek,

On 31/03/12 12:42 PM, Marek Vasut wrote:
> Dear Graeme Smecher,
>
>> Hi Wolfgang,
>>
>> On 18/09/10 01:02 PM, Wolfgang Denk wrote:
>>> Dear Graeme Smecher,
>>>
>>> In message<1280955847-2999-1-git-send-email-graeme.smecher@mail.mcgill.ca>
> you wrote:
>>>> This code differs in only trivial ways from the altera_spi driver. It
>>>> plays nice with Thomas Chou's mmc_spi driver, as well as with SPI
>>>> flash.
>>> Hm... if the core really differs in only trivial ways from the
>>> altera_spi driver, then why do we need a duplication of that code?
>>>
>>> Can we plase have a single driver source that supports both instead?
>> Hm... It's possible to combine xilinx_spi.c and altera_spi.c. However, I
>> suspect joining them will make maintenance more complicated rather than
>> simpler. I can't, for example, test a combined driver on Altera hardware
>> (and the Altera maintainer will likely have the same problem with Xilinx
>> hardware.)
>>
>> My guess is that most SPI interfaces are nearly identical at a register
>> level, especially for drivers that don't support interrupts and other
>> complications. (See mxc_spi.c for another example.) Xilinx and Altera's
>> SPI interfaces are just two examples that happen to both be FPGA-based
>> -- I could probably have adapted any of the other SPI drivers instead.
>>
>> Are you sure combining drivers is the most logical approach? Let me
>> know, and I'll have a crack at it.
>>
>> thanks,
>> Graeme
> What was the conclusion here? Shall I drop the patch or will you submit a
> rebased version?

Please drop the patch for now, since I'm not in a position to maintain 
it. The trail of bread-crumbs on the mailing list is a good compromise 
until someone (me, later on?) steps up.

thanks,
Graeme

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

* [U-Boot] [PATCH V2] Adds driver for Xilinx' xps_spi SPI controller.
  2012-04-02 15:56           ` Graeme Smecher
@ 2012-04-02 16:34             ` Marek Vasut
  0 siblings, 0 replies; 12+ messages in thread
From: Marek Vasut @ 2012-04-02 16:34 UTC (permalink / raw)
  To: u-boot

Dear Graeme Smecher,

> Hi Marek,
> 
> On 31/03/12 12:42 PM, Marek Vasut wrote:
> > Dear Graeme Smecher,
> > 
> >> Hi Wolfgang,
> >> 
> >> On 18/09/10 01:02 PM, Wolfgang Denk wrote:
> >>> Dear Graeme Smecher,
> >>> 
> >>> In
> >>> message<1280955847-2999-1-git-send-email-graeme.smecher@mail.mcgill.ca
> >>> >
> > 
> > you wrote:
> >>>> This code differs in only trivial ways from the altera_spi driver. It
> >>>> plays nice with Thomas Chou's mmc_spi driver, as well as with SPI
> >>>> flash.
> >>> 
> >>> Hm... if the core really differs in only trivial ways from the
> >>> altera_spi driver, then why do we need a duplication of that code?
> >>> 
> >>> Can we plase have a single driver source that supports both instead?
> >> 
> >> Hm... It's possible to combine xilinx_spi.c and altera_spi.c. However, I
> >> suspect joining them will make maintenance more complicated rather than
> >> simpler. I can't, for example, test a combined driver on Altera hardware
> >> (and the Altera maintainer will likely have the same problem with Xilinx
> >> hardware.)
> >> 
> >> My guess is that most SPI interfaces are nearly identical at a register
> >> level, especially for drivers that don't support interrupts and other
> >> complications. (See mxc_spi.c for another example.) Xilinx and Altera's
> >> SPI interfaces are just two examples that happen to both be FPGA-based
> >> -- I could probably have adapted any of the other SPI drivers instead.
> >> 
> >> Are you sure combining drivers is the most logical approach? Let me
> >> know, and I'll have a crack at it.
> >> 
> >> thanks,
> >> Graeme
> > 
> > What was the conclusion here? Shall I drop the patch or will you submit a
> > rebased version?
> 
> Please drop the patch for now, since I'm not in a position to maintain
> it. The trail of bread-crumbs on the mailing list is a good compromise
> until someone (me, later on?) steps up.

Sorry to hear that, though thanks for updating me on the situation :)

> thanks,
> Graeme

Best regards,
Marek Vasut

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

end of thread, other threads:[~2012-04-02 16:34 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-03 15:47 [U-Boot] [PATCH] Adds driver for Xilinx' xps_spi SPI controller Graeme Smecher
2010-08-03 17:59 ` Mike Frysinger
2010-08-04 21:01   ` Graeme Smecher
2010-08-04 21:04   ` [U-Boot] [PATCH V2] " Graeme Smecher
2010-08-17 16:27     ` Graeme Smecher
2010-08-17 17:25       ` Anatolij Gustschin
2010-08-17 17:34         ` Graeme Smecher
2010-09-18 20:02     ` Wolfgang Denk
2010-09-20 14:43       ` Graeme Smecher
2012-03-31 19:42         ` Marek Vasut
2012-04-02 15:56           ` Graeme Smecher
2012-04-02 16:34             ` Marek Vasut

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.