blob: e703a8d209e243d87410b2bde4f520ac5bd75769 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 * Support for Sharp SL-C7xx PDAs
3 * Models: SL-C700 (Corgi), SL-C750 (Shepherd), SL-C760 (Husky)
4 *
5 * Copyright (c) 2004-2005 Richard Purdie
6 *
7 * Based on Sharp's 2.4 kernel patches/lubbock.c
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12 *
13 */
14
15#include <linux/kernel.h>
16#include <linux/init.h>
Russell Kingd052d1b2005-10-29 19:07:23 +010017#include <linux/platform_device.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070018#include <linux/major.h>
19#include <linux/fs.h>
20#include <linux/interrupt.h>
21#include <linux/mmc/host.h>
Richard Purdie74617fb2006-06-19 19:57:12 +010022#include <linux/pm.h>
Richard Purdiec3f8f652007-09-03 00:27:00 +010023#include <linux/backlight.h>
Richard Purdieca4d6cf2008-01-02 01:09:54 +010024#include <video/w100fb.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070025
26#include <asm/setup.h>
27#include <asm/memory.h>
28#include <asm/mach-types.h>
Russell Kinga09e64f2008-08-05 16:14:15 +010029#include <mach/hardware.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070030#include <asm/irq.h>
31#include <asm/io.h>
Richard Purdie74617fb2006-06-19 19:57:12 +010032#include <asm/system.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070033
34#include <asm/mach/arch.h>
35#include <asm/mach/map.h>
36#include <asm/mach/irq.h>
37
Russell Kinga09e64f2008-08-05 16:14:15 +010038#include <mach/pxa-regs.h>
39#include <mach/pxa2xx-regs.h>
40#include <mach/pxa2xx-gpio.h>
Mark Brownf8787fd2008-08-26 13:30:03 +010041#include <mach/i2c.h>
Russell Kinga09e64f2008-08-05 16:14:15 +010042#include <mach/irda.h>
43#include <mach/mmc.h>
44#include <mach/udc.h>
45#include <mach/corgi.h>
46#include <mach/sharpsl.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070047
48#include <asm/mach/sharpsl_param.h>
49#include <asm/hardware/scoop.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070050
51#include "generic.h"
Russell King46c41e62007-05-15 15:39:36 +010052#include "devices.h"
Richard Purdie50a5de42005-09-13 01:25:30 -070053#include "sharpsl.h"
Linus Torvalds1da177e2005-04-16 15:20:36 -070054
55
56/*
57 * Corgi SCOOP Device
58 */
59static struct resource corgi_scoop_resources[] = {
60 [0] = {
61 .start = 0x10800000,
62 .end = 0x10800fff,
63 .flags = IORESOURCE_MEM,
64 },
65};
66
67static struct scoop_config corgi_scoop_setup = {
68 .io_dir = CORGI_SCOOP_IO_DIR,
69 .io_out = CORGI_SCOOP_IO_OUT,
70};
71
72struct platform_device corgiscoop_device = {
73 .name = "sharp-scoop",
74 .id = -1,
75 .dev = {
76 .platform_data = &corgi_scoop_setup,
77 },
78 .num_resources = ARRAY_SIZE(corgi_scoop_resources),
79 .resource = corgi_scoop_resources,
80};
81
Richard Purdiea63ae442005-11-08 19:15:43 +000082static void corgi_pcmcia_init(void)
83{
84 /* Setup default state of GPIO outputs
85 before we enable them as outputs. */
86 GPSR(GPIO48_nPOE) = GPIO_bit(GPIO48_nPOE) |
87 GPIO_bit(GPIO49_nPWE) | GPIO_bit(GPIO50_nPIOR) |
88 GPIO_bit(GPIO51_nPIOW) | GPIO_bit(GPIO52_nPCE_1) |
89 GPIO_bit(GPIO53_nPCE_2);
90
91 pxa_gpio_mode(GPIO48_nPOE_MD);
92 pxa_gpio_mode(GPIO49_nPWE_MD);
93 pxa_gpio_mode(GPIO50_nPIOR_MD);
94 pxa_gpio_mode(GPIO51_nPIOW_MD);
95 pxa_gpio_mode(GPIO55_nPREG_MD);
96 pxa_gpio_mode(GPIO56_nPWAIT_MD);
97 pxa_gpio_mode(GPIO57_nIOIS16_MD);
98 pxa_gpio_mode(GPIO52_nPCE_1_MD);
99 pxa_gpio_mode(GPIO53_nPCE_2_MD);
100 pxa_gpio_mode(GPIO54_pSKTSEL_MD);
101}
102
103static struct scoop_pcmcia_dev corgi_pcmcia_scoop[] = {
104{
105 .dev = &corgiscoop_device.dev,
106 .irq = CORGI_IRQ_GPIO_CF_IRQ,
107 .cd_irq = CORGI_IRQ_GPIO_CF_CD,
108 .cd_irq_str = "PCMCIA0 CD",
109},
110};
111
112static struct scoop_pcmcia_config corgi_pcmcia_config = {
113 .devs = &corgi_pcmcia_scoop[0],
114 .num_devs = 1,
115 .pcmcia_init = corgi_pcmcia_init,
116};
117
118EXPORT_SYMBOL(corgiscoop_device);
119
Linus Torvalds1da177e2005-04-16 15:20:36 -0700120
121/*
122 * Corgi SSP Device
123 *
124 * Set the parent as the scoop device because a lot of SSP devices
125 * also use scoop functions and this makes the power up/down order
126 * work correctly.
127 */
Richard Purdie41b1bce2005-09-06 15:19:05 -0700128struct platform_device corgissp_device = {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700129 .name = "corgi-ssp",
130 .dev = {
131 .parent = &corgiscoop_device.dev,
132 },
133 .id = -1,
134};
135
Richard Purdie50a5de42005-09-13 01:25:30 -0700136struct corgissp_machinfo corgi_ssp_machinfo = {
137 .port = 1,
138 .cs_lcdcon = CORGI_GPIO_LCDCON_CS,
139 .cs_ads7846 = CORGI_GPIO_ADS7846_CS,
140 .cs_max1111 = CORGI_GPIO_MAX1111_CS,
141 .clk_lcdcon = 76,
142 .clk_ads7846 = 2,
143 .clk_max1111 = 8,
144};
145
Linus Torvalds1da177e2005-04-16 15:20:36 -0700146
147/*
Richard Purdieca4d6cf2008-01-02 01:09:54 +0100148 * LCD/Framebuffer
149 */
150static void w100_lcdtg_suspend(struct w100fb_par *par)
151{
152 corgi_lcdtg_suspend();
153}
154
155static void w100_lcdtg_init(struct w100fb_par *par)
156{
157 corgi_lcdtg_hw_init(par->xres);
158}
159
160
161static struct w100_tg_info corgi_lcdtg_info = {
162 .change = w100_lcdtg_init,
163 .suspend = w100_lcdtg_suspend,
164 .resume = w100_lcdtg_init,
165};
166
167static struct w100_mem_info corgi_fb_mem = {
168 .ext_cntl = 0x00040003,
169 .sdram_mode_reg = 0x00650021,
170 .ext_timing_cntl = 0x10002a4a,
171 .io_cntl = 0x7ff87012,
172 .size = 0x1fffff,
173};
174
175static struct w100_gen_regs corgi_fb_regs = {
176 .lcd_format = 0x00000003,
177 .lcdd_cntl1 = 0x01CC0000,
178 .lcdd_cntl2 = 0x0003FFFF,
179 .genlcd_cntl1 = 0x00FFFF0D,
180 .genlcd_cntl2 = 0x003F3003,
181 .genlcd_cntl3 = 0x000102aa,
182};
183
184static struct w100_gpio_regs corgi_fb_gpio = {
185 .init_data1 = 0x000000bf,
186 .init_data2 = 0x00000000,
187 .gpio_dir1 = 0x00000000,
188 .gpio_oe1 = 0x03c0feff,
189 .gpio_dir2 = 0x00000000,
190 .gpio_oe2 = 0x00000000,
191};
192
193static struct w100_mode corgi_fb_modes[] = {
194{
195 .xres = 480,
196 .yres = 640,
197 .left_margin = 0x56,
198 .right_margin = 0x55,
199 .upper_margin = 0x03,
200 .lower_margin = 0x00,
201 .crtc_ss = 0x82360056,
202 .crtc_ls = 0xA0280000,
203 .crtc_gs = 0x80280028,
204 .crtc_vpos_gs = 0x02830002,
205 .crtc_rev = 0x00400008,
206 .crtc_dclk = 0xA0000000,
207 .crtc_gclk = 0x8015010F,
208 .crtc_goe = 0x80100110,
209 .crtc_ps1_active = 0x41060010,
210 .pll_freq = 75,
211 .fast_pll_freq = 100,
212 .sysclk_src = CLK_SRC_PLL,
213 .sysclk_divider = 0,
214 .pixclk_src = CLK_SRC_PLL,
215 .pixclk_divider = 2,
216 .pixclk_divider_rotated = 6,
217},{
218 .xres = 240,
219 .yres = 320,
220 .left_margin = 0x27,
221 .right_margin = 0x2e,
222 .upper_margin = 0x01,
223 .lower_margin = 0x00,
224 .crtc_ss = 0x81170027,
225 .crtc_ls = 0xA0140000,
226 .crtc_gs = 0xC0140014,
227 .crtc_vpos_gs = 0x00010141,
228 .crtc_rev = 0x00400008,
229 .crtc_dclk = 0xA0000000,
230 .crtc_gclk = 0x8015010F,
231 .crtc_goe = 0x80100110,
232 .crtc_ps1_active = 0x41060010,
233 .pll_freq = 0,
234 .fast_pll_freq = 0,
235 .sysclk_src = CLK_SRC_XTAL,
236 .sysclk_divider = 0,
237 .pixclk_src = CLK_SRC_XTAL,
238 .pixclk_divider = 1,
239 .pixclk_divider_rotated = 1,
240},
241
242};
243
244static struct w100fb_mach_info corgi_fb_info = {
245 .tg = &corgi_lcdtg_info,
246 .init_mode = INIT_MODE_ROTATED,
247 .mem = &corgi_fb_mem,
248 .regs = &corgi_fb_regs,
249 .modelist = &corgi_fb_modes[0],
250 .num_modes = 2,
251 .gpio = &corgi_fb_gpio,
252 .xtal_freq = 12500000,
253 .xtal_dbl = 0,
254};
255
256static struct resource corgi_fb_resources[] = {
257 [0] = {
258 .start = 0x08000000,
259 .end = 0x08ffffff,
260 .flags = IORESOURCE_MEM,
261 },
262};
263
264static struct platform_device corgifb_device = {
265 .name = "w100fb",
266 .id = -1,
267 .num_resources = ARRAY_SIZE(corgi_fb_resources),
268 .resource = corgi_fb_resources,
269 .dev = {
270 .platform_data = &corgi_fb_info,
271 .parent = &corgissp_device.dev,
272 },
273
274};
275
276
277/*
Linus Torvalds1da177e2005-04-16 15:20:36 -0700278 * Corgi Backlight Device
279 */
Richard Purdiec3f8f652007-09-03 00:27:00 +0100280static void corgi_bl_kick_battery(void)
281{
282 void (*kick_batt)(void);
283
284 kick_batt = symbol_get(sharpsl_battery_kick);
285 if (kick_batt) {
286 kick_batt();
287 symbol_put(sharpsl_battery_kick);
288 }
289}
290
Richard Purdieca4d6cf2008-01-02 01:09:54 +0100291static void corgi_bl_set_intensity(int intensity)
292{
293 if (intensity > 0x10)
294 intensity += 0x10;
295
296 /* Bits 0-4 are accessed via the SSP interface */
297 corgi_ssp_blduty_set(intensity & 0x1f);
298
299 /* Bit 5 is via SCOOP */
300 if (intensity & 0x0020)
301 set_scoop_gpio(&corgiscoop_device.dev, CORGI_SCP_BACKLIGHT_CONT);
302 else
303 reset_scoop_gpio(&corgiscoop_device.dev, CORGI_SCP_BACKLIGHT_CONT);
304}
305
Richard Purdiec3f8f652007-09-03 00:27:00 +0100306static struct generic_bl_info corgi_bl_machinfo = {
307 .name = "corgi-bl",
Richard Purdie1351e6e2005-09-13 01:25:33 -0700308 .max_intensity = 0x2f,
Richard Purdie2c0f5fb2006-03-31 02:31:51 -0800309 .default_intensity = 0x1f,
310 .limit_mask = 0x0b,
Richard Purdie1351e6e2005-09-13 01:25:33 -0700311 .set_bl_intensity = corgi_bl_set_intensity,
Richard Purdiec3f8f652007-09-03 00:27:00 +0100312 .kick_battery = corgi_bl_kick_battery,
Richard Purdie1351e6e2005-09-13 01:25:33 -0700313};
314
Linus Torvalds1da177e2005-04-16 15:20:36 -0700315static struct platform_device corgibl_device = {
Richard Purdiec3f8f652007-09-03 00:27:00 +0100316 .name = "generic-bl",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700317 .dev = {
318 .parent = &corgifb_device.dev,
Richard Purdie1351e6e2005-09-13 01:25:33 -0700319 .platform_data = &corgi_bl_machinfo,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700320 },
321 .id = -1,
322};
323
324
325/*
Richard Purdief7ceff32005-09-06 15:19:07 -0700326 * Corgi Keyboard Device
327 */
328static struct platform_device corgikbd_device = {
329 .name = "corgi-keyboard",
330 .id = -1,
331};
332
333
334/*
Richard Purdie31791082006-03-31 02:31:09 -0800335 * Corgi LEDs
336 */
337static struct platform_device corgiled_device = {
338 .name = "corgi-led",
339 .id = -1,
340};
341
Richard Purdieca4d6cf2008-01-02 01:09:54 +0100342
Richard Purdie31791082006-03-31 02:31:09 -0800343/*
Richard Purdief7ceff32005-09-06 15:19:07 -0700344 * Corgi Touch Screen Device
345 */
Richard Purdieca4d6cf2008-01-02 01:09:54 +0100346static unsigned long (*get_hsync_invperiod)(struct device *dev);
347
348static void inline sharpsl_wait_sync(int gpio)
349{
350 while((GPLR(gpio) & GPIO_bit(gpio)) == 0);
351 while((GPLR(gpio) & GPIO_bit(gpio)) != 0);
352}
353
354static unsigned long corgi_get_hsync_invperiod(void)
355{
356 if (!get_hsync_invperiod)
357 get_hsync_invperiod = symbol_get(w100fb_get_hsynclen);
358 if (!get_hsync_invperiod)
359 return 0;
360
361 return get_hsync_invperiod(&corgifb_device.dev);
362}
363
364static void corgi_put_hsync(void)
365{
366 if (get_hsync_invperiod)
367 symbol_put(w100fb_get_hsynclen);
368 get_hsync_invperiod = NULL;
369}
370
371static void corgi_wait_hsync(void)
372{
373 sharpsl_wait_sync(CORGI_GPIO_HSYNC);
374}
375
Richard Purdie513b6e12005-09-13 01:25:33 -0700376static struct resource corgits_resources[] = {
377 [0] = {
378 .start = CORGI_IRQ_GPIO_TP_INT,
379 .end = CORGI_IRQ_GPIO_TP_INT,
380 .flags = IORESOURCE_IRQ,
381 },
382};
383
384static struct corgits_machinfo corgi_ts_machinfo = {
Richard Purdieca4d6cf2008-01-02 01:09:54 +0100385 .get_hsync_invperiod = corgi_get_hsync_invperiod,
386 .put_hsync = corgi_put_hsync,
387 .wait_hsync = corgi_wait_hsync,
Richard Purdie513b6e12005-09-13 01:25:33 -0700388};
389
Richard Purdief7ceff32005-09-06 15:19:07 -0700390static struct platform_device corgits_device = {
391 .name = "corgi-ts",
392 .dev = {
393 .parent = &corgissp_device.dev,
Richard Purdie513b6e12005-09-13 01:25:33 -0700394 .platform_data = &corgi_ts_machinfo,
Richard Purdief7ceff32005-09-06 15:19:07 -0700395 },
396 .id = -1,
Richard Purdie513b6e12005-09-13 01:25:33 -0700397 .num_resources = ARRAY_SIZE(corgits_resources),
398 .resource = corgits_resources,
Richard Purdief7ceff32005-09-06 15:19:07 -0700399};
400
401
402/*
Linus Torvalds1da177e2005-04-16 15:20:36 -0700403 * MMC/SD Device
404 *
Richard Purdieaa6c2e72005-09-09 18:54:03 +0100405 * The card detect interrupt isn't debounced so we delay it by 250ms
Linus Torvalds1da177e2005-04-16 15:20:36 -0700406 * to give the card a chance to fully insert/eject.
407 */
Richard Purdieaa6c2e72005-09-09 18:54:03 +0100408static struct pxamci_platform_data corgi_mci_platform_data;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700409
David Howells40220c12006-10-09 12:19:47 +0100410static int corgi_mci_init(struct device *dev, irq_handler_t corgi_detect_int, void *data)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700411{
412 int err;
413
414 /* setup GPIO for PXA25x MMC controller */
415 pxa_gpio_mode(GPIO6_MMCCLK_MD);
416 pxa_gpio_mode(GPIO8_MMCCS0_MD);
417 pxa_gpio_mode(CORGI_GPIO_nSD_DETECT | GPIO_IN);
418 pxa_gpio_mode(CORGI_GPIO_SD_PWR | GPIO_OUT);
419
Richard Purdieaa6c2e72005-09-09 18:54:03 +0100420 corgi_mci_platform_data.detect_delay = msecs_to_jiffies(250);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700421
Russell King9ded96f2006-01-08 01:02:07 -0800422 err = request_irq(CORGI_IRQ_GPIO_nSD_DETECT, corgi_detect_int,
Thomas Gleixner52e405e2006-07-03 02:20:05 +0200423 IRQF_DISABLED | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
Russell King9ded96f2006-01-08 01:02:07 -0800424 "MMC card detect", data);
Russell King2687bd32008-01-23 14:05:58 +0000425 if (err)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700426 printk(KERN_ERR "corgi_mci_init: MMC/SD: can't request MMC card detect IRQ\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700427
Russell King2687bd32008-01-23 14:05:58 +0000428 return err;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700429}
430
431static void corgi_mci_setpower(struct device *dev, unsigned int vdd)
432{
433 struct pxamci_platform_data* p_d = dev->platform_data;
434
Richard Purdiefdce05b2005-09-15 14:53:21 +0100435 if (( 1 << vdd) & p_d->ocr_mask)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700436 GPSR1 = GPIO_bit(CORGI_GPIO_SD_PWR);
Richard Purdiefdce05b2005-09-15 14:53:21 +0100437 else
Linus Torvalds1da177e2005-04-16 15:20:36 -0700438 GPCR1 = GPIO_bit(CORGI_GPIO_SD_PWR);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700439}
440
Richard Purdie3870ee82005-09-06 15:19:07 -0700441static int corgi_mci_get_ro(struct device *dev)
442{
443 return GPLR(CORGI_GPIO_nSD_WP) & GPIO_bit(CORGI_GPIO_nSD_WP);
444}
445
Linus Torvalds1da177e2005-04-16 15:20:36 -0700446static void corgi_mci_exit(struct device *dev, void *data)
447{
448 free_irq(CORGI_IRQ_GPIO_nSD_DETECT, data);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700449}
450
451static struct pxamci_platform_data corgi_mci_platform_data = {
452 .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34,
453 .init = corgi_mci_init,
Richard Purdie3870ee82005-09-06 15:19:07 -0700454 .get_ro = corgi_mci_get_ro,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700455 .setpower = corgi_mci_setpower,
456 .exit = corgi_mci_exit,
457};
458
459
Richard Purdieca1140b2005-10-30 14:38:53 +0000460/*
461 * Irda
462 */
463static void corgi_irda_transceiver_mode(struct device *dev, int mode)
464{
465 if (mode & IR_OFF)
466 GPSR(CORGI_GPIO_IR_ON) = GPIO_bit(CORGI_GPIO_IR_ON);
467 else
468 GPCR(CORGI_GPIO_IR_ON) = GPIO_bit(CORGI_GPIO_IR_ON);
Dmitry Baryshkov0fc3ff32008-07-02 13:54:46 +0100469 pxa2xx_transceiver_mode(dev, mode);
Richard Purdieca1140b2005-10-30 14:38:53 +0000470}
471
472static struct pxaficp_platform_data corgi_ficp_platform_data = {
473 .transceiver_cap = IR_SIRMODE | IR_OFF,
474 .transceiver_mode = corgi_irda_transceiver_mode,
475};
476
Richard Purdief7ceff32005-09-06 15:19:07 -0700477
Linus Torvalds1da177e2005-04-16 15:20:36 -0700478/*
479 * USB Device Controller
480 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700481static struct pxa2xx_udc_mach_info udc_info __initdata = {
482 /* no connect GPIO; corgi can't tell connection status */
David Brownellb2bbb202006-06-29 12:25:39 -0700483 .gpio_pullup = CORGI_GPIO_USB_PULLUP,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700484};
485
486
487static struct platform_device *devices[] __initdata = {
488 &corgiscoop_device,
489 &corgissp_device,
490 &corgifb_device,
Richard Purdief7ceff32005-09-06 15:19:07 -0700491 &corgikbd_device,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700492 &corgibl_device,
Richard Purdief7ceff32005-09-06 15:19:07 -0700493 &corgits_device,
Richard Purdie31791082006-03-31 02:31:09 -0800494 &corgiled_device,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700495};
496
Richard Purdie74617fb2006-06-19 19:57:12 +0100497static void corgi_poweroff(void)
498{
Richard Purdie74617fb2006-06-19 19:57:12 +0100499 if (!machine_is_corgi())
500 /* Green LED off tells the bootloader to halt */
501 reset_scoop_gpio(&corgiscoop_device.dev, CORGI_SCP_LED_GREEN);
502 arm_machine_restart('h');
503}
504
505static void corgi_restart(char mode)
506{
Richard Purdie74617fb2006-06-19 19:57:12 +0100507 if (!machine_is_corgi())
508 /* Green LED on tells the bootloader to reboot */
509 set_scoop_gpio(&corgiscoop_device.dev, CORGI_SCP_LED_GREEN);
510 arm_machine_restart('h');
511}
512
Linus Torvalds1da177e2005-04-16 15:20:36 -0700513static void __init corgi_init(void)
514{
Richard Purdie74617fb2006-06-19 19:57:12 +0100515 pm_power_off = corgi_poweroff;
516 arm_pm_restart = corgi_restart;
517
Richard Purdiefdce05b2005-09-15 14:53:21 +0100518 /* setup sleep mode values */
519 PWER = 0x00000002;
520 PFER = 0x00000000;
521 PRER = 0x00000002;
522 PGSR0 = 0x0158C000;
523 PGSR1 = 0x00FF0080;
524 PGSR2 = 0x0001C004;
525 /* Stop 3.6MHz and drive HIGH to PCMCIA and CS */
526 PCFR |= PCFR_OPDE;
527
Richard Purdie50a5de42005-09-13 01:25:30 -0700528 corgi_ssp_set_machinfo(&corgi_ssp_machinfo);
529
Richard Purdieca1140b2005-10-30 14:38:53 +0000530 pxa_gpio_mode(CORGI_GPIO_IR_ON | GPIO_OUT);
Richard Purdie513b6e12005-09-13 01:25:33 -0700531 pxa_gpio_mode(CORGI_GPIO_HSYNC | GPIO_IN);
Richard Purdieca1140b2005-10-30 14:38:53 +0000532
Linus Torvalds1da177e2005-04-16 15:20:36 -0700533 pxa_set_udc_info(&udc_info);
534 pxa_set_mci_info(&corgi_mci_platform_data);
Richard Purdieca1140b2005-10-30 14:38:53 +0000535 pxa_set_ficp_info(&corgi_ficp_platform_data);
Mark Brownf8787fd2008-08-26 13:30:03 +0100536 pxa_set_i2c_info(NULL);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700537
Richard Purdiea63ae442005-11-08 19:15:43 +0000538 platform_scoop_config = &corgi_pcmcia_config;
Richard Purdie0ce76252005-09-05 20:49:54 +0100539
Linus Torvalds1da177e2005-04-16 15:20:36 -0700540 platform_add_devices(devices, ARRAY_SIZE(devices));
541}
542
543static void __init fixup_corgi(struct machine_desc *desc,
544 struct tag *tags, char **cmdline, struct meminfo *mi)
545{
546 sharpsl_save_param();
547 mi->nr_banks=1;
548 mi->bank[0].start = 0xa0000000;
549 mi->bank[0].node = 0;
550 if (machine_is_corgi())
551 mi->bank[0].size = (32*1024*1024);
552 else
553 mi->bank[0].size = (64*1024*1024);
554}
555
Linus Torvalds1da177e2005-04-16 15:20:36 -0700556#ifdef CONFIG_MACH_CORGI
557MACHINE_START(CORGI, "SHARP Corgi")
Russell Kinge9dea0c2005-07-03 17:38:58 +0100558 .phys_io = 0x40000000,
Russell King68070bd2005-07-04 10:44:34 +0100559 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
Russell Kinge9dea0c2005-07-03 17:38:58 +0100560 .fixup = fixup_corgi,
Richard Purdiefdce05b2005-09-15 14:53:21 +0100561 .map_io = pxa_map_io,
Eric Miaocd491042007-06-22 04:14:09 +0100562 .init_irq = pxa25x_init_irq,
Russell Kinge9dea0c2005-07-03 17:38:58 +0100563 .init_machine = corgi_init,
564 .timer = &pxa_timer,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700565MACHINE_END
566#endif
567
568#ifdef CONFIG_MACH_SHEPHERD
569MACHINE_START(SHEPHERD, "SHARP Shepherd")
Russell Kinge9dea0c2005-07-03 17:38:58 +0100570 .phys_io = 0x40000000,
Russell King68070bd2005-07-04 10:44:34 +0100571 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
Russell Kinge9dea0c2005-07-03 17:38:58 +0100572 .fixup = fixup_corgi,
Richard Purdiefdce05b2005-09-15 14:53:21 +0100573 .map_io = pxa_map_io,
Eric Miaocd491042007-06-22 04:14:09 +0100574 .init_irq = pxa25x_init_irq,
Russell Kinge9dea0c2005-07-03 17:38:58 +0100575 .init_machine = corgi_init,
576 .timer = &pxa_timer,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700577MACHINE_END
578#endif
579
580#ifdef CONFIG_MACH_HUSKY
581MACHINE_START(HUSKY, "SHARP Husky")
Russell Kinge9dea0c2005-07-03 17:38:58 +0100582 .phys_io = 0x40000000,
Russell King68070bd2005-07-04 10:44:34 +0100583 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
Russell Kinge9dea0c2005-07-03 17:38:58 +0100584 .fixup = fixup_corgi,
Richard Purdiefdce05b2005-09-15 14:53:21 +0100585 .map_io = pxa_map_io,
Eric Miaocd491042007-06-22 04:14:09 +0100586 .init_irq = pxa25x_init_irq,
Russell Kinge9dea0c2005-07-03 17:38:58 +0100587 .init_machine = corgi_init,
588 .timer = &pxa_timer,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700589MACHINE_END
590#endif
591