Skip to contentSkip to conversation

Blackfin arch update for 2.6.23

GIT PULL Bryan Wu 3 participants 7 messages Aug 5, 2007 – Aug 7, 2007 SPI

lore
Share & tools
lore

Bryan Wu

author
#0 lore raw

Hi Linus,

Please pull from 'for-linus' branch of

master.kernel.org:/pub/scm/linux/kernel/git/cooloney/blackfin-2.6.git for-linus

to receive the following updates:

 arch/blackfin/Kconfig                             |    2 +-
 arch/blackfin/kernel/bfin_gpio.c                  |  291 ++++++++++++++--
 arch/blackfin/kernel/init_task.c                  |    1 +
 arch/blackfin/kernel/process.c                    |    2 +
 arch/blackfin/kernel/sys_bfin.c                   |    1 +
 arch/blackfin/kernel/traps.c                      |    1 +
 arch/blackfin/mach-bf548/Kconfig                  |    4 +-
 arch/blackfin/mach-bf548/boards/ezkit.c           |  367 ++++++++++++++++++++-
 arch/blackfin/mach-bf548/gpio.c                   |   98 +++++-
 arch/blackfin/mach-common/ints-priority-dc.c      |    4 +-
 arch/blackfin/mach-common/ints-priority-sc.c      |    8 +-
 drivers/spi/spi_bfin5xx.c                         |  149 +++++----
 include/asm-blackfin/bfin5xx_spi.h                |    6 +
 include/asm-blackfin/gpio.h                       |   31 ++
 include/asm-blackfin/mach-bf533/bfin_serial_5xx.h |   11 +-
 include/asm-blackfin/mach-bf533/blackfin.h        |    2 +-
 include/asm-blackfin/mach-bf533/irq.h             |    2 +
 include/asm-blackfin/mach-bf533/portmux.h         |    2 +-
 include/asm-blackfin/mach-bf537/bfin_serial_5xx.h |   23 +-
 include/asm-blackfin/mach-bf537/blackfin.h        |    2 +-
 include/asm-blackfin/mach-bf537/irq.h             |    2 +
 include/asm-blackfin/mach-bf537/portmux.h         |   35 ++-
 include/asm-blackfin/mach-bf548/bfin_serial_5xx.h |   39 +--
 include/asm-blackfin/mach-bf548/blackfin.h        |    2 +-
 include/asm-blackfin/mach-bf548/defBF54x_base.h   |   17 +
 include/asm-blackfin/mach-bf548/gpio.h            |    5 -
 include/asm-blackfin/mach-bf548/irq.h             |    2 +
 include/asm-blackfin/mach-bf561/bfin_serial_5xx.h |   11 +-
 include/asm-blackfin/mach-bf561/blackfin.h        |    2 +-
 include/asm-blackfin/mach-bf561/irq.h             |    2 +
 include/asm-blackfin/portmux.h                    |   22 ++
 31 files changed, 971 insertions(+), 175 deletions(-)

Bryan Wu (4):
Blackfin arch: bug fixing, add missing BF533_FAMILY GPIO_PFx definition Blackfin arch: update platform driver resource information to the ezkitBF548 board file Blackfin arch: after removing fs.h from mm.h, fix the broken on Blackfin arch. Blackfin SPI driver: Initial supporting BF54x in SPI driver

Michael Hennerich (11):
Blackfin arch: store labels so we later know who allocated GPIO/Peripheral resources Blackfin arch: add peripheral resource allocation support
Blackfin arch: Add label to call new GPIO API
Blackfin arch: fix PORT_J BUG for BF537/6 EMAC driver
Blackfin arch: Finalize the generic gpio support - add gpio_to_irq and irq_to_gpio Blackfin arch: Advertise GENERIC_GPIO and remove duplicated GENERIC_CALIBRATE_DELAY Blackfin arch: Add PORT_J.High (needed for BF548-EZkit Touchscreen interrupts) - remove PORT_C.H Blackfin arch: add missing gpio error handling to make sure we roll back requests in case one fails Blackfin serial driver: use new GPIO API
Blackfin SPI driver: Make BF54x SPI work and add support for portmux API
Blackfin SPI driver: use new GPIO API and add error handling

Mike Frysinger (1):
Blackfin arch: scrub remaining ASSEMBLY usage since the switch to __ASSEMBLY__

arch/blackfin/Kconfig +1 -1
index 017defa..5c1e215 100644
@@ -57,7 +57,7 @@ config GENERIC_TIME
 	bool
 	default n
 
-config GENERIC_CALIBRATE_DELAY
+config GENERIC_GPIO
 	bool
 	default y
 
arch/blackfin/kernel/bfin_gpio.c +255 -36

421 lines not on this page · raw message

