blob: b757dd7566552e6a547eaf1137f1ea3563ed5820 [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>
29#include <asm/hardware.h>
30#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
38#include <asm/arch/pxa-regs.h>
eric miaoa683b142008-03-03 09:44:25 +080039#include <asm/arch/pxa2xx-gpio.h>
Richard Purdieca1140b2005-10-30 14:38:53 +000040#include <asm/arch/irda.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070041#include <asm/arch/mmc.h>
42#include <asm/arch/udc.h>
43#include <asm/arch/corgi.h>
Richard Purdie10362602005-10-10 10:17:45 +010044#include <asm/arch/sharpsl.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070045
46#include <asm/mach/sharpsl_param.h>
47#include <asm/hardware/scoop.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070048
49#include "generic.h"
Russell King46c41e62007-05-15 15:39:36 +010050#include "devices.h"
Richard Purdie50a5de42005-09-13 01:25:30 -070051#include "sharpsl.h"
Linus Torvalds1da177e2005-04-16 15:20:36 -070052
53
54/*
55 * Corgi SCOOP Device
56 */
57static struct resource corgi_scoop_resources[] = {
58 [0] = {
59 .start = 0x10800000,
60 .end = 0x10800fff,
61 .flags = IORESOURCE_MEM,
62 },
63};
64
65static struct scoop_config corgi_scoop_setup = {
66 .io_dir = CORGI_SCOOP_IO_DIR,
67 .io_out = CORGI_SCOOP_IO_OUT,
68};
69
70struct platform_device corgiscoop_device = {
71 .name = "sharp-scoop",
72 .id = -1,
73 .dev = {
74 .platform_data = &corgi_scoop_setup,
75 },
76 .num_resources = ARRAY_SIZE(corgi_scoop_resources),
77 .resource = corgi_scoop_resources,
78};
79
Richard Purdiea63ae442005-11-08 19:15:43 +000080static void corgi_pcmcia_init(void)
81{
82 /* Setup default state of GPIO outputs
83 before we enable them as outputs. */
84 GPSR(GPIO48_nPOE) = GPIO_bit(GPIO48_nPOE) |
85 GPIO_bit(GPIO49_nPWE) | GPIO_bit(GPIO50_nPIOR) |
86 GPIO_bit(GPIO51_nPIOW) | GPIO_bit(GPIO52_nPCE_1) |
87 GPIO_bit(GPIO53_nPCE_2);
88
89 pxa_gpio_mode(GPIO48_nPOE_MD);
90 pxa_gpio_mode(GPIO49_nPWE_MD);
91 pxa_gpio_mode(GPIO50_nPIOR_MD);
92 pxa_gpio_mode(GPIO51_nPIOW_MD);
93 pxa_gpio_mode(GPIO55_nPREG_MD);
94 pxa_gpio_mode(GPIO56_nPWAIT_MD);
95 pxa_gpio_mode(GPIO57_nIOIS16_MD);
96 pxa_gpio_mode(GPIO52_nPCE_1_MD);
97 pxa_gpio_mode(GPIO53_nPCE_2_MD);
98 pxa_gpio_mode(GPIO54_pSKTSEL_MD);
99}
100
101static struct scoop_pcmcia_dev corgi_pcmcia_scoop[] = {
102{
103 .dev = &corgiscoop_device.dev,
104 .irq = CORGI_IRQ_GPIO_CF_IRQ,
105 .cd_irq = CORGI_IRQ_GPIO_CF_CD,
106 .cd_irq_str = "PCMCIA0 CD",
107},
108};
109
110static struct scoop_pcmcia_config corgi_pcmcia_config = {
111 .devs = &corgi_pcmcia_scoop[0],
112 .num_devs = 1,
113 .pcmcia_init = corgi_pcmcia_init,
114};
115
116EXPORT_SYMBOL(corgiscoop_device);
117
Linus Torvalds1da177e2005-04-16 15:20:36 -0700118
119/*
120 * Corgi SSP Device
121 *
122 * Set the parent as the scoop device because a lot of SSP devices
123 * also use scoop functions and this makes the power up/down order
124 * work correctly.
125 */
Richard Purdie41b1bce2005-09-06 15:19:05 -0700126struct platform_device corgissp_device = {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700127 .name = "corgi-ssp",
128 .dev = {
129 .parent = &corgiscoop_device.dev,
130 },
131 .id = -1,
132};
133
Richard Purdie50a5de42005-09-13 01:25:30 -0700134struct corgissp_machinfo corgi_ssp_machinfo = {
135 .port = 1,
136 .cs_lcdcon = CORGI_GPIO_LCDCON_CS,
137 .cs_ads7846 = CORGI_GPIO_ADS7846_CS,
138 .cs_max1111 = CORGI_GPIO_MAX1111_CS,
139 .clk_lcdcon = 76,
140 .clk_ads7846 = 2,
141 .clk_max1111 = 8,
142};
143
Linus Torvalds1da177e2005-04-16 15:20:36 -0700144
145/*
Richard Purdieca4d6cf2008-01-02 01:09:54 +0100146 * LCD/Framebuffer
147 */
148static void w100_lcdtg_suspend(struct w100fb_par *par)
149{
150 corgi_lcdtg_suspend();
151}
152
153static void w100_lcdtg_init(struct w100fb_par *par)
154{
155 corgi_lcdtg_hw_init(par->xres);
156}
157
158
159static struct w100_tg_info corgi_lcdtg_info = {
160 .change = w100_lcdtg_init,
161 .suspend = w100_lcdtg_suspend,
162 .resume = w100_lcdtg_init,
163};
164
165static struct w100_mem_info corgi_fb_mem = {
166 .ext_cntl = 0x00040003,
167 .sdram_mode_reg = 0x00650021,
168 .ext_timing_cntl = 0x10002a4a,
169 .io_cntl = 0x7ff87012,
170 .size = 0x1fffff,
171};
172
173static struct w100_gen_regs corgi_fb_regs = {
174 .lcd_format = 0x00000003,
175 .lcdd_cntl1 = 0x01CC0000,
176 .lcdd_cntl2 = 0x0003FFFF,
177 .genlcd_cntl1 = 0x00FFFF0D,
178 .genlcd_cntl2 = 0x003F3003,
179 .genlcd_cntl3 = 0x000102aa,
180};
181
182static struct w100_gpio_regs corgi_fb_gpio = {
183 .init_data1 = 0x000000bf,
184 .init_data2 = 0x00000000,
185 .gpio_dir1 = 0x00000000,
186 .gpio_oe1 = 0x03c0feff,
187 .gpio_dir2 = 0x00000000,
188 .gpio_oe2 = 0x00000000,
189};
190
191static struct w100_mode corgi_fb_modes[] = {
192{
193 .xres = 480,
194 .yres = 640,
195 .left_margin = 0x56,
196 .right_margin = 0x55,
197 .upper_margin = 0x03,
198 .lower_margin = 0x00,
199 .crtc_ss = 0x82360056,
200 .crtc_ls = 0xA0280000,
201 .crtc_gs = 0x80280028,
202 .crtc_vpos_gs = 0x02830002,
203 .crtc_rev = 0x00400008,
204 .crtc_dclk = 0xA0000000,
205 .crtc_gclk = 0x8015010F,
206 .crtc_goe = 0x80100110,
207 .crtc_ps1_active = 0x41060010,
208 .pll_freq = 75,
209 .fast_pll_freq = 100,
210 .sysclk_src = CLK_SRC_PLL,
211 .sysclk_divider = 0,
212 .pixclk_src = CLK_SRC_PLL,
213 .pixclk_divider = 2,
214 .pixclk_divider_rotated = 6,
215},{
216 .xres = 240,
217 .yres = 320,
218 .left_margin = 0x27,
219 .right_margin = 0x2e,
220 .upper_margin = 0x01,
221 .lower_margin = 0x00,
222 .crtc_ss = 0x81170027,
223 .crtc_ls = 0xA0140000,
224 .crtc_gs = 0xC0140014,
225 .crtc_vpos_gs = 0x00010141,
226 .crtc_rev = 0x00400008,
227 .crtc_dclk = 0xA0000000,
228 .crtc_gclk = 0x8015010F,
229 .crtc_goe = 0x80100110,
230 .crtc_ps1_active = 0x41060010,
231 .pll_freq = 0,
232 .fast_pll_freq = 0,
233 .sysclk_src = CLK_SRC_XTAL,
234 .sysclk_divider = 0,
235 .pixclk_src = CLK_SRC_XTAL,
236 .pixclk_divider = 1,
237 .pixclk_divider_rotated = 1,
238},
239
240};
241
242static struct w100fb_mach_info corgi_fb_info = {
243 .tg = &corgi_lcdtg_info,
244 .init_mode = INIT_MODE_ROTATED,
245 .mem = &corgi_fb_mem,
246 .regs = &corgi_fb_regs,
247 .modelist = &corgi_fb_modes[0],
248 .num_modes = 2,
249 .gpio = &corgi_fb_gpio,
250 .xtal_freq = 12500000,
251 .xtal_dbl = 0,
252};
253
254static struct resource corgi_fb_resources[] = {
255 [0] = {
256 .start = 0x08000000,
257 .end = 0x08ffffff,
258 .flags = IORESOURCE_MEM,
259 },
260};
261
262static struct platform_device corgifb_device = {
263 .name = "w100fb",
264 .id = -1,
265 .num_resources = ARRAY_SIZE(corgi_fb_resources),
266 .resource = corgi_fb_resources,
267 .dev = {
268 .platform_data = &corgi_fb_info,
269 .parent = &corgissp_device.dev,
270 },
271
272};
273
274
275/*
Linus Torvalds1da177e2005-04-16 15:20:36 -0700276 * Corgi Backlight Device
277 */
Richard Purdiec3f8f652007-09-03 00:27:00 +0100278static void corgi_bl_kick_battery(void)
279{
280 void (*kick_batt)(void);
281
282 kick_batt = symbol_get(sharpsl_battery_kick);
283 if (kick_batt) {
284 kick_batt();
285 symbol_put(sharpsl_battery_kick);
286 }
287}
288
Richard Purdieca4d6cf2008-01-02 01:09:54 +0100289static void corgi_bl_set_intensity(int intensity)
290{
291 if (intensity > 0x10)
292 intensity += 0x10;
293
294 /* Bits 0-4 are accessed via the SSP interface */
295 corgi_ssp_blduty_set(intensity & 0x1f);
296
297 /* Bit 5 is via SCOOP */
298 if (intensity & 0x0020)
299 set_scoop_gpio(&corgiscoop_device.dev, CORGI_SCP_BACKLIGHT_CONT);
300 else
301 reset_scoop_gpio(&corgiscoop_device.dev, CORGI_SCP_BACKLIGHT_CONT);
302}
303
Richard Purdiec3f8f652007-09-03 00:27:00 +0100304static struct generic_bl_info corgi_bl_machinfo = {
305 .name = "corgi-bl",
Richard Purdie1351e6e2005-09-13 01:25:33 -0700306 .max_intensity = 0x2f,
Richard Purdie2c0f5fb2006-03-31 02:31:51 -0800307 .default_intensity = 0x1f,
308 .limit_mask = 0x0b,
Richard Purdie1351e6e2005-09-13 01:25:33 -0700309 .set_bl_intensity = corgi_bl_set_intensity,
Richard Purdiec3f8f652007-09-03 00:27:00 +0100310 .kick_battery = corgi_bl_kick_battery,
Richard Purdie1351e6e2005-09-13 01:25:33 -0700311};
312
Linus Torvalds1da177e2005-04-16 15:20:36 -0700313static struct platform_device corgibl_device = {
Richard Purdiec3f8f652007-09-03 00:27:00 +0100314 .name = "generic-bl",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700315 .dev = {
316 .parent = &corgifb_device.dev,
Richard Purdie1351e6e2005-09-13 01:25:33 -0700317 .platform_data = &corgi_bl_machinfo,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700318 },
319 .id = -1,
320};
321
322
323/*
Richard Purdief7ceff32005-09-06 15:19:07 -0700324 * Corgi Keyboard Device
325 */
326static struct platform_device corgikbd_device = {
327 .name = "corgi-keyboard",
328 .id = -1,
329};
330
331
332/*
Richard Purdie31791082006-03-31 02:31:09 -0800333 * Corgi LEDs
334 */
335static struct platform_device corgiled_device = {
336 .name = "corgi-led",
337 .id = -1,
338};
339
Richard Purdieca4d6cf2008-01-02 01:09:54 +0100340
Richard Purdie31791082006-03-31 02:31:09 -0800341/*
Richard Purdief7ceff32005-09-06 15:19:07 -0700342 * Corgi Touch Screen Device
343 */
Richard Purdieca4d6cf2008-01-02 01:09:54 +0100344static unsigned long (*get_hsync_invperiod)(struct device *dev);
345
346static void inline sharpsl_wait_sync(int gpio)
347{
348 while((GPLR(gpio) & GPIO_bit(gpio)) == 0);
349 while((GPLR(gpio) & GPIO_bit(gpio)) != 0);
350}
351
352static unsigned long corgi_get_hsync_invperiod(void)
353{
354 if (!get_hsync_invperiod)
355 get_hsync_invperiod = symbol_get(w100fb_get_hsynclen);
356 if (!get_hsync_invperiod)
357 return 0;
358
359 return get_hsync_invperiod(&corgifb_device.dev);
360}
361
362static void corgi_put_hsync(void)
363{
364 if (get_hsync_invperiod)
365 symbol_put(w100fb_get_hsynclen);
366 get_hsync_invperiod = NULL;
367}
368
369static void corgi_wait_hsync(void)
370{
371 sharpsl_wait_sync(CORGI_GPIO_HSYNC);
372}
373
Richard Purdie513b6e12005-09-13 01:25:33 -0700374static struct resource corgits_resources[] = {
375 [0] = {
376 .start = CORGI_IRQ_GPIO_TP_INT,
377 .end = CORGI_IRQ_GPIO_TP_INT,
378 .flags = IORESOURCE_IRQ,
379 },
380};
381
382static struct corgits_machinfo corgi_ts_machinfo = {
Richard Purdieca4d6cf2008-01-02 01:09:54 +0100383 .get_hsync_invperiod = corgi_get_hsync_invperiod,
384 .put_hsync = corgi_put_hsync,
385 .wait_hsync = corgi_wait_hsync,
Richard Purdie513b6e12005-09-13 01:25:33 -0700386};
387
Richard Purdief7ceff32005-09-06 15:19:07 -0700388static struct platform_device corgits_device = {
389 .name = "corgi-ts",
390 .dev = {
391 .parent = &corgissp_device.dev,
Richard Purdie513b6e12005-09-13 01:25:33 -0700392 .platform_data = &corgi_ts_machinfo,
Richard Purdief7ceff32005-09-06 15:19:07 -0700393 },
394 .id = -1,
Richard Purdie513b6e12005-09-13 01:25:33 -0700395 .num_resources = ARRAY_SIZE(corgits_resources),
396 .resource = corgits_resources,
Richard Purdief7ceff32005-09-06 15:19:07 -0700397};
398
399
400/*
Linus Torvalds1da177e2005-04-16 15:20:36 -0700401 * MMC/SD Device
402 *
Richard Purdieaa6c2e72005-09-09 18:54:03 +0100403 * The card detect interrupt isn't debounced so we delay it by 250ms
Linus Torvalds1da177e2005-04-16 15:20:36 -0700404 * to give the card a chance to fully insert/eject.
405 */
Richard Purdieaa6c2e72005-09-09 18:54:03 +0100406static struct pxamci_platform_data corgi_mci_platform_data;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700407
David Howells40220c12006-10-09 12:19:47 +0100408static int corgi_mci_init(struct device *dev, irq_handler_t corgi_detect_int, void *data)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700409{
410 int err;
411
412 /* setup GPIO for PXA25x MMC controller */
413 pxa_gpio_mode(GPIO6_MMCCLK_MD);
414 pxa_gpio_mode(GPIO8_MMCCS0_MD);
415 pxa_gpio_mode(CORGI_GPIO_nSD_DETECT | GPIO_IN);
416 pxa_gpio_mode(CORGI_GPIO_SD_PWR | GPIO_OUT);
417
Richard Purdieaa6c2e72005-09-09 18:54:03 +0100418 corgi_mci_platform_data.detect_delay = msecs_to_jiffies(250);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700419
Russell King9ded96f2006-01-08 01:02:07 -0800420 err = request_irq(CORGI_IRQ_GPIO_nSD_DETECT, corgi_detect_int,
Thomas Gleixner52e405e2006-07-03 02:20:05 +0200421 IRQF_DISABLED | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
Russell King9ded96f2006-01-08 01:02:07 -0800422 "MMC card detect", data);
Russell King2687bd32008-01-23 14:05:58 +0000423 if (err)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700424 printk(KERN_ERR "corgi_mci_init: MMC/SD: can't request MMC card detect IRQ\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700425
Russell King2687bd32008-01-23 14:05:58 +0000426 return err;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700427}
428
429static void corgi_mci_setpower(struct device *dev, unsigned int vdd)
430{
431 struct pxamci_platform_data* p_d = dev->platform_data;
432
Richard Purdiefdce05b2005-09-15 14:53:21 +0100433 if (( 1 << vdd) & p_d->ocr_mask)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700434 GPSR1 = GPIO_bit(CORGI_GPIO_SD_PWR);
Richard Purdiefdce05b2005-09-15 14:53:21 +0100435 else
Linus Torvalds1da177e2005-04-16 15:20:36 -0700436 GPCR1 = GPIO_bit(CORGI_GPIO_SD_PWR);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700437}
438
Richard Purdie3870ee82005-09-06 15:19:07 -0700439static int corgi_mci_get_ro(struct device *dev)
440{
441 return GPLR(CORGI_GPIO_nSD_WP) & GPIO_bit(CORGI_GPIO_nSD_WP);
442}
443
Linus Torvalds1da177e2005-04-16 15:20:36 -0700444static void corgi_mci_exit(struct device *dev, void *data)
445{
446 free_irq(CORGI_IRQ_GPIO_nSD_DETECT, data);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700447}
448
449static struct pxamci_platform_data corgi_mci_platform_data = {
450 .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34,
451 .init = corgi_mci_init,
Richard Purdie3870ee82005-09-06 15:19:07 -0700452 .get_ro = corgi_mci_get_ro,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700453 .setpower = corgi_mci_setpower,
454 .exit = corgi_mci_exit,
455};
456
457
Richard Purdieca1140b2005-10-30 14:38:53 +0000458/*
459 * Irda
460 */
461static void corgi_irda_transceiver_mode(struct device *dev, int mode)
462{
463 if (mode & IR_OFF)
464 GPSR(CORGI_GPIO_IR_ON) = GPIO_bit(CORGI_GPIO_IR_ON);
465 else
466 GPCR(CORGI_GPIO_IR_ON) = GPIO_bit(CORGI_GPIO_IR_ON);
467}
468
469static struct pxaficp_platform_data corgi_ficp_platform_data = {
470 .transceiver_cap = IR_SIRMODE | IR_OFF,
471 .transceiver_mode = corgi_irda_transceiver_mode,
472};
473
Richard Purdief7ceff32005-09-06 15:19:07 -0700474
Linus Torvalds1da177e2005-04-16 15:20:36 -0700475/*
476 * USB Device Controller
477 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700478static struct pxa2xx_udc_mach_info udc_info __initdata = {
479 /* no connect GPIO; corgi can't tell connection status */
David Brownellb2bbb202006-06-29 12:25:39 -0700480 .gpio_pullup = CORGI_GPIO_USB_PULLUP,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700481};
482
483
484static struct platform_device *devices[] __initdata = {
485 &corgiscoop_device,
486 &corgissp_device,
487 &corgifb_device,
Richard Purdief7ceff32005-09-06 15:19:07 -0700488 &corgikbd_device,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700489 &corgibl_device,
Richard Purdief7ceff32005-09-06 15:19:07 -0700490 &corgits_device,
Richard Purdie31791082006-03-31 02:31:09 -0800491 &corgiled_device,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700492};
493
Richard Purdie74617fb2006-06-19 19:57:12 +0100494static void corgi_poweroff(void)
495{
Richard Purdie74617fb2006-06-19 19:57:12 +0100496 if (!machine_is_corgi())
497 /* Green LED off tells the bootloader to halt */
498 reset_scoop_gpio(&corgiscoop_device.dev, CORGI_SCP_LED_GREEN);
499 arm_machine_restart('h');
500}
501
502static void corgi_restart(char mode)
503{
Richard Purdie74617fb2006-06-19 19:57:12 +0100504 if (!machine_is_corgi())
505 /* Green LED on tells the bootloader to reboot */
506 set_scoop_gpio(&corgiscoop_device.dev, CORGI_SCP_LED_GREEN);
507 arm_machine_restart('h');
508}
509
Linus Torvalds1da177e2005-04-16 15:20:36 -0700510static void __init corgi_init(void)
511{
Richard Purdie74617fb2006-06-19 19:57:12 +0100512 pm_power_off = corgi_poweroff;
513 arm_pm_restart = corgi_restart;
514
Richard Purdiefdce05b2005-09-15 14:53:21 +0100515 /* setup sleep mode values */
516 PWER = 0x00000002;
517 PFER = 0x00000000;
518 PRER = 0x00000002;
519 PGSR0 = 0x0158C000;
520 PGSR1 = 0x00FF0080;
521 PGSR2 = 0x0001C004;
522 /* Stop 3.6MHz and drive HIGH to PCMCIA and CS */
523 PCFR |= PCFR_OPDE;
524
Richard Purdie50a5de42005-09-13 01:25:30 -0700525 corgi_ssp_set_machinfo(&corgi_ssp_machinfo);
526
Richard Purdieca1140b2005-10-30 14:38:53 +0000527 pxa_gpio_mode(CORGI_GPIO_IR_ON | GPIO_OUT);
Richard Purdie513b6e12005-09-13 01:25:33 -0700528 pxa_gpio_mode(CORGI_GPIO_HSYNC | GPIO_IN);
Richard Purdieca1140b2005-10-30 14:38:53 +0000529
Linus Torvalds1da177e2005-04-16 15:20:36 -0700530 pxa_set_udc_info(&udc_info);
531 pxa_set_mci_info(&corgi_mci_platform_data);
Richard Purdieca1140b2005-10-30 14:38:53 +0000532 pxa_set_ficp_info(&corgi_ficp_platform_data);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700533
Richard Purdiea63ae442005-11-08 19:15:43 +0000534 platform_scoop_config = &corgi_pcmcia_config;
Richard Purdie0ce76252005-09-05 20:49:54 +0100535
Linus Torvalds1da177e2005-04-16 15:20:36 -0700536 platform_add_devices(devices, ARRAY_SIZE(devices));
537}
538
539static void __init fixup_corgi(struct machine_desc *desc,
540 struct tag *tags, char **cmdline, struct meminfo *mi)
541{
542 sharpsl_save_param();
543 mi->nr_banks=1;
544 mi->bank[0].start = 0xa0000000;
545 mi->bank[0].node = 0;
546 if (machine_is_corgi())
547 mi->bank[0].size = (32*1024*1024);
548 else
549 mi->bank[0].size = (64*1024*1024);
550}
551
Linus Torvalds1da177e2005-04-16 15:20:36 -0700552#ifdef CONFIG_MACH_CORGI
553MACHINE_START(CORGI, "SHARP Corgi")
Russell Kinge9dea0c2005-07-03 17:38:58 +0100554 .phys_io = 0x40000000,
Russell King68070bd2005-07-04 10:44:34 +0100555 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
Russell Kinge9dea0c2005-07-03 17:38:58 +0100556 .fixup = fixup_corgi,
Richard Purdiefdce05b2005-09-15 14:53:21 +0100557 .map_io = pxa_map_io,
Eric Miaocd491042007-06-22 04:14:09 +0100558 .init_irq = pxa25x_init_irq,
Russell Kinge9dea0c2005-07-03 17:38:58 +0100559 .init_machine = corgi_init,
560 .timer = &pxa_timer,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700561MACHINE_END
562#endif
563
564#ifdef CONFIG_MACH_SHEPHERD
565MACHINE_START(SHEPHERD, "SHARP Shepherd")
Russell Kinge9dea0c2005-07-03 17:38:58 +0100566 .phys_io = 0x40000000,
Russell King68070bd2005-07-04 10:44:34 +0100567 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
Russell Kinge9dea0c2005-07-03 17:38:58 +0100568 .fixup = fixup_corgi,
Richard Purdiefdce05b2005-09-15 14:53:21 +0100569 .map_io = pxa_map_io,
Eric Miaocd491042007-06-22 04:14:09 +0100570 .init_irq = pxa25x_init_irq,
Russell Kinge9dea0c2005-07-03 17:38:58 +0100571 .init_machine = corgi_init,
572 .timer = &pxa_timer,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700573MACHINE_END
574#endif
575
576#ifdef CONFIG_MACH_HUSKY
577MACHINE_START(HUSKY, "SHARP Husky")
Russell Kinge9dea0c2005-07-03 17:38:58 +0100578 .phys_io = 0x40000000,
Russell King68070bd2005-07-04 10:44:34 +0100579 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
Russell Kinge9dea0c2005-07-03 17:38:58 +0100580 .fixup = fixup_corgi,
Richard Purdiefdce05b2005-09-15 14:53:21 +0100581 .map_io = pxa_map_io,
Eric Miaocd491042007-06-22 04:14:09 +0100582 .init_irq = pxa25x_init_irq,
Russell Kinge9dea0c2005-07-03 17:38:58 +0100583 .init_machine = corgi_init,
584 .timer = &pxa_timer,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700585MACHINE_END
586#endif
587