blob: 7439798d58e4646db45a95786cab232a991318f1 [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
Russell King2d34e502015-03-09 11:03:00 +000015#include <linux/clkdev.h>
Dirk Opfer8459c152005-11-06 14:27:52 +000016#include <linux/kernel.h>
17#include <linux/init.h>
Dirk Opfer067c9042005-11-21 15:17:06 +000018#include <linux/platform_device.h>
Dirk Opfer8459c152005-11-06 14:27:52 +000019#include <linux/major.h>
20#include <linux/fs.h>
21#include <linux/interrupt.h>
Dmitry Baryshkovbf0116e2008-06-14 11:42:02 +010022#include <linux/delay.h>
23#include <linux/fb.h>
Dirk Opfer8459c152005-11-06 14:27:52 +000024#include <linux/mmc/host.h>
Dmitry Baryshkovbf0116e2008-06-14 11:42:02 +010025#include <linux/mfd/tc6393xb.h>
Dmitry Baryshkov5289fec2008-06-27 10:38:44 +010026#include <linux/mfd/tmio.h>
Boris Brezillond4092d72017-08-04 17:29:10 +020027#include <linux/mtd/rawnand.h>
Dmitry Baryshkov5289fec2008-06-27 10:38:44 +010028#include <linux/mtd/partitions.h>
Dmitry Baryshkovf34ee792008-11-25 00:57:27 +030029#include <linux/mtd/physmap.h>
Richard Purdie74617fb2006-06-19 19:57:12 +010030#include <linux/pm.h>
Dmitry Baryshkov93e9012f2008-01-21 01:04:20 -050031#include <linux/gpio_keys.h>
32#include <linux/input.h>
Dmitry Baryshkovd4e7d092008-04-12 20:16:16 +010033#include <linux/gpio.h>
Linus Walleij32d15442018-12-02 09:43:22 +010034#include <linux/gpio/machine.h>
Dmitry Eremin-Solenikov62a75752014-10-24 21:14:22 +040035#include <linux/power/gpio-charger.h>
Dmitry Baryshkov14b7b402008-09-13 21:06:41 +040036#include <linux/spi/spi.h>
Sebastian Andrzej Siewior8348c252010-11-22 17:12:15 -080037#include <linux/spi/pxa2xx_spi.h>
Eric Miaof69a6542010-01-01 15:28:21 +080038#include <linux/input/matrix_keypad.h>
Wolfram Sangf15fc9b2017-11-13 18:27:39 +010039#include <linux/platform_data/i2c-pxa.h>
Dmitry Eremin-Solenikovef8b3cc2011-02-14 15:33:18 +030040#include <linux/usb/gpio_vbus.h>
Robin Holt7b6d8642013-07-08 16:01:40 -070041#include <linux/reboot.h>
Laura Abbott1c2f87c2014-04-13 22:54:58 +010042#include <linux/memblock.h>
Dirk Opfer8459c152005-11-06 14:27:52 +000043
44#include <asm/setup.h>
Dirk Opfer8459c152005-11-06 14:27:52 +000045#include <asm/mach-types.h>
Eric Miao51c62982009-01-02 23:17:22 +080046
Arnd Bergmann4c25c5d2015-01-30 10:45:33 +010047#include "pxa25x.h"
Russell Kingafd2fc02008-08-07 11:05:25 +010048#include <mach/reset.h>
Arnd Bergmann293b2da2012-08-24 15:16:48 +020049#include <linux/platform_data/irda-pxaficp.h>
50#include <linux/platform_data/mmc-pxamci.h>
Arnd Bergmann4c25c5d2015-01-30 10:45:33 +010051#include "udc.h"
52#include "tosa_bt.h"
Mark Brown80748fb2009-04-03 12:45:49 +010053#include <mach/audio.h>
Marek Vasutad68bb92010-11-03 16:29:35 +010054#include <mach/smemc.h>
Dirk Opfer8459c152005-11-06 14:27:52 +000055
56#include <asm/mach/arch.h>
Russell Kinga09e64f2008-08-05 16:14:15 +010057#include <mach/tosa.h>
Dirk Opfer8459c152005-11-06 14:27:52 +000058
59#include <asm/hardware/scoop.h>
60#include <asm/mach/sharpsl_param.h>
61
62#include "generic.h"
Russell King46c41e62007-05-15 15:39:36 +010063#include "devices.h"
Dirk Opfer8459c152005-11-06 14:27:52 +000064
Dmitry Baryshkov2cb47342008-04-10 11:00:32 +010065static unsigned long tosa_pin_config[] = {
66 GPIO78_nCS_2, /* Scoop */
67 GPIO80_nCS_4, /* tg6393xb */
68 GPIO33_nCS_5, /* Scoop */
69
70 // GPIO76 CARD_VCC_ON1
71
72 GPIO19_GPIO, /* Reset out */
73 GPIO1_RST | WAKEUP_ON_EDGE_FALL,
74
75 GPIO0_GPIO | WAKEUP_ON_EDGE_FALL, /* WAKE_UP */
76 GPIO2_GPIO | WAKEUP_ON_EDGE_BOTH, /* AC_IN */
77 GPIO3_GPIO | WAKEUP_ON_EDGE_FALL, /* RECORD */
78 GPIO4_GPIO | WAKEUP_ON_EDGE_FALL, /* SYNC */
79 GPIO20_GPIO, /* EAR_IN */
80 GPIO22_GPIO, /* On */
81
82 GPIO5_GPIO, /* USB_IN */
83 GPIO32_GPIO, /* Pen IRQ */
84
85 GPIO7_GPIO, /* Jacket Detect */
86 GPIO14_GPIO, /* BAT0_CRG */
87 GPIO12_GPIO, /* BAT1_CRG */
88 GPIO17_GPIO, /* BAT0_LOW */
89 GPIO84_GPIO, /* BAT1_LOW */
90 GPIO38_GPIO, /* BAT_LOCK */
91
92 GPIO11_3_6MHz,
93 GPIO15_GPIO, /* TC6393XB IRQ */
94 GPIO18_RDY,
95 GPIO27_GPIO, /* LCD Sync */
96
97 /* MMC */
98 GPIO6_MMC_CLK,
99 GPIO8_MMC_CS0,
100 GPIO9_GPIO, /* Detect */
Dmitry Baryshkovc4d5f8d2008-06-09 13:23:50 +0100101 GPIO10_GPIO, /* nSD_INT */
Dmitry Baryshkov2cb47342008-04-10 11:00:32 +0100102
103 /* CF */
104 GPIO13_GPIO, /* CD_IRQ */
105 GPIO21_GPIO, /* Main Slot IRQ */
106 GPIO36_GPIO, /* Jacket Slot IRQ */
107 GPIO48_nPOE,
108 GPIO49_nPWE,
109 GPIO50_nPIOR,
110 GPIO51_nPIOW,
111 GPIO52_nPCE_1,
112 GPIO53_nPCE_2,
113 GPIO54_nPSKTSEL,
114 GPIO55_nPREG,
115 GPIO56_nPWAIT,
116 GPIO57_nIOIS16,
117
118 /* AC97 */
119 GPIO31_AC97_SYNC,
120 GPIO30_AC97_SDATA_OUT,
121 GPIO28_AC97_BITCLK,
122 GPIO29_AC97_SDATA_IN_0,
123 // GPIO79 nAUD_IRQ
124
125 /* FFUART */
126 GPIO34_FFUART_RXD,
127 GPIO35_FFUART_CTS,
128 GPIO37_FFUART_DSR,
129 GPIO39_FFUART_TXD,
130 GPIO40_FFUART_DTR,
131 GPIO41_FFUART_RTS,
132
133 /* BTUART */
134 GPIO42_BTUART_RXD,
135 GPIO43_BTUART_TXD,
136 GPIO44_BTUART_CTS,
137 GPIO45_BTUART_RTS,
138
Dmitry Baryshkov2cb47342008-04-10 11:00:32 +0100139 /* Keybd */
Eric Miaof69a6542010-01-01 15:28:21 +0800140 GPIO58_GPIO | MFP_LPM_DRIVE_LOW, /* Column 0 */
141 GPIO59_GPIO | MFP_LPM_DRIVE_LOW, /* Column 1 */
142 GPIO60_GPIO | MFP_LPM_DRIVE_LOW, /* Column 2 */
143 GPIO61_GPIO | MFP_LPM_DRIVE_LOW, /* Column 3 */
144 GPIO62_GPIO | MFP_LPM_DRIVE_LOW, /* Column 4 */
145 GPIO63_GPIO | MFP_LPM_DRIVE_LOW, /* Column 5 */
146 GPIO64_GPIO | MFP_LPM_DRIVE_LOW, /* Column 6 */
147 GPIO65_GPIO | MFP_LPM_DRIVE_LOW, /* Column 7 */
148 GPIO66_GPIO | MFP_LPM_DRIVE_LOW, /* Column 8 */
149 GPIO67_GPIO | MFP_LPM_DRIVE_LOW, /* Column 9 */
150 GPIO68_GPIO | MFP_LPM_DRIVE_LOW, /* Column 10 */
151 GPIO69_GPIO | MFP_LPM_DRIVE_LOW, /* Row 0 */
152 GPIO70_GPIO | MFP_LPM_DRIVE_LOW, /* Row 1 */
153 GPIO71_GPIO | MFP_LPM_DRIVE_LOW, /* Row 2 */
154 GPIO72_GPIO | MFP_LPM_DRIVE_LOW, /* Row 3 */
155 GPIO73_GPIO | MFP_LPM_DRIVE_LOW, /* Row 4 */
156 GPIO74_GPIO | MFP_LPM_DRIVE_LOW, /* Row 5 */
157 GPIO75_GPIO | MFP_LPM_DRIVE_LOW, /* Row 6 */
Dmitry Baryshkov2cb47342008-04-10 11:00:32 +0100158
159 /* SPI */
160 GPIO81_SSP2_CLK_OUT,
161 GPIO82_SSP2_FRM_OUT,
162 GPIO83_SSP2_TXD,
Dmitry Baryshkov2cb47342008-04-10 11:00:32 +0100163
Dmitry Baryshkov0fc3ff32008-07-02 13:54:46 +0100164 /* IrDA is managed in other way */
165 GPIO46_GPIO,
166 GPIO47_GPIO,
Dmitry Baryshkovb032fcc2008-06-12 11:42:07 +0100167};
168
Dirk Opfer8459c152005-11-06 14:27:52 +0000169/*
170 * SCOOP Device
171 */
172static struct resource tosa_scoop_resources[] = {
173 [0] = {
174 .start = TOSA_CF_PHYS,
175 .end = TOSA_CF_PHYS + 0xfff,
176 .flags = IORESOURCE_MEM,
177 },
178};
179
180static struct scoop_config tosa_scoop_setup = {
181 .io_dir = TOSA_SCOOP_IO_DIR,
Dmitry Baryshkovd4e7d092008-04-12 20:16:16 +0100182 .gpio_base = TOSA_SCOOP_GPIO_BASE,
Dirk Opfer8459c152005-11-06 14:27:52 +0000183};
184
Dmitry Baryshkovba4eb7e2008-04-19 10:42:25 +0100185static struct platform_device tosascoop_device = {
Dirk Opfer8459c152005-11-06 14:27:52 +0000186 .name = "sharp-scoop",
187 .id = 0,
188 .dev = {
189 .platform_data = &tosa_scoop_setup,
190 },
191 .num_resources = ARRAY_SIZE(tosa_scoop_resources),
192 .resource = tosa_scoop_resources,
193};
194
195
196/*
197 * SCOOP Device Jacket
198 */
199static struct resource tosa_scoop_jc_resources[] = {
200 [0] = {
201 .start = TOSA_SCOOP_PHYS + 0x40,
202 .end = TOSA_SCOOP_PHYS + 0xfff,
203 .flags = IORESOURCE_MEM,
204 },
205};
206
207static struct scoop_config tosa_scoop_jc_setup = {
208 .io_dir = TOSA_SCOOP_JC_IO_DIR,
Dmitry Baryshkovd4e7d092008-04-12 20:16:16 +0100209 .gpio_base = TOSA_SCOOP_JC_GPIO_BASE,
Dirk Opfer8459c152005-11-06 14:27:52 +0000210};
211
Dmitry Baryshkovba4eb7e2008-04-19 10:42:25 +0100212static struct platform_device tosascoop_jc_device = {
Dirk Opfer8459c152005-11-06 14:27:52 +0000213 .name = "sharp-scoop",
214 .id = 1,
215 .dev = {
216 .platform_data = &tosa_scoop_jc_setup,
217 .parent = &tosascoop_device.dev,
218 },
219 .num_resources = ARRAY_SIZE(tosa_scoop_jc_resources),
220 .resource = tosa_scoop_jc_resources,
221};
222
Dirk Opfer4c18ad22005-11-08 19:15:50 +0000223/*
224 * PCMCIA
225 */
Dirk Opfer8459c152005-11-06 14:27:52 +0000226static struct scoop_pcmcia_dev tosa_pcmcia_scoop[] = {
227{
228 .dev = &tosascoop_device.dev,
229 .irq = TOSA_IRQ_GPIO_CF_IRQ,
230 .cd_irq = TOSA_IRQ_GPIO_CF_CD,
231 .cd_irq_str = "PCMCIA0 CD",
232},{
233 .dev = &tosascoop_jc_device.dev,
234 .irq = TOSA_IRQ_GPIO_JC_CF_IRQ,
235 .cd_irq = -1,
236},
237};
238
Dirk Opfer4c18ad22005-11-08 19:15:50 +0000239static struct scoop_pcmcia_config tosa_pcmcia_config = {
240 .devs = &tosa_pcmcia_scoop[0],
241 .num_devs = 2,
Dirk Opfer4c18ad22005-11-08 19:15:50 +0000242};
243
Dirk Opfera93876c2005-11-08 19:15:30 +0000244/*
245 * USB Device Controller
246 */
Dmitry Eremin-Solenikovef8b3cc2011-02-14 15:33:18 +0300247static struct gpio_vbus_mach_info tosa_udc_info = {
Dmitry Baryshkovd4e7d092008-04-12 20:16:16 +0100248 .gpio_pullup = TOSA_GPIO_USB_PULLUP,
Dmitry Baryshkov487dc922007-12-21 12:18:01 +0300249 .gpio_vbus = TOSA_GPIO_USB_IN,
250 .gpio_vbus_inverted = 1,
Dirk Opfera93876c2005-11-08 19:15:30 +0000251};
252
Dmitry Eremin-Solenikovef8b3cc2011-02-14 15:33:18 +0300253static struct platform_device tosa_gpio_vbus = {
254 .name = "gpio-vbus",
255 .id = -1,
256 .dev = {
257 .platform_data = &tosa_udc_info,
258 },
259};
260
Dirk Opfera93876c2005-11-08 19:15:30 +0000261/*
262 * MMC/SD Device
263 */
David Howells40220c12006-10-09 12:19:47 +0100264static int tosa_mci_init(struct device *dev, irq_handler_t tosa_detect_int, void *data)
Dirk Opfera93876c2005-11-08 19:15:30 +0000265{
266 int err;
267
Dmitry Baryshkovc4d5f8d2008-06-09 13:23:50 +0100268 err = gpio_request(TOSA_GPIO_nSD_INT, "SD Int");
269 if (err) {
270 printk(KERN_ERR "tosa_mci_init: can't request SD_PWR gpio\n");
271 goto err_gpio_int;
272 }
273 err = gpio_direction_input(TOSA_GPIO_nSD_INT);
274 if (err)
275 goto err_gpio_int_dir;
276
Dmitry Baryshkovd4e7d092008-04-12 20:16:16 +0100277 return 0;
278
Dmitry Baryshkovc4d5f8d2008-06-09 13:23:50 +0100279err_gpio_int_dir:
280 gpio_free(TOSA_GPIO_nSD_INT);
281err_gpio_int:
Russell King2687bd32008-01-23 14:05:58 +0000282 return err;
Dirk Opfera93876c2005-11-08 19:15:30 +0000283}
284
Dirk Opfera93876c2005-11-08 19:15:30 +0000285static void tosa_mci_exit(struct device *dev, void *data)
286{
Dmitry Baryshkovc4d5f8d2008-06-09 13:23:50 +0100287 gpio_free(TOSA_GPIO_nSD_INT);
Dirk Opfera93876c2005-11-08 19:15:30 +0000288}
289
290static struct pxamci_platform_data tosa_mci_platform_data = {
Eric Miaof97cab22010-04-14 07:00:42 +0800291 .detect_delay_ms = 250,
Robert Jarzmik7a648252009-07-06 22:16:42 +0200292 .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34,
293 .init = tosa_mci_init,
294 .exit = tosa_mci_exit,
Dirk Opfera93876c2005-11-08 19:15:30 +0000295};
296
Linus Walleij32d15442018-12-02 09:43:22 +0100297static struct gpiod_lookup_table tosa_mci_gpio_table = {
298 .dev_id = "pxa2xx-mci.0",
299 .table = {
300 GPIO_LOOKUP("gpio-pxa", TOSA_GPIO_nSD_DETECT,
301 "cd", GPIO_ACTIVE_LOW),
302 GPIO_LOOKUP("gpio-pxa", TOSA_GPIO_SD_WP,
303 "wp", GPIO_ACTIVE_LOW),
Linus Walleijf54005b2018-12-02 09:43:27 +0100304 GPIO_LOOKUP("gpio-pxa", TOSA_GPIO_PWR_ON,
305 "power", GPIO_ACTIVE_HIGH),
Linus Walleij32d15442018-12-02 09:43:22 +0100306 { },
307 },
308};
309
Dirk Opfera93876c2005-11-08 19:15:30 +0000310/*
311 * Irda
312 */
Dmitry Baryshkovb032fcc2008-06-12 11:42:07 +0100313static void tosa_irda_transceiver_mode(struct device *dev, int mode)
314{
315 if (mode & IR_OFF) {
316 gpio_set_value(TOSA_GPIO_IR_POWERDWN, 0);
Dmitry Baryshkov0fc3ff32008-07-02 13:54:46 +0100317 pxa2xx_transceiver_mode(dev, mode);
Dmitry Baryshkovb032fcc2008-06-12 11:42:07 +0100318 gpio_direction_output(TOSA_GPIO_IRDA_TX, 0);
319 } else {
Dmitry Baryshkov0fc3ff32008-07-02 13:54:46 +0100320 pxa2xx_transceiver_mode(dev, mode);
Dmitry Baryshkovb032fcc2008-06-12 11:42:07 +0100321 gpio_set_value(TOSA_GPIO_IR_POWERDWN, 1);
322 }
323}
324
Dmitry Baryshkovd4e7d092008-04-12 20:16:16 +0100325static int tosa_irda_startup(struct device *dev)
326{
327 int ret;
328
Dmitry Baryshkovb032fcc2008-06-12 11:42:07 +0100329 ret = gpio_request(TOSA_GPIO_IRDA_TX, "IrDA TX");
330 if (ret)
331 goto err_tx;
332 ret = gpio_direction_output(TOSA_GPIO_IRDA_TX, 0);
333 if (ret)
334 goto err_tx_dir;
335
Dmitry Baryshkovd4e7d092008-04-12 20:16:16 +0100336 ret = gpio_request(TOSA_GPIO_IR_POWERDWN, "IrDA powerdown");
337 if (ret)
Dmitry Baryshkovb032fcc2008-06-12 11:42:07 +0100338 goto err_pwr;
Dmitry Baryshkovd4e7d092008-04-12 20:16:16 +0100339
340 ret = gpio_direction_output(TOSA_GPIO_IR_POWERDWN, 0);
341 if (ret)
Dmitry Baryshkovb032fcc2008-06-12 11:42:07 +0100342 goto err_pwr_dir;
Dmitry Baryshkovd4e7d092008-04-12 20:16:16 +0100343
Dmitry Baryshkovb032fcc2008-06-12 11:42:07 +0100344 tosa_irda_transceiver_mode(dev, IR_SIRMODE | IR_OFF);
345
346 return 0;
347
348err_pwr_dir:
349 gpio_free(TOSA_GPIO_IR_POWERDWN);
350err_pwr:
351err_tx_dir:
352 gpio_free(TOSA_GPIO_IRDA_TX);
353err_tx:
Dmitry Baryshkovd4e7d092008-04-12 20:16:16 +0100354 return ret;
Dmitry Baryshkovb032fcc2008-06-12 11:42:07 +0100355}
Dmitry Baryshkovd4e7d092008-04-12 20:16:16 +0100356
357static void tosa_irda_shutdown(struct device *dev)
358{
Dmitry Baryshkovb032fcc2008-06-12 11:42:07 +0100359 tosa_irda_transceiver_mode(dev, IR_SIRMODE | IR_OFF);
Dmitry Baryshkovd4e7d092008-04-12 20:16:16 +0100360 gpio_free(TOSA_GPIO_IR_POWERDWN);
Dmitry Baryshkovb032fcc2008-06-12 11:42:07 +0100361 gpio_free(TOSA_GPIO_IRDA_TX);
Dirk Opfera93876c2005-11-08 19:15:30 +0000362}
363
364static struct pxaficp_platform_data tosa_ficp_platform_data = {
Marek Vasutc4bd0172009-07-17 12:50:43 +0200365 .gpio_pwdown = -1,
366 .transceiver_cap = IR_SIRMODE | IR_OFF,
367 .transceiver_mode = tosa_irda_transceiver_mode,
368 .startup = tosa_irda_startup,
369 .shutdown = tosa_irda_shutdown,
Dirk Opfera93876c2005-11-08 19:15:30 +0000370};
371
372/*
Dmitry Baryshkov53b14ea2008-06-14 11:43:36 +0100373 * Tosa AC IN
374 */
Dmitry Baryshkov53b14ea2008-06-14 11:43:36 +0100375static char *tosa_ac_supplied_to[] = {
376 "main-battery",
377 "backup-battery",
378 "jacket-battery",
379};
380
Dmitry Eremin-Solenikov62a75752014-10-24 21:14:22 +0400381static struct gpio_charger_platform_data tosa_power_data = {
382 .name = "charger",
383 .type = POWER_SUPPLY_TYPE_MAINS,
384 .gpio = TOSA_GPIO_AC_IN,
385 .gpio_active_low = 1,
Dmitry Baryshkov53b14ea2008-06-14 11:43:36 +0100386 .supplied_to = tosa_ac_supplied_to,
387 .num_supplicants = ARRAY_SIZE(tosa_ac_supplied_to),
388};
389
390static struct resource tosa_power_resource[] = {
391 {
392 .name = "ac",
Haojian Zhuang4929f5a2011-10-10 16:03:51 +0800393 .start = PXA_GPIO_TO_IRQ(TOSA_GPIO_AC_IN),
394 .end = PXA_GPIO_TO_IRQ(TOSA_GPIO_AC_IN),
Dmitry Baryshkov53b14ea2008-06-14 11:43:36 +0100395 .flags = IORESOURCE_IRQ |
396 IORESOURCE_IRQ_HIGHEDGE |
397 IORESOURCE_IRQ_LOWEDGE,
398 },
399};
400
401static struct platform_device tosa_power_device = {
Dmitry Eremin-Solenikov62a75752014-10-24 21:14:22 +0400402 .name = "gpio-charger",
Dmitry Baryshkov53b14ea2008-06-14 11:43:36 +0100403 .id = -1,
404 .dev.platform_data = &tosa_power_data,
405 .resource = tosa_power_resource,
406 .num_resources = ARRAY_SIZE(tosa_power_resource),
407};
408
409/*
Dirk Opfera93876c2005-11-08 19:15:30 +0000410 * Tosa Keyboard
411 */
Eric Miaof69a6542010-01-01 15:28:21 +0800412static const uint32_t tosakbd_keymap[] = {
Dmitry Eremin-Solenikov506cac12013-11-16 16:47:50 +0400413 KEY(0, 1, KEY_W),
414 KEY(0, 5, KEY_K),
415 KEY(0, 6, KEY_BACKSPACE),
416 KEY(0, 7, KEY_P),
417 KEY(1, 0, KEY_Q),
418 KEY(1, 1, KEY_E),
419 KEY(1, 2, KEY_T),
420 KEY(1, 3, KEY_Y),
421 KEY(1, 5, KEY_O),
422 KEY(1, 6, KEY_I),
423 KEY(1, 7, KEY_COMMA),
424 KEY(2, 0, KEY_A),
425 KEY(2, 1, KEY_D),
426 KEY(2, 2, KEY_G),
427 KEY(2, 3, KEY_U),
428 KEY(2, 5, KEY_L),
429 KEY(2, 6, KEY_ENTER),
430 KEY(2, 7, KEY_DOT),
431 KEY(3, 0, KEY_Z),
432 KEY(3, 1, KEY_C),
433 KEY(3, 2, KEY_V),
434 KEY(3, 3, KEY_J),
435 KEY(3, 4, TOSA_KEY_ADDRESSBOOK),
436 KEY(3, 5, TOSA_KEY_CANCEL),
437 KEY(3, 6, TOSA_KEY_CENTER),
438 KEY(3, 7, TOSA_KEY_OK),
439 KEY(3, 8, KEY_LEFTSHIFT),
440 KEY(4, 0, KEY_S),
441 KEY(4, 1, KEY_R),
442 KEY(4, 2, KEY_B),
443 KEY(4, 3, KEY_N),
444 KEY(4, 4, TOSA_KEY_CALENDAR),
445 KEY(4, 5, TOSA_KEY_HOMEPAGE),
446 KEY(4, 6, KEY_LEFTCTRL),
447 KEY(4, 7, TOSA_KEY_LIGHT),
448 KEY(4, 9, KEY_RIGHTSHIFT),
449 KEY(5, 0, KEY_TAB),
450 KEY(5, 1, KEY_SLASH),
451 KEY(5, 2, KEY_H),
452 KEY(5, 3, KEY_M),
453 KEY(5, 4, TOSA_KEY_MENU),
454 KEY(5, 6, KEY_UP),
455 KEY(5, 10, TOSA_KEY_FN),
456 KEY(6, 0, KEY_X),
457 KEY(6, 1, KEY_F),
458 KEY(6, 2, KEY_SPACE),
459 KEY(6, 3, KEY_APOSTROPHE),
460 KEY(6, 4, TOSA_KEY_MAIL),
461 KEY(6, 5, KEY_LEFT),
462 KEY(6, 6, KEY_DOWN),
463 KEY(6, 7, KEY_RIGHT),
Eric Miaof69a6542010-01-01 15:28:21 +0800464};
465
466static struct matrix_keymap_data tosakbd_keymap_data = {
467 .keymap = tosakbd_keymap,
468 .keymap_size = ARRAY_SIZE(tosakbd_keymap),
469};
470
471static const int tosakbd_col_gpios[] =
472 { 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68 };
473static const int tosakbd_row_gpios[] =
474 { 69, 70, 71, 72, 73, 74, 75 };
475
476static struct matrix_keypad_platform_data tosakbd_pdata = {
477 .keymap_data = &tosakbd_keymap_data,
478 .row_gpios = tosakbd_row_gpios,
479 .col_gpios = tosakbd_col_gpios,
480 .num_row_gpios = ARRAY_SIZE(tosakbd_row_gpios),
481 .num_col_gpios = ARRAY_SIZE(tosakbd_col_gpios),
482 .col_scan_delay_us = 10,
483 .debounce_ms = 10,
484 .wakeup = 1,
485};
486
Dirk Opfera93876c2005-11-08 19:15:30 +0000487static struct platform_device tosakbd_device = {
Eric Miaof69a6542010-01-01 15:28:21 +0800488 .name = "matrix-keypad",
Dirk Opfera93876c2005-11-08 19:15:30 +0000489 .id = -1,
Eric Miaof69a6542010-01-01 15:28:21 +0800490 .dev = {
491 .platform_data = &tosakbd_pdata,
492 },
Dirk Opfera93876c2005-11-08 19:15:30 +0000493};
Dirk Opfer8459c152005-11-06 14:27:52 +0000494
Dmitry Baryshkov93e9012f2008-01-21 01:04:20 -0500495static struct gpio_keys_button tosa_gpio_keys[] = {
Dmitry Baryshkov0aa975612008-04-12 20:02:50 +0100496 /*
497 * Two following keys are directly tied to "ON" button of tosa. Why?
498 * The first one can be used as a wakeup source, the second can't;
499 * also the first one is OR of ac_powered and on_button.
500 */
501 {
502 .type = EV_PWR,
503 .code = KEY_RESERVED,
504 .gpio = TOSA_GPIO_POWERON,
505 .desc = "Poweron",
506 .wakeup = 1,
507 .active_low = 1,
508 },
Dmitry Baryshkov93e9012f2008-01-21 01:04:20 -0500509 {
510 .type = EV_PWR,
511 .code = KEY_SUSPEND,
512 .gpio = TOSA_GPIO_ON_KEY,
513 .desc = "On key",
Dmitry Baryshkov0aa975612008-04-12 20:02:50 +0100514 /*
515 * can't be used as wakeup
516 * .wakeup = 1,
517 */
Dmitry Baryshkov93e9012f2008-01-21 01:04:20 -0500518 .active_low = 1,
519 },
520 {
521 .type = EV_KEY,
522 .code = TOSA_KEY_RECORD,
523 .gpio = TOSA_GPIO_RECORD_BTN,
524 .desc = "Record Button",
525 .wakeup = 1,
526 .active_low = 1,
527 },
528 {
529 .type = EV_KEY,
530 .code = TOSA_KEY_SYNC,
531 .gpio = TOSA_GPIO_SYNC,
532 .desc = "Sync Button",
533 .wakeup = 1,
534 .active_low = 1,
535 },
Dmitry Baryshkovc33de472008-09-11 01:28:51 +0100536 {
537 .type = EV_SW,
538 .code = SW_HEADPHONE_INSERT,
539 .gpio = TOSA_GPIO_EAR_IN,
540 .desc = "HeadPhone insert",
541 .active_low = 1,
542 .debounce_interval = 300,
543 },
Dmitry Baryshkov93e9012f2008-01-21 01:04:20 -0500544};
545
546static struct gpio_keys_platform_data tosa_gpio_keys_platform_data = {
547 .buttons = tosa_gpio_keys,
548 .nbuttons = ARRAY_SIZE(tosa_gpio_keys),
549};
550
551static struct platform_device tosa_gpio_keys_device = {
552 .name = "gpio-keys",
553 .id = -1,
554 .dev = {
555 .platform_data = &tosa_gpio_keys_platform_data,
556 },
557};
558
Dirk Opfer6d0cf3e2006-03-31 02:31:12 -0800559/*
560 * Tosa LEDs
561 */
Dmitry Baryshkovba4eb7e2008-04-19 10:42:25 +0100562static struct gpio_led tosa_gpio_leds[] = {
Dmitry Baryshkov311c7362008-04-12 20:17:02 +0100563 {
564 .name = "tosa:amber:charge",
565 .default_trigger = "main-battery-charging",
566 .gpio = TOSA_GPIO_CHRG_ERR_LED,
567 },
568 {
569 .name = "tosa:green:mail",
570 .default_trigger = "nand-disk",
571 .gpio = TOSA_GPIO_NOTE_LED,
572 },
Dmitry Baryshkovc5461062008-04-19 10:42:06 +0100573 {
574 .name = "tosa:dual:wlan",
575 .default_trigger = "none",
576 .gpio = TOSA_GPIO_WLAN_LED,
577 },
578 {
579 .name = "tosa:blue:bluetooth",
Dmitry Baryshkov16b32fd2008-07-05 09:02:48 +0100580 .default_trigger = "tosa-bt",
Dmitry Baryshkovc5461062008-04-19 10:42:06 +0100581 .gpio = TOSA_GPIO_BT_LED,
582 },
Dmitry Baryshkov311c7362008-04-12 20:17:02 +0100583};
584
Dmitry Baryshkovba4eb7e2008-04-19 10:42:25 +0100585static struct gpio_led_platform_data tosa_gpio_leds_platform_data = {
Dmitry Baryshkov311c7362008-04-12 20:17:02 +0100586 .leds = tosa_gpio_leds,
587 .num_leds = ARRAY_SIZE(tosa_gpio_leds),
588};
589
Dirk Opfer6d0cf3e2006-03-31 02:31:12 -0800590static struct platform_device tosaled_device = {
Dmitry Baryshkov311c7362008-04-12 20:17:02 +0100591 .name = "leds-gpio",
592 .id = -1,
593 .dev = {
594 .platform_data = &tosa_gpio_leds_platform_data,
595 },
Dirk Opfer6d0cf3e2006-03-31 02:31:12 -0800596};
597
Dmitry Baryshkovbf0116e2008-06-14 11:42:02 +0100598/*
599 * Toshiba Mobile IO Controller
600 */
601static struct resource tc6393xb_resources[] = {
602 [0] = {
603 .start = TOSA_LCDC_PHYS,
604 .end = TOSA_LCDC_PHYS + 0x3ffffff,
605 .flags = IORESOURCE_MEM,
606 },
607
608 [1] = {
609 .start = TOSA_IRQ_GPIO_TC6393XB_INT,
610 .end = TOSA_IRQ_GPIO_TC6393XB_INT,
611 .flags = IORESOURCE_IRQ,
612 },
613};
614
615
616static int tosa_tc6393xb_enable(struct platform_device *dev)
617{
618 int rc;
619
620 rc = gpio_request(TOSA_GPIO_TC6393XB_REST_IN, "tc6393xb #pclr");
621 if (rc)
622 goto err_req_pclr;
623 rc = gpio_request(TOSA_GPIO_TC6393XB_SUSPEND, "tc6393xb #suspend");
624 if (rc)
625 goto err_req_suspend;
Dmitry Baryshkov14b7b402008-09-13 21:06:41 +0400626 rc = gpio_request(TOSA_GPIO_TC6393XB_L3V_ON, "tc6393xb l3v");
Dmitry Baryshkovbf0116e2008-06-14 11:42:02 +0100627 if (rc)
628 goto err_req_l3v;
629 rc = gpio_direction_output(TOSA_GPIO_TC6393XB_L3V_ON, 0);
630 if (rc)
631 goto err_dir_l3v;
632 rc = gpio_direction_output(TOSA_GPIO_TC6393XB_SUSPEND, 0);
633 if (rc)
634 goto err_dir_suspend;
635 rc = gpio_direction_output(TOSA_GPIO_TC6393XB_REST_IN, 0);
636 if (rc)
637 goto err_dir_pclr;
638
639 mdelay(1);
640
641 gpio_set_value(TOSA_GPIO_TC6393XB_SUSPEND, 1);
642
643 mdelay(10);
644
645 gpio_set_value(TOSA_GPIO_TC6393XB_REST_IN, 1);
646 gpio_set_value(TOSA_GPIO_TC6393XB_L3V_ON, 1);
647
648 return 0;
649err_dir_pclr:
650err_dir_suspend:
651err_dir_l3v:
652 gpio_free(TOSA_GPIO_TC6393XB_L3V_ON);
653err_req_l3v:
654 gpio_free(TOSA_GPIO_TC6393XB_SUSPEND);
655err_req_suspend:
656 gpio_free(TOSA_GPIO_TC6393XB_REST_IN);
657err_req_pclr:
658 return rc;
659}
660
661static int tosa_tc6393xb_disable(struct platform_device *dev)
662{
663 gpio_free(TOSA_GPIO_TC6393XB_L3V_ON);
664 gpio_free(TOSA_GPIO_TC6393XB_SUSPEND);
665 gpio_free(TOSA_GPIO_TC6393XB_REST_IN);
666
667 return 0;
668}
669
670static int tosa_tc6393xb_resume(struct platform_device *dev)
671{
672 gpio_set_value(TOSA_GPIO_TC6393XB_SUSPEND, 1);
673 mdelay(10);
674 gpio_set_value(TOSA_GPIO_TC6393XB_L3V_ON, 1);
675 mdelay(10);
676
677 return 0;
678}
679
680static int tosa_tc6393xb_suspend(struct platform_device *dev)
681{
682 gpio_set_value(TOSA_GPIO_TC6393XB_L3V_ON, 0);
683 gpio_set_value(TOSA_GPIO_TC6393XB_SUSPEND, 0);
684 return 0;
685}
686
Dmitry Baryshkov5289fec2008-06-27 10:38:44 +0100687static uint8_t scan_ff_pattern[] = { 0xff, 0xff };
688
689static struct nand_bbt_descr tosa_tc6393xb_nand_bbt = {
690 .options = 0,
691 .offs = 4,
692 .len = 2,
693 .pattern = scan_ff_pattern
694};
695
Andrea Adamib3bd8552017-11-21 22:43:49 +0100696static const char * const probes[] = {
697 "cmdlinepart",
698 "ofpart",
699 "sharpslpart",
700 NULL,
701};
702
Dmitry Baryshkov5289fec2008-06-27 10:38:44 +0100703static struct tmio_nand_data tosa_tc6393xb_nand_config = {
Dmitry Baryshkov5289fec2008-06-27 10:38:44 +0100704 .badblock_pattern = &tosa_tc6393xb_nand_bbt,
Andrea Adamib3bd8552017-11-21 22:43:49 +0100705 .part_parsers = probes,
Dmitry Baryshkov5289fec2008-06-27 10:38:44 +0100706};
707
Dmitry Baryshkov1c1b6ff2008-09-24 23:36:23 +0200708static int tosa_tc6393xb_setup(struct platform_device *dev)
709{
710 int rc;
711
712 rc = gpio_request(TOSA_GPIO_CARD_VCC_ON, "CARD_VCC_ON");
713 if (rc)
714 goto err_req;
715
716 rc = gpio_direction_output(TOSA_GPIO_CARD_VCC_ON, 1);
717 if (rc)
718 goto err_dir;
719
720 return rc;
721
722err_dir:
723 gpio_free(TOSA_GPIO_CARD_VCC_ON);
724err_req:
725 return rc;
726}
727
728static void tosa_tc6393xb_teardown(struct platform_device *dev)
729{
730 gpio_free(TOSA_GPIO_CARD_VCC_ON);
731}
732
Dmitry Baryshkovddfb33c2008-11-27 01:25:09 +0300733#ifdef CONFIG_MFD_TC6393XB
Dmitry Baryshkov31c9b282008-10-28 18:40:37 +0300734static struct fb_videomode tosa_tc6393xb_lcd_mode[] = {
735 {
736 .xres = 480,
737 .yres = 640,
738 .pixclock = 0x002cdf00,/* PLL divisor */
739 .left_margin = 0x004c,
740 .right_margin = 0x005b,
741 .upper_margin = 0x0001,
742 .lower_margin = 0x000d,
743 .hsync_len = 0x0002,
744 .vsync_len = 0x0001,
745 .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
746 .vmode = FB_VMODE_NONINTERLACED,
747 },{
748 .xres = 240,
749 .yres = 320,
750 .pixclock = 0x00e7f203,/* PLL divisor */
751 .left_margin = 0x0024,
752 .right_margin = 0x002f,
753 .upper_margin = 0x0001,
754 .lower_margin = 0x000d,
755 .hsync_len = 0x0002,
756 .vsync_len = 0x0001,
757 .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
758 .vmode = FB_VMODE_NONINTERLACED,
759 }
760};
761
762static struct tmio_fb_data tosa_tc6393xb_fb_config = {
763 .lcd_set_power = tc6393xb_lcd_set_power,
764 .lcd_mode = tc6393xb_lcd_mode,
765 .num_modes = ARRAY_SIZE(tosa_tc6393xb_lcd_mode),
766 .modes = &tosa_tc6393xb_lcd_mode[0],
767 .height = 82,
768 .width = 60,
769};
Dmitry Baryshkovddfb33c2008-11-27 01:25:09 +0300770#endif
Dmitry Baryshkov31c9b282008-10-28 18:40:37 +0300771
Dmitry Baryshkov1c1b6ff2008-09-24 23:36:23 +0200772static struct tc6393xb_platform_data tosa_tc6393xb_data = {
Dmitry Baryshkovbf0116e2008-06-14 11:42:02 +0100773 .scr_pll2cr = 0x0cc1,
774 .scr_gper = 0x3300,
Dmitry Baryshkovbf0116e2008-06-14 11:42:02 +0100775
776 .irq_base = IRQ_BOARD_START,
777 .gpio_base = TOSA_TC6393XB_GPIO_BASE,
Dmitry Baryshkov1c1b6ff2008-09-24 23:36:23 +0200778 .setup = tosa_tc6393xb_setup,
779 .teardown = tosa_tc6393xb_teardown,
Dmitry Baryshkovbf0116e2008-06-14 11:42:02 +0100780
781 .enable = tosa_tc6393xb_enable,
782 .disable = tosa_tc6393xb_disable,
783 .suspend = tosa_tc6393xb_suspend,
784 .resume = tosa_tc6393xb_resume,
Dmitry Baryshkov5289fec2008-06-27 10:38:44 +0100785
786 .nand_data = &tosa_tc6393xb_nand_config,
Dmitry Baryshkovddfb33c2008-11-27 01:25:09 +0300787#ifdef CONFIG_MFD_TC6393XB
Dmitry Baryshkov31c9b282008-10-28 18:40:37 +0300788 .fb_data = &tosa_tc6393xb_fb_config,
Dmitry Baryshkovddfb33c2008-11-27 01:25:09 +0300789#endif
Dmitry Baryshkovf98a0bd2008-09-24 23:46:10 +0200790
791 .resume_restore = 1,
Dmitry Baryshkovbf0116e2008-06-14 11:42:02 +0100792};
793
794
795static struct platform_device tc6393xb_device = {
796 .name = "tc6393xb",
797 .id = -1,
798 .dev = {
Dmitry Baryshkov1c1b6ff2008-09-24 23:36:23 +0200799 .platform_data = &tosa_tc6393xb_data,
Dmitry Baryshkovbf0116e2008-06-14 11:42:02 +0100800 },
801 .num_resources = ARRAY_SIZE(tc6393xb_resources),
802 .resource = tc6393xb_resources,
803};
804
Dmitry Baryshkov16b32fd2008-07-05 09:02:48 +0100805static struct tosa_bt_data tosa_bt_data = {
806 .gpio_pwr = TOSA_GPIO_BT_PWR_EN,
807 .gpio_reset = TOSA_GPIO_BT_RESET,
808};
809
810static struct platform_device tosa_bt_device = {
811 .name = "tosa-bt",
812 .id = -1,
813 .dev.platform_data = &tosa_bt_data,
814};
815
Lubomir Rintel51eea522019-01-16 16:13:31 +0100816static struct pxa2xx_spi_controller pxa_ssp_master_info = {
Dmitry Baryshkov14b7b402008-09-13 21:06:41 +0400817 .num_chipselect = 1,
818};
819
820static struct spi_board_info spi_board_info[] __initdata = {
821 {
822 .modalias = "tosa-lcd",
823 // .platform_data
824 .max_speed_hz = 28750,
825 .bus_num = 2,
826 .chip_select = 0,
827 .mode = SPI_MODE_0,
828 },
829};
Dmitry Baryshkov16b32fd2008-07-05 09:02:48 +0100830
Dmitry Baryshkovf34ee792008-11-25 00:57:27 +0300831static struct mtd_partition sharpsl_rom_parts[] = {
832 {
833 .name ="Boot PROM Filesystem",
834 .offset = 0x00160000,
835 .size = MTDPART_SIZ_FULL,
836 },
837};
838
839static struct physmap_flash_data sharpsl_rom_data = {
840 .width = 2,
841 .nr_parts = ARRAY_SIZE(sharpsl_rom_parts),
842 .parts = sharpsl_rom_parts,
843};
844
845static struct resource sharpsl_rom_resources[] = {
846 {
847 .start = 0x00000000,
848 .end = 0x007fffff,
849 .flags = IORESOURCE_MEM,
850 },
851};
852
853static struct platform_device sharpsl_rom_device = {
854 .name = "physmap-flash",
855 .id = -1,
856 .resource = sharpsl_rom_resources,
857 .num_resources = ARRAY_SIZE(sharpsl_rom_resources),
858 .dev.platform_data = &sharpsl_rom_data,
859};
860
Dmitry Eremin-Solenikovfa4704f2011-02-23 02:29:10 +0300861static struct platform_device wm9712_device = {
862 .name = "wm9712-codec",
863 .id = -1,
864};
865
Axel Linf285b8c2011-12-15 10:57:22 +0800866static struct platform_device tosa_audio_device = {
867 .name = "tosa-audio",
868 .id = -1,
869};
870
Dirk Opfer8459c152005-11-06 14:27:52 +0000871static struct platform_device *devices[] __initdata = {
872 &tosascoop_device,
873 &tosascoop_jc_device,
Dmitry Baryshkovbf0116e2008-06-14 11:42:02 +0100874 &tc6393xb_device,
Dmitry Baryshkov53b14ea2008-06-14 11:43:36 +0100875 &tosa_power_device,
Dirk Opfera93876c2005-11-08 19:15:30 +0000876 &tosakbd_device,
Dmitry Baryshkov93e9012f2008-01-21 01:04:20 -0500877 &tosa_gpio_keys_device,
Dirk Opfer6d0cf3e2006-03-31 02:31:12 -0800878 &tosaled_device,
Dmitry Baryshkov16b32fd2008-07-05 09:02:48 +0100879 &tosa_bt_device,
Dmitry Baryshkovf34ee792008-11-25 00:57:27 +0300880 &sharpsl_rom_device,
Dmitry Eremin-Solenikovfa4704f2011-02-23 02:29:10 +0300881 &wm9712_device,
Dmitry Eremin-Solenikovef8b3cc2011-02-14 15:33:18 +0300882 &tosa_gpio_vbus,
Axel Linf285b8c2011-12-15 10:57:22 +0800883 &tosa_audio_device,
Dirk Opfer8459c152005-11-06 14:27:52 +0000884};
885
Richard Purdie74617fb2006-06-19 19:57:12 +0100886static void tosa_poweroff(void)
887{
Robin Holt7b6d8642013-07-08 16:01:40 -0700888 pxa_restart(REBOOT_GPIO, NULL);
Richard Purdie74617fb2006-06-19 19:57:12 +0100889}
890
Robin Holt7b6d8642013-07-08 16:01:40 -0700891static void tosa_restart(enum reboot_mode mode, const char *cmd)
Richard Purdie74617fb2006-06-19 19:57:12 +0100892{
Marek Vasutad68bb92010-11-03 16:29:35 +0100893 uint32_t msc0 = __raw_readl(MSC0);
894
Richard Purdie74617fb2006-06-19 19:57:12 +0100895 /* Bootloader magic for a reboot */
Marek Vasutad68bb92010-11-03 16:29:35 +0100896 if((msc0 & 0xffff0000) == 0x7ff00000)
897 __raw_writel((msc0 & 0xffff) | 0x7ee00000, MSC0);
Richard Purdie74617fb2006-06-19 19:57:12 +0100898
899 tosa_poweroff();
900}
901
Dirk Opfer8459c152005-11-06 14:27:52 +0000902static void __init tosa_init(void)
903{
Dmitry Baryshkov2cb47342008-04-10 11:00:32 +0100904 pxa2xx_mfp_config(ARRAY_AND_SIZE(tosa_pin_config));
Russell Kingcc155c62009-11-09 13:34:08 +0800905
906 pxa_set_ffuart_info(NULL);
907 pxa_set_btuart_info(NULL);
908 pxa_set_stuart_info(NULL);
909
Dmitry Baryshkov2cb47342008-04-10 11:00:32 +0100910 gpio_set_wake(MFP_PIN_GPIO1, 1);
911 /* We can't pass to gpio-keys since it will drop the Reset altfunc */
912
Daniel Ribeiro216e3b72009-05-05 22:43:18 -0300913 init_gpio_reset(TOSA_GPIO_ON_RESET, 0, 0);
Dmitry Baryshkov86159a92008-05-22 16:21:48 +0100914
Richard Purdie74617fb2006-06-19 19:57:12 +0100915 pm_power_off = tosa_poweroff;
Richard Purdie74617fb2006-06-19 19:57:12 +0100916
Dirk Opfer8459c152005-11-06 14:27:52 +0000917 PCFR |= PCFR_OPDE;
918
Dirk Opfera93876c2005-11-08 19:15:30 +0000919 /* enable batt_fault */
Dirk Opfer8459c152005-11-06 14:27:52 +0000920 PMCR = 0x01;
921
Linus Walleij32d15442018-12-02 09:43:22 +0100922 gpiod_add_lookup_table(&tosa_mci_gpio_table);
Dirk Opfera93876c2005-11-08 19:15:30 +0000923 pxa_set_mci_info(&tosa_mci_platform_data);
Dirk Opfera93876c2005-11-08 19:15:30 +0000924 pxa_set_ficp_info(&tosa_ficp_platform_data);
Dmitry Baryshkov481ea5a2008-04-10 15:43:18 +0100925 pxa_set_i2c_info(NULL);
Mark Brown80748fb2009-04-03 12:45:49 +0100926 pxa_set_ac97_info(NULL);
Dirk Opfer4c18ad22005-11-08 19:15:50 +0000927 platform_scoop_config = &tosa_pcmcia_config;
Dirk Opfer8459c152005-11-06 14:27:52 +0000928
Dmitry Baryshkov14b7b402008-09-13 21:06:41 +0400929 pxa2xx_set_spi_info(2, &pxa_ssp_master_info);
930 spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));
931
Dmitry Eremin-Solenikovc68ffdd2009-03-05 18:17:53 +0300932 clk_add_alias("CLK_CK3P6MI", tc6393xb_device.name, "GPIO11_CLK", NULL);
Dmitry Baryshkov7bdb22c2008-09-10 10:30:37 +0100933
Dirk Opfer4c18ad22005-11-08 19:15:50 +0000934 platform_add_devices(devices, ARRAY_SIZE(devices));
Dirk Opfer8459c152005-11-06 14:27:52 +0000935}
936
Laura Abbott1c2f87c2014-04-13 22:54:58 +0100937static void __init fixup_tosa(struct tag *tags, char **cmdline)
Dirk Opfer8459c152005-11-06 14:27:52 +0000938{
939 sharpsl_save_param();
Laura Abbott1c2f87c2014-04-13 22:54:58 +0100940 memblock_add(0xa0000000, SZ_64M);
Dirk Opfer8459c152005-11-06 14:27:52 +0000941}
942
943MACHINE_START(TOSA, "SHARP Tosa")
Dirk Opfer8459c152005-11-06 14:27:52 +0000944 .fixup = fixup_tosa,
Marek Vasut851982c2010-10-11 02:20:19 +0200945 .map_io = pxa25x_map_io,
Haojian Zhuang6ac6b812010-08-20 15:23:59 +0800946 .nr_irqs = TOSA_NR_IRQS,
Eric Miaocd491042007-06-22 04:14:09 +0100947 .init_irq = pxa25x_init_irq,
Eric Miao8a97ae22011-05-18 21:30:04 +0800948 .handle_irq = pxa25x_handle_irq,
Dirk Opfer8459c152005-11-06 14:27:52 +0000949 .init_machine = tosa_init,
Stephen Warren6bb27d72012-11-08 12:40:59 -0700950 .init_time = pxa_timer_init,
Russell King271a74f2011-11-04 14:15:53 +0000951 .restart = tosa_restart,
Dirk Opfer8459c152005-11-06 14:27:52 +0000952MACHINE_END