arch/blackfin/kernel/init_task.c +1 -0
index b45188f..673c860 100644
@@ -31,6 +31,7 @@
 #include <linux/module.h>
 #include <linux/init_task.h>
 #include <linux/mqueue.h>
+#include <linux/fs.h>
 
 static struct fs_struct init_fs = INIT_FS;
 static struct files_struct init_files = INIT_FILES;
arch/blackfin/kernel/process.c +2 -0
index 5a51dd6..6a7aefe 100644
@@ -33,6 +33,8 @@
 #include <linux/user.h>
 #include <linux/a.out.h>
 #include <linux/uaccess.h>
+#include <linux/fs.h>
+#include <linux/err.h>
 
 #include <asm/blackfin.h>
 #include <asm/fixed_code.h>
arch/blackfin/kernel/sys_bfin.c +1 -0
index f5e1ae3..abcd148 100644
@@ -37,6 +37,7 @@
 #include <linux/syscalls.h>
 #include <linux/mman.h>
 #include <linux/file.h>
+#include <linux/fs.h>
 #include <linux/uaccess.h>
 #include <linux/ipc.h>
 #include <linux/unistd.h>
arch/blackfin/kernel/traps.c +1 -0
index 8766bd6..792a841 100644
@@ -31,6 +31,7 @@
 #include <linux/interrupt.h>
 #include <linux/module.h>
 #include <linux/kallsyms.h>
+#include <linux/fs.h>
 #include <asm/traps.h>
 #include <asm/cacheflush.h>
 #include <asm/blackfin.h>
arch/blackfin/mach-bf548/Kconfig +2 -2
index e78b03d..3976b7f 100644
@@ -282,7 +282,7 @@ menu "Assignment"
 
 config PINTx_REASSIGN
 	bool "Reprogram PINT Assignment"
-	default n
+	default y
 	help
 	  The interrupt assignment registers controls the pin-to-interrupt
 	  assignment in a byte-wide manner. Each option allows you to select
@@ -303,7 +303,7 @@ config PINT1_ASSIGN
 config PINT2_ASSIGN
 	hex "PINT2_ASSIGN"
 	depends on PINTx_REASSIGN
-	default 0x00000101
+	default 0x07000101
 config PINT3_ASSIGN
 	hex "PINT3_ASSIGN"
 	depends on PINTx_REASSIGN
arch/blackfin/mach-bf548/boards/ezkit.c +366 -1

399 lines not on this page · raw message

arch/blackfin/mach-bf548/gpio.c +81 -17

207 lines not on this page · raw message

