diff options
Diffstat (limited to 'arch/avr32/boards/atstk1000/atstk1002.c')
-rw-r--r-- | arch/avr32/boards/atstk1000/atstk1002.c | 50 |
1 files changed, 41 insertions, 9 deletions
diff --git a/arch/avr32/boards/atstk1000/atstk1002.c b/arch/avr32/boards/atstk1000/atstk1002.c index e253e86a1a39..cb93eabb9c6c 100644 --- a/arch/avr32/boards/atstk1000/atstk1002.c +++ b/arch/avr32/boards/atstk1000/atstk1002.c | |||
@@ -27,15 +27,27 @@ | |||
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]; |
34 | }; | 33 | }; |
35 | 34 | ||
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] = { |
37 | { | ||
38 | /* | ||
39 | * The MDIO pullups on STK1000 are a bit too weak for | ||
40 | * the autodetection to work properly, so we have to | ||
41 | * mask out everything but the correct address. | ||
42 | */ | ||
43 | .phy_mask = ~(1U << 16), | ||
44 | }, | ||
45 | { | ||
46 | .phy_mask = ~(1U << 17), | ||
47 | }, | ||
48 | }; | ||
38 | 49 | ||
50 | #ifndef CONFIG_BOARD_ATSTK1002_SW1_CUSTOM | ||
39 | static struct spi_board_info spi0_board_info[] __initdata = { | 51 | static struct spi_board_info spi0_board_info[] __initdata = { |
40 | { | 52 | { |
41 | /* QVGA display */ | 53 | /* QVGA display */ |
@@ -45,6 +57,13 @@ static struct spi_board_info spi0_board_info[] __initdata = { | |||
45 | .mode = SPI_MODE_3, | 57 | .mode = SPI_MODE_3, |
46 | }, | 58 | }, |
47 | }; | 59 | }; |
60 | #endif | ||
61 | |||
62 | #ifdef CONFIG_BOARD_ATSTK1002_SPI1 | ||
63 | static struct spi_board_info spi1_board_info[] __initdata = { { | ||
64 | /* patch in custom entries here */ | ||
65 | } }; | ||
66 | #endif | ||
48 | 67 | ||
49 | /* | 68 | /* |
50 | * The next two functions should go away as the boot loader is | 69 | * The next two functions should go away as the boot loader is |
@@ -103,10 +122,10 @@ static void __init set_hw_addr(struct platform_device *pdev) | |||
103 | 122 | ||
104 | void __init setup_board(void) | 123 | void __init setup_board(void) |
105 | { | 124 | { |
106 | #ifdef SW2_DEFAULT | 125 | #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 */ | 126 | at32_map_usart(0, 1); /* USART 0/B: /dev/ttyS1, IRDA */ |
127 | #else | ||
128 | at32_map_usart(1, 0); /* USART 1/A: /dev/ttyS0, DB9 */ | ||
110 | #endif | 129 | #endif |
111 | /* USART 2/unused: expansion connector */ | 130 | /* USART 2/unused: expansion connector */ |
112 | at32_map_usart(3, 2); /* USART 3/C: /dev/ttyS2, DB9 */ | 131 | at32_map_usart(3, 2); /* USART 3/C: /dev/ttyS2, DB9 */ |
@@ -140,18 +159,31 @@ static int __init atstk1002_init(void) | |||
140 | 159 | ||
141 | at32_add_system_devices(); | 160 | at32_add_system_devices(); |
142 | 161 | ||
143 | #ifdef SW2_DEFAULT | 162 | #ifdef CONFIG_BOARD_ATSTK1002_SW2_CUSTOM |
144 | at32_add_device_usart(0); | ||
145 | #else | ||
146 | at32_add_device_usart(1); | 163 | at32_add_device_usart(1); |
164 | #else | ||
165 | at32_add_device_usart(0); | ||
147 | #endif | 166 | #endif |
148 | at32_add_device_usart(2); | 167 | at32_add_device_usart(2); |
149 | 168 | ||
169 | #ifndef CONFIG_BOARD_ATSTK1002_SW6_CUSTOM | ||
150 | set_hw_addr(at32_add_device_eth(0, ð_data[0])); | 170 | set_hw_addr(at32_add_device_eth(0, ð_data[0])); |
151 | 171 | #endif | |
172 | #ifndef CONFIG_BOARD_ATSTK1002_SW1_CUSTOM | ||
152 | at32_add_device_spi(0, spi0_board_info, ARRAY_SIZE(spi0_board_info)); | 173 | at32_add_device_spi(0, spi0_board_info, ARRAY_SIZE(spi0_board_info)); |
174 | #endif | ||
175 | #ifdef CONFIG_BOARD_ATSTK1002_SPI1 | ||
176 | at32_add_device_spi(1, spi1_board_info, ARRAY_SIZE(spi1_board_info)); | ||
177 | #endif | ||
178 | #ifdef CONFIG_BOARD_ATSTK1002_SW5_CUSTOM | ||
179 | set_hw_addr(at32_add_device_eth(1, ð_data[1])); | ||
180 | #else | ||
153 | at32_add_device_lcdc(0, &atstk1000_lcdc_data, | 181 | at32_add_device_lcdc(0, &atstk1000_lcdc_data, |
154 | fbmem_start, fbmem_size); | 182 | fbmem_start, fbmem_size); |
183 | #endif | ||
184 | #ifndef CONFIG_BOARD_ATSTK1002_SW3_CUSTOM | ||
185 | at32_add_device_ssc(0, ATMEL_SSC_TX); | ||
186 | #endif | ||
155 | 187 | ||
156 | return 0; | 188 | return 0; |
157 | } | 189 | } |