diff options
author | David Brownell <david-b@pacbell.net> | 2007-01-23 20:14:02 -0800 |
---|---|---|
committer | Haavard Skinnemoen <hskinnemoen@atmel.com> | 2007-02-09 15:01:57 +0100 |
commit | a3d912c8fa709c4078ceaabf4d71001190e19325 (patch) | |
tree | 58a492ce454a6412bb63710decc56f741981ede7 /arch/avr32/boards/atstk1000/atstk1002.c | |
parent | 914ab06279f15d3f368f4fae74db58fdcf03a2ed (diff) |
[AVR32] fix serial port setup on ATSTK1000
Fixes to USART setup on the stk-1000 ... don't configure USART 2, since
its TXD/RXD are used for INT-A and INT-B buttons; and configure USART 0
(for IRDA, and with corrected IRQ) iff SW2 has a non-default setting.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
Diffstat (limited to 'arch/avr32/boards/atstk1000/atstk1002.c')
-rw-r--r-- | arch/avr32/boards/atstk1000/atstk1002.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/arch/avr32/boards/atstk1000/atstk1002.c b/arch/avr32/boards/atstk1000/atstk1002.c index 32b361f31c2..3787d6bfe0d 100644 --- a/arch/avr32/boards/atstk1000/atstk1002.c +++ b/arch/avr32/boards/atstk1000/atstk1002.c @@ -20,6 +20,9 @@ #include <asm/arch/board.h> #include <asm/arch/init.h> + +#define SW2_DEFAULT /* MMCI and UART_A available */ + struct eth_addr { u8 addr[6]; }; @@ -86,9 +89,13 @@ static void __init set_hw_addr(struct platform_device *pdev) void __init setup_board(void) { - at32_map_usart(1, 0); /* /dev/ttyS0 */ - at32_map_usart(2, 1); /* /dev/ttyS1 */ - at32_map_usart(3, 2); /* /dev/ttyS2 */ +#ifdef SW2_DEFAULT + at32_map_usart(1, 0); /* USART 1/A: /dev/ttyS0, DB9 */ +#else + at32_map_usart(0, 1); /* USART 0/B: /dev/ttyS1, IRDA */ +#endif + /* USART 2/unused: expansion connector */ + at32_map_usart(3, 2); /* USART 3/C: /dev/ttyS2, DB9 */ at32_setup_serial_console(0); } @@ -97,8 +104,11 @@ static int __init atstk1002_init(void) { at32_add_system_devices(); +#ifdef SW2_DEFAULT at32_add_device_usart(0); +#else at32_add_device_usart(1); +#endif at32_add_device_usart(2); set_hw_addr(at32_add_device_eth(0, ð_data[0])); |