arch/blackfin/mach-common/ints-priority-dc.c +2 -2
index 660f881..d5d9e57 100644
@@ -221,7 +221,7 @@ static unsigned int bf561_gpio_irq_startup(unsigned int irq)
 
 	if (!(gpio_enabled[gpio_bank(gpionr)] & gpio_bit(gpionr))) {
 
-		ret = gpio_request(gpionr, NULL);
+		ret = gpio_request(gpionr, "IRQ");
 		if (ret)
 			return ret;
 
@@ -261,7 +261,7 @@ static int bf561_gpio_irq_type(unsigned int irq, unsigned int type)
 
 		if (!(gpio_enabled[gpio_bank(gpionr)] & gpio_bit(gpionr))) {
 
-			ret = gpio_request(gpionr, NULL);
+			ret = gpio_request(gpionr, "IRQ");
 			if (ret)
 				return ret;
 
arch/blackfin/mach-common/ints-priority-sc.c +4 -4
index 4708023..505b948 100644
@@ -343,7 +343,7 @@ static unsigned int bfin_gpio_irq_startup(unsigned int irq)
 	u16 gpionr = irq - IRQ_PF0;
 
 	if (!(gpio_enabled[gpio_bank(gpionr)] & gpio_bit(gpionr))) {
-		ret = gpio_request(gpionr, NULL);
+		ret = gpio_request(gpionr, "IRQ");
 		if (ret)
 			return ret;
 	}
@@ -377,7 +377,7 @@ static int bfin_gpio_irq_type(unsigned int irq, unsigned int type)
 	if (type & (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING |
 		    IRQ_TYPE_LEVEL_HIGH | IRQ_TYPE_LEVEL_LOW)) {
 		if (!(gpio_enabled[gpio_bank(gpionr)] & gpio_bit(gpionr))) {
-			ret = gpio_request(gpionr, NULL);
+			ret = gpio_request(gpionr, "IRQ");
 			if (ret)
 				return ret;
 		}
@@ -587,7 +587,7 @@ static unsigned int bfin_gpio_irq_startup(unsigned int irq)
 	}
 
 	if (!(gpio_enabled[gpio_bank(gpionr)] & gpio_bit(gpionr))) {
-		ret = gpio_request(gpionr, NULL);
+		ret = gpio_request(gpionr, "IRQ");
 		if (ret)
 			return ret;
 	}
@@ -627,7 +627,7 @@ static int bfin_gpio_irq_type(unsigned int irq, unsigned int type)
 	if (type & (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING |
 		    IRQ_TYPE_LEVEL_HIGH | IRQ_TYPE_LEVEL_LOW)) {
 		if (!(gpio_enabled[gpio_bank(gpionr)] & gpio_bit(gpionr))) {
-			ret = gpio_request(gpionr, NULL);
+			ret = gpio_request(gpionr, "IRQ");
 			if (ret)
 				return ret;
 		}
drivers/spi/spi_bfin5xx.c +81 -68

269 lines not on this page · raw message

include/asm-blackfin/bfin5xx_spi.h +6 -0
index 95c1c95..8b211ff 100644
@@ -150,6 +150,12 @@
 #define CFG_SPI_CS6VALUE    6
 #define CFG_SPI_CS7VALUE    7
 
+#if defined(CONFIG_BF54x)
+#define CH_SPI			CH_SPI0
+#define bfin_read_SPI_STAT	bfin_read_SPI0_STAT
+#endif
+
+
 /* device.platform_data for SSP controller devices */
 struct bfin5xx_spi_master {
 	u16 num_chipselect;
include/asm-blackfin/gpio.h +31 -0
index 7480cfa..dd203cd 100644
@@ -144,6 +144,24 @@
 
 #ifdef BF533_FAMILY
 #define MAX_BLACKFIN_GPIOS 16
+
+#define	GPIO_PF0	0
+#define	GPIO_PF1	1
+#define	GPIO_PF2	2
+#define	GPIO_PF3	3
+#define	GPIO_PF4	4
+#define	GPIO_PF5	5
+#define	GPIO_PF6	6
+#define	GPIO_PF7	7
+#define	GPIO_PF8	8
+#define	GPIO_PF9	9
+#define	GPIO_PF10	10
+#define	GPIO_PF11	11
+#define	GPIO_PF12	12
+#define	GPIO_PF13	13
+#define	GPIO_PF14	14
+#define	GPIO_PF15	15
+
 #endif
 
 #ifdef BF537_FAMILY
@@ -421,6 +439,19 @@ unsigned short gpio_get_value(unsigned short gpio);
 void gpio_direction_input(unsigned short gpio);
 void gpio_direction_output(unsigned short gpio);
 
+#include <asm-generic/gpio.h>		/* cansleep wrappers */
+#include <asm/irq.h>
+
+static inline int gpio_to_irq(unsigned gpio)
+{
+	return (gpio + GPIO_IRQ_BASE);
+}
+
+static inline int irq_to_gpio(unsigned irq)
+{
+	return (irq - GPIO_IRQ_BASE);
+}
+
 #endif /* __ASSEMBLY__ */
 
 #endif /* __ARCH_BLACKFIN_GPIO_H__ */
include/asm-blackfin/mach-bf533/bfin_serial_5xx.h +9 -2
index e043caf..69b9f8e 100644
@@ -1,5 +1,6 @@
 #include <linux/serial.h>
 #include <asm/dma.h>
+#include <asm/portmux.h>
 
 #define NR_PORTS                1
 
@@ -92,18 +93,24 @@ struct bfin_serial_res bfin_serial_resource[] = {
 	}
 };
 
+#define DRIVER_NAME "bfin-uart"
 
 int nr_ports = NR_PORTS;
 static void bfin_serial_hw_init(struct bfin_serial_port *uart)
 {
 
+#ifdef CONFIG_SERIAL_BFIN_UART0
+	peripheral_request(P_UART0_TX, DRIVER_NAME);
+	peripheral_request(P_UART0_RX, DRIVER_NAME);
+#endif
+
 #ifdef CONFIG_SERIAL_BFIN_CTSRTS
 	if (uart->cts_pin >= 0) {
-		gpio_request(uart->cts_pin, NULL);
+		gpio_request(uart->cts_pin, DRIVER_NAME);
 		gpio_direction_input(uart->cts_pin);
 	}
 	if (uart->rts_pin >= 0) {
-		gpio_request(uart->rts_pin, NULL);
+		gpio_request(uart->rts_pin, DRIVER_NAME);
 		gpio_direction_input(uart->rts_pin);
 	}
 #endif
include/asm-blackfin/mach-bf533/blackfin.h +1 -1
index e438449..f3b240a 100644
@@ -38,7 +38,7 @@
 #include "defBF532.h"
 #include "anomaly.h"
 
-#if !(defined(__ASSEMBLY__) || defined(ASSEMBLY))
+#if !defined(__ASSEMBLY__)
 #include "cdefBF532.h"
 #endif
 
include/asm-blackfin/mach-bf533/irq.h +2 -0
index 9879e68..452fb82 100644
@@ -128,6 +128,8 @@ Core        Emulation               **
 #define IRQ_PF14		47
 #define IRQ_PF15		48
 
+#define GPIO_IRQ_BASE		IRQ_PF0
+
 #ifdef CONFIG_IRQCHIP_DEMUX_GPIO
 #define	NR_IRQS		(IRQ_PF15+1)
 #else
include/asm-blackfin/mach-bf533/portmux.h +1 -1
index b88d7a0..137f488 100644
@@ -42,7 +42,7 @@
 #define P_SPORT0_DRPRI	(P_DONTCARE)
 
 #define P_SPI0_MOSI	(P_DONTCARE)
-#define P_SPI0_MIS0	(P_DONTCARE)
+#define P_SPI0_MISO	(P_DONTCARE)
 #define P_SPI0_SCK	(P_DONTCARE)
 #define P_SPI0_SSEL7	(P_DEFINED | P_IDENT(GPIO_PF7))
 #define P_SPI0_SSEL6	(P_DEFINED | P_IDENT(GPIO_PF6))
include/asm-blackfin/mach-bf537/bfin_serial_5xx.h +14 -9
index 8f5d9c4..6fb328f 100644
@@ -1,5 +1,6 @@
 #include <linux/serial.h>
 #include <asm/dma.h>
+#include <asm/portmux.h>
 
 #define NR_PORTS		2
 
@@ -122,25 +123,29 @@ struct bfin_serial_res bfin_serial_resource[] = {
 
 int nr_ports = ARRAY_SIZE(bfin_serial_resource);
 
+#define DRIVER_NAME "bfin-uart"
+
 static void bfin_serial_hw_init(struct bfin_serial_port *uart)
 {
-	unsigned short val;
-	val = bfin_read16(BFIN_PORT_MUX);
-	val &= ~(PFDE | PFTE);
-	bfin_write16(BFIN_PORT_MUX, val);
 
-	val = bfin_read16(PORTF_FER);
-	val |= 0xF;
-	bfin_write16(PORTF_FER, val);
+#ifdef CONFIG_SERIAL_BFIN_UART0
+	peripheral_request(P_UART0_TX, DRIVER_NAME);
+	peripheral_request(P_UART0_RX, DRIVER_NAME);
+#endif
+
+#ifdef CONFIG_SERIAL_BFIN_UART1
+	peripheral_request(P_UART1_TX, DRIVER_NAME);
+	peripheral_request(P_UART1_RX, DRIVER_NAME);
+#endif
 
 #ifdef CONFIG_SERIAL_BFIN_CTSRTS
 	if (uart->cts_pin >= 0) {
-		gpio_request(uart->cts_pin, NULL);
+		gpio_request(uart->cts_pin, DRIVER_NAME);
 		gpio_direction_input(uart->cts_pin);
 	}
 
 	if (uart->rts_pin >= 0) {
-		gpio_request(uart->rts_pin, NULL);
+		gpio_request(uart->rts_pin, DRIVER_NAME);
 		gpio_direction_output(uart->rts_pin);
 	}
 #endif
include/asm-blackfin/mach-bf537/blackfin.h +1 -1
index bbd9705..f196588 100644
@@ -43,7 +43,7 @@
 #include "defBF537.h"
 #endif
 
-#if !(defined(__ASSEMBLY__) || defined(ASSEMBLY))
+#if !defined(__ASSEMBLY__)
 #include "cdefBF534.h"
 
 /* UART 0*/
include/asm-blackfin/mach-bf537/irq.h +2 -0
index 8af2a83..36c44bc 100644
@@ -160,6 +160,8 @@ Core        Emulation               **
 #define IRQ_PH14        96
 #define IRQ_PH15        97
 
+#define GPIO_IRQ_BASE	IRQ_PF0
+
 #ifdef CONFIG_IRQCHIP_DEMUX_GPIO
 #define NR_IRQS     (IRQ_PH15+1)
 #else
include/asm-blackfin/mach-bf537/portmux.h +34 -1
index 23e13c5..ae6c53b 100644
@@ -106,4 +106,37 @@
 #define P_SPI0_SSEL2	(P_DEFINED | P_IDENT(PORT_PJ11) | P_FUNCT(1))
 #define P_SPI0_SSEL7	(P_DEFINED | P_IDENT(PORT_PJ5) | P_FUNCT(2))
 
-#endif /* _MACH_PORTMUX_H_ */
+#define P_MII0 {\
+	P_MII0_ETxD0, \
+	P_MII0_ETxD1, \
+	P_MII0_ETxD2, \
+	P_MII0_ETxD3, \
+	P_MII0_ETxEN, \
+	P_MII0_TxCLK, \
+	P_MII0_PHYINT, \
+	P_MII0_COL, \
+	P_MII0_ERxD0, \
+	P_MII0_ERxD1, \
+	P_MII0_ERxD2, \
+	P_MII0_ERxD3, \
+	P_MII0_ERxDV, \
+	P_MII0_ERxCLK, \
+	P_MII0_ERxER, \
+	P_MII0_CRS, \
+	P_MDC, \
+	P_MDIO, 0}
+
+
+#define P_RMII0 {\
+	P_MII0_ETxD0, \
+	P_MII0_ETxD1, \
+	P_MII0_ETxEN, \
+	P_MII0_ERxD0, \
+	P_MII0_ERxD1, \
+	P_MII0_ERxER, \
+	P_RMII0_REF_CLK, \
+	P_RMII0_MDINT, \
+	P_RMII0_CRS_DV, \
+	P_MDC, \
+	P_MDIO, 0}
+#endif			        	/* _MACH_PORTMUX_H_ */
include/asm-blackfin/mach-bf548/bfin_serial_5xx.h +19 -20
index 2f4afc9..f21a162 100644
@@ -1,5 +1,6 @@
 #include <linux/serial.h>
 #include <asm/dma.h>
+#include <asm/portmux.h>
 
 #define NR_PORTS		4
 
@@ -143,50 +144,48 @@ struct bfin_serial_res bfin_serial_resource[] = {
 
 int nr_ports = ARRAY_SIZE(bfin_serial_resource);
 
+#define DRIVER_NAME "bfin-uart"
+
 static void bfin_serial_hw_init(struct bfin_serial_port *uart)
 {
 #ifdef CONFIG_SERIAL_BFIN_UART0
-	/* Enable UART0 RX and TX on pin 7 & 8 of PORT E */
-	bfin_write_PORTE_FER(0x180 | bfin_read_PORTE_FER());
-	bfin_write_PORTE_MUX(0x3C000 | bfin_read_PORTE_MUX());
+	peripheral_request(P_UART0_TX, DRIVER_NAME);
+	peripheral_request(P_UART0_RX, DRIVER_NAME);
 #endif
 
 #ifdef CONFIG_SERIAL_BFIN_UART1
-	/* Enable UART1 RX and TX on pin 0 & 1 of PORT H */
-	bfin_write_PORTH_FER(0x3 | bfin_read_PORTH_FER());
-	bfin_write_PORTH_MUX(~0xF & bfin_read_PORTH_MUX());
+	peripheral_request(P_UART1_TX, DRIVER_NAME);
+	peripheral_request(P_UART1_RX, DRIVER_NAME);
+
 #ifdef CONFIG_BFIN_UART1_CTSRTS
-	/* Enable UART1 RTS and CTS on pin 9 & 10 of PORT E */
-	bfin_write_PORTE_FER(0x600 | bfin_read_PORTE_FER());
-	bfin_write_PORTE_MUX(~0x3C0000 & bfin_read_PORTE_MUX());
+	peripheral_request(P_UART1_RTS, DRIVER_NAME);
+	peripheral_request(P_UART1_CTS DRIVER_NAME);
 #endif
 #endif
 
 #ifdef CONFIG_SERIAL_BFIN_UART2
-	/* Enable UART2 RX and TX on pin 4 & 5 of PORT B */
-	bfin_write_PORTB_FER(0x30 | bfin_read_PORTB_FER());
-	bfin_write_PORTB_MUX(~0xF00 & bfin_read_PORTB_MUX());
+	peripheral_request(P_UART2_TX, DRIVER_NAME);
+	peripheral_request(P_UART2_RX, DRIVER_NAME);
 #endif
 
 #ifdef CONFIG_SERIAL_BFIN_UART3
-	/* Enable UART3 RX and TX on pin 6 & 7 of PORT B */
-	bfin_write_PORTB_FER(0xC0 | bfin_read_PORTB_FER());
-	bfin_write_PORTB_MUX(~0xF000 | bfin_read_PORTB_MUX());
+	peripheral_request(P_UART3_TX, DRIVER_NAME);
+	peripheral_request(P_UART3_RX, DRIVER_NAME);
+
 #ifdef CONFIG_BFIN_UART3_CTSRTS
-	/* Enable UART3 RTS and CTS on pin 2 & 3 of PORT B */
-	bfin_write_PORTB_FER(0xC | bfin_read_PORTB_FER());
-	bfin_write_PORTB_MUX(~0xF0 | bfin_read_PORTB_MUX());
+	peripheral_request(P_UART3_RTS, DRIVER_NAME);
+	peripheral_request(P_UART3_CTS DRIVER_NAME);
 #endif
 #endif
 	SSYNC();
 #ifdef CONFIG_SERIAL_BFIN_CTSRTS
 	if (uart->cts_pin >= 0) {
-		gpio_request(uart->cts_pin, NULL);
+		gpio_request(uart->cts_pin, DRIVER_NAME);
 		gpio_direction_input(uart->cts_pin);
 	}
 
 	if (uart->rts_pin >= 0) {
-		gpio_request(uart->rts_pin, NULL);
+		gpio_request(uart->rts_pin, DRIVER_NAME);
 		gpio_direction_output(uart->rts_pin);
 	}
 #endif
include/asm-blackfin/mach-bf548/blackfin.h +1 -1
index 791218f..19e84dd 100644
@@ -54,7 +54,7 @@
 #include "defBF549.h"
 #endif
 
-#if !(defined(__ASSEMBLY__) || defined(ASSEMBLY))
+#if !defined(__ASSEMBLY__)
 #ifdef CONFIG_BF542
 #include "cdefBF542.h"
 #endif
include/asm-blackfin/mach-bf548/defBF54x_base.h +17 -0
index 895ddd4..56f0a76 100644
@@ -1637,8 +1637,25 @@
 #define                   RESTART  0x20       /* Work Unit Transitions */
 #define                    DI_SEL  0x40       /* Data Interrupt Timing Select */
 #define                     DI_EN  0x80       /* Data Interrupt Enable */
+
 #define                    NDSIZE  0xf00      /* Flex Descriptor Size */
+#define                  NDSIZE_0 0x0000      /* Next Descriptor Size = 0 (Stop/Autobuffer) */
+#define                  NDSIZE_1 0x0100      /* Next Descriptor Size = 1 */
+#define                  NDSIZE_2 0x0200      /* Next Descriptor Size = 2 */
+#define                  NDSIZE_3 0x0300      /* Next Descriptor Size = 3 */
+#define                  NDSIZE_4 0x0400      /* Next Descriptor Size = 4 */
+#define                  NDSIZE_5 0x0500      /* Next Descriptor Size = 5 */
+#define                  NDSIZE_6 0x0600      /* Next Descriptor Size = 6 */
+#define                  NDSIZE_7 0x0700      /* Next Descriptor Size = 7 */
+#define                  NDSIZE_8 0x0800      /* Next Descriptor Size = 8 */
+#define                  NDSIZE_9 0x0900      /* Next Descriptor Size = 9 */
+
 #define                   DMAFLOW  0xf000     /* Next Operation */
+#define              DMAFLOW_STOP  0x0000     /* Stop Mode */
+#define              DMAFLOW_AUTO  0x1000     /* Autobuffer Mode */
+#define             DMAFLOW_ARRAY  0x4000     /* Descriptor Array Mode */
+#define             DMAFLOW_SMALL  0x6000     /* Small Model Descriptor List Mode */
+#define             DMAFLOW_LARGE  0x7000     /* Large Model Descriptor List Mode */
 
 /* Bit masks for DMAx_IRQ_STATUS, MDMA_Sx_IRQ_STATUS, MDMA_Dx_IRQ_STATUS */
 
include/asm-blackfin/mach-bf548/gpio.h +0 -5
index dbf66bc..cb8b0f1 100644
@@ -209,8 +209,3 @@ struct gpio_port_t {
 	unsigned short dummy7;
 	unsigned int port_mux;
 };
-
-int gpio_request(unsigned short gpio, const char *label);
-void peripheral_free(unsigned short per);
-int peripheral_request_list(unsigned short per[], const char *label);
-void peripheral_free_list(unsigned short per[]);
include/asm-blackfin/mach-bf548/irq.h +2 -0
index e548d3c..21f06f7 100644
@@ -337,6 +337,8 @@ Events         (highest priority)  EMU         0
 #define IRQ_PJ14	BFIN_PJ_IRQ(14)		/* N/A */
 #define IRQ_PJ15	BFIN_PJ_IRQ(15)		/* N/A */
 
+#define GPIO_IRQ_BASE	IRQ_PA0
+
 #ifdef CONFIG_IRQCHIP_DEMUX_GPIO
 #define NR_IRQS     (IRQ_PJ15+1)
 #else
include/asm-blackfin/mach-bf561/bfin_serial_5xx.h +9 -2
index e043caf..69b9f8e 100644
@@ -1,5 +1,6 @@
 #include <linux/serial.h>
 #include <asm/dma.h>
+#include <asm/portmux.h>
 
 #define NR_PORTS                1
 
@@ -92,18 +93,24 @@ struct bfin_serial_res bfin_serial_resource[] = {
 	}
 };
 
+#define DRIVER_NAME "bfin-uart"
 
 int nr_ports = NR_PORTS;
 static void bfin_serial_hw_init(struct bfin_serial_port *uart)
 {
 
+#ifdef CONFIG_SERIAL_BFIN_UART0
+	peripheral_request(P_UART0_TX, DRIVER_NAME);
+	peripheral_request(P_UART0_RX, DRIVER_NAME);
+#endif
+
 #ifdef CONFIG_SERIAL_BFIN_CTSRTS
 	if (uart->cts_pin >= 0) {
-		gpio_request(uart->cts_pin, NULL);
+		gpio_request(uart->cts_pin, DRIVER_NAME);
 		gpio_direction_input(uart->cts_pin);
 	}
 	if (uart->rts_pin >= 0) {
-		gpio_request(uart->rts_pin, NULL);
+		gpio_request(uart->rts_pin, DRIVER_NAME);
 		gpio_direction_input(uart->rts_pin);
 	}
 #endif
include/asm-blackfin/mach-bf561/blackfin.h +1 -1
index 2537c84..562aee3 100644
@@ -38,7 +38,7 @@
 #include "defBF561.h"
 #include "anomaly.h"
 
-#if !(defined(__ASSEMBLY__) || defined(ASSEMBLY))
+#if !defined(__ASSEMBLY__)
 #include "cdefBF561.h"
 #endif
 
include/asm-blackfin/mach-bf561/irq.h +2 -0
index a753ce7..1278992 100644
@@ -289,6 +289,8 @@
 #define IRQ_PF46		119
 #define IRQ_PF47		120
 
+#define GPIO_IRQ_BASE		IRQ_PF0
+
 #ifdef CONFIG_IRQCHIP_DEMUX_GPIO
 #define NR_IRQS			(IRQ_PF47 + 1)
 #else
include/asm-blackfin/portmux.h +22 -0
index 9d3681e..d1bcd91 100644
@@ -14,6 +14,12 @@
 #define P_MAYSHARE	0x2000
 #define P_DONTCARE	0x1000
 
+
+int peripheral_request(unsigned short per, const char *label);
+void peripheral_free(unsigned short per);
+int peripheral_request_list(unsigned short per[], const char *label);
+void peripheral_free_list(unsigned short per[]);
+
 #include <asm/gpio.h>
 #include <asm/mach/portmux.h>
 
@@ -513,6 +519,22 @@
 #define P_SPI0_SSEL3 P_UNDEF
 #endif
 
+#ifndef P_SPI0_SSEL4
+#define P_SPI0_SSEL4 P_UNDEF
+#endif
+
+#ifndef P_SPI0_SSEL5
+#define P_SPI0_SSEL5 P_UNDEF
+#endif
+
+#ifndef P_SPI0_SSEL6
+#define P_SPI0_SSEL6 P_UNDEF
+#endif
+
+#ifndef P_SPI0_SSEL7
+#define P_SPI0_SSEL7 P_UNDEF
+#endif
+
 #ifndef P_UART0_TX
 #define P_UART0_TX P_UNDEF
 #endif
#1 lore raw
Quoted 9 lines · Bryan Wu

Bryan Wu (4):
Blackfin SPI driver: Initial supporting BF54x in SPI driver

Michael Hennerich (11):
Blackfin arch: store labels so we later know who allocated GPIO/Peripheral resources Blackfin arch: add peripheral resource allocation support
Blackfin arch: Add label to call new GPIO API
Blackfin SPI driver: Make BF54x SPI work and add support for portmux API Blackfin SPI driver: use new GPIO API and add error handling

i think this is the sort of thing Linus wants left for initial merge windows ? -mike

author
#2 lore raw
Quoted 11 lines · Mike Frysinger
Quoted 9 lines · Bryan Wu

Bryan Wu (4):
Blackfin SPI driver: Initial supporting BF54x in SPI driver

Michael Hennerich (11):
Blackfin arch: store labels so we later know who allocated GPIO/Peripheral resources Blackfin arch: add peripheral resource allocation support
Blackfin arch: Add label to call new GPIO API
Blackfin SPI driver: Make BF54x SPI work and add support for portmux API Blackfin SPI driver: use new GPIO API and add error handling

Quoted 2 lines

i think this is the sort of thing Linus wants left for initial merge windows ? -mike

Actually, this GPIO API has been added to the upstream in -RC1. In this pull, Michael's patch just enable it in arch code and driver. And it is tested at least 2-3 weeks, I think it is OK for the -RC merge.

And most our driver things are moved to depend on this new GPIO API. I just wanna make thing easier to maintain.

Thanks Mike
- Bryan Wu

#3 lore raw
Quoted 15 lines · Bryan Wu
Quoted 11 lines · Mike Frysinger
Quoted 9 lines · Bryan Wu

Bryan Wu (4):
Blackfin SPI driver: Initial supporting BF54x in SPI driver

Michael Hennerich (11):
Blackfin arch: store labels so we later know who allocated GPIO/Peripheral resources Blackfin arch: add peripheral resource allocation support
Blackfin arch: Add label to call new GPIO API
Blackfin SPI driver: Make BF54x SPI work and add support for portmux API Blackfin SPI driver: use new GPIO API and add error handling

Quoted 2 lines

i think this is the sort of thing Linus wants left for initial merge windows ? -mike

Quoted 6 lines

Actually, this GPIO API has been added to the upstream in -RC1. In this pull, Michael's patch just enable it in arch code and driver. And it is tested at least 2-3 weeks, I think it is OK for the -RC merge.

And most our driver things are moved to depend on this new GPIO API. I just wanna make thing easier to maintain.

i was referring to the SPI stuff, not GPIO
-mike

author
#4 lore raw
Quoted 20 lines · Mike Frysinger
Quoted 19 lines · Bryan Wu
Quoted 11 lines · Mike Frysinger
Quoted 9 lines · Bryan Wu

Bryan Wu (4):
Blackfin SPI driver: Initial supporting BF54x in SPI driver

Michael Hennerich (11):
Blackfin arch: store labels so we later know who allocated GPIO/Peripheral resources Blackfin arch: add peripheral resource allocation support
Blackfin arch: Add label to call new GPIO API
Blackfin SPI driver: Make BF54x SPI work and add support for portmux API Blackfin SPI driver: use new GPIO API and add error handling

Quoted 2 lines

i think this is the sort of thing Linus wants left for initial merge windows ? -mike

Actually, this GPIO API has been added to the upstream in -RC1. In this pull, Michael's patch just enable it in arch code and driver. And it is tested at least 2-3 weeks, I think it is OK for the -RC merge.

Quoted 5 lines
Quoted 2 lines

And most our driver things are moved to depend on this new GPIO API. I just wanna make thing easier to maintain.

i was referring to the SPI stuff, not GPIO
-mike

This GIT-PULL is for Blackfin new GPIO update, so I including this SPI driver patches related to GPIO update. You know, there are still some SPI patches not included in this GIT-PULL because they are not related to GPIO update.

So next GIT-PULL, I will try to send out anomaly update from you and Robin.

Regards,
- Bryan

#5 lore raw
In reply to Mike Frysinger
Quoted 4 lines · Mike Frysinger
Quoted 3 lines · Bryan Wu

Bryan Wu (4):
Blackfin SPI driver: Initial supporting BF54x in SPI driver

Quoted 8 lines
Quoted 6 lines

Michael Hennerich (11):
Blackfin arch: store labels so we later know who allocated GPIO/Peripheral resources Blackfin arch: add peripheral resource allocation support
Blackfin arch: Add label to call new GPIO API
Blackfin SPI driver: Make BF54x SPI work and add support for portmux API Blackfin SPI driver: use new GPIO API and add error handling

i think this is the sort of thing Linus wants left for initial merge windows ?

What, merging patches that have never even been seen by the relevant subsystem maintainer(s)?

I've never seen any of those SPI patches before, and am not inclined to try plucking three of them out of a composite patch for a separate review ...

Same goes for GPIO, for that matter. It's harder to goof those up, but it's still possible. If those were reviewed I personally might be inclined to OK merges after RC1; GPIOs get used almost everywhere. (Pretty much as Bryan commented...) Those look more like portmux changes than GPIO changes though.

- Dave

author
#6 lore raw
Quoted 12 lines · David Brownell
Quoted 11 lines · Mike Frysinger
Quoted 9 lines · Bryan Wu

Bryan Wu (4):
Blackfin SPI driver: Initial supporting BF54x in SPI driver

Michael Hennerich (11):
Blackfin arch: store labels so we later know who allocated GPIO/Peripheral resources Blackfin arch: add peripheral resource allocation support
Blackfin arch: Add label to call new GPIO API
Blackfin SPI driver: Make BF54x SPI work and add support for portmux API Blackfin SPI driver: use new GPIO API and add error handling

Quoted 9 lines
Quoted 1 line

i think this is the sort of thing Linus wants left for initial merge windows ?

What, merging patches that have never even been seen by the relevant subsystem maintainer(s)?

I've never seen any of those SPI patches before, and am not inclined to try plucking three of them out of a composite patch for a separate review ...

Yeah, although the Blackfin on-chip SPI driver is originally developed by Luke Yang, currently it is maintained by me. Sorry for this missing, I will send driver update patches
to related subsystem maintainers in LKML.

Quoted 5 lines

Same goes for GPIO, for that matter. It's harder to goof those up, but it's still possible. If those were reviewed I personally might be inclined to OK merges after RC1; GPIOs get used almost everywhere. (Pretty much as Bryan commented...) Those look more like portmux changes than GPIO changes though.

Actually, I wanna to obey the merge window policy, but there are some many changes in my local tree related to GPIO, silicon anomaly (common fixing). So I choose GPIO changes in this git-pull, thanks for your understanding situation.

I will remove the SPI driver patch from this GIT-PULL, a new GIT-PULL will be requested.
(Frankly speaking, I am afraid of being added to Linus's shit-list for the next few releases, -:(( ).

Thanks a lot, Mike and David.
Best Regards,

- Bryan Wu