1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22#include <linux/serial_8250.h>
23#include <linux/dm9000.h>
24#include <linux/gpio.h>
25#include <linux/platform_data/i2c-pxa.h>
26
27#include <linux/platform_data/mtd-nand-pxa3xx.h>
28
29#include <linux/platform_data/video-pxafb.h>
30#include <linux/platform_data/mmc-pxamci.h>
31#include <linux/platform_data/usb-ohci-pxa27x.h>
32#include "pxa320.h"
33
34#include "mxm8x10.h"
35
36#include "devices.h"
37#include "generic.h"
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
233
234
235static mfp_cfg_t mfp_cfg[] __initdata = {
236
237 GPIO10_UTM_CLK,
238 GPIO49_U2D_PHYDATA_0,
239 GPIO50_U2D_PHYDATA_1,
240 GPIO51_U2D_PHYDATA_2,
241 GPIO52_U2D_PHYDATA_3,
242 GPIO53_U2D_PHYDATA_4,
243 GPIO54_U2D_PHYDATA_5,
244 GPIO55_U2D_PHYDATA_6,
245 GPIO56_U2D_PHYDATA_7,
246 GPIO58_UTM_RXVALID,
247 GPIO59_UTM_RXACTIVE,
248 GPIO60_U2D_RXERROR,
249 GPIO61_U2D_OPMODE0,
250 GPIO62_U2D_OPMODE1,
251 GPIO71_GPIO,
252 GPIO73_UTM_TXREADY,
253 GPIO83_U2D_TXVALID,
254 GPIO98_U2D_RESET,
255 GPIO99_U2D_XCVR_SEL,
256 GPIO100_U2D_TERM_SEL,
257 GPIO101_U2D_SUSPEND,
258 GPIO102_UTM_LINESTATE_0,
259 GPIO103_UTM_LINESTATE_1,
260 GPIO4_2_GPIO | MFP_PULL_HIGH,
261
262
263 GPIO1_GPIO,
264 GPIO9_GPIO,
265 GPIO36_GPIO,
266
267
268 GPIO35_AC97_SDATA_IN_0,
269 GPIO37_AC97_SDATA_OUT,
270 GPIO38_AC97_SYNC,
271 GPIO39_AC97_BITCLK,
272 GPIO40_AC97_nACRESET,
273
274
275 GPIO41_UART1_RXD,
276 GPIO42_UART1_TXD,
277 GPIO43_UART1_CTS,
278 GPIO44_UART1_DCD,
279 GPIO45_UART1_DSR,
280 GPIO46_UART1_RI,
281 GPIO47_UART1_DTR,
282 GPIO48_UART1_RTS,
283
284 GPIO109_UART2_RTS,
285 GPIO110_UART2_RXD,
286 GPIO111_UART2_TXD,
287 GPIO112_UART2_CTS,
288
289 GPIO105_UART3_CTS,
290 GPIO106_UART3_RTS,
291 GPIO107_UART3_TXD,
292 GPIO108_UART3_RXD,
293
294 GPIO78_GPIO,
295 GPIO79_GPIO,
296 GPIO80_GPIO,
297 GPIO81_GPIO,
298
299
300 GPIO32_I2C_SCL,
301 GPIO33_I2C_SDA,
302
303
304 GPIO18_MMC1_DAT0,
305 GPIO19_MMC1_DAT1,
306 GPIO20_MMC1_DAT2,
307 GPIO21_MMC1_DAT3,
308 GPIO22_MMC1_CLK,
309 GPIO23_MMC1_CMD,
310 GPIO72_GPIO | MFP_PULL_HIGH,
311 GPIO84_GPIO | MFP_PULL_LOW,
312
313
314 GPIO74_GPIO | MFP_LPM_EDGE_RISE,
315 GPIO75_GPIO | MFP_LPM_EDGE_RISE,
316 GPIO76_GPIO | MFP_LPM_EDGE_RISE,
317 GPIO77_GPIO | MFP_LPM_EDGE_RISE,
318 GPIO78_GPIO | MFP_LPM_EDGE_RISE,
319 GPIO79_GPIO | MFP_LPM_EDGE_RISE,
320 GPIO80_GPIO | MFP_LPM_EDGE_RISE,
321 GPIO81_GPIO | MFP_LPM_EDGE_RISE
322};
323
324
325#if defined(CONFIG_MMC)
326static struct pxamci_platform_data mxm_8x10_mci_platform_data = {
327 .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34,
328 .detect_delay_ms = 10,
329 .gpio_card_detect = MXM_8X10_SD_nCD,
330 .gpio_card_ro = MXM_8X10_SD_WP,
331 .gpio_power = -1
332};
333
334void __init mxm_8x10_mmc_init(void)
335{
336 pxa_set_mci_info(&mxm_8x10_mci_platform_data);
337}
338#endif
339
340
341static struct pxaohci_platform_data mxm_8x10_ohci_platform_data = {
342 .port_mode = PMM_NPS_MODE,
343 .flags = ENABLE_PORT_ALL
344};
345
346void __init mxm_8x10_usb_host_init(void)
347{
348 pxa_set_ohci_info(&mxm_8x10_ohci_platform_data);
349}
350
351
352static struct platform_device mxm_8x10_ac97_device = {
353 .name = "pxa2xx-ac97"
354};
355
356void __init mxm_8x10_ac97_init(void)
357{
358 platform_device_register(&mxm_8x10_ac97_device);
359}
360
361
362#if IS_ENABLED(CONFIG_MTD_NAND_MARVELL)
363#define NAND_BLOCK_SIZE SZ_128K
364#define NB(x) (NAND_BLOCK_SIZE * (x))
365static struct mtd_partition mxm_8x10_nand_partitions[] = {
366 [0] = {
367 .name = "boot",
368 .size = NB(0x002),
369 .offset = NB(0x000),
370 .mask_flags = MTD_WRITEABLE
371 },
372 [1] = {
373 .name = "kernel",
374 .size = NB(0x010),
375 .offset = NB(0x002),
376 .mask_flags = MTD_WRITEABLE
377 },
378 [2] = {
379 .name = "root",
380 .size = NB(0x36c),
381 .offset = NB(0x012)
382 },
383 [3] = {
384 .name = "bbt",
385 .size = NB(0x082),
386 .offset = NB(0x37e),
387 .mask_flags = MTD_WRITEABLE
388 }
389};
390
391static struct pxa3xx_nand_platform_data mxm_8x10_nand_info = {
392 .keep_config = 1,
393 .parts = mxm_8x10_nand_partitions,
394 .nr_parts = ARRAY_SIZE(mxm_8x10_nand_partitions)
395};
396
397static void __init mxm_8x10_nand_init(void)
398{
399 pxa3xx_set_nand_info(&mxm_8x10_nand_info);
400}
401#else
402static inline void mxm_8x10_nand_init(void) {}
403#endif
404
405
406static struct resource dm9k_resources[] = {
407 [0] = {
408 .start = MXM_8X10_ETH_PHYS + 0x300,
409 .end = MXM_8X10_ETH_PHYS + 0x300,
410 .flags = IORESOURCE_MEM
411 },
412 [1] = {
413 .start = MXM_8X10_ETH_PHYS + 0x308,
414 .end = MXM_8X10_ETH_PHYS + 0x308,
415 .flags = IORESOURCE_MEM
416 },
417 [2] = {
418 .start = PXA_GPIO_TO_IRQ(mfp_to_gpio(MFP_PIN_GPIO9)),
419 .end = PXA_GPIO_TO_IRQ(mfp_to_gpio(MFP_PIN_GPIO9)),
420 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE
421 }
422};
423
424static struct dm9000_plat_data dm9k_plat_data = {
425 .flags = DM9000_PLATF_16BITONLY
426};
427
428static struct platform_device dm9k_device = {
429 .name = "dm9000",
430 .id = 0,
431 .num_resources = ARRAY_SIZE(dm9k_resources),
432 .resource = dm9k_resources,
433 .dev = {
434 .platform_data = &dm9k_plat_data
435 }
436};
437
438static void __init mxm_8x10_ethernet_init(void)
439{
440 platform_device_register(&dm9k_device);
441}
442
443
444static void __init mxm_8x10_uarts_init(void)
445{
446 pxa_set_ffuart_info(NULL);
447 pxa_set_btuart_info(NULL);
448 pxa_set_stuart_info(NULL);
449}
450
451
452static struct i2c_board_info __initdata mxm_8x10_i2c_devices[] = {
453 {
454 I2C_BOARD_INFO("ds1337", 0x68)
455 }
456};
457
458static void __init mxm_8x10_i2c_init(void)
459{
460 i2c_register_board_info(0, mxm_8x10_i2c_devices,
461 ARRAY_SIZE(mxm_8x10_i2c_devices));
462 pxa_set_i2c_info(NULL);
463}
464
465void __init mxm_8x10_barebones_init(void)
466{
467 pxa3xx_mfp_config(ARRAY_AND_SIZE(mfp_cfg));
468
469 mxm_8x10_uarts_init();
470 mxm_8x10_nand_init();
471 mxm_8x10_i2c_init();
472 mxm_8x10_ethernet_init();
473}
474