blob: c158a6e3e0aa82a52458044b24c4444e2a5208ac [file] [log] [blame]
Dirk Opfer8459c152005-11-06 14:27:52 +00001/*
2 * Support for Sharp SL-C6000x PDAs
3 * Model: (Tosa)
4 *
5 * Copyright (c) 2005 Dirk Opfer
6 *
7 * Based on code written by Sharp/Lineo for 2.4 kernels
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>
Dirk Opfer067c9042005-11-21 15:17:06 +000017#include <linux/platform_device.h>
Dirk Opfer8459c152005-11-06 14:27:52 +000018#include <linux/major.h>
19#include <linux/fs.h>
20#include <linux/interrupt.h>
Dmitry Baryshkovbf0116e2008-06-14 11:42:02 +010021#include <linux/delay.h>
22#include <linux/fb.h>
Dirk Opfer8459c152005-11-06 14:27:52 +000023#include <linux/mmc/host.h>
Dmitry Baryshkovbf0116e2008-06-14 11:42:02 +010024#include <linux/mfd/tc6393xb.h>
Dmitry Baryshkov5289fec2008-06-27 10:38:44 +010025#include <linux/mfd/tmio.h>
26#include <linux/mtd/nand.h>
27#include <linux/mtd/partitions.h>
Dmitry Baryshkovf34ee792008-11-25 00:57:27 +030028#include <linux/mtd/physmap.h>
Richard Purdie74617fb2006-06-19 19:57:12 +010029#include <linux/pm.h>
Dmitry Baryshkov93e90122008-01-21 01:04:20 -050030#include <linux/gpio_keys.h>
31#include <linux/input.h>
Dmitry Baryshkovd4e7d092008-04-12 20:16:16 +010032#include <linux/gpio.h>
Dmitry Baryshkov53b14ea2008-06-14 11:43:36 +010033#include <linux/pda_power.h>
Dmitry Baryshkov14b7b402008-09-13 21:06:41 +040034#include <linux/spi/spi.h>
Sebastian Andrzej Siewior8348c252010-11-22 17:12:15 -080035#include <linux/spi/pxa2xx_spi.h>
Eric Miaof69a6542010-01-01 15:28:21 +080036#include <linux/input/matrix_keypad.h>
Sebastian Andrzej Siewiorb4593962011-02-23 12:38:16 +010037#include <linux/i2c/pxa-i2c.h>
Dmitry Eremin-Solenikovef8b3cc2011-02-14 15:33:18 +030038#include <linux/usb/gpio_vbus.h>
Robin Holt7b6d8642013-07-08 16:01:40 -070039#include <linux/reboot.h>
Laura Abbott1c2f87c2014-04-13 22:54:58 +010040#include <linux/memblock.h>
Dirk Opfer8459c152005-11-06 14:27:52 +000041
42#include <asm/setup.h>
Dirk Opfer8459c152005-11-06 14:27:52 +000043#include <asm/mach-types.h>
Eric Miao51c62982009-01-02 23:17:22 +080044
45#include <mach/pxa25x.h>
Russell Kingafd2fc02008-08-07 11:05:25 +010046#include <mach/reset.h>
Arnd Bergmann293b2da2012-08-24 15:16:48 +020047#include <linux/platform_data/irda-pxaficp.h>
48#include <linux/platform_data/mmc-pxamci.h>
Russell Kinga09e64f2008-08-05 16:14:15 +010049#include <mach/udc.h>
50#include <mach/tosa_bt.h>
Mark Brown80748fb2009-04-03 12:45:49 +010051#include <mach/audio.h>
Marek Vasutad68bb92010-11-03 16:29:35 +010052#include <mach/smemc.h>
Dirk Opfer8459c152005-11-06 14:27:52 +000053
54#include <asm/mach/arch.h>
Russell Kinga09e64f2008-08-05 16:14:15 +010055#include <mach/tosa.h>
Dirk Opfer8459c152005-11-06 14:27:52 +000056
57#include <asm/hardware/scoop.h>
58#include <asm/mach/sharpsl_param.h>
59
60#include "generic.h"
Dmitry Baryshkov7bdb22c2008-09-10 10:30:37 +010061#include "clock.h"
Russell King46c41e62007-05-15 15:39:36 +010062#include "devices.h"
Dirk Opfer8459c152005-11-06 14:27:52 +000063
Dmitry Baryshkov2cb47342008-04-10 11:00:32 +010064static unsigned long tosa_pin_config[] = {
65 GPIO78_nCS_2, /* Scoop */
66 GPIO80_nCS_4, /* tg6393xb */
67 GPIO33_nCS_5, /* Scoop */
68
69 // GPIO76 CARD_VCC_ON1
70
71 GPIO19_GPIO, /* Reset out */
72 GPIO1_RST | WAKEUP_ON_EDGE_FALL,
73
74 GPIO0_GPIO | WAKEUP_ON_EDGE_FALL, /* WAKE_UP */
75 GPIO2_GPIO | WAKEUP_ON_EDGE_BOTH, /* AC_IN */
76 GPIO3_GPIO | WAKEUP_ON_EDGE_FALL, /* RECORD */
77 GPIO4_GPIO | WAKEUP_ON_EDGE_FALL, /* SYNC */
78 GPIO20_GPIO, /* EAR_IN */
79 GPIO22_GPIO, /* On */
80
81 GPIO5_GPIO, /* USB_IN */
82 GPIO32_GPIO, /* Pen IRQ */
83
84 GPIO7_GPIO, /* Jacket Detect */
85 GPIO14_GPIO, /* BAT0_CRG */
86 GPIO12_GPIO, /* BAT1_CRG */
87 GPIO17_GPIO, /* BAT0_LOW */
88 GPIO84_GPIO, /* BAT1_LOW */
89 GPIO38_GPIO, /* BAT_LOCK */
90
91 GPIO11_3_6MHz,
92 GPIO15_GPIO, /* TC6393XB IRQ */
93 GPIO18_RDY,
94 GPIO27_GPIO, /* LCD Sync */
95
96 /* MMC */
97 GPIO6_MMC_CLK,
98 GPIO8_MMC_CS0,
99 GPIO9_GPIO, /* Detect */
Dmitry Baryshkovc4d5f8d2008-06-09 13:23:50 +0100100 GPIO10_GPIO, /* nSD_INT */
Dmitry Baryshkov2cb47342008-04-10 11:00:32 +0100101
102 /* CF */
103 GPIO13_GPIO, /* CD_IRQ */
104 GPIO21_GPIO, /* Main Slot IRQ */
105 GPIO36_GPIO, /* Jacket Slot IRQ */
106 GPIO48_nPOE,
107 GPIO49_nPWE,
108 GPIO50_nPIOR,
109 GPIO51_nPIOW,
110 GPIO52_nPCE_1,
111 GPIO53_nPCE_2,
112 GPIO54_nPSKTSEL,
113 GPIO55_nPREG,
114 GPIO56_nPWAIT,
115 GPIO57_nIOIS16,
116
117 /* AC97 */
118 GPIO31_AC97_SYNC,
119 GPIO30_AC97_SDATA_OUT,
120 GPIO28_AC97_BITCLK,
121 GPIO29_AC97_SDATA_IN_0,
122 // GPIO79 nAUD_IRQ
123
124 /* FFUART */
125 GPIO34_FFUART_RXD,
126 GPIO35_FFUART_CTS,
127 GPIO37_FFUART_DSR,
128 GPIO39_FFUART_TXD,
129 GPIO40_FFUART_DTR,
130 GPIO41_FFUART_RTS,
131
132 /* BTUART */
133 GPIO42_BTUART_RXD,
134 GPIO43_BTUART_TXD,
135 GPIO44_BTUART_CTS,
136 GPIO45_BTUART_RTS,
137
Dmitry Baryshkov2cb47342008-04-10 11:00:32 +0100138 /* Keybd */
Eric Miaof69a6542010-01-01 15:28:21 +0800139 GPIO58_GPIO | MFP_LPM_DRIVE_LOW, /* Column 0 */
140 GPIO59_GPIO | MFP_LPM_DRIVE_LOW, /* Column 1 */
141 GPIO60_GPIO | MFP_LPM_DRIVE_LOW, /* Column 2 */
142 GPIO61_GPIO | MFP_LPM_DRIVE_LOW, /* Column 3 */
143 GPIO62_GPIO | MFP_LPM_DRIVE_LOW, /* Column 4 */
144 GPIO63_GPIO | MFP_LPM_DRIVE_LOW, /* Column 5 */
145 GPIO64_GPIO | MFP_LPM_DRIVE_LOW, /* Column 6 */
146 GPIO65_GPIO | MFP_LPM_DRIVE_LOW, /* Column 7 */
147 GPIO66_GPIO | MFP_LPM_DRIVE_LOW, /* Column 8 */
148 GPIO67_GPIO | MFP_LPM_DRIVE_LOW, /* Column 9 */
149 GPIO68_GPIO | MFP_LPM_DRIVE_LOW, /* Column 10 */
150 GPIO69_GPIO | MFP_LPM_DRIVE_LOW, /* Row 0 */
151 GPIO70_GPIO | MFP_LPM_DRIVE_LOW, /* Row 1 */
152 GPIO71_GPIO | MFP_LPM_DRIVE_LOW, /* Row 2 */
153 GPIO72_GPIO | MFP_LPM_DRIVE_LOW, /* Row 3 */
154 GPIO73_GPIO | MFP_LPM_DRIVE_LOW, /* Row 4 */
155 GPIO74_GPIO | MFP_LPM_DRIVE_LOW, /* Row 5 */
156 GPIO75_GPIO | MFP_LPM_DRIVE_LOW, /* Row 6 */
Dmitry Baryshkov2cb47342008-04-10 11:00:32 +0100157
158 /* SPI */
159 GPIO81_SSP2_CLK_OUT,
160 GPIO82_SSP2_FRM_OUT,
161 GPIO83_SSP2_TXD,
Dmitry Baryshkov2cb47342008-04-10 11:00:32 +0100162
Dmitry Baryshkov0fc3ff32008-07-02 13:54:46 +0100163 /* IrDA is managed in other way */
164 GPIO46_GPIO,
165 GPIO47_GPIO,
Dmitry Baryshkovb032fcc2008-06-12 11:42:07 +0100166};
167
Dirk Opfer8459c152005-11-06 14:27:52 +0000168/*
169 * SCOOP Device
170 */
171static struct resource tosa_scoop_resources[] = {
172 [0] = {
173 .start = TOSA_CF_PHYS,
174 .end = TOSA_CF_PHYS + 0xfff,
175 .flags = IORESOURCE_MEM,
176 },
177};
178
179static struct scoop_config tosa_scoop_setup = {
180 .io_dir = TOSA_SCOOP_IO_DIR,
Dmitry Baryshkovd4e7d092008-04-12 20:16:16 +0100181 .gpio_base = TOSA_SCOOP_GPIO_BASE,
Dirk Opfer8459c152005-11-06 14:27:52 +0000182};
183
Dmitry Baryshkovba4eb7e2008-04-19 10:42:25 +0100184static struct platform_device tosascoop_device = {
Dirk Opfer8459c152005-11-06 14:27:52 +0000185 .name = "sharp-scoop",
186 .id = 0,
187 .dev = {
188 .platform_data = &tosa_scoop_setup,
189 },
190 .num_resources = ARRAY_SIZE(tosa_scoop_resources),
191 .resource = tosa_scoop_resources,
192};
193
194
195/*
196 * SCOOP Device Jacket
197 */
198static struct resource tosa_scoop_jc_resources[] = {
199 [0] = {
200 .start = TOSA_SCOOP_PHYS + 0x40,
201 .end = TOSA_SCOOP_PHYS + 0xfff,
202 .flags = IORESOURCE_MEM,
203 },
204};
205
206static struct scoop_config tosa_scoop_jc_setup = {
207 .io_dir = TOSA_SCOOP_JC_IO_DIR,
Dmitry Baryshkovd4e7d092008-04-12 20:16:16 +0100208 .gpio_base = TOSA_SCOOP_JC_GPIO_BASE,
Dirk Opfer8459c152005-11-06 14:27:52 +0000209};
210
Dmitry Baryshkovba4eb7e2008-04-19 10:42:25 +0100211static struct platform_device tosascoop_jc_device = {
Dirk Opfer8459c152005-11-06 14:27:52 +0000212 .name = "sharp-scoop",
213 .id = 1,
214 .dev = {
215 .platform_data = &tosa_scoop_jc_setup,
216 .parent = &tosascoop_device.dev,
217 },
218 .num_resources = ARRAY_SIZE(tosa_scoop_jc_resources),
219 .resource = tosa_scoop_jc_resources,
220};
221
Dirk Opfer4c18ad22005-11-08 19:15:50 +0000222/*
223 * PCMCIA
224 */
Dirk Opfer8459c152005-11-06 14:27:52 +0000225static struct scoop_pcmcia_dev tosa_pcmcia_scoop[] = {
226{
227 .dev = &tosascoop_device.dev,
228 .irq = TOSA_IRQ_GPIO_CF_IRQ,
229 .cd_irq = TOSA_IRQ_GPIO_CF_CD,
230 .cd_irq_str = "PCMCIA0 CD",
231},{
232 .dev = &tosascoop_jc_device.dev,
233 .irq = TOSA_IRQ_GPIO_JC_CF_IRQ,
234 .cd_irq = -1,
235},
236};
237
Dirk Opfer4c18ad22005-11-08 19:15:50 +0000238static struct scoop_pcmcia_config tosa_pcmcia_config = {
239 .devs = &tosa_pcmcia_scoop[0],
240 .num_devs = 2,
Dirk Opfer4c18ad22005-11-08 19:15:50 +0000241};
242
Dirk Opfera93876c2005-11-08 19:15:30 +0000243/*
244 * USB Device Controller
245 */
Dmitry Eremin-Solenikovef8b3cc2011-02-14 15:33:18 +0300246static struct gpio_vbus_mach_info tosa_udc_info = {
Dmitry Baryshkovd4e7d092008-04-12 20:16:16 +0100247 .gpio_pullup = TOSA_GPIO_USB_PULLUP,
Dmitry Baryshkov487dc922007-12-21 12:18:01 +0300248 .gpio_vbus = TOSA_GPIO_USB_IN,
249 .gpio_vbus_inverted = 1,
Dirk Opfera93876c2005-11-08 19:15:30 +0000250};
251
Dmitry Eremin-Solenikovef8b3cc2011-02-14 15:33:18 +0300252static struct platform_device tosa_gpio_vbus = {
253 .name = "gpio-vbus",
254 .id = -1,
255 .dev = {
256 .platform_data = &tosa_udc_info,
257 },
258};
259
Dirk Opfera93876c2005-11-08 19:15:30 +0000260/*
261 * MMC/SD Device
262 */
David Howells40220c12006-10-09 12:19:47 +0100263static int tosa_mci_init(struct device *dev, irq_handler_t tosa_detect_int, void *data)
Dirk Opfera93876c2005-11-08 19:15:30 +0000264{
265 int err;
266
Dmitry Baryshkovc4d5f8d2008-06-09 13:23:50 +0100267 err = gpio_request(TOSA_GPIO_nSD_INT, "SD Int");
268 if (err) {
269 printk(KERN_ERR "tosa_mci_init: can't request SD_PWR gpio\n");
270 goto err_gpio_int;
271 }
272 err = gpio_direction_input(TOSA_GPIO_nSD_INT);
273 if (err)
274 goto err_gpio_int_dir;
275
Dmitry Baryshkovd4e7d092008-04-12 20:16:16 +0100276 return 0;
277
Dmitry Baryshkovc4d5f8d2008-06-09 13:23:50 +0100278err_gpio_int_dir:
279 gpio_free(TOSA_GPIO_nSD_INT);
280err_gpio_int:
Russell King2687bd32008-01-23 14:05:58 +0000281 return err;
Dirk Opfera93876c2005-11-08 19:15:30 +0000282}
283
Dirk Opfera93876c2005-11-08 19:15:30 +0000284static void tosa_mci_exit(struct device *dev, void *data)
285{
Dmitry Baryshkovc4d5f8d2008-06-09 13:23:50 +0100286 gpio_free(TOSA_GPIO_nSD_INT);
Dirk Opfera93876c2005-11-08 19:15:30 +0000287}
288
289static struct pxamci_platform_data tosa_mci_platform_data = {
Eric Miaof97cab22010-04-14 07:00:42 +0800290 .detect_delay_ms = 250,
Robert Jarzmik7a648252009-07-06 22:16:42 +0200291 .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34,
292 .init = tosa_mci_init,
293 .exit = tosa_mci_exit,
294 .gpio_card_detect = TOSA_GPIO_nSD_DETECT,
295 .gpio_card_ro = TOSA_GPIO_SD_WP,
296 .gpio_power = TOSA_GPIO_PWR_ON,
Dirk Opfera93876c2005-11-08 19:15:30 +0000297};
298
299/*
300 * Irda
301 */
Dmitry Baryshkovb032fcc2008-06-12 11:42:07 +0100302static void tosa_irda_transceiver_mode(struct device *dev, int mode)
303{
304 if (mode & IR_OFF) {
305 gpio_set_value(TOSA_GPIO_IR_POWERDWN, 0);
Dmitry Baryshkov0fc3ff32008-07-02 13:54:46 +0100306 pxa2xx_transceiver_mode(dev, mode);
Dmitry Baryshkovb032fcc2008-06-12 11:42:07 +0100307 gpio_direction_output(TOSA_GPIO_IRDA_TX, 0);
308 } else {
Dmitry Baryshkov0fc3ff32008-07-02 13:54:46 +0100309 pxa2xx_transceiver_mode(dev, mode);
Dmitry Baryshkovb032fcc2008-06-12 11:42:07 +0100310 gpio_set_value(TOSA_GPIO_IR_POWERDWN, 1);
311 }
312}
313
Dmitry Baryshkovd4e7d092008-04-12 20:16:16 +0100314static int tosa_irda_startup(struct device *dev)
315{
316 int ret;
317
Dmitry Baryshkovb032fcc2008-06-12 11:42:07 +0100318 ret = gpio_request(TOSA_GPIO_IRDA_TX, "IrDA TX");
319 if (ret)
320 goto err_tx;
321 ret = gpio_direction_output(TOSA_GPIO_IRDA_TX, 0);
322 if (ret)
323 goto err_tx_dir;
324
Dmitry Baryshkovd4e7d092008-04-12 20:16:16 +0100325 ret = gpio_request(TOSA_GPIO_IR_POWERDWN, "IrDA powerdown");
326 if (ret)
Dmitry Baryshkovb032fcc2008-06-12 11:42:07 +0100327 goto err_pwr;
Dmitry Baryshkovd4e7d092008-04-12 20:16:16 +0100328
329 ret = gpio_direction_output(TOSA_GPIO_IR_POWERDWN, 0);
330 if (ret)
Dmitry Baryshkovb032fcc2008-06-12 11:42:07 +0100331 goto err_pwr_dir;
Dmitry Baryshkovd4e7d092008-04-12 20:16:16 +0100332
Dmitry Baryshkovb032fcc2008-06-12 11:42:07 +0100333 tosa_irda_transceiver_mode(dev, IR_SIRMODE | IR_OFF);
334
335 return 0;
336
337err_pwr_dir:
338 gpio_free(TOSA_GPIO_IR_POWERDWN);
339err_pwr:
340err_tx_dir:
341 gpio_free(TOSA_GPIO_IRDA_TX);
342err_tx:
Dmitry Baryshkovd4e7d092008-04-12 20:16:16 +0100343 return ret;
Dmitry Baryshkovb032fcc2008-06-12 11:42:07 +0100344}
Dmitry Baryshkovd4e7d092008-04-12 20:16:16 +0100345
346static void tosa_irda_shutdown(struct device *dev)
347{
Dmitry Baryshkovb032fcc2008-06-12 11:42:07 +0100348 tosa_irda_transceiver_mode(dev, IR_SIRMODE | IR_OFF);
Dmitry Baryshkovd4e7d092008-04-12 20:16:16 +0100349 gpio_free(TOSA_GPIO_IR_POWERDWN);
Dmitry Baryshkovb032fcc2008-06-12 11:42:07 +0100350 gpio_free(TOSA_GPIO_IRDA_TX);
Dirk Opfera93876c2005-11-08 19:15:30 +0000351}
352
353static struct pxaficp_platform_data tosa_ficp_platform_data = {
Marek Vasutc4bd0172009-07-17 12:50:43 +0200354 .gpio_pwdown = -1,
355 .transceiver_cap = IR_SIRMODE | IR_OFF,
356 .transceiver_mode = tosa_irda_transceiver_mode,
357 .startup = tosa_irda_startup,
358 .shutdown = tosa_irda_shutdown,
Dirk Opfera93876c2005-11-08 19:15:30 +0000359};
360
361/*
Dmitry Baryshkov53b14ea2008-06-14 11:43:36 +0100362 * Tosa AC IN
363 */
364static int tosa_power_init(struct device *dev)
365{
366 int ret = gpio_request(TOSA_GPIO_AC_IN, "ac in");
367 if (ret)
368 goto err_gpio_req;
369
370 ret = gpio_direction_input(TOSA_GPIO_AC_IN);
371 if (ret)
372 goto err_gpio_in;
373
374 return 0;
375
376err_gpio_in:
377 gpio_free(TOSA_GPIO_AC_IN);
378err_gpio_req:
379 return ret;
380}
381
382static void tosa_power_exit(struct device *dev)
383{
384 gpio_free(TOSA_GPIO_AC_IN);
385}
386
387static int tosa_power_ac_online(void)
388{
389 return gpio_get_value(TOSA_GPIO_AC_IN) == 0;
390}
391
392static char *tosa_ac_supplied_to[] = {
393 "main-battery",
394 "backup-battery",
395 "jacket-battery",
396};
397
398static struct pda_power_pdata tosa_power_data = {
399 .init = tosa_power_init,
400 .is_ac_online = tosa_power_ac_online,
401 .exit = tosa_power_exit,
402 .supplied_to = tosa_ac_supplied_to,
403 .num_supplicants = ARRAY_SIZE(tosa_ac_supplied_to),
404};
405
406static struct resource tosa_power_resource[] = {
407 {
408 .name = "ac",
Haojian Zhuang4929f5a2011-10-10 16:03:51 +0800409 .start = PXA_GPIO_TO_IRQ(TOSA_GPIO_AC_IN),
410 .end = PXA_GPIO_TO_IRQ(TOSA_GPIO_AC_IN),
Dmitry Baryshkov53b14ea2008-06-14 11:43:36 +0100411 .flags = IORESOURCE_IRQ |
412 IORESOURCE_IRQ_HIGHEDGE |
413 IORESOURCE_IRQ_LOWEDGE,
414 },
415};
416
417static struct platform_device tosa_power_device = {
418 .name = "pda-power",
419 .id = -1,
420 .dev.platform_data = &tosa_power_data,
421 .resource = tosa_power_resource,
422 .num_resources = ARRAY_SIZE(tosa_power_resource),
423};
424
425/*
Dirk Opfera93876c2005-11-08 19:15:30 +0000426 * Tosa Keyboard
427 */
Eric Miaof69a6542010-01-01 15:28:21 +0800428static const uint32_t tosakbd_keymap[] = {
Dmitry Eremin-Solenikov506cac12013-11-16 16:47:50 +0400429 KEY(0, 1, KEY_W),
430 KEY(0, 5, KEY_K),
431 KEY(0, 6, KEY_BACKSPACE),
432 KEY(0, 7, KEY_P),
433 KEY(1, 0, KEY_Q),
434 KEY(1, 1, KEY_E),
435 KEY(1, 2, KEY_T),
436 KEY(1, 3, KEY_Y),
437 KEY(1, 5, KEY_O),
438 KEY(1, 6, KEY_I),
439 KEY(1, 7, KEY_COMMA),
440 KEY(2, 0, KEY_A),
441 KEY(2, 1, KEY_D),
442 KEY(2, 2, KEY_G),
443 KEY(2, 3, KEY_U),
444 KEY(2, 5, KEY_L),
445 KEY(2, 6, KEY_ENTER),
446 KEY(2, 7, KEY_DOT),
447 KEY(3, 0, KEY_Z),
448 KEY(3, 1, KEY_C),
449 KEY(3, 2, KEY_V),
450 KEY(3, 3, KEY_J),
451 KEY(3, 4, TOSA_KEY_ADDRESSBOOK),
452 KEY(3, 5, TOSA_KEY_CANCEL),
453 KEY(3, 6, TOSA_KEY_CENTER),
454 KEY(3, 7, TOSA_KEY_OK),
455 KEY(3, 8, KEY_LEFTSHIFT),
456 KEY(4, 0, KEY_S),
457 KEY(4, 1, KEY_R),
458 KEY(4, 2, KEY_B),
459 KEY(4, 3, KEY_N),
460 KEY(4, 4, TOSA_KEY_CALENDAR),
461 KEY(4, 5, TOSA_KEY_HOMEPAGE),
462 KEY(4, 6, KEY_LEFTCTRL),
463 KEY(4, 7, TOSA_KEY_LIGHT),
464 KEY(4, 9, KEY_RIGHTSHIFT),
465 KEY(5, 0, KEY_TAB),
466 KEY(5, 1, KEY_SLASH),
467 KEY(5, 2, KEY_H),
468 KEY(5, 3, KEY_M),
469 KEY(5, 4, TOSA_KEY_MENU),
470 KEY(5, 6, KEY_UP),
471 KEY(5, 10, TOSA_KEY_FN),
472 KEY(6, 0, KEY_X),
473 KEY(6, 1, KEY_F),
474 KEY(6, 2, KEY_SPACE),
475 KEY(6, 3, KEY_APOSTROPHE),
476 KEY(6, 4, TOSA_KEY_MAIL),
477 KEY(6, 5, KEY_LEFT),
478 KEY(6, 6, KEY_DOWN),
479 KEY(6, 7, KEY_RIGHT),
Eric Miaof69a6542010-01-01 15:28:21 +0800480};
481
482static struct matrix_keymap_data tosakbd_keymap_data = {
483 .keymap = tosakbd_keymap,
484 .keymap_size = ARRAY_SIZE(tosakbd_keymap),
485};
486
487static const int tosakbd_col_gpios[] =
488 { 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68 };
489static const int tosakbd_row_gpios[] =
490 { 69, 70, 71, 72, 73, 74, 75 };
491
492static struct matrix_keypad_platform_data tosakbd_pdata = {
493 .keymap_data = &tosakbd_keymap_data,
494 .row_gpios = tosakbd_row_gpios,
495 .col_gpios = tosakbd_col_gpios,
496 .num_row_gpios = ARRAY_SIZE(tosakbd_row_gpios),
497 .num_col_gpios = ARRAY_SIZE(tosakbd_col_gpios),
498 .col_scan_delay_us = 10,
499 .debounce_ms = 10,
500 .wakeup = 1,
501};
502
Dirk Opfera93876c2005-11-08 19:15:30 +0000503static struct platform_device tosakbd_device = {
Eric Miaof69a6542010-01-01 15:28:21 +0800504 .name = "matrix-keypad",
Dirk Opfera93876c2005-11-08 19:15:30 +0000505 .id = -1,
Eric Miaof69a6542010-01-01 15:28:21 +0800506 .dev = {
507 .platform_data = &tosakbd_pdata,
508 },
Dirk Opfera93876c2005-11-08 19:15:30 +0000509};
Dirk Opfer8459c152005-11-06 14:27:52 +0000510
Dmitry Baryshkov93e90122008-01-21 01:04:20 -0500511static struct gpio_keys_button tosa_gpio_keys[] = {
Dmitry Baryshkov0aa97562008-04-12 20:02:50 +0100512 /*
513 * Two following keys are directly tied to "ON" button of tosa. Why?
514 * The first one can be used as a wakeup source, the second can't;
515 * also the first one is OR of ac_powered and on_button.
516 */
517 {
518 .type = EV_PWR,
519 .code = KEY_RESERVED,
520 .gpio = TOSA_GPIO_POWERON,
521 .desc = "Poweron",
522 .wakeup = 1,
523 .active_low = 1,
524 },
Dmitry Baryshkov93e90122008-01-21 01:04:20 -0500525 {
526 .type = EV_PWR,
527 .code = KEY_SUSPEND,
528 .gpio = TOSA_GPIO_ON_KEY,
529 .desc = "On key",
Dmitry Baryshkov0aa97562008-04-12 20:02:50 +0100530 /*
531 * can't be used as wakeup
532 * .wakeup = 1,
533 */
Dmitry Baryshkov93e90122008-01-21 01:04:20 -0500534 .active_low = 1,
535 },
536 {
537 .type = EV_KEY,
538 .code = TOSA_KEY_RECORD,
539 .gpio = TOSA_GPIO_RECORD_BTN,
540 .desc = "Record Button",
541 .wakeup = 1,
542 .active_low = 1,
543 },
544 {
545 .type = EV_KEY,
546 .code = TOSA_KEY_SYNC,
547 .gpio = TOSA_GPIO_SYNC,
548 .desc = "Sync Button",
549 .wakeup = 1,
550 .active_low = 1,
551 },
Dmitry Baryshkovc33de472008-09-11 01:28:51 +0100552 {
553 .type = EV_SW,
554 .code = SW_HEADPHONE_INSERT,
555 .gpio = TOSA_GPIO_EAR_IN,
556 .desc = "HeadPhone insert",
557 .active_low = 1,
558 .debounce_interval = 300,
559 },
Dmitry Baryshkov93e90122008-01-21 01:04:20 -0500560};
561
562static struct gpio_keys_platform_data tosa_gpio_keys_platform_data = {
563 .buttons = tosa_gpio_keys,
564 .nbuttons = ARRAY_SIZE(tosa_gpio_keys),
565};
566
567static struct platform_device tosa_gpio_keys_device = {
568 .name = "gpio-keys",
569 .id = -1,
570 .dev = {
571 .platform_data = &tosa_gpio_keys_platform_data,
572 },
573};
574
Dirk Opfer6d0cf3e2006-03-31 02:31:12 -0800575/*
576 * Tosa LEDs
577 */
Dmitry Baryshkovba4eb7e2008-04-19 10:42:25 +0100578static struct gpio_led tosa_gpio_leds[] = {
Dmitry Baryshkov311c7362008-04-12 20:17:02 +0100579 {
580 .name = "tosa:amber:charge",
581 .default_trigger = "main-battery-charging",
582 .gpio = TOSA_GPIO_CHRG_ERR_LED,
583 },
584 {
585 .name = "tosa:green:mail",
586 .default_trigger = "nand-disk",
587 .gpio = TOSA_GPIO_NOTE_LED,
588 },
Dmitry Baryshkovc5461062008-04-19 10:42:06 +0100589 {
590 .name = "tosa:dual:wlan",
591 .default_trigger = "none",
592 .gpio = TOSA_GPIO_WLAN_LED,
593 },
594 {
595 .name = "tosa:blue:bluetooth",
Dmitry Baryshkov16b32fd2008-07-05 09:02:48 +0100596 .default_trigger = "tosa-bt",
Dmitry Baryshkovc5461062008-04-19 10:42:06 +0100597 .gpio = TOSA_GPIO_BT_LED,
598 },
Dmitry Baryshkov311c7362008-04-12 20:17:02 +0100599};
600
Dmitry Baryshkovba4eb7e2008-04-19 10:42:25 +0100601static struct gpio_led_platform_data tosa_gpio_leds_platform_data = {
Dmitry Baryshkov311c7362008-04-12 20:17:02 +0100602 .leds = tosa_gpio_leds,
603 .num_leds = ARRAY_SIZE(tosa_gpio_leds),
604};
605
Dirk Opfer6d0cf3e2006-03-31 02:31:12 -0800606static struct platform_device tosaled_device = {
Dmitry Baryshkov311c7362008-04-12 20:17:02 +0100607 .name = "leds-gpio",
608 .id = -1,
609 .dev = {
610 .platform_data = &tosa_gpio_leds_platform_data,
611 },
Dirk Opfer6d0cf3e2006-03-31 02:31:12 -0800612};
613
Dmitry Baryshkovbf0116e2008-06-14 11:42:02 +0100614/*
615 * Toshiba Mobile IO Controller
616 */
617static struct resource tc6393xb_resources[] = {
618 [0] = {
619 .start = TOSA_LCDC_PHYS,
620 .end = TOSA_LCDC_PHYS + 0x3ffffff,
621 .flags = IORESOURCE_MEM,
622 },
623
624 [1] = {
625 .start = TOSA_IRQ_GPIO_TC6393XB_INT,
626 .end = TOSA_IRQ_GPIO_TC6393XB_INT,
627 .flags = IORESOURCE_IRQ,
628 },
629};
630
631
632static int tosa_tc6393xb_enable(struct platform_device *dev)
633{
634 int rc;
635
636 rc = gpio_request(TOSA_GPIO_TC6393XB_REST_IN, "tc6393xb #pclr");
637 if (rc)
638 goto err_req_pclr;
639 rc = gpio_request(TOSA_GPIO_TC6393XB_SUSPEND, "tc6393xb #suspend");
640 if (rc)
641 goto err_req_suspend;
Dmitry Baryshkov14b7b402008-09-13 21:06:41 +0400642 rc = gpio_request(TOSA_GPIO_TC6393XB_L3V_ON, "tc6393xb l3v");
Dmitry Baryshkovbf0116e2008-06-14 11:42:02 +0100643 if (rc)
644 goto err_req_l3v;
645 rc = gpio_direction_output(TOSA_GPIO_TC6393XB_L3V_ON, 0);
646 if (rc)
647 goto err_dir_l3v;
648 rc = gpio_direction_output(TOSA_GPIO_TC6393XB_SUSPEND, 0);
649 if (rc)
650 goto err_dir_suspend;
651 rc = gpio_direction_output(TOSA_GPIO_TC6393XB_REST_IN, 0);
652 if (rc)
653 goto err_dir_pclr;
654
655 mdelay(1);
656
657 gpio_set_value(TOSA_GPIO_TC6393XB_SUSPEND, 1);
658
659 mdelay(10);
660
661 gpio_set_value(TOSA_GPIO_TC6393XB_REST_IN, 1);
662 gpio_set_value(TOSA_GPIO_TC6393XB_L3V_ON, 1);
663
664 return 0;
665err_dir_pclr:
666err_dir_suspend:
667err_dir_l3v:
668 gpio_free(TOSA_GPIO_TC6393XB_L3V_ON);
669err_req_l3v:
670 gpio_free(TOSA_GPIO_TC6393XB_SUSPEND);
671err_req_suspend:
672 gpio_free(TOSA_GPIO_TC6393XB_REST_IN);
673err_req_pclr:
674 return rc;
675}
676
677static int tosa_tc6393xb_disable(struct platform_device *dev)
678{
679 gpio_free(TOSA_GPIO_TC6393XB_L3V_ON);
680 gpio_free(TOSA_GPIO_TC6393XB_SUSPEND);
681 gpio_free(TOSA_GPIO_TC6393XB_REST_IN);
682
683 return 0;
684}
685
686static int tosa_tc6393xb_resume(struct platform_device *dev)
687{
688 gpio_set_value(TOSA_GPIO_TC6393XB_SUSPEND, 1);
689 mdelay(10);
690 gpio_set_value(TOSA_GPIO_TC6393XB_L3V_ON, 1);
691 mdelay(10);
692
693 return 0;
694}
695
696static int tosa_tc6393xb_suspend(struct platform_device *dev)
697{
698 gpio_set_value(TOSA_GPIO_TC6393XB_L3V_ON, 0);
699 gpio_set_value(TOSA_GPIO_TC6393XB_SUSPEND, 0);
700 return 0;
701}
702
Dmitry Baryshkov5289fec2008-06-27 10:38:44 +0100703static struct mtd_partition tosa_nand_partition[] = {
704 {
705 .name = "smf",
706 .offset = 0,
707 .size = 7 * 1024 * 1024,
708 },
709 {
710 .name = "root",
711 .offset = MTDPART_OFS_APPEND,
712 .size = 28 * 1024 * 1024,
713 },
714 {
715 .name = "home",
716 .offset = MTDPART_OFS_APPEND,
717 .size = MTDPART_SIZ_FULL,
718 },
719};
720
721static uint8_t scan_ff_pattern[] = { 0xff, 0xff };
722
723static struct nand_bbt_descr tosa_tc6393xb_nand_bbt = {
724 .options = 0,
725 .offs = 4,
726 .len = 2,
727 .pattern = scan_ff_pattern
728};
729
730static struct tmio_nand_data tosa_tc6393xb_nand_config = {
731 .num_partitions = ARRAY_SIZE(tosa_nand_partition),
732 .partition = tosa_nand_partition,
733 .badblock_pattern = &tosa_tc6393xb_nand_bbt,
734};
735
Dmitry Baryshkov1c1b6ff2008-09-24 23:36:23 +0200736static int tosa_tc6393xb_setup(struct platform_device *dev)
737{
738 int rc;
739
740 rc = gpio_request(TOSA_GPIO_CARD_VCC_ON, "CARD_VCC_ON");
741 if (rc)
742 goto err_req;
743
744 rc = gpio_direction_output(TOSA_GPIO_CARD_VCC_ON, 1);
745 if (rc)
746 goto err_dir;
747
748 return rc;
749
750err_dir:
751 gpio_free(TOSA_GPIO_CARD_VCC_ON);
752err_req:
753 return rc;
754}
755
756static void tosa_tc6393xb_teardown(struct platform_device *dev)
757{
758 gpio_free(TOSA_GPIO_CARD_VCC_ON);
759}
760
Dmitry Baryshkovddfb33c2008-11-27 01:25:09 +0300761#ifdef CONFIG_MFD_TC6393XB
Dmitry Baryshkov31c9b282008-10-28 18:40:37 +0300762static struct fb_videomode tosa_tc6393xb_lcd_mode[] = {
763 {
764 .xres = 480,
765 .yres = 640,
766 .pixclock = 0x002cdf00,/* PLL divisor */
767 .left_margin = 0x004c,
768 .right_margin = 0x005b,
769 .upper_margin = 0x0001,
770 .lower_margin = 0x000d,
771 .hsync_len = 0x0002,
772 .vsync_len = 0x0001,
773 .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
774 .vmode = FB_VMODE_NONINTERLACED,
775 },{
776 .xres = 240,
777 .yres = 320,
778 .pixclock = 0x00e7f203,/* PLL divisor */
779 .left_margin = 0x0024,
780 .right_margin = 0x002f,
781 .upper_margin = 0x0001,
782 .lower_margin = 0x000d,
783 .hsync_len = 0x0002,
784 .vsync_len = 0x0001,
785 .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
786 .vmode = FB_VMODE_NONINTERLACED,
787 }
788};
789
790static struct tmio_fb_data tosa_tc6393xb_fb_config = {
791 .lcd_set_power = tc6393xb_lcd_set_power,
792 .lcd_mode = tc6393xb_lcd_mode,
793 .num_modes = ARRAY_SIZE(tosa_tc6393xb_lcd_mode),
794 .modes = &tosa_tc6393xb_lcd_mode[0],
795 .height = 82,
796 .width = 60,
797};
Dmitry Baryshkovddfb33c2008-11-27 01:25:09 +0300798#endif
Dmitry Baryshkov31c9b282008-10-28 18:40:37 +0300799
Dmitry Baryshkov1c1b6ff2008-09-24 23:36:23 +0200800static struct tc6393xb_platform_data tosa_tc6393xb_data = {
Dmitry Baryshkovbf0116e2008-06-14 11:42:02 +0100801 .scr_pll2cr = 0x0cc1,
802 .scr_gper = 0x3300,
Dmitry Baryshkovbf0116e2008-06-14 11:42:02 +0100803
804 .irq_base = IRQ_BOARD_START,
805 .gpio_base = TOSA_TC6393XB_GPIO_BASE,
Dmitry Baryshkov1c1b6ff2008-09-24 23:36:23 +0200806 .setup = tosa_tc6393xb_setup,
807 .teardown = tosa_tc6393xb_teardown,
Dmitry Baryshkovbf0116e2008-06-14 11:42:02 +0100808
809 .enable = tosa_tc6393xb_enable,
810 .disable = tosa_tc6393xb_disable,
811 .suspend = tosa_tc6393xb_suspend,
812 .resume = tosa_tc6393xb_resume,
Dmitry Baryshkov5289fec2008-06-27 10:38:44 +0100813
814 .nand_data = &tosa_tc6393xb_nand_config,
Dmitry Baryshkovddfb33c2008-11-27 01:25:09 +0300815#ifdef CONFIG_MFD_TC6393XB
Dmitry Baryshkov31c9b282008-10-28 18:40:37 +0300816 .fb_data = &tosa_tc6393xb_fb_config,
Dmitry Baryshkovddfb33c2008-11-27 01:25:09 +0300817#endif
Dmitry Baryshkovf98a0bd2008-09-24 23:46:10 +0200818
819 .resume_restore = 1,
Dmitry Baryshkovbf0116e2008-06-14 11:42:02 +0100820};
821
822
823static struct platform_device tc6393xb_device = {
824 .name = "tc6393xb",
825 .id = -1,
826 .dev = {
Dmitry Baryshkov1c1b6ff2008-09-24 23:36:23 +0200827 .platform_data = &tosa_tc6393xb_data,
Dmitry Baryshkovbf0116e2008-06-14 11:42:02 +0100828 },
829 .num_resources = ARRAY_SIZE(tc6393xb_resources),
830 .resource = tc6393xb_resources,
831};
832
Dmitry Baryshkov16b32fd2008-07-05 09:02:48 +0100833static struct tosa_bt_data tosa_bt_data = {
834 .gpio_pwr = TOSA_GPIO_BT_PWR_EN,
835 .gpio_reset = TOSA_GPIO_BT_RESET,
836};
837
838static struct platform_device tosa_bt_device = {
839 .name = "tosa-bt",
840 .id = -1,
841 .dev.platform_data = &tosa_bt_data,
842};
843
Dmitry Baryshkov14b7b402008-09-13 21:06:41 +0400844static struct pxa2xx_spi_master pxa_ssp_master_info = {
845 .num_chipselect = 1,
846};
847
848static struct spi_board_info spi_board_info[] __initdata = {
849 {
850 .modalias = "tosa-lcd",
851 // .platform_data
852 .max_speed_hz = 28750,
853 .bus_num = 2,
854 .chip_select = 0,
855 .mode = SPI_MODE_0,
856 },
857};
Dmitry Baryshkov16b32fd2008-07-05 09:02:48 +0100858
Dmitry Baryshkovf34ee792008-11-25 00:57:27 +0300859static struct mtd_partition sharpsl_rom_parts[] = {
860 {
861 .name ="Boot PROM Filesystem",
862 .offset = 0x00160000,
863 .size = MTDPART_SIZ_FULL,
864 },
865};
866
867static struct physmap_flash_data sharpsl_rom_data = {
868 .width = 2,
869 .nr_parts = ARRAY_SIZE(sharpsl_rom_parts),
870 .parts = sharpsl_rom_parts,
871};
872
873static struct resource sharpsl_rom_resources[] = {
874 {
875 .start = 0x00000000,
876 .end = 0x007fffff,
877 .flags = IORESOURCE_MEM,
878 },
879};
880
881static struct platform_device sharpsl_rom_device = {
882 .name = "physmap-flash",
883 .id = -1,
884 .resource = sharpsl_rom_resources,
885 .num_resources = ARRAY_SIZE(sharpsl_rom_resources),
886 .dev.platform_data = &sharpsl_rom_data,
887};
888
Dmitry Eremin-Solenikovfa4704f2011-02-23 02:29:10 +0300889static struct platform_device wm9712_device = {
890 .name = "wm9712-codec",
891 .id = -1,
892};
893
Axel Linf285b8c2011-12-15 10:57:22 +0800894static struct platform_device tosa_audio_device = {
895 .name = "tosa-audio",
896 .id = -1,
897};
898
Dirk Opfer8459c152005-11-06 14:27:52 +0000899static struct platform_device *devices[] __initdata = {
900 &tosascoop_device,
901 &tosascoop_jc_device,
Dmitry Baryshkovbf0116e2008-06-14 11:42:02 +0100902 &tc6393xb_device,
Dmitry Baryshkov53b14ea2008-06-14 11:43:36 +0100903 &tosa_power_device,
Dirk Opfera93876c2005-11-08 19:15:30 +0000904 &tosakbd_device,
Dmitry Baryshkov93e90122008-01-21 01:04:20 -0500905 &tosa_gpio_keys_device,
Dirk Opfer6d0cf3e2006-03-31 02:31:12 -0800906 &tosaled_device,
Dmitry Baryshkov16b32fd2008-07-05 09:02:48 +0100907 &tosa_bt_device,
Dmitry Baryshkovf34ee792008-11-25 00:57:27 +0300908 &sharpsl_rom_device,
Dmitry Eremin-Solenikovfa4704f2011-02-23 02:29:10 +0300909 &wm9712_device,
Dmitry Eremin-Solenikovef8b3cc2011-02-14 15:33:18 +0300910 &tosa_gpio_vbus,
Axel Linf285b8c2011-12-15 10:57:22 +0800911 &tosa_audio_device,
Dirk Opfer8459c152005-11-06 14:27:52 +0000912};
913
Richard Purdie74617fb2006-06-19 19:57:12 +0100914static void tosa_poweroff(void)
915{
Robin Holt7b6d8642013-07-08 16:01:40 -0700916 pxa_restart(REBOOT_GPIO, NULL);
Richard Purdie74617fb2006-06-19 19:57:12 +0100917}
918
Robin Holt7b6d8642013-07-08 16:01:40 -0700919static void tosa_restart(enum reboot_mode mode, const char *cmd)
Richard Purdie74617fb2006-06-19 19:57:12 +0100920{
Marek Vasutad68bb92010-11-03 16:29:35 +0100921 uint32_t msc0 = __raw_readl(MSC0);
922
Richard Purdie74617fb2006-06-19 19:57:12 +0100923 /* Bootloader magic for a reboot */
Marek Vasutad68bb92010-11-03 16:29:35 +0100924 if((msc0 & 0xffff0000) == 0x7ff00000)
925 __raw_writel((msc0 & 0xffff) | 0x7ee00000, MSC0);
Richard Purdie74617fb2006-06-19 19:57:12 +0100926
927 tosa_poweroff();
928}
929
Dirk Opfer8459c152005-11-06 14:27:52 +0000930static void __init tosa_init(void)
931{
Dmitry Baryshkov2cb47342008-04-10 11:00:32 +0100932 pxa2xx_mfp_config(ARRAY_AND_SIZE(tosa_pin_config));
Russell Kingcc155c62009-11-09 13:34:08 +0800933
934 pxa_set_ffuart_info(NULL);
935 pxa_set_btuart_info(NULL);
936 pxa_set_stuart_info(NULL);
937
Dmitry Baryshkov2cb47342008-04-10 11:00:32 +0100938 gpio_set_wake(MFP_PIN_GPIO1, 1);
939 /* We can't pass to gpio-keys since it will drop the Reset altfunc */
940
Daniel Ribeiro216e3b72009-05-05 22:43:18 -0300941 init_gpio_reset(TOSA_GPIO_ON_RESET, 0, 0);
Dmitry Baryshkov86159a92008-05-22 16:21:48 +0100942
Richard Purdie74617fb2006-06-19 19:57:12 +0100943 pm_power_off = tosa_poweroff;
Richard Purdie74617fb2006-06-19 19:57:12 +0100944
Dirk Opfer8459c152005-11-06 14:27:52 +0000945 PCFR |= PCFR_OPDE;
946
Dirk Opfera93876c2005-11-08 19:15:30 +0000947 /* enable batt_fault */
Dirk Opfer8459c152005-11-06 14:27:52 +0000948 PMCR = 0x01;
949
Dirk Opfera93876c2005-11-08 19:15:30 +0000950 pxa_set_mci_info(&tosa_mci_platform_data);
Dirk Opfera93876c2005-11-08 19:15:30 +0000951 pxa_set_ficp_info(&tosa_ficp_platform_data);
Dmitry Baryshkov481ea5a2008-04-10 15:43:18 +0100952 pxa_set_i2c_info(NULL);
Mark Brown80748fb2009-04-03 12:45:49 +0100953 pxa_set_ac97_info(NULL);
Dirk Opfer4c18ad22005-11-08 19:15:50 +0000954 platform_scoop_config = &tosa_pcmcia_config;
Dirk Opfer8459c152005-11-06 14:27:52 +0000955
Dmitry Baryshkov14b7b402008-09-13 21:06:41 +0400956 pxa2xx_set_spi_info(2, &pxa_ssp_master_info);
957 spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));
958
Dmitry Eremin-Solenikovc68ffdd2009-03-05 18:17:53 +0300959 clk_add_alias("CLK_CK3P6MI", tc6393xb_device.name, "GPIO11_CLK", NULL);
Dmitry Baryshkov7bdb22c2008-09-10 10:30:37 +0100960
Dirk Opfer4c18ad22005-11-08 19:15:50 +0000961 platform_add_devices(devices, ARRAY_SIZE(devices));
Dirk Opfer8459c152005-11-06 14:27:52 +0000962}
963
Laura Abbott1c2f87c2014-04-13 22:54:58 +0100964static void __init fixup_tosa(struct tag *tags, char **cmdline)
Dirk Opfer8459c152005-11-06 14:27:52 +0000965{
966 sharpsl_save_param();
Laura Abbott1c2f87c2014-04-13 22:54:58 +0100967 memblock_add(0xa0000000, SZ_64M);
Dirk Opfer8459c152005-11-06 14:27:52 +0000968}
969
970MACHINE_START(TOSA, "SHARP Tosa")
Dirk Opfer8459c152005-11-06 14:27:52 +0000971 .fixup = fixup_tosa,
Marek Vasut851982c2010-10-11 02:20:19 +0200972 .map_io = pxa25x_map_io,
Haojian Zhuang6ac6b812010-08-20 15:23:59 +0800973 .nr_irqs = TOSA_NR_IRQS,
Eric Miaocd491042007-06-22 04:14:09 +0100974 .init_irq = pxa25x_init_irq,
Eric Miao8a97ae22011-05-18 21:30:04 +0800975 .handle_irq = pxa25x_handle_irq,
Dirk Opfer8459c152005-11-06 14:27:52 +0000976 .init_machine = tosa_init,
Stephen Warren6bb27d72012-11-08 12:40:59 -0700977 .init_time = pxa_timer_init,
Russell King271a74f2011-11-04 14:15:53 +0000978 .restart = tosa_restart,
Dirk Opfer8459c152005-11-06 14:27:52 +0000979MACHINE_END