ARM: sa1100: refactor sa1100 serial driver
Subsystems (5)
Device tree bindings Arm (32-bit) Arm sub-architectures TTY layer and serial drivers +1 more subsystems
PATCH v2 1/1 ARM: sa1100: refactor sa1100 serial driver
- move pin initialization into board files
- make use of resources in platform device
rather than hardcoding them in the driver
- add DT support
Signed-off-by Jochen Friedrich <[email protected]>
---
V2: fixed off-by-one error
.../devicetree/bindings/tty/serial/sa1100-uart.txt | 20 ++ .../devicetree/bindings/vendor-prefixes.txt | 1 + arch/arm/include/asm/mach/serial_sa1100.h | 5 +- arch/arm/mach-sa1100/badge4.c | 3 + arch/arm/mach-sa1100/cerf.c | 3 + arch/arm/mach-sa1100/collie.c | 2 + arch/arm/mach-sa1100/generic.c | 85 +++++++- arch/arm/mach-sa1100/generic.h | 2 + arch/arm/mach-sa1100/h3xxx.c | 3 +- arch/arm/mach-sa1100/hackkit.c | 3 + arch/arm/mach-sa1100/jornada720.c | 3 + arch/arm/mach-sa1100/lart.c | 3 + arch/arm/mach-sa1100/pleb.c | 3 + arch/arm/mach-sa1100/shannon.c | 3 + arch/arm/mach-sa1100/simpad.c | 5 +- drivers/tty/serial/sa1100.c | 240 +++++++++++--------- 16 files changed, 261 insertions(+), 123 deletions(-) create mode 100644 Documentation/devicetree/bindings/tty/serial/sa1100-uart.txt
Documentation/devicetree/bindings/tty/serial/sa1100-uart.txt new file +20 -0
@@ -0,0 +1,20 @@ +* SA11x0 Universal Asynchronous Receiver/Transmitter (UART) + +Required properties: +- compatible: Should be "intel,<chip>-uart" + The compatible <chip> indicated will be the first SoC to support an + additional mode or an UART new feature. +- reg: Should contain registers location and length +- interrupts: Should contain interrupt + +<chip> compatible description: +- sa1100: generic UART implementation for SA11x0 SoCs + +Example: + + uart0: serial at 0x80010000 { + compatible = "intel,sa1100-uart"; + reg = <0x80010000 0x24>; + interrupts = <15>; + }; +
Documentation/devicetree/bindings/vendor-prefixes.txt +1 -0
@@ -19,6 +19,7 @@ gef GE Fanuc Intelligent Platforms Embedded Systems, Inc. hp Hewlett Packard ibm International Business Machines (IBM) idt Integrated Device Technologies, Inc. +intel Intel intercontrol Inter Control Group linux Linux-specific binding marvell Marvell Technology Group Ltd.
arch/arm/include/asm/mach/serial_sa1100.h +2 -3
@@ -9,7 +9,6 @@*/ struct uart_port ; -struct uart_info ;/* * This is a temporary structure for registering these
@@ -22,10 +21,10 @@ struct sa1100_port_fns {int (*set_wake)(struct uart_port *,u_int ); }; +struct platform_device *sa1100_get_uart (int id); +#ifdef CONFIG_SERIAL_SA1100 void sa1100_register_uart_fns (struct sa1100_port_fns *fns); -void sa1100_register_uart (int idx,int port);#else #define sa1100_register_uart_fns (fns) do { } while (0) -#define sa1100_register_uart (idx,port) do { } while (0)#endif
arch/arm/mach-sa1100/badge4.c +3 -0
@@ -296,6 +296,9 @@ static void __init badge4_map_io(void)sa1100_map_io ();iotable_init (badge4_io_desc,ARRAY_SIZE (badge4_io_desc)); +PPDR |=PPC_TXD1 |PPC_TXD3 ; +PPSR |=PPC_TXD1 |PPC_TXD3 ; +sa1100_register_uart_fns (&badge4_port_fns);sa1100_register_uart (0 ,3 );sa1100_register_uart (1 ,1 );
arch/arm/mach-sa1100/cerf.c +3 -0
@@ -113,6 +113,9 @@ static void __init cerf_map_io(void)sa1100_map_io ();iotable_init (cerf_io_desc,ARRAY_SIZE (cerf_io_desc)); +PPDR |=PPC_TXD1 |PPC_TXD2 |PPC_TXD3 ; +PPSR |=PPC_TXD1 |PPC_TXD2 |PPC_TXD3 ; +sa1100_register_uart (0 ,3 );sa1100_register_uart (1 ,2 );/* disable this and the uart2 device for sa1100_fir */ sa1100_register_uart (2 ,1 );
arch/arm/mach-sa1100/collie.c +2 -0
@@ -330,6 +330,8 @@ static void __init collie_init(void)PPC_LDD6 |PPC_LDD7 |PPC_L_PCLK |PPC_L_LCLK |PPC_L_FCLK |PPC_L_BIAS |PPC_TXD1 |PPC_TXD2 |PPC_TXD3 |PPC_TXD4 |PPC_SCLK |PPC_SFRM ; +PPSR |=PPC_TXD1 |PPC_TXD3 ; +PWER = _COLLIE_GPIO_AC_IN | _COLLIE_GPIO_CO | _COLLIE_GPIO_ON_KEY | _COLLIE_GPIO_WAKEUP | _COLLIE_GPIO_nREMOCON_INT |PWER_RTC ;
arch/arm/mach-sa1100/generic.c +78 -7
127 lines not on this page · raw message
arch/arm/mach-sa1100/generic.h +2 -0
@@ -39,3 +39,5 @@ void sa11x0_register_irda(struct irda_platform_data *irda);struct mcp_plat_data ;void sa11x0_register_mcp (struct mcp_plat_data *data); + +extern void sa1100_register_uart (int hw,int id);
arch/arm/mach-sa1100/h3xxx.c +2 -1
@@ -299,7 +299,8 @@ void __init h3xxx_map_io(void)// sa1100_register_uart(1, 1); /* Microcontroller on 3100/3600 */ /* Ensure those pins are outputs and driving low */ -PPDR |=PPC_TXD4 |PPC_SCLK |PPC_SFRM ; +PPDR |=PPC_TXD3 |PPC_TXD4 |PPC_SCLK |PPC_SFRM ; +PPSR |=PPC_TXD3 ;PPSR &= ~(PPC_TXD4 |PPC_SCLK |PPC_SFRM );/* Configure suspend conditions */
arch/arm/mach-sa1100/hackkit.c +3 -0
@@ -80,6 +80,9 @@ static void __init hackkit_map_io(void)sa1100_map_io ();iotable_init (hackkit_io_desc,ARRAY_SIZE (hackkit_io_desc)); +PPDR |=PPC_TXD1 |PPC_TXD2 |PPC_TXD3 ; +PPSR |=PPC_TXD1 |PPC_TXD2 |PPC_TXD3 ; +sa1100_register_uart_fns (&hackkit_port_fns);sa1100_register_uart (0 ,1 );/* com port */ sa1100_register_uart (1 ,2 );
arch/arm/mach-sa1100/jornada720.c +3 -0
@@ -297,6 +297,9 @@ static void __init jornada720_map_io(void)sa1100_map_io ();iotable_init (jornada720_io_desc,ARRAY_SIZE (jornada720_io_desc)); +PPDR |=PPC_TXD1 |PPC_TXD3 ; +PPSR |=PPC_TXD1 |PPC_TXD3 ; +sa1100_register_uart (0 ,3 );sa1100_register_uart (1 ,1 ); }
arch/arm/mach-sa1100/lart.c +3 -0
@@ -50,6 +50,9 @@ static void __init lart_map_io(void)sa1100_map_io ();iotable_init (lart_io_desc,ARRAY_SIZE (lart_io_desc)); +PPDR |=PPC_TXD1 |PPC_TXD2 |PPC_TXD3 ; +PPSR |=PPC_TXD1 |PPC_TXD2 |PPC_TXD3 ; +sa1100_register_uart (0 ,3 );sa1100_register_uart (1 ,1 );sa1100_register_uart (2 ,2 );
arch/arm/mach-sa1100/pleb.c +3 -0
@@ -121,6 +121,9 @@ static void __init pleb_map_io(void) {sa1100_map_io (); +PPDR |=PPC_TXD1 |PPC_TXD3 ; +PPSR |=PPC_TXD1 |PPC_TXD3 ; +sa1100_register_uart (0 ,3 );sa1100_register_uart (1 ,1 );
arch/arm/mach-sa1100/shannon.c +3 -0
@@ -67,6 +67,9 @@ static void __init shannon_map_io(void) {sa1100_map_io (); +PPDR |=PPC_TXD1 |PPC_TXD3 ; +PPSR |=PPC_TXD1 |PPC_TXD3 ; +sa1100_register_uart (0 ,3 );sa1100_register_uart (1 ,1 );
arch/arm/mach-sa1100/simpad.c +4 -1
@@ -206,7 +206,10 @@ static void __init simpad_map_io(void) RS232_ON | ENABLE_5V | RESET_SIMCARD | DECT_POWER_ON);__simpad_write_cs3 ();/* Spinlocks not yet initialized */ -sa1100_register_uart_fns (&simpad_port_fns); +PPDR |=PPC_TXD1 |PPC_TXD3 ; +PPSR |=PPC_TXD1 |PPC_TXD3 ; + +sa1100_register_uart_fns (&simpad_port_fns);sa1100_register_uart (0 ,3 );/* serial interface */ sa1100_register_uart (1 ,1 );/* DECT */
drivers/tty/serial/sa1100.c +129 -111
378 lines not on this page · raw message
Signature · 1 line
1.7.7.3