diff options
Diffstat (limited to 'arch/avr32/boards/atstk1000/atstk1002.c')
-rw-r--r-- | arch/avr32/boards/atstk1000/atstk1002.c | 53 |
1 files changed, 50 insertions, 3 deletions
diff --git a/arch/avr32/boards/atstk1000/atstk1002.c b/arch/avr32/boards/atstk1000/atstk1002.c index 32b361f31c2c..d47e39f0e971 100644 --- a/arch/avr32/boards/atstk1000/atstk1002.c +++ b/arch/avr32/boards/atstk1000/atstk1002.c | |||
@@ -8,17 +8,24 @@ | |||
8 | * published by the Free Software Foundation. | 8 | * published by the Free Software Foundation. |
9 | */ | 9 | */ |
10 | #include <linux/clk.h> | 10 | #include <linux/clk.h> |
11 | #include <linux/device.h> | ||
11 | #include <linux/etherdevice.h> | 12 | #include <linux/etherdevice.h> |
12 | #include <linux/init.h> | 13 | #include <linux/init.h> |
13 | #include <linux/kernel.h> | 14 | #include <linux/kernel.h> |
14 | #include <linux/platform_device.h> | 15 | #include <linux/platform_device.h> |
15 | #include <linux/string.h> | 16 | #include <linux/string.h> |
16 | #include <linux/types.h> | 17 | #include <linux/types.h> |
18 | #include <linux/spi/spi.h> | ||
17 | 19 | ||
18 | #include <asm/io.h> | 20 | #include <asm/io.h> |
19 | #include <asm/setup.h> | 21 | #include <asm/setup.h> |
22 | #include <asm/arch/at32ap7000.h> | ||
20 | #include <asm/arch/board.h> | 23 | #include <asm/arch/board.h> |
21 | #include <asm/arch/init.h> | 24 | #include <asm/arch/init.h> |
25 | #include <asm/arch/portmux.h> | ||
26 | |||
27 | |||
28 | #define SW2_DEFAULT /* MMCI and UART_A available */ | ||
22 | 29 | ||
23 | struct eth_addr { | 30 | struct eth_addr { |
24 | u8 addr[6]; | 31 | u8 addr[6]; |
@@ -29,6 +36,16 @@ static struct eth_addr __initdata hw_addr[2]; | |||
29 | static struct eth_platform_data __initdata eth_data[2]; | 36 | static struct eth_platform_data __initdata eth_data[2]; |
30 | extern struct lcdc_platform_data atstk1000_fb0_data; | 37 | extern struct lcdc_platform_data atstk1000_fb0_data; |
31 | 38 | ||
39 | static struct spi_board_info spi_board_info[] __initdata = { | ||
40 | { | ||
41 | .modalias = "ltv350qv", | ||
42 | .controller_data = (void *)GPIO_PIN_PA(4), | ||
43 | .max_speed_hz = 16000000, | ||
44 | .bus_num = 0, | ||
45 | .chip_select = 1, | ||
46 | }, | ||
47 | }; | ||
48 | |||
32 | /* | 49 | /* |
33 | * The next two functions should go away as the boot loader is | 50 | * The next two functions should go away as the boot loader is |
34 | * supposed to initialize the macb address registers with a valid | 51 | * supposed to initialize the macb address registers with a valid |
@@ -86,23 +103,53 @@ static void __init set_hw_addr(struct platform_device *pdev) | |||
86 | 103 | ||
87 | void __init setup_board(void) | 104 | void __init setup_board(void) |
88 | { | 105 | { |
89 | at32_map_usart(1, 0); /* /dev/ttyS0 */ | 106 | #ifdef SW2_DEFAULT |
90 | at32_map_usart(2, 1); /* /dev/ttyS1 */ | 107 | at32_map_usart(1, 0); /* USART 1/A: /dev/ttyS0, DB9 */ |
91 | at32_map_usart(3, 2); /* /dev/ttyS2 */ | 108 | #else |
109 | at32_map_usart(0, 1); /* USART 0/B: /dev/ttyS1, IRDA */ | ||
110 | #endif | ||
111 | /* USART 2/unused: expansion connector */ | ||
112 | at32_map_usart(3, 2); /* USART 3/C: /dev/ttyS2, DB9 */ | ||
92 | 113 | ||
93 | at32_setup_serial_console(0); | 114 | at32_setup_serial_console(0); |
94 | } | 115 | } |
95 | 116 | ||
96 | static int __init atstk1002_init(void) | 117 | static int __init atstk1002_init(void) |
97 | { | 118 | { |
119 | /* | ||
120 | * ATSTK1000 uses 32-bit SDRAM interface. Reserve the | ||
121 | * SDRAM-specific pins so that nobody messes with them. | ||
122 | */ | ||
123 | at32_reserve_pin(GPIO_PIN_PE(0)); /* DATA[16] */ | ||
124 | at32_reserve_pin(GPIO_PIN_PE(1)); /* DATA[17] */ | ||
125 | at32_reserve_pin(GPIO_PIN_PE(2)); /* DATA[18] */ | ||
126 | at32_reserve_pin(GPIO_PIN_PE(3)); /* DATA[19] */ | ||
127 | at32_reserve_pin(GPIO_PIN_PE(4)); /* DATA[20] */ | ||
128 | at32_reserve_pin(GPIO_PIN_PE(5)); /* DATA[21] */ | ||
129 | at32_reserve_pin(GPIO_PIN_PE(6)); /* DATA[22] */ | ||
130 | at32_reserve_pin(GPIO_PIN_PE(7)); /* DATA[23] */ | ||
131 | at32_reserve_pin(GPIO_PIN_PE(8)); /* DATA[24] */ | ||
132 | at32_reserve_pin(GPIO_PIN_PE(9)); /* DATA[25] */ | ||
133 | at32_reserve_pin(GPIO_PIN_PE(10)); /* DATA[26] */ | ||
134 | at32_reserve_pin(GPIO_PIN_PE(11)); /* DATA[27] */ | ||
135 | at32_reserve_pin(GPIO_PIN_PE(12)); /* DATA[28] */ | ||
136 | at32_reserve_pin(GPIO_PIN_PE(13)); /* DATA[29] */ | ||
137 | at32_reserve_pin(GPIO_PIN_PE(14)); /* DATA[30] */ | ||
138 | at32_reserve_pin(GPIO_PIN_PE(15)); /* DATA[31] */ | ||
139 | at32_reserve_pin(GPIO_PIN_PE(26)); /* SDCS */ | ||
140 | |||
98 | at32_add_system_devices(); | 141 | at32_add_system_devices(); |
99 | 142 | ||
143 | #ifdef SW2_DEFAULT | ||
100 | at32_add_device_usart(0); | 144 | at32_add_device_usart(0); |
145 | #else | ||
101 | at32_add_device_usart(1); | 146 | at32_add_device_usart(1); |
147 | #endif | ||
102 | at32_add_device_usart(2); | 148 | at32_add_device_usart(2); |
103 | 149 | ||
104 | set_hw_addr(at32_add_device_eth(0, ð_data[0])); | 150 | set_hw_addr(at32_add_device_eth(0, ð_data[0])); |
105 | 151 | ||
152 | spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info)); | ||
106 | at32_add_device_spi(0); | 153 | at32_add_device_spi(0); |
107 | at32_add_device_lcdc(0, &atstk1000_fb0_data); | 154 | at32_add_device_lcdc(0, &atstk1000_fb0_data); |
108 | 155 | ||