From c194588dba968510b5aa7a1818bd2c8b36a416f7 Mon Sep 17 00:00:00 2001 From: Haavard Skinnemoen Date: Wed, 4 Oct 2006 16:02:10 +0200 Subject: [PATCH] AVR32: Allow renumbering of serial devices Allow the board to remap actual USART peripheral devices to serial devices by calling at32_map_usart(hw_id, serial_line). This ensures that even though ATSTK1002 uses USART1 as the first serial port, it will still have a ttyS0 device. This also adds a board-specific early setup hook and moves the at32_setup_serial_console() call there from the platform code. Signed-off-by: Haavard Skinnemoen Signed-off-by: Linus Torvalds --- arch/avr32/boards/atstk1000/atstk1002.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'arch/avr32/boards/atstk1000') diff --git a/arch/avr32/boards/atstk1000/atstk1002.c b/arch/avr32/boards/atstk1000/atstk1002.c index 49164e9aadd..cced73c5811 100644 --- a/arch/avr32/boards/atstk1000/atstk1002.c +++ b/arch/avr32/boards/atstk1000/atstk1002.c @@ -10,6 +10,7 @@ #include #include +#include struct eth_platform_data __initdata eth0_data = { .valid = 1, @@ -20,13 +21,22 @@ struct eth_platform_data __initdata eth0_data = { extern struct lcdc_platform_data atstk1000_fb0_data; +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 */ + + at32_setup_serial_console(0); +} + static int __init atstk1002_init(void) { at32_add_system_devices(); - at32_add_device_usart(1); /* /dev/ttyS0 */ - at32_add_device_usart(2); /* /dev/ttyS1 */ - at32_add_device_usart(3); /* /dev/ttyS2 */ + at32_add_device_usart(0); + at32_add_device_usart(1); + at32_add_device_usart(2); at32_add_device_eth(0, ð0_data); at32_add_device_spi(0); -- cgit v1.2.3-70-g09d2