aboutsummaryrefslogtreecommitdiffstats
path: root/arch/avr32/boards
diff options
context:
space:
mode:
Diffstat (limited to 'arch/avr32/boards')
-rw-r--r--arch/avr32/boards/atstk1000/Kconfig53
-rw-r--r--arch/avr32/boards/atstk1000/atstk1002.c50
2 files changed, 94 insertions, 9 deletions
diff --git a/arch/avr32/boards/atstk1000/Kconfig b/arch/avr32/boards/atstk1000/Kconfig
new file mode 100644
index 000000000000..71bc7d364fb7
--- /dev/null
+++ b/arch/avr32/boards/atstk1000/Kconfig
@@ -0,0 +1,53 @@
1# STK1000 customization
2
3if BOARD_ATSTK1002
4
5config BOARD_ATSTK1002_CUSTOM
6 bool "Non-default STK-1002 jumper settings"
7 help
8 You will normally leave the jumpers on the CPU card at their
9 default settings. If you need to use certain peripherals,
10 you will need to change some of those jumpers.
11
12if BOARD_ATSTK1002_CUSTOM
13
14config BOARD_ATSTK1002_SW1_CUSTOM
15 bool "SW1: use SSC1 (not SPI0)"
16 help
17 This also prevents using the external DAC as an audio interface,
18 and means you can't initialize the on-board QVGA display.
19
20config BOARD_ATSTK1002_SW2_CUSTOM
21 bool "SW2: use IRDA or TIMER0 (not UART-A, MMC/SD, and PS2-A)"
22 help
23 If you change this you'll want an updated boot loader putting
24 the console on UART-C not UART-A.
25
26config BOARD_ATSTK1002_SW3_CUSTOM
27 bool "SW3: use TIMER1 (not SSC0 and GCLK)"
28 help
29 This also prevents using the external DAC as an audio interface.
30
31config BOARD_ATSTK1002_SW4_CUSTOM
32 bool "SW4: use ISI/Camera (not GPIOs, SPI1, and PS2-B)"
33 help
34 To use the camera interface you'll need a custom card (on the
35 PCI-format connector) connect a video sensor.
36
37config BOARD_ATSTK1002_SW5_CUSTOM
38 bool "SW5: use MACB1 (not LCDC)"
39
40config BOARD_ATSTK1002_SW6_CUSTOM
41 bool "SW6: more GPIOs (not MACB0)"
42
43endif # custom
44
45config BOARD_ATSTK1002_SPI1
46 bool "Configure SPI1 controller"
47 depends on !BOARD_ATSTK1002_SW4_CUSTOM
48 help
49 All the signals for the second SPI controller are available on
50 GPIO lines and accessed through the J1 jumper block. Say "y"
51 here to configure that SPI controller.
52
53endif # stk 1002
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
32struct eth_addr { 31struct eth_addr {
33 u8 addr[6]; 32 u8 addr[6];
34}; 33};
35 34
36static struct eth_addr __initdata hw_addr[2]; 35static struct eth_addr __initdata hw_addr[2];
37static struct eth_platform_data __initdata eth_data[2]; 36static 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
39static struct spi_board_info spi0_board_info[] __initdata = { 51static 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
63static 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
104void __init setup_board(void) 123void __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, &eth_data[0])); 170 set_hw_addr(at32_add_device_eth(0, &eth_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, &eth_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}