1*4882a593Smuzhiyun /*
2*4882a593Smuzhiyun * linux/arch/arm/mach-sa1100/collie.c
3*4882a593Smuzhiyun *
4*4882a593Smuzhiyun * May be copied or modified under the terms of the GNU General Public
5*4882a593Smuzhiyun * License. See linux/COPYING for more information.
6*4882a593Smuzhiyun *
7*4882a593Smuzhiyun * This file contains all Collie-specific tweaks.
8*4882a593Smuzhiyun *
9*4882a593Smuzhiyun * This program is free software; you can redistribute it and/or modify
10*4882a593Smuzhiyun * it under the terms of the GNU General Public License version 2 as
11*4882a593Smuzhiyun * published by the Free Software Foundation.
12*4882a593Smuzhiyun *
13*4882a593Smuzhiyun * ChangeLog:
14*4882a593Smuzhiyun * 2006 Pavel Machek <pavel@ucw.cz>
15*4882a593Smuzhiyun * 03-06-2004 John Lenz <lenz@cs.wisc.edu>
16*4882a593Smuzhiyun * 06-04-2002 Chris Larson <kergoth@digitalnemesis.net>
17*4882a593Smuzhiyun * 04-16-2001 Lineo Japan,Inc. ...
18*4882a593Smuzhiyun */
19*4882a593Smuzhiyun
20*4882a593Smuzhiyun #include <linux/init.h>
21*4882a593Smuzhiyun #include <linux/kernel.h>
22*4882a593Smuzhiyun #include <linux/tty.h>
23*4882a593Smuzhiyun #include <linux/delay.h>
24*4882a593Smuzhiyun #include <linux/platform_data/sa11x0-serial.h>
25*4882a593Smuzhiyun #include <linux/platform_device.h>
26*4882a593Smuzhiyun #include <linux/mfd/ucb1x00.h>
27*4882a593Smuzhiyun #include <linux/mtd/mtd.h>
28*4882a593Smuzhiyun #include <linux/mtd/partitions.h>
29*4882a593Smuzhiyun #include <linux/timer.h>
30*4882a593Smuzhiyun #include <linux/gpio_keys.h>
31*4882a593Smuzhiyun #include <linux/input.h>
32*4882a593Smuzhiyun #include <linux/gpio.h>
33*4882a593Smuzhiyun #include <linux/gpio/machine.h>
34*4882a593Smuzhiyun #include <linux/power/gpio-charger.h>
35*4882a593Smuzhiyun
36*4882a593Smuzhiyun #include <video/sa1100fb.h>
37*4882a593Smuzhiyun
38*4882a593Smuzhiyun #include <mach/hardware.h>
39*4882a593Smuzhiyun #include <asm/mach-types.h>
40*4882a593Smuzhiyun #include <asm/page.h>
41*4882a593Smuzhiyun #include <asm/setup.h>
42*4882a593Smuzhiyun #include <mach/collie.h>
43*4882a593Smuzhiyun
44*4882a593Smuzhiyun #include <asm/mach/arch.h>
45*4882a593Smuzhiyun #include <asm/mach/flash.h>
46*4882a593Smuzhiyun #include <asm/mach/map.h>
47*4882a593Smuzhiyun #include <linux/platform_data/irda-sa11x0.h>
48*4882a593Smuzhiyun
49*4882a593Smuzhiyun #include <asm/hardware/scoop.h>
50*4882a593Smuzhiyun #include <asm/mach/sharpsl_param.h>
51*4882a593Smuzhiyun #include <asm/hardware/locomo.h>
52*4882a593Smuzhiyun #include <linux/platform_data/mfd-mcp-sa11x0.h>
53*4882a593Smuzhiyun #include <mach/irqs.h>
54*4882a593Smuzhiyun
55*4882a593Smuzhiyun #include "generic.h"
56*4882a593Smuzhiyun
57*4882a593Smuzhiyun static struct resource collie_scoop_resources[] = {
58*4882a593Smuzhiyun [0] = DEFINE_RES_MEM(0x40800000, SZ_4K),
59*4882a593Smuzhiyun };
60*4882a593Smuzhiyun
61*4882a593Smuzhiyun static struct scoop_config collie_scoop_setup = {
62*4882a593Smuzhiyun .io_dir = COLLIE_SCOOP_IO_DIR,
63*4882a593Smuzhiyun .io_out = COLLIE_SCOOP_IO_OUT,
64*4882a593Smuzhiyun .gpio_base = COLLIE_SCOOP_GPIO_BASE,
65*4882a593Smuzhiyun };
66*4882a593Smuzhiyun
67*4882a593Smuzhiyun struct platform_device colliescoop_device = {
68*4882a593Smuzhiyun .name = "sharp-scoop",
69*4882a593Smuzhiyun .id = -1,
70*4882a593Smuzhiyun .dev = {
71*4882a593Smuzhiyun .platform_data = &collie_scoop_setup,
72*4882a593Smuzhiyun },
73*4882a593Smuzhiyun .num_resources = ARRAY_SIZE(collie_scoop_resources),
74*4882a593Smuzhiyun .resource = collie_scoop_resources,
75*4882a593Smuzhiyun };
76*4882a593Smuzhiyun
77*4882a593Smuzhiyun static struct scoop_pcmcia_dev collie_pcmcia_scoop[] = {
78*4882a593Smuzhiyun {
79*4882a593Smuzhiyun .dev = &colliescoop_device.dev,
80*4882a593Smuzhiyun .irq = COLLIE_IRQ_GPIO_CF_IRQ,
81*4882a593Smuzhiyun .cd_irq = COLLIE_IRQ_GPIO_CF_CD,
82*4882a593Smuzhiyun .cd_irq_str = "PCMCIA0 CD",
83*4882a593Smuzhiyun },
84*4882a593Smuzhiyun };
85*4882a593Smuzhiyun
86*4882a593Smuzhiyun static struct scoop_pcmcia_config collie_pcmcia_config = {
87*4882a593Smuzhiyun .devs = &collie_pcmcia_scoop[0],
88*4882a593Smuzhiyun .num_devs = 1,
89*4882a593Smuzhiyun };
90*4882a593Smuzhiyun
91*4882a593Smuzhiyun static struct ucb1x00_plat_data collie_ucb1x00_data = {
92*4882a593Smuzhiyun .gpio_base = COLLIE_TC35143_GPIO_BASE,
93*4882a593Smuzhiyun };
94*4882a593Smuzhiyun
95*4882a593Smuzhiyun static struct mcp_plat_data collie_mcp_data = {
96*4882a593Smuzhiyun .mccr0 = MCCR0_ADM | MCCR0_ExtClk,
97*4882a593Smuzhiyun .sclk_rate = 9216000,
98*4882a593Smuzhiyun .codec_pdata = &collie_ucb1x00_data,
99*4882a593Smuzhiyun };
100*4882a593Smuzhiyun
collie_ir_startup(struct device * dev)101*4882a593Smuzhiyun static int collie_ir_startup(struct device *dev)
102*4882a593Smuzhiyun {
103*4882a593Smuzhiyun int rc = gpio_request(COLLIE_GPIO_IR_ON, "IrDA");
104*4882a593Smuzhiyun if (rc)
105*4882a593Smuzhiyun return rc;
106*4882a593Smuzhiyun rc = gpio_direction_output(COLLIE_GPIO_IR_ON, 1);
107*4882a593Smuzhiyun
108*4882a593Smuzhiyun if (!rc)
109*4882a593Smuzhiyun return 0;
110*4882a593Smuzhiyun
111*4882a593Smuzhiyun gpio_free(COLLIE_GPIO_IR_ON);
112*4882a593Smuzhiyun return rc;
113*4882a593Smuzhiyun }
114*4882a593Smuzhiyun
collie_ir_shutdown(struct device * dev)115*4882a593Smuzhiyun static void collie_ir_shutdown(struct device *dev)
116*4882a593Smuzhiyun {
117*4882a593Smuzhiyun gpio_free(COLLIE_GPIO_IR_ON);
118*4882a593Smuzhiyun }
119*4882a593Smuzhiyun
collie_ir_set_power(struct device * dev,unsigned int state)120*4882a593Smuzhiyun static int collie_ir_set_power(struct device *dev, unsigned int state)
121*4882a593Smuzhiyun {
122*4882a593Smuzhiyun gpio_set_value(COLLIE_GPIO_IR_ON, !state);
123*4882a593Smuzhiyun return 0;
124*4882a593Smuzhiyun }
125*4882a593Smuzhiyun
126*4882a593Smuzhiyun static struct irda_platform_data collie_ir_data = {
127*4882a593Smuzhiyun .startup = collie_ir_startup,
128*4882a593Smuzhiyun .shutdown = collie_ir_shutdown,
129*4882a593Smuzhiyun .set_power = collie_ir_set_power,
130*4882a593Smuzhiyun };
131*4882a593Smuzhiyun
132*4882a593Smuzhiyun /*
133*4882a593Smuzhiyun * Collie AC IN
134*4882a593Smuzhiyun */
135*4882a593Smuzhiyun static struct gpiod_lookup_table collie_power_gpiod_table = {
136*4882a593Smuzhiyun .dev_id = "gpio-charger",
137*4882a593Smuzhiyun .table = {
138*4882a593Smuzhiyun GPIO_LOOKUP("gpio", COLLIE_GPIO_AC_IN,
139*4882a593Smuzhiyun NULL, GPIO_ACTIVE_HIGH),
140*4882a593Smuzhiyun { },
141*4882a593Smuzhiyun },
142*4882a593Smuzhiyun };
143*4882a593Smuzhiyun
144*4882a593Smuzhiyun static char *collie_ac_supplied_to[] = {
145*4882a593Smuzhiyun "main-battery",
146*4882a593Smuzhiyun "backup-battery",
147*4882a593Smuzhiyun };
148*4882a593Smuzhiyun
149*4882a593Smuzhiyun static struct gpio_charger_platform_data collie_power_data = {
150*4882a593Smuzhiyun .name = "charger",
151*4882a593Smuzhiyun .type = POWER_SUPPLY_TYPE_MAINS,
152*4882a593Smuzhiyun .supplied_to = collie_ac_supplied_to,
153*4882a593Smuzhiyun .num_supplicants = ARRAY_SIZE(collie_ac_supplied_to),
154*4882a593Smuzhiyun };
155*4882a593Smuzhiyun
156*4882a593Smuzhiyun static struct platform_device collie_power_device = {
157*4882a593Smuzhiyun .name = "gpio-charger",
158*4882a593Smuzhiyun .id = -1,
159*4882a593Smuzhiyun .dev.platform_data = &collie_power_data,
160*4882a593Smuzhiyun };
161*4882a593Smuzhiyun
162*4882a593Smuzhiyun #ifdef CONFIG_SHARP_LOCOMO
163*4882a593Smuzhiyun /*
164*4882a593Smuzhiyun * low-level UART features.
165*4882a593Smuzhiyun */
166*4882a593Smuzhiyun struct platform_device collie_locomo_device;
167*4882a593Smuzhiyun
collie_uart_set_mctrl(struct uart_port * port,u_int mctrl)168*4882a593Smuzhiyun static void collie_uart_set_mctrl(struct uart_port *port, u_int mctrl)
169*4882a593Smuzhiyun {
170*4882a593Smuzhiyun if (mctrl & TIOCM_RTS)
171*4882a593Smuzhiyun locomo_gpio_write(&collie_locomo_device.dev, LOCOMO_GPIO_RTS, 0);
172*4882a593Smuzhiyun else
173*4882a593Smuzhiyun locomo_gpio_write(&collie_locomo_device.dev, LOCOMO_GPIO_RTS, 1);
174*4882a593Smuzhiyun
175*4882a593Smuzhiyun if (mctrl & TIOCM_DTR)
176*4882a593Smuzhiyun locomo_gpio_write(&collie_locomo_device.dev, LOCOMO_GPIO_DTR, 0);
177*4882a593Smuzhiyun else
178*4882a593Smuzhiyun locomo_gpio_write(&collie_locomo_device.dev, LOCOMO_GPIO_DTR, 1);
179*4882a593Smuzhiyun }
180*4882a593Smuzhiyun
collie_uart_get_mctrl(struct uart_port * port)181*4882a593Smuzhiyun static u_int collie_uart_get_mctrl(struct uart_port *port)
182*4882a593Smuzhiyun {
183*4882a593Smuzhiyun int ret = TIOCM_CD;
184*4882a593Smuzhiyun unsigned int r;
185*4882a593Smuzhiyun
186*4882a593Smuzhiyun r = locomo_gpio_read_output(&collie_locomo_device.dev, LOCOMO_GPIO_CTS & LOCOMO_GPIO_DSR);
187*4882a593Smuzhiyun if (r == -ENODEV)
188*4882a593Smuzhiyun return ret;
189*4882a593Smuzhiyun if (r & LOCOMO_GPIO_CTS)
190*4882a593Smuzhiyun ret |= TIOCM_CTS;
191*4882a593Smuzhiyun if (r & LOCOMO_GPIO_DSR)
192*4882a593Smuzhiyun ret |= TIOCM_DSR;
193*4882a593Smuzhiyun
194*4882a593Smuzhiyun return ret;
195*4882a593Smuzhiyun }
196*4882a593Smuzhiyun
197*4882a593Smuzhiyun static struct sa1100_port_fns collie_port_fns __initdata = {
198*4882a593Smuzhiyun .set_mctrl = collie_uart_set_mctrl,
199*4882a593Smuzhiyun .get_mctrl = collie_uart_get_mctrl,
200*4882a593Smuzhiyun };
201*4882a593Smuzhiyun
collie_uart_probe(struct locomo_dev * dev)202*4882a593Smuzhiyun static int collie_uart_probe(struct locomo_dev *dev)
203*4882a593Smuzhiyun {
204*4882a593Smuzhiyun return 0;
205*4882a593Smuzhiyun }
206*4882a593Smuzhiyun
collie_uart_remove(struct locomo_dev * dev)207*4882a593Smuzhiyun static int collie_uart_remove(struct locomo_dev *dev)
208*4882a593Smuzhiyun {
209*4882a593Smuzhiyun return 0;
210*4882a593Smuzhiyun }
211*4882a593Smuzhiyun
212*4882a593Smuzhiyun static struct locomo_driver collie_uart_driver = {
213*4882a593Smuzhiyun .drv = {
214*4882a593Smuzhiyun .name = "collie_uart",
215*4882a593Smuzhiyun },
216*4882a593Smuzhiyun .devid = LOCOMO_DEVID_UART,
217*4882a593Smuzhiyun .probe = collie_uart_probe,
218*4882a593Smuzhiyun .remove = collie_uart_remove,
219*4882a593Smuzhiyun };
220*4882a593Smuzhiyun
collie_uart_init(void)221*4882a593Smuzhiyun static int __init collie_uart_init(void)
222*4882a593Smuzhiyun {
223*4882a593Smuzhiyun return locomo_driver_register(&collie_uart_driver);
224*4882a593Smuzhiyun }
225*4882a593Smuzhiyun device_initcall(collie_uart_init);
226*4882a593Smuzhiyun
227*4882a593Smuzhiyun #endif
228*4882a593Smuzhiyun
229*4882a593Smuzhiyun
230*4882a593Smuzhiyun static struct resource locomo_resources[] = {
231*4882a593Smuzhiyun [0] = DEFINE_RES_MEM(0x40000000, SZ_8K),
232*4882a593Smuzhiyun [1] = DEFINE_RES_IRQ(IRQ_GPIO25),
233*4882a593Smuzhiyun };
234*4882a593Smuzhiyun
235*4882a593Smuzhiyun static struct locomo_platform_data locomo_info = {
236*4882a593Smuzhiyun .irq_base = IRQ_BOARD_START,
237*4882a593Smuzhiyun };
238*4882a593Smuzhiyun
239*4882a593Smuzhiyun struct platform_device collie_locomo_device = {
240*4882a593Smuzhiyun .name = "locomo",
241*4882a593Smuzhiyun .id = 0,
242*4882a593Smuzhiyun .dev = {
243*4882a593Smuzhiyun .platform_data = &locomo_info,
244*4882a593Smuzhiyun },
245*4882a593Smuzhiyun .num_resources = ARRAY_SIZE(locomo_resources),
246*4882a593Smuzhiyun .resource = locomo_resources,
247*4882a593Smuzhiyun };
248*4882a593Smuzhiyun
249*4882a593Smuzhiyun static struct gpio_keys_button collie_gpio_keys[] = {
250*4882a593Smuzhiyun {
251*4882a593Smuzhiyun .type = EV_PWR,
252*4882a593Smuzhiyun .code = KEY_RESERVED,
253*4882a593Smuzhiyun .gpio = COLLIE_GPIO_ON_KEY,
254*4882a593Smuzhiyun .desc = "On key",
255*4882a593Smuzhiyun .wakeup = 1,
256*4882a593Smuzhiyun .active_low = 1,
257*4882a593Smuzhiyun },
258*4882a593Smuzhiyun {
259*4882a593Smuzhiyun .type = EV_PWR,
260*4882a593Smuzhiyun .code = KEY_WAKEUP,
261*4882a593Smuzhiyun .gpio = COLLIE_GPIO_WAKEUP,
262*4882a593Smuzhiyun .desc = "Sync",
263*4882a593Smuzhiyun .wakeup = 1,
264*4882a593Smuzhiyun .active_low = 1,
265*4882a593Smuzhiyun },
266*4882a593Smuzhiyun };
267*4882a593Smuzhiyun
268*4882a593Smuzhiyun static struct gpio_keys_platform_data collie_gpio_keys_data = {
269*4882a593Smuzhiyun .buttons = collie_gpio_keys,
270*4882a593Smuzhiyun .nbuttons = ARRAY_SIZE(collie_gpio_keys),
271*4882a593Smuzhiyun };
272*4882a593Smuzhiyun
273*4882a593Smuzhiyun static struct platform_device collie_gpio_keys_device = {
274*4882a593Smuzhiyun .name = "gpio-keys",
275*4882a593Smuzhiyun .id = -1,
276*4882a593Smuzhiyun .dev = {
277*4882a593Smuzhiyun .platform_data = &collie_gpio_keys_data,
278*4882a593Smuzhiyun },
279*4882a593Smuzhiyun };
280*4882a593Smuzhiyun
281*4882a593Smuzhiyun static struct platform_device *devices[] __initdata = {
282*4882a593Smuzhiyun &collie_locomo_device,
283*4882a593Smuzhiyun &colliescoop_device,
284*4882a593Smuzhiyun &collie_power_device,
285*4882a593Smuzhiyun &collie_gpio_keys_device,
286*4882a593Smuzhiyun };
287*4882a593Smuzhiyun
288*4882a593Smuzhiyun static struct mtd_partition collie_partitions[] = {
289*4882a593Smuzhiyun {
290*4882a593Smuzhiyun .name = "bootloader",
291*4882a593Smuzhiyun .offset = 0,
292*4882a593Smuzhiyun .size = 0x000C0000,
293*4882a593Smuzhiyun .mask_flags = MTD_WRITEABLE
294*4882a593Smuzhiyun }, {
295*4882a593Smuzhiyun .name = "kernel",
296*4882a593Smuzhiyun .offset = MTDPART_OFS_APPEND,
297*4882a593Smuzhiyun .size = 0x00100000,
298*4882a593Smuzhiyun }, {
299*4882a593Smuzhiyun .name = "rootfs",
300*4882a593Smuzhiyun .offset = MTDPART_OFS_APPEND,
301*4882a593Smuzhiyun .size = 0x00e20000,
302*4882a593Smuzhiyun }, {
303*4882a593Smuzhiyun .name = "bootblock",
304*4882a593Smuzhiyun .offset = MTDPART_OFS_APPEND,
305*4882a593Smuzhiyun .size = 0x00020000,
306*4882a593Smuzhiyun .mask_flags = MTD_WRITEABLE
307*4882a593Smuzhiyun }
308*4882a593Smuzhiyun };
309*4882a593Smuzhiyun
collie_flash_init(void)310*4882a593Smuzhiyun static int collie_flash_init(void)
311*4882a593Smuzhiyun {
312*4882a593Smuzhiyun int rc = gpio_request(COLLIE_GPIO_VPEN, "flash Vpp enable");
313*4882a593Smuzhiyun if (rc)
314*4882a593Smuzhiyun return rc;
315*4882a593Smuzhiyun
316*4882a593Smuzhiyun rc = gpio_direction_output(COLLIE_GPIO_VPEN, 1);
317*4882a593Smuzhiyun if (rc)
318*4882a593Smuzhiyun gpio_free(COLLIE_GPIO_VPEN);
319*4882a593Smuzhiyun
320*4882a593Smuzhiyun return rc;
321*4882a593Smuzhiyun }
322*4882a593Smuzhiyun
collie_set_vpp(int vpp)323*4882a593Smuzhiyun static void collie_set_vpp(int vpp)
324*4882a593Smuzhiyun {
325*4882a593Smuzhiyun gpio_set_value(COLLIE_GPIO_VPEN, vpp);
326*4882a593Smuzhiyun }
327*4882a593Smuzhiyun
collie_flash_exit(void)328*4882a593Smuzhiyun static void collie_flash_exit(void)
329*4882a593Smuzhiyun {
330*4882a593Smuzhiyun gpio_free(COLLIE_GPIO_VPEN);
331*4882a593Smuzhiyun }
332*4882a593Smuzhiyun
333*4882a593Smuzhiyun static struct flash_platform_data collie_flash_data = {
334*4882a593Smuzhiyun .map_name = "cfi_probe",
335*4882a593Smuzhiyun .init = collie_flash_init,
336*4882a593Smuzhiyun .set_vpp = collie_set_vpp,
337*4882a593Smuzhiyun .exit = collie_flash_exit,
338*4882a593Smuzhiyun .parts = collie_partitions,
339*4882a593Smuzhiyun .nr_parts = ARRAY_SIZE(collie_partitions),
340*4882a593Smuzhiyun };
341*4882a593Smuzhiyun
342*4882a593Smuzhiyun static struct resource collie_flash_resources[] = {
343*4882a593Smuzhiyun DEFINE_RES_MEM(SA1100_CS0_PHYS, SZ_32M),
344*4882a593Smuzhiyun };
345*4882a593Smuzhiyun
346*4882a593Smuzhiyun static struct sa1100fb_mach_info collie_lcd_info = {
347*4882a593Smuzhiyun .pixclock = 171521, .bpp = 16,
348*4882a593Smuzhiyun .xres = 320, .yres = 240,
349*4882a593Smuzhiyun
350*4882a593Smuzhiyun .hsync_len = 5, .vsync_len = 1,
351*4882a593Smuzhiyun .left_margin = 11, .upper_margin = 2,
352*4882a593Smuzhiyun .right_margin = 30, .lower_margin = 0,
353*4882a593Smuzhiyun
354*4882a593Smuzhiyun .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
355*4882a593Smuzhiyun
356*4882a593Smuzhiyun .lccr0 = LCCR0_Color | LCCR0_Sngl | LCCR0_Act,
357*4882a593Smuzhiyun .lccr3 = LCCR3_OutEnH | LCCR3_PixRsEdg | LCCR3_ACBsDiv(2),
358*4882a593Smuzhiyun
359*4882a593Smuzhiyun #ifdef CONFIG_BACKLIGHT_LOCOMO
360*4882a593Smuzhiyun .lcd_power = locomolcd_power
361*4882a593Smuzhiyun #endif
362*4882a593Smuzhiyun };
363*4882a593Smuzhiyun
collie_init(void)364*4882a593Smuzhiyun static void __init collie_init(void)
365*4882a593Smuzhiyun {
366*4882a593Smuzhiyun int ret = 0;
367*4882a593Smuzhiyun
368*4882a593Smuzhiyun /* cpu initialize */
369*4882a593Smuzhiyun GAFR = GPIO_SSP_TXD | GPIO_SSP_SCLK | GPIO_SSP_SFRM | GPIO_SSP_CLK |
370*4882a593Smuzhiyun GPIO_MCP_CLK | GPIO_32_768kHz;
371*4882a593Smuzhiyun
372*4882a593Smuzhiyun GPDR = GPIO_LDD8 | GPIO_LDD9 | GPIO_LDD10 | GPIO_LDD11 | GPIO_LDD12 |
373*4882a593Smuzhiyun GPIO_LDD13 | GPIO_LDD14 | GPIO_LDD15 | GPIO_SSP_TXD |
374*4882a593Smuzhiyun GPIO_SSP_SCLK | GPIO_SSP_SFRM | GPIO_SDLC_SCLK |
375*4882a593Smuzhiyun _COLLIE_GPIO_UCB1x00_RESET | _COLLIE_GPIO_nMIC_ON |
376*4882a593Smuzhiyun _COLLIE_GPIO_nREMOCON_ON | GPIO_32_768kHz;
377*4882a593Smuzhiyun
378*4882a593Smuzhiyun PPDR = PPC_LDD0 | PPC_LDD1 | PPC_LDD2 | PPC_LDD3 | PPC_LDD4 | PPC_LDD5 |
379*4882a593Smuzhiyun PPC_LDD6 | PPC_LDD7 | PPC_L_PCLK | PPC_L_LCLK | PPC_L_FCLK | PPC_L_BIAS |
380*4882a593Smuzhiyun PPC_TXD1 | PPC_TXD2 | PPC_TXD3 | PPC_TXD4 | PPC_SCLK | PPC_SFRM;
381*4882a593Smuzhiyun
382*4882a593Smuzhiyun PWER = 0;
383*4882a593Smuzhiyun
384*4882a593Smuzhiyun PGSR = _COLLIE_GPIO_nREMOCON_ON;
385*4882a593Smuzhiyun
386*4882a593Smuzhiyun PSDR = PPC_RXD1 | PPC_RXD2 | PPC_RXD3 | PPC_RXD4;
387*4882a593Smuzhiyun
388*4882a593Smuzhiyun PCFR = PCFR_OPDE;
389*4882a593Smuzhiyun
390*4882a593Smuzhiyun GPSR |= _COLLIE_GPIO_UCB1x00_RESET;
391*4882a593Smuzhiyun
392*4882a593Smuzhiyun sa11x0_ppc_configure_mcp();
393*4882a593Smuzhiyun
394*4882a593Smuzhiyun
395*4882a593Smuzhiyun platform_scoop_config = &collie_pcmcia_config;
396*4882a593Smuzhiyun
397*4882a593Smuzhiyun gpiod_add_lookup_table(&collie_power_gpiod_table);
398*4882a593Smuzhiyun
399*4882a593Smuzhiyun ret = platform_add_devices(devices, ARRAY_SIZE(devices));
400*4882a593Smuzhiyun if (ret) {
401*4882a593Smuzhiyun printk(KERN_WARNING "collie: Unable to register LoCoMo device\n");
402*4882a593Smuzhiyun }
403*4882a593Smuzhiyun
404*4882a593Smuzhiyun sa11x0_register_lcd(&collie_lcd_info);
405*4882a593Smuzhiyun sa11x0_register_mtd(&collie_flash_data, collie_flash_resources,
406*4882a593Smuzhiyun ARRAY_SIZE(collie_flash_resources));
407*4882a593Smuzhiyun sa11x0_register_mcp(&collie_mcp_data);
408*4882a593Smuzhiyun sa11x0_register_irda(&collie_ir_data);
409*4882a593Smuzhiyun
410*4882a593Smuzhiyun sharpsl_save_param();
411*4882a593Smuzhiyun }
412*4882a593Smuzhiyun
413*4882a593Smuzhiyun static struct map_desc collie_io_desc[] __initdata = {
414*4882a593Smuzhiyun { /* 32M main flash (cs0) */
415*4882a593Smuzhiyun .virtual = 0xe8000000,
416*4882a593Smuzhiyun .pfn = __phys_to_pfn(0x00000000),
417*4882a593Smuzhiyun .length = 0x02000000,
418*4882a593Smuzhiyun .type = MT_DEVICE
419*4882a593Smuzhiyun }, { /* 32M boot flash (cs1) */
420*4882a593Smuzhiyun .virtual = 0xea000000,
421*4882a593Smuzhiyun .pfn = __phys_to_pfn(0x08000000),
422*4882a593Smuzhiyun .length = 0x02000000,
423*4882a593Smuzhiyun .type = MT_DEVICE
424*4882a593Smuzhiyun }
425*4882a593Smuzhiyun };
426*4882a593Smuzhiyun
collie_map_io(void)427*4882a593Smuzhiyun static void __init collie_map_io(void)
428*4882a593Smuzhiyun {
429*4882a593Smuzhiyun sa1100_map_io();
430*4882a593Smuzhiyun iotable_init(collie_io_desc, ARRAY_SIZE(collie_io_desc));
431*4882a593Smuzhiyun
432*4882a593Smuzhiyun #ifdef CONFIG_SHARP_LOCOMO
433*4882a593Smuzhiyun sa1100_register_uart_fns(&collie_port_fns);
434*4882a593Smuzhiyun #endif
435*4882a593Smuzhiyun sa1100_register_uart(0, 3);
436*4882a593Smuzhiyun sa1100_register_uart(1, 1);
437*4882a593Smuzhiyun }
438*4882a593Smuzhiyun
439*4882a593Smuzhiyun MACHINE_START(COLLIE, "Sharp-Collie")
440*4882a593Smuzhiyun .map_io = collie_map_io,
441*4882a593Smuzhiyun .nr_irqs = SA1100_NR_IRQS,
442*4882a593Smuzhiyun .init_irq = sa1100_init_irq,
443*4882a593Smuzhiyun .init_time = sa1100_timer_init,
444*4882a593Smuzhiyun .init_machine = collie_init,
445*4882a593Smuzhiyun .init_late = sa11x0_init_late,
446*4882a593Smuzhiyun .restart = sa11x0_restart,
447*4882a593Smuzhiyun MACHINE_END
448