075743b4eb27b63066c0cf8b450379c36ddb2c42
[openwrt/svn-archive/archive.git] / target / linux / avr32 / patches / 000-revert_usart_pin_selection.patch
1 --- a/arch/avr32/boards/atngw100/setup.c
2 +++ b/arch/avr32/boards/atngw100/setup.c
3 @@ -118,7 +118,7 @@ static void __init set_hw_addr(struct pl
4
5 void __init setup_board(void)
6 {
7 - at32_map_usart(1, 0, 0); /* USART 1: /dev/ttyS0, DB9 */
8 + at32_map_usart(1, 0); /* USART 1: /dev/ttyS0, DB9 */
9 at32_setup_serial_console(0);
10 }
11
12 --- a/arch/avr32/boards/atstk1000/atstk1002.c
13 +++ b/arch/avr32/boards/atstk1000/atstk1002.c
14 @@ -252,12 +252,12 @@ static void __init atstk1002_setup_extda
15 void __init setup_board(void)
16 {
17 #ifdef CONFIG_BOARD_ATSTK100X_SW2_CUSTOM
18 - at32_map_usart(0, 1, 0); /* USART 0/B: /dev/ttyS1, IRDA */
19 + at32_map_usart(0, 1); /* USART 0/B: /dev/ttyS1, IRDA */
20 #else
21 - at32_map_usart(1, 0, 0); /* USART 1/A: /dev/ttyS0, DB9 */
22 + at32_map_usart(1, 0); /* USART 1/A: /dev/ttyS0, DB9 */
23 #endif
24 /* USART 2/unused: expansion connector */
25 - at32_map_usart(3, 2, 0); /* USART 3/C: /dev/ttyS2, DB9 */
26 + at32_map_usart(3, 2); /* USART 3/C: /dev/ttyS2, DB9 */
27
28 at32_setup_serial_console(0);
29 }
30 --- a/arch/avr32/boards/atstk1000/atstk1003.c
31 +++ b/arch/avr32/boards/atstk1000/atstk1003.c
32 @@ -115,12 +115,12 @@ static void __init atstk1003_setup_extda
33 void __init setup_board(void)
34 {
35 #ifdef CONFIG_BOARD_ATSTK100X_SW2_CUSTOM
36 - at32_map_usart(0, 1, 0); /* USART 0/B: /dev/ttyS1, IRDA */
37 + at32_map_usart(0, 1); /* USART 0/B: /dev/ttyS1, IRDA */
38 #else
39 - at32_map_usart(1, 0, 0); /* USART 1/A: /dev/ttyS0, DB9 */
40 + at32_map_usart(1, 0); /* USART 1/A: /dev/ttyS0, DB9 */
41 #endif
42 /* USART 2/unused: expansion connector */
43 - at32_map_usart(3, 2, 0); /* USART 3/C: /dev/ttyS2, DB9 */
44 + at32_map_usart(3, 2); /* USART 3/C: /dev/ttyS2, DB9 */
45
46 at32_setup_serial_console(0);
47 }
48 --- a/arch/avr32/boards/atstk1000/atstk1004.c
49 +++ b/arch/avr32/boards/atstk1000/atstk1004.c
50 @@ -120,12 +120,12 @@ static void __init atstk1004_setup_extda
51 void __init setup_board(void)
52 {
53 #ifdef CONFIG_BOARD_ATSTK100X_SW2_CUSTOM
54 - at32_map_usart(0, 1, 0); /* USART 0/B: /dev/ttyS1, IRDA */
55 + at32_map_usart(0, 1); /* USART 0/B: /dev/ttyS1, IRDA */
56 #else
57 - at32_map_usart(1, 0, 0); /* USART 1/A: /dev/ttyS0, DB9 */
58 + at32_map_usart(1, 0); /* USART 1/A: /dev/ttyS0, DB9 */
59 #endif
60 /* USART 2/unused: expansion connector */
61 - at32_map_usart(3, 2, 0); /* USART 3/C: /dev/ttyS2, DB9 */
62 + at32_map_usart(3, 2); /* USART 3/C: /dev/ttyS2, DB9 */
63
64 at32_setup_serial_console(0);
65 }
66 --- a/arch/avr32/boards/favr-32/setup.c
67 +++ b/arch/avr32/boards/favr-32/setup.c
68 @@ -250,7 +250,7 @@ static void __init favr32_setup_atmel_pw
69
70 void __init setup_board(void)
71 {
72 - at32_map_usart(3, 0, 0); /* USART 3 => /dev/ttyS0 */
73 + at32_map_usart(3, 0); /* USART 3 => /dev/ttyS0 */
74 at32_setup_serial_console(0);
75 }
76
77 --- a/arch/avr32/boards/hammerhead/setup.c
78 +++ b/arch/avr32/boards/hammerhead/setup.c
79 @@ -165,7 +165,7 @@ static void __init set_hw_addr(struct pl
80
81 void __init setup_board(void)
82 {
83 - at32_map_usart(1, 0, 0); /* USART 1: /dev/ttyS0, DB9 */
84 + at32_map_usart(1, 0); /* USART 1: /dev/ttyS0, DB9 */
85 at32_setup_serial_console(0);
86 }
87
88 --- a/arch/avr32/boards/merisc/setup.c
89 +++ b/arch/avr32/boards/merisc/setup.c
90 @@ -231,9 +231,9 @@ static void detect_merisc_board_id(void)
91
92 void __init setup_board(void)
93 {
94 - at32_map_usart(0, 0, 0);
95 - at32_map_usart(1, 1, 0);
96 - at32_map_usart(3, 3, 0);
97 + at32_map_usart(0, 0);
98 + at32_map_usart(1, 1);
99 + at32_map_usart(3, 3);
100 at32_setup_serial_console(1);
101 }
102
103 @@ -248,7 +248,7 @@ static int __init merisc_init(void)
104 at32_reserve_pin(GPIO_PIOE_BASE, ATMEL_EBI_PE_DATA_ALL | (1 << 26));
105
106 if (merisc_board_id >= 1)
107 - at32_map_usart(2, 2, 0);
108 + at32_map_usart(2, 2);
109
110 at32_add_device_usart(0);
111 at32_add_device_usart(1);
112 --- a/arch/avr32/boards/mimc200/setup.c
113 +++ b/arch/avr32/boards/mimc200/setup.c
114 @@ -175,10 +175,10 @@ static void __init set_hw_addr(struct pl
115
116 void __init setup_board(void)
117 {
118 - at32_map_usart(0, 0, 0); /* USART 0: /dev/ttyS0 (TTL --> Altera) */
119 - at32_map_usart(1, 1, 0); /* USART 1: /dev/ttyS1 (RS232) */
120 - at32_map_usart(2, 2, 0); /* USART 2: /dev/ttyS2 (RS485) */
121 - at32_map_usart(3, 3, 0); /* USART 3: /dev/ttyS3 (RS422 Multidrop) */
122 + at32_map_usart(0, 0); /* USART 0: /dev/ttyS0 (TTL --> Altera) */
123 + at32_map_usart(1, 1); /* USART 1: /dev/ttyS1 (RS232) */
124 + at32_map_usart(2, 2); /* USART 2: /dev/ttyS2 (RS485) */
125 + at32_map_usart(3, 3); /* USART 3: /dev/ttyS3 (RS422 Multidrop) */
126 }
127
128 static struct i2c_gpio_platform_data i2c_gpio_data = {
129 --- a/arch/avr32/mach-at32ap/at32ap700x.c
130 +++ b/arch/avr32/mach-at32ap/at32ap700x.c
131 @@ -966,68 +966,56 @@ static struct resource atmel_usart3_reso
132 DEFINE_DEV_DATA(atmel_usart, 3);
133 DEV_CLK(usart, atmel_usart3, pba, 6);
134
135 -static inline void configure_usart0_pins(int flags)
136 +static inline void configure_usart0_pins(void)
137 {
138 u32 pin_mask = (1 << 8) | (1 << 9); /* RXD & TXD */
139 - if (flags & ATMEL_USART_RTS) pin_mask |= (1 << 6);
140 - if (flags & ATMEL_USART_CTS) pin_mask |= (1 << 7);
141 - if (flags & ATMEL_USART_CLK) pin_mask |= (1 << 10);
142
143 select_peripheral(PIOA, pin_mask, PERIPH_B, AT32_GPIOF_PULLUP);
144 }
145
146 -static inline void configure_usart1_pins(int flags)
147 +static inline void configure_usart1_pins(void)
148 {
149 u32 pin_mask = (1 << 17) | (1 << 18); /* RXD & TXD */
150 - if (flags & ATMEL_USART_RTS) pin_mask |= (1 << 19);
151 - if (flags & ATMEL_USART_CTS) pin_mask |= (1 << 20);
152 - if (flags & ATMEL_USART_CLK) pin_mask |= (1 << 16);
153
154 select_peripheral(PIOA, pin_mask, PERIPH_A, AT32_GPIOF_PULLUP);
155 }
156
157 -static inline void configure_usart2_pins(int flags)
158 +static inline void configure_usart2_pins(void)
159 {
160 u32 pin_mask = (1 << 26) | (1 << 27); /* RXD & TXD */
161 - if (flags & ATMEL_USART_RTS) pin_mask |= (1 << 30);
162 - if (flags & ATMEL_USART_CTS) pin_mask |= (1 << 29);
163 - if (flags & ATMEL_USART_CLK) pin_mask |= (1 << 28);
164
165 select_peripheral(PIOB, pin_mask, PERIPH_B, AT32_GPIOF_PULLUP);
166 }
167
168 -static inline void configure_usart3_pins(int flags)
169 +static inline void configure_usart3_pins(void)
170 {
171 u32 pin_mask = (1 << 18) | (1 << 17); /* RXD & TXD */
172 - if (flags & ATMEL_USART_RTS) pin_mask |= (1 << 16);
173 - if (flags & ATMEL_USART_CTS) pin_mask |= (1 << 15);
174 - if (flags & ATMEL_USART_CLK) pin_mask |= (1 << 19);
175
176 select_peripheral(PIOB, pin_mask, PERIPH_B, AT32_GPIOF_PULLUP);
177 }
178
179 static struct platform_device *__initdata at32_usarts[4];
180
181 -void __init at32_map_usart(unsigned int hw_id, unsigned int line, int flags)
182 +void __init at32_map_usart(unsigned int hw_id, unsigned int line)
183 {
184 struct platform_device *pdev;
185
186 switch (hw_id) {
187 case 0:
188 pdev = &atmel_usart0_device;
189 - configure_usart0_pins(flags);
190 + configure_usart0_pins();
191 break;
192 case 1:
193 pdev = &atmel_usart1_device;
194 - configure_usart1_pins(flags);
195 + configure_usart1_pins();
196 break;
197 case 2:
198 pdev = &atmel_usart2_device;
199 - configure_usart2_pins(flags);
200 + configure_usart2_pins();
201 break;
202 case 3:
203 pdev = &atmel_usart3_device;
204 - configure_usart3_pins(flags);
205 + configure_usart3_pins();
206 break;
207 default:
208 return;
209 --- a/arch/avr32/mach-at32ap/include/mach/board.h
210 +++ b/arch/avr32/mach-at32ap/include/mach/board.h
211 @@ -26,17 +26,12 @@ static inline void __deprecated at32_add
212 #define ATMEL_MAX_UART 4
213 extern struct platform_device *atmel_default_console_device;
214
215 -/* Flags for selecting USART extra pins */
216 -#define ATMEL_USART_RTS 0x01
217 -#define ATMEL_USART_CTS 0x02
218 -#define ATMEL_USART_CLK 0x03
219 -
220 struct atmel_uart_data {
221 short use_dma_tx; /* use transmit DMA? */
222 short use_dma_rx; /* use receive DMA? */
223 void __iomem *regs; /* virtual base address, if any */
224 };
225 -void at32_map_usart(unsigned int hw_id, unsigned int line, int flags);
226 +void at32_map_usart(unsigned int hw_id, unsigned int line);
227 struct platform_device *at32_add_device_usart(unsigned int id);
228
229 struct eth_platform_data {