Commit | Line | Data |
---|---|---|
a3929f31 EM |
1 | /* |
2 | * linux/arch/arm/mach-mmp/tavorevb.c | |
3 | * | |
4 | * Support for the Marvell PXA910-based TavorEVB Development Platform. | |
5 | * | |
6 | * This program is free software; you can redistribute it and/or modify | |
7 | * it under the terms of the GNU General Public License version 2 as | |
8 | * publishhed by the Free Software Foundation. | |
9 | */ | |
2f8163ba | 10 | #include <linux/gpio.h> |
b8f649f1 | 11 | #include <linux/gpio-pxa.h> |
a3929f31 EM |
12 | #include <linux/init.h> |
13 | #include <linux/kernel.h> | |
14 | #include <linux/platform_device.h> | |
15 | #include <linux/smc91x.h> | |
16 | ||
17 | #include <asm/mach-types.h> | |
18 | #include <asm/mach/arch.h> | |
b501fd7b AB |
19 | #include "addr-map.h" |
20 | #include "mfp-pxa910.h" | |
21 | #include "pxa910.h" | |
22 | #include "irqs.h" | |
a3929f31 EM |
23 | |
24 | #include "common.h" | |
25 | ||
26 | static unsigned long tavorevb_pin_config[] __initdata = { | |
27 | /* UART2 */ | |
28 | GPIO47_UART2_RXD, | |
29 | GPIO48_UART2_TXD, | |
30 | ||
31 | /* SMC */ | |
32 | SM_nCS0_nCS0, | |
33 | SM_ADV_SM_ADV, | |
34 | SM_SCLK_SM_SCLK, | |
35 | SM_SCLK_SM_SCLK, | |
36 | SM_BE0_SM_BE0, | |
37 | SM_BE1_SM_BE1, | |
38 | ||
39 | /* DFI */ | |
40 | DF_IO0_ND_IO0, | |
41 | DF_IO1_ND_IO1, | |
42 | DF_IO2_ND_IO2, | |
43 | DF_IO3_ND_IO3, | |
44 | DF_IO4_ND_IO4, | |
45 | DF_IO5_ND_IO5, | |
46 | DF_IO6_ND_IO6, | |
47 | DF_IO7_ND_IO7, | |
48 | DF_IO8_ND_IO8, | |
49 | DF_IO9_ND_IO9, | |
50 | DF_IO10_ND_IO10, | |
51 | DF_IO11_ND_IO11, | |
52 | DF_IO12_ND_IO12, | |
53 | DF_IO13_ND_IO13, | |
54 | DF_IO14_ND_IO14, | |
55 | DF_IO15_ND_IO15, | |
56 | DF_nCS0_SM_nCS2_nCS0, | |
57 | DF_ALE_SM_WEn_ND_ALE, | |
58 | DF_CLE_SM_OEn_ND_CLE, | |
59 | DF_WEn_DF_WEn, | |
60 | DF_REn_DF_REn, | |
61 | DF_RDY0_DF_RDY0, | |
62 | }; | |
63 | ||
b8f649f1 HZ |
64 | static struct pxa_gpio_platform_data pxa910_gpio_pdata = { |
65 | .irq_base = MMP_GPIO_TO_IRQ(0), | |
66 | }; | |
67 | ||
a3929f31 EM |
68 | static struct smc91x_platdata tavorevb_smc91x_info = { |
69 | .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT, | |
70 | }; | |
71 | ||
72 | static struct resource smc91x_resources[] = { | |
73 | [0] = { | |
74 | .start = SMC_CS1_PHYS_BASE + 0x300, | |
75 | .end = SMC_CS1_PHYS_BASE + 0xfffff, | |
76 | .flags = IORESOURCE_MEM, | |
77 | }, | |
78 | [1] = { | |
4929f5a8 HZ |
79 | .start = MMP_GPIO_TO_IRQ(80), |
80 | .end = MMP_GPIO_TO_IRQ(80), | |
a3929f31 EM |
81 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE, |
82 | } | |
83 | }; | |
84 | ||
85 | static struct platform_device smc91x_device = { | |
86 | .name = "smc91x", | |
87 | .id = 0, | |
88 | .dev = { | |
89 | .platform_data = &tavorevb_smc91x_info, | |
90 | }, | |
91 | .num_resources = ARRAY_SIZE(smc91x_resources), | |
92 | .resource = smc91x_resources, | |
93 | }; | |
94 | ||
95 | static void __init tavorevb_init(void) | |
96 | { | |
97 | mfp_config(ARRAY_AND_SIZE(tavorevb_pin_config)); | |
98 | ||
99 | /* on-chip devices */ | |
100 | pxa910_add_uart(1); | |
b8f649f1 HZ |
101 | platform_device_add_data(&pxa910_device_gpio, &pxa910_gpio_pdata, |
102 | sizeof(struct pxa_gpio_platform_data)); | |
157d2644 | 103 | platform_device_register(&pxa910_device_gpio); |
a3929f31 EM |
104 | |
105 | /* off-chip devices */ | |
106 | platform_device_register(&smc91x_device); | |
107 | } | |
108 | ||
109 | MACHINE_START(TAVOREVB, "PXA910 Evaluation Board (aka TavorEVB)") | |
8022887c | 110 | .map_io = mmp_map_io, |
8661fb92 | 111 | .nr_irqs = MMP_NR_IRQS, |
a3929f31 | 112 | .init_irq = pxa910_init_irq, |
6bb27d73 | 113 | .init_time = pxa910_timer_init, |
a3929f31 | 114 | .init_machine = tavorevb_init, |
9854a38e | 115 | .restart = mmp_restart, |
a3929f31 | 116 | MACHINE_END |