1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23#include <linux/irq.h>
24#include <linux/platform_device.h>
25#include <linux/mtd/physmap.h>
26#include <linux/spi/spi.h>
27#include <linux/spi/max7301.h>
28#include <linux/spi/pxa2xx_spi.h>
29#include <linux/leds.h>
30
31#include <asm/mach-types.h>
32#include <asm/mach/arch.h>
33#include <mach/pxa27x.h>
34#include <mach/pcm027.h>
35#include "generic.h"
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
86static unsigned long pcm027_pin_config[] __initdata = {
87
88 GPIO20_nSDCS_2,
89 GPIO21_nSDCS_3,
90 GPIO15_nCS_1,
91 GPIO78_nCS_2,
92 GPIO80_nCS_4,
93 GPIO33_nCS_5,
94
95
96 GPIO117_I2C_SCL,
97 GPIO118_I2C_SDA,
98
99
100 GPIO52_GPIO,
101#ifdef CONFIG_LEDS_GPIO
102 GPIO90_GPIO,
103 GPIO91_GPIO,
104#endif
105 GPIO114_GPIO,
106};
107
108
109
110
111static struct resource smc91x_resources[] = {
112 [0] = {
113 .start = PCM027_ETH_PHYS + 0x300,
114 .end = PCM027_ETH_PHYS + PCM027_ETH_SIZE,
115 .flags = IORESOURCE_MEM,
116 },
117 [1] = {
118 .start = PCM027_ETH_IRQ,
119 .end = PCM027_ETH_IRQ,
120
121 .flags = IORESOURCE_IRQ | PCM027_ETH_IRQ_EDGE,
122 }
123};
124
125static struct platform_device smc91x_device = {
126 .name = "smc91x",
127 .id = 0,
128 .num_resources = ARRAY_SIZE(smc91x_resources),
129 .resource = smc91x_resources,
130};
131
132
133
134
135static struct pxa2xx_spi_master pxa_ssp_master_info = {
136 .num_chipselect = 1,
137};
138
139static struct max7301_platform_data max7301_info = {
140 .base = -1,
141};
142
143
144static struct spi_board_info spi_board_info[] __initdata = {
145 {
146 .modalias = "max7301",
147 .platform_data = &max7301_info,
148 .max_speed_hz = 13000000,
149 .bus_num = 1,
150 .chip_select = 0,
151 .mode = SPI_MODE_0,
152 },
153};
154
155
156
157
158static struct physmap_flash_data pcm027_flash_data = {
159 .width = 4,
160};
161
162static struct resource pcm027_flash_resource = {
163 .start = PCM027_FLASH_PHYS,
164 .end = PCM027_FLASH_PHYS + PCM027_FLASH_SIZE - 1 ,
165 .flags = IORESOURCE_MEM,
166};
167
168static struct platform_device pcm027_flash = {
169 .name = "physmap-flash",
170 .id = 0,
171 .dev = {
172 .platform_data = &pcm027_flash_data,
173 },
174 .resource = &pcm027_flash_resource,
175 .num_resources = 1,
176};
177
178#ifdef CONFIG_LEDS_GPIO
179
180static struct gpio_led pcm027_led[] = {
181 {
182 .name = "led0:red",
183 .gpio = PCM027_LED_CPU
184 },
185 {
186 .name = "led1:green",
187 .gpio = PCM027_LED_HEARD_BEAT
188 },
189};
190
191static struct gpio_led_platform_data pcm027_led_data = {
192 .num_leds = ARRAY_SIZE(pcm027_led),
193 .leds = pcm027_led
194};
195
196static struct platform_device pcm027_led_dev = {
197 .name = "leds-gpio",
198 .id = 0,
199 .dev = {
200 .platform_data = &pcm027_led_data,
201 },
202};
203
204#endif
205
206
207
208
209static struct platform_device *devices[] __initdata = {
210 &smc91x_device,
211 &pcm027_flash,
212#ifdef CONFIG_LEDS_GPIO
213 &pcm027_led_dev
214#endif
215};
216
217
218
219
220static void __init pcm027_init(void)
221{
222
223
224
225
226 ARB_CNTRL = ARB_CORE_PARK | 0x234;
227
228 pxa2xx_mfp_config(pcm027_pin_config, ARRAY_SIZE(pcm027_pin_config));
229
230 pxa_set_ffuart_info(NULL);
231 pxa_set_btuart_info(NULL);
232 pxa_set_stuart_info(NULL);
233
234 platform_add_devices(devices, ARRAY_SIZE(devices));
235
236
237#ifdef CONFIG_MACH_PCM990_BASEBOARD
238 pcm990_baseboard_init();
239#endif
240
241 pxa2xx_set_spi_info(1, &pxa_ssp_master_info);
242 spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));
243}
244
245static void __init pcm027_map_io(void)
246{
247 pxa27x_map_io();
248
249
250 PGSR0 = 0x01308000;
251 PGSR1 = 0x00CF0002;
252 PGSR2 = 0x0E294000;
253 PGSR3 = 0x0000C000;
254 PWER = 0x40000000 | PWER_GPIO0 | PWER_GPIO1;
255 PRER = 0x00000000;
256 PFER = 0x00000003;
257}
258
259MACHINE_START(PCM027, "Phytec Messtechnik GmbH phyCORE-PXA270")
260
261 .atag_offset = 0x100,
262 .map_io = pcm027_map_io,
263 .nr_irqs = PCM027_NR_IRQS,
264 .init_irq = pxa27x_init_irq,
265 .handle_irq = pxa27x_handle_irq,
266 .timer = &pxa_timer,
267 .init_machine = pcm027_init,
268 .restart = pxa_restart,
269MACHINE_END
270