This source file includes following definitions.
- mxm_8x10_mmc_init
- mxm_8x10_usb_host_init
- mxm_8x10_ac97_init
- mxm_8x10_nand_init
- mxm_8x10_nand_init
- mxm_8x10_ethernet_init
- mxm_8x10_uarts_init
- mxm_8x10_i2c_init
- mxm_8x10_barebones_init
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 #include <linux/serial_8250.h>
20 #include <linux/dm9000.h>
21 #include <linux/gpio/machine.h>
22 #include <linux/platform_data/i2c-pxa.h>
23
24 #include <linux/platform_data/mtd-nand-pxa3xx.h>
25
26 #include <linux/platform_data/video-pxafb.h>
27 #include <linux/platform_data/mmc-pxamci.h>
28 #include <linux/platform_data/usb-ohci-pxa27x.h>
29 #include "pxa320.h"
30
31 #include "mxm8x10.h"
32
33 #include "devices.h"
34 #include "generic.h"
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232 static mfp_cfg_t mfp_cfg[] __initdata = {
233
234 GPIO10_UTM_CLK,
235 GPIO49_U2D_PHYDATA_0,
236 GPIO50_U2D_PHYDATA_1,
237 GPIO51_U2D_PHYDATA_2,
238 GPIO52_U2D_PHYDATA_3,
239 GPIO53_U2D_PHYDATA_4,
240 GPIO54_U2D_PHYDATA_5,
241 GPIO55_U2D_PHYDATA_6,
242 GPIO56_U2D_PHYDATA_7,
243 GPIO58_UTM_RXVALID,
244 GPIO59_UTM_RXACTIVE,
245 GPIO60_U2D_RXERROR,
246 GPIO61_U2D_OPMODE0,
247 GPIO62_U2D_OPMODE1,
248 GPIO71_GPIO,
249 GPIO73_UTM_TXREADY,
250 GPIO83_U2D_TXVALID,
251 GPIO98_U2D_RESET,
252 GPIO99_U2D_XCVR_SEL,
253 GPIO100_U2D_TERM_SEL,
254 GPIO101_U2D_SUSPEND,
255 GPIO102_UTM_LINESTATE_0,
256 GPIO103_UTM_LINESTATE_1,
257 GPIO4_2_GPIO | MFP_PULL_HIGH,
258
259
260 GPIO1_GPIO,
261 GPIO9_GPIO,
262 GPIO36_GPIO,
263
264
265 GPIO35_AC97_SDATA_IN_0,
266 GPIO37_AC97_SDATA_OUT,
267 GPIO38_AC97_SYNC,
268 GPIO39_AC97_BITCLK,
269 GPIO40_AC97_nACRESET,
270
271
272 GPIO41_UART1_RXD,
273 GPIO42_UART1_TXD,
274 GPIO43_UART1_CTS,
275 GPIO44_UART1_DCD,
276 GPIO45_UART1_DSR,
277 GPIO46_UART1_RI,
278 GPIO47_UART1_DTR,
279 GPIO48_UART1_RTS,
280
281 GPIO109_UART2_RTS,
282 GPIO110_UART2_RXD,
283 GPIO111_UART2_TXD,
284 GPIO112_UART2_CTS,
285
286 GPIO105_UART3_CTS,
287 GPIO106_UART3_RTS,
288 GPIO107_UART3_TXD,
289 GPIO108_UART3_RXD,
290
291 GPIO78_GPIO,
292 GPIO79_GPIO,
293 GPIO80_GPIO,
294 GPIO81_GPIO,
295
296
297 GPIO32_I2C_SCL,
298 GPIO33_I2C_SDA,
299
300
301 GPIO18_MMC1_DAT0,
302 GPIO19_MMC1_DAT1,
303 GPIO20_MMC1_DAT2,
304 GPIO21_MMC1_DAT3,
305 GPIO22_MMC1_CLK,
306 GPIO23_MMC1_CMD,
307 GPIO72_GPIO | MFP_PULL_HIGH,
308 GPIO84_GPIO | MFP_PULL_LOW,
309
310
311 GPIO74_GPIO | MFP_LPM_EDGE_RISE,
312 GPIO75_GPIO | MFP_LPM_EDGE_RISE,
313 GPIO76_GPIO | MFP_LPM_EDGE_RISE,
314 GPIO77_GPIO | MFP_LPM_EDGE_RISE,
315 GPIO78_GPIO | MFP_LPM_EDGE_RISE,
316 GPIO79_GPIO | MFP_LPM_EDGE_RISE,
317 GPIO80_GPIO | MFP_LPM_EDGE_RISE,
318 GPIO81_GPIO | MFP_LPM_EDGE_RISE
319 };
320
321
322 #if defined(CONFIG_MMC)
323 static struct pxamci_platform_data mxm_8x10_mci_platform_data = {
324 .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34,
325 .detect_delay_ms = 10,
326 };
327
328 static struct gpiod_lookup_table mxm_8x10_mci_gpio_table = {
329 .dev_id = "pxa2xx-mci.0",
330 .table = {
331
332 GPIO_LOOKUP("gpio-pxa", MXM_8X10_SD_nCD,
333 "cd", GPIO_ACTIVE_LOW),
334
335 GPIO_LOOKUP("gpio-pxa", MXM_8X10_SD_WP,
336 "wp", GPIO_ACTIVE_LOW),
337 { },
338 },
339 };
340
341 void __init mxm_8x10_mmc_init(void)
342 {
343 gpiod_add_lookup_table(&mxm_8x10_mci_gpio_table);
344 pxa_set_mci_info(&mxm_8x10_mci_platform_data);
345 }
346 #endif
347
348
349 static struct pxaohci_platform_data mxm_8x10_ohci_platform_data = {
350 .port_mode = PMM_NPS_MODE,
351 .flags = ENABLE_PORT_ALL
352 };
353
354 void __init mxm_8x10_usb_host_init(void)
355 {
356 pxa_set_ohci_info(&mxm_8x10_ohci_platform_data);
357 }
358
359
360 static struct platform_device mxm_8x10_ac97_device = {
361 .name = "pxa2xx-ac97"
362 };
363
364 void __init mxm_8x10_ac97_init(void)
365 {
366 platform_device_register(&mxm_8x10_ac97_device);
367 }
368
369
370 #if IS_ENABLED(CONFIG_MTD_NAND_MARVELL)
371 #define NAND_BLOCK_SIZE SZ_128K
372 #define NB(x) (NAND_BLOCK_SIZE * (x))
373 static struct mtd_partition mxm_8x10_nand_partitions[] = {
374 [0] = {
375 .name = "boot",
376 .size = NB(0x002),
377 .offset = NB(0x000),
378 .mask_flags = MTD_WRITEABLE
379 },
380 [1] = {
381 .name = "kernel",
382 .size = NB(0x010),
383 .offset = NB(0x002),
384 .mask_flags = MTD_WRITEABLE
385 },
386 [2] = {
387 .name = "root",
388 .size = NB(0x36c),
389 .offset = NB(0x012)
390 },
391 [3] = {
392 .name = "bbt",
393 .size = NB(0x082),
394 .offset = NB(0x37e),
395 .mask_flags = MTD_WRITEABLE
396 }
397 };
398
399 static struct pxa3xx_nand_platform_data mxm_8x10_nand_info = {
400 .keep_config = 1,
401 .parts = mxm_8x10_nand_partitions,
402 .nr_parts = ARRAY_SIZE(mxm_8x10_nand_partitions)
403 };
404
405 static void __init mxm_8x10_nand_init(void)
406 {
407 pxa3xx_set_nand_info(&mxm_8x10_nand_info);
408 }
409 #else
410 static inline void mxm_8x10_nand_init(void) {}
411 #endif
412
413
414 static struct resource dm9k_resources[] = {
415 [0] = {
416 .start = MXM_8X10_ETH_PHYS + 0x300,
417 .end = MXM_8X10_ETH_PHYS + 0x300,
418 .flags = IORESOURCE_MEM
419 },
420 [1] = {
421 .start = MXM_8X10_ETH_PHYS + 0x308,
422 .end = MXM_8X10_ETH_PHYS + 0x308,
423 .flags = IORESOURCE_MEM
424 },
425 [2] = {
426 .start = PXA_GPIO_TO_IRQ(mfp_to_gpio(MFP_PIN_GPIO9)),
427 .end = PXA_GPIO_TO_IRQ(mfp_to_gpio(MFP_PIN_GPIO9)),
428 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE
429 }
430 };
431
432 static struct dm9000_plat_data dm9k_plat_data = {
433 .flags = DM9000_PLATF_16BITONLY
434 };
435
436 static struct platform_device dm9k_device = {
437 .name = "dm9000",
438 .id = 0,
439 .num_resources = ARRAY_SIZE(dm9k_resources),
440 .resource = dm9k_resources,
441 .dev = {
442 .platform_data = &dm9k_plat_data
443 }
444 };
445
446 static void __init mxm_8x10_ethernet_init(void)
447 {
448 platform_device_register(&dm9k_device);
449 }
450
451
452 static void __init mxm_8x10_uarts_init(void)
453 {
454 pxa_set_ffuart_info(NULL);
455 pxa_set_btuart_info(NULL);
456 pxa_set_stuart_info(NULL);
457 }
458
459
460 static struct i2c_board_info __initdata mxm_8x10_i2c_devices[] = {
461 {
462 I2C_BOARD_INFO("ds1337", 0x68)
463 }
464 };
465
466 static void __init mxm_8x10_i2c_init(void)
467 {
468 i2c_register_board_info(0, mxm_8x10_i2c_devices,
469 ARRAY_SIZE(mxm_8x10_i2c_devices));
470 pxa_set_i2c_info(NULL);
471 }
472
473 void __init mxm_8x10_barebones_init(void)
474 {
475 pxa3xx_mfp_config(ARRAY_AND_SIZE(mfp_cfg));
476
477 mxm_8x10_uarts_init();
478 mxm_8x10_nand_init();
479 mxm_8x10_i2c_init();
480 mxm_8x10_ethernet_init();
481 }