diff options
author | David Brownell <dbrownell@users.sourceforge.net> | 2007-06-12 08:34:47 -0400 |
---|---|---|
committer | Haavard Skinnemoen <hskinnemoen@atmel.com> | 2007-07-18 14:45:51 -0400 |
commit | a8e93ed8cb3d9aa22d192033009357526548c825 (patch) | |
tree | 40e551da96bfc4753853bb863f92eb6e56bd7115 /arch/avr32/boards/atstk1000/atstk1002.c | |
parent | 9e58e1855c9815ad4944df90f695a7645c50f463 (diff) |
[AVR32] Make STK1000 mux settings configurable
This adds some STK1002-specific config options covering the jumper settings,
so the kernel can automatically be configured to include the relevant devices.
One of them replaces the previous internal SW2_DEFAULT setting; SPI config
is affected by two of the jumpers; and a fourth one switches between LCD and
the second Ethernet connector. (There's more that to be done.)
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 | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/arch/avr32/boards/atstk1000/atstk1002.c b/arch/avr32/boards/atstk1000/atstk1002.c index e253e86a1a39..6b2187f35031 100644 --- a/arch/avr32/boards/atstk1000/atstk1002.c +++ b/arch/avr32/boards/atstk1000/atstk1002.c | |||
@@ -27,7 +27,6 @@ | |||
27 | 27 | ||
28 | #include "atstk1000.h" | 28 | #include "atstk1000.h" |
29 | 29 | ||
30 | #define SW2_DEFAULT /* MMCI and UART_A available */ | ||
31 | 30 | ||
32 | struct eth_addr { | 31 | struct eth_addr { |
33 | u8 addr[6]; | 32 | u8 addr[6]; |
@@ -36,6 +35,7 @@ struct eth_addr { | |||
36 | static struct eth_addr __initdata hw_addr[2]; | 35 | static struct eth_addr __initdata hw_addr[2]; |
37 | static struct eth_platform_data __initdata eth_data[2]; | 36 | static struct eth_platform_data __initdata eth_data[2]; |
38 | 37 | ||
38 | #ifndef CONFIG_BOARD_ATSTK1002_SW1_CUSTOM | ||
39 | static struct spi_board_info spi0_board_info[] __initdata = { | 39 | static struct spi_board_info spi0_board_info[] __initdata = { |
40 | { | 40 | { |
41 | /* QVGA display */ | 41 | /* QVGA display */ |
@@ -45,6 +45,13 @@ static struct spi_board_info spi0_board_info[] __initdata = { | |||
45 | .mode = SPI_MODE_3, | 45 | .mode = SPI_MODE_3, |
46 | }, | 46 | }, |
47 | }; | 47 | }; |
48 | #endif | ||
49 | |||
50 | #ifdef CONFIG_BOARD_ATSTK1002_SPI1 | ||
51 | static struct spi_board_info spi1_board_info[] __initdata = { { | ||
52 | /* patch in custom entries here */ | ||
53 | } }; | ||
54 | #endif | ||
48 | 55 | ||
49 | /* | 56 | /* |
50 | * The next two functions should go away as the boot loader is | 57 | * The next two functions should go away as the boot loader is |
@@ -103,10 +110,10 @@ static void __init set_hw_addr(struct platform_device *pdev) | |||
103 | 110 | ||
104 | void __init setup_board(void) | 111 | void __init setup_board(void) |
105 | { | 112 | { |
106 | #ifdef SW2_DEFAULT | 113 | #ifdef CONFIG_BOARD_ATSTK1002_SW2_CUSTOM |
107 | at32_map_usart(1, 0); /* USART 1/A: /dev/ttyS0, DB9 */ | ||
108 | #else | ||
109 | at32_map_usart(0, 1); /* USART 0/B: /dev/ttyS1, IRDA */ | 114 | at32_map_usart(0, 1); /* USART 0/B: /dev/ttyS1, IRDA */ |
115 | #else | ||
116 | at32_map_usart(1, 0); /* USART 1/A: /dev/ttyS0, DB9 */ | ||
110 | #endif | 117 | #endif |
111 | /* USART 2/unused: expansion connector */ | 118 | /* USART 2/unused: expansion connector */ |
112 | at32_map_usart(3, 2); /* USART 3/C: /dev/ttyS2, DB9 */ | 119 | at32_map_usart(3, 2); /* USART 3/C: /dev/ttyS2, DB9 */ |
@@ -140,18 +147,27 @@ static int __init atstk1002_init(void) | |||
140 | 147 | ||
141 | at32_add_system_devices(); | 148 | at32_add_system_devices(); |
142 | 149 | ||
143 | #ifdef SW2_DEFAULT | 150 | #ifdef CONFIG_BOARD_ATSTK1002_SW2_CUSTOM |
144 | at32_add_device_usart(0); | ||
145 | #else | ||
146 | at32_add_device_usart(1); | 151 | at32_add_device_usart(1); |
152 | #else | ||
153 | at32_add_device_usart(0); | ||
147 | #endif | 154 | #endif |
148 | at32_add_device_usart(2); | 155 | at32_add_device_usart(2); |
149 | 156 | ||
150 | set_hw_addr(at32_add_device_eth(0, ð_data[0])); | 157 | set_hw_addr(at32_add_device_eth(0, ð_data[0])); |
151 | 158 | ||
159 | #ifndef CONFIG_BOARD_ATSTK1002_SW1_CUSTOM | ||
152 | at32_add_device_spi(0, spi0_board_info, ARRAY_SIZE(spi0_board_info)); | 160 | at32_add_device_spi(0, spi0_board_info, ARRAY_SIZE(spi0_board_info)); |
161 | #endif | ||
162 | #ifdef CONFIG_BOARD_ATSTK1002_SPI1 | ||
163 | at32_add_device_spi(1, spi1_board_info, ARRAY_SIZE(spi1_board_info)); | ||
164 | #endif | ||
165 | #ifdef CONFIG_BOARD_ATSTK1002_SW5_CUSTOM | ||
166 | set_hw_addr(at32_add_device_eth(1, ð_data[1])); | ||
167 | #else | ||
153 | at32_add_device_lcdc(0, &atstk1000_lcdc_data, | 168 | at32_add_device_lcdc(0, &atstk1000_lcdc_data, |
154 | fbmem_start, fbmem_size); | 169 | fbmem_start, fbmem_size); |
170 | #endif | ||
155 | 171 | ||
156 | return 0; | 172 | return 0; |
157 | } | 173 | } |