فهرست منبع

[PATCH] atmel_serial: Support AVR32

Make CONFIG_SERIAL_ATMEL selectable on AVR32 and #ifdef out some ARM-
specific code in the driver.

Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
Acked-by: Andrew Victor <andrew@sanpeople.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Haavard Skinnemoen 18 سال پیش
والد
کامیت
acca9b83ac
2فایلهای تغییر یافته به همراه16 افزوده شده و 12 حذف شده
  1. 12 12
      drivers/serial/Kconfig
  2. 4 0
      drivers/serial/atmel_serial.c

+ 12 - 12
drivers/serial/Kconfig

@@ -301,31 +301,31 @@ config SERIAL_AMBA_PL011_CONSOLE
 
 
 config SERIAL_ATMEL
 config SERIAL_ATMEL
 	bool "AT91 / AT32 on-chip serial port support"
 	bool "AT91 / AT32 on-chip serial port support"
-	depends on ARM && (ARCH_AT91RM9200 || ARCH_AT91SAM9261)
+	depends on (ARM && ARCH_AT91) || AVR32
 	select SERIAL_CORE
 	select SERIAL_CORE
 	help
 	help
 	  This enables the driver for the on-chip UARTs of the Atmel
 	  This enables the driver for the on-chip UARTs of the Atmel
-	  AT91RM9200 and AT91SAM926 processor.
+	  AT91 and AT32 processors.
 
 
 config SERIAL_ATMEL_CONSOLE
 config SERIAL_ATMEL_CONSOLE
 	bool "Support for console on AT91 / AT32 serial port"
 	bool "Support for console on AT91 / AT32 serial port"
 	depends on SERIAL_ATMEL=y
 	depends on SERIAL_ATMEL=y
 	select SERIAL_CORE_CONSOLE
 	select SERIAL_CORE_CONSOLE
 	help
 	help
-	  Say Y here if you wish to use a UART on the Atmel AT91RM9200 or
-	  AT91SAM9261 as the system console (the system console is the device
-	  which receives all kernel messages and warnings and which allows
-	  logins in single user mode).
+	  Say Y here if you wish to use an on-chip UART on a Atmel
+	  AT91 or AT32 processor as the system console (the system
+	  console is the device which receives all kernel messages and
+	  warnings and which allows logins in single user mode).
 
 
 config SERIAL_ATMEL_TTYAT
 config SERIAL_ATMEL_TTYAT
-	bool "Install as device ttyAT0-4 instead of ttyS0-4"
+	bool "Install as device ttyATn instead of ttySn"
 	depends on SERIAL_ATMEL=y
 	depends on SERIAL_ATMEL=y
 	help
 	help
-	  Say Y here if you wish to have the five internal AT91RM9200 UARTs
-	  appear as /dev/ttyAT0-4 (major 204, minor 154-158) instead of the
-	  normal /dev/ttyS0-4 (major 4, minor 64-68). This is necessary if
-	  you also want other UARTs, such as external 8250/16C550 compatible
-	  UARTs.
+	  Say Y here if you wish to have the internal AT91 / AT32 UARTs
+	  appear as /dev/ttyATn (major 204, minor starting at 154)
+	  instead of the normal /dev/ttySn (major 4, minor starting at
+	  64). This is necessary if you also want other UARTs, such as
+	  external 8250/16C550 compatible UARTs.
 	  The ttySn nodes are legally reserved for the 8250 serial driver
 	  The ttySn nodes are legally reserved for the 8250 serial driver
 	  but are often misused by other serial drivers.
 	  but are often misused by other serial drivers.
 
 

+ 4 - 0
drivers/serial/atmel_serial.c

@@ -39,8 +39,10 @@
 #include <asm/arch/at91rm9200_pdc.h>
 #include <asm/arch/at91rm9200_pdc.h>
 #include <asm/mach/serial_at91.h>
 #include <asm/mach/serial_at91.h>
 #include <asm/arch/board.h>
 #include <asm/arch/board.h>
+#ifdef CONFIG_ARM
 #include <asm/arch/system.h>
 #include <asm/arch/system.h>
 #include <asm/arch/gpio.h>
 #include <asm/arch/gpio.h>
+#endif
 
 
 #include "atmel_serial.h"
 #include "atmel_serial.h"
 
 
@@ -135,6 +137,7 @@ static void atmel_set_mctrl(struct uart_port *port, u_int mctrl)
 	unsigned int control = 0;
 	unsigned int control = 0;
 	unsigned int mode;
 	unsigned int mode;
 
 
+#ifdef CONFIG_ARM
 	if (arch_identify() == ARCH_ID_AT91RM9200) {
 	if (arch_identify() == ARCH_ID_AT91RM9200) {
 		/*
 		/*
 		 * AT91RM9200 Errata #39: RTS0 is not internally connected to PA21.
 		 * AT91RM9200 Errata #39: RTS0 is not internally connected to PA21.
@@ -147,6 +150,7 @@ static void atmel_set_mctrl(struct uart_port *port, u_int mctrl)
 				at91_set_gpio_value(AT91_PIN_PA21, 1);
 				at91_set_gpio_value(AT91_PIN_PA21, 1);
 		}
 		}
 	}
 	}
+#endif
 
 
 	if (mctrl & TIOCM_RTS)
 	if (mctrl & TIOCM_RTS)
 		control |= ATMEL_US_RTSEN;
 		control |= ATMEL_US_RTSEN;