2 * Support for Sharp SL-C6000x PDAs
5 * Copyright (c) 2005 Dirk Opfer
7 * Based on code written by Sharp/Lineo for 2.4 kernels
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.
15 #include <linux/kernel.h>
16 #include <linux/init.h>
17 #include <linux/platform_device.h>
18 #include <linux/major.h>
20 #include <linux/interrupt.h>
21 #include <linux/delay.h>
23 #include <linux/mmc/host.h>
24 #include <linux/mfd/tc6393xb.h>
25 #include <linux/mfd/tmio.h>
26 #include <linux/mtd/nand.h>
27 #include <linux/mtd/partitions.h>
28 #include <linux/mtd/physmap.h>
30 #include <linux/gpio_keys.h>
31 #include <linux/input.h>
32 #include <linux/gpio.h>
33 #include <linux/pda_power.h>
34 #include <linux/spi/spi.h>
35 #include <linux/spi/pxa2xx_spi.h>
36 #include <linux/input/matrix_keypad.h>
37 #include <linux/i2c/pxa-i2c.h>
38 #include <linux/usb/gpio_vbus.h>
39 #include <linux/reboot.h>
41 #include <asm/setup.h>
42 #include <asm/mach-types.h>
44 #include <mach/pxa25x.h>
45 #include <mach/reset.h>
46 #include <linux/platform_data/irda-pxaficp.h>
47 #include <linux/platform_data/mmc-pxamci.h>
49 #include <mach/tosa_bt.h>
50 #include <mach/audio.h>
51 #include <mach/smemc.h>
53 #include <asm/mach/arch.h>
54 #include <mach/tosa.h>
56 #include <asm/hardware/scoop.h>
57 #include <asm/mach/sharpsl_param.h>
63 static unsigned long tosa_pin_config
[] = {
64 GPIO78_nCS_2
, /* Scoop */
65 GPIO80_nCS_4
, /* tg6393xb */
66 GPIO33_nCS_5
, /* Scoop */
68 // GPIO76 CARD_VCC_ON1
70 GPIO19_GPIO
, /* Reset out */
71 GPIO1_RST
| WAKEUP_ON_EDGE_FALL
,
73 GPIO0_GPIO
| WAKEUP_ON_EDGE_FALL
, /* WAKE_UP */
74 GPIO2_GPIO
| WAKEUP_ON_EDGE_BOTH
, /* AC_IN */
75 GPIO3_GPIO
| WAKEUP_ON_EDGE_FALL
, /* RECORD */
76 GPIO4_GPIO
| WAKEUP_ON_EDGE_FALL
, /* SYNC */
77 GPIO20_GPIO
, /* EAR_IN */
80 GPIO5_GPIO
, /* USB_IN */
81 GPIO32_GPIO
, /* Pen IRQ */
83 GPIO7_GPIO
, /* Jacket Detect */
84 GPIO14_GPIO
, /* BAT0_CRG */
85 GPIO12_GPIO
, /* BAT1_CRG */
86 GPIO17_GPIO
, /* BAT0_LOW */
87 GPIO84_GPIO
, /* BAT1_LOW */
88 GPIO38_GPIO
, /* BAT_LOCK */
91 GPIO15_GPIO
, /* TC6393XB IRQ */
93 GPIO27_GPIO
, /* LCD Sync */
98 GPIO9_GPIO
, /* Detect */
99 GPIO10_GPIO
, /* nSD_INT */
102 GPIO13_GPIO
, /* CD_IRQ */
103 GPIO21_GPIO
, /* Main Slot IRQ */
104 GPIO36_GPIO
, /* Jacket Slot IRQ */
118 GPIO30_AC97_SDATA_OUT
,
120 GPIO29_AC97_SDATA_IN_0
,
138 GPIO58_GPIO
| MFP_LPM_DRIVE_LOW
, /* Column 0 */
139 GPIO59_GPIO
| MFP_LPM_DRIVE_LOW
, /* Column 1 */
140 GPIO60_GPIO
| MFP_LPM_DRIVE_LOW
, /* Column 2 */
141 GPIO61_GPIO
| MFP_LPM_DRIVE_LOW
, /* Column 3 */
142 GPIO62_GPIO
| MFP_LPM_DRIVE_LOW
, /* Column 4 */
143 GPIO63_GPIO
| MFP_LPM_DRIVE_LOW
, /* Column 5 */
144 GPIO64_GPIO
| MFP_LPM_DRIVE_LOW
, /* Column 6 */
145 GPIO65_GPIO
| MFP_LPM_DRIVE_LOW
, /* Column 7 */
146 GPIO66_GPIO
| MFP_LPM_DRIVE_LOW
, /* Column 8 */
147 GPIO67_GPIO
| MFP_LPM_DRIVE_LOW
, /* Column 9 */
148 GPIO68_GPIO
| MFP_LPM_DRIVE_LOW
, /* Column 10 */
149 GPIO69_GPIO
| MFP_LPM_DRIVE_LOW
, /* Row 0 */
150 GPIO70_GPIO
| MFP_LPM_DRIVE_LOW
, /* Row 1 */
151 GPIO71_GPIO
| MFP_LPM_DRIVE_LOW
, /* Row 2 */
152 GPIO72_GPIO
| MFP_LPM_DRIVE_LOW
, /* Row 3 */
153 GPIO73_GPIO
| MFP_LPM_DRIVE_LOW
, /* Row 4 */
154 GPIO74_GPIO
| MFP_LPM_DRIVE_LOW
, /* Row 5 */
155 GPIO75_GPIO
| MFP_LPM_DRIVE_LOW
, /* Row 6 */
162 /* IrDA is managed in other way */
170 static struct resource tosa_scoop_resources
[] = {
172 .start
= TOSA_CF_PHYS
,
173 .end
= TOSA_CF_PHYS
+ 0xfff,
174 .flags
= IORESOURCE_MEM
,
178 static struct scoop_config tosa_scoop_setup
= {
179 .io_dir
= TOSA_SCOOP_IO_DIR
,
180 .gpio_base
= TOSA_SCOOP_GPIO_BASE
,
183 static struct platform_device tosascoop_device
= {
184 .name
= "sharp-scoop",
187 .platform_data
= &tosa_scoop_setup
,
189 .num_resources
= ARRAY_SIZE(tosa_scoop_resources
),
190 .resource
= tosa_scoop_resources
,
195 * SCOOP Device Jacket
197 static struct resource tosa_scoop_jc_resources
[] = {
199 .start
= TOSA_SCOOP_PHYS
+ 0x40,
200 .end
= TOSA_SCOOP_PHYS
+ 0xfff,
201 .flags
= IORESOURCE_MEM
,
205 static struct scoop_config tosa_scoop_jc_setup
= {
206 .io_dir
= TOSA_SCOOP_JC_IO_DIR
,
207 .gpio_base
= TOSA_SCOOP_JC_GPIO_BASE
,
210 static struct platform_device tosascoop_jc_device
= {
211 .name
= "sharp-scoop",
214 .platform_data
= &tosa_scoop_jc_setup
,
215 .parent
= &tosascoop_device
.dev
,
217 .num_resources
= ARRAY_SIZE(tosa_scoop_jc_resources
),
218 .resource
= tosa_scoop_jc_resources
,
224 static struct scoop_pcmcia_dev tosa_pcmcia_scoop
[] = {
226 .dev
= &tosascoop_device
.dev
,
227 .irq
= TOSA_IRQ_GPIO_CF_IRQ
,
228 .cd_irq
= TOSA_IRQ_GPIO_CF_CD
,
229 .cd_irq_str
= "PCMCIA0 CD",
231 .dev
= &tosascoop_jc_device
.dev
,
232 .irq
= TOSA_IRQ_GPIO_JC_CF_IRQ
,
237 static struct scoop_pcmcia_config tosa_pcmcia_config
= {
238 .devs
= &tosa_pcmcia_scoop
[0],
243 * USB Device Controller
245 static struct gpio_vbus_mach_info tosa_udc_info
= {
246 .gpio_pullup
= TOSA_GPIO_USB_PULLUP
,
247 .gpio_vbus
= TOSA_GPIO_USB_IN
,
248 .gpio_vbus_inverted
= 1,
251 static struct platform_device tosa_gpio_vbus
= {
255 .platform_data
= &tosa_udc_info
,
262 static int tosa_mci_init(struct device
*dev
, irq_handler_t tosa_detect_int
, void *data
)
266 err
= gpio_request(TOSA_GPIO_nSD_INT
, "SD Int");
268 printk(KERN_ERR
"tosa_mci_init: can't request SD_PWR gpio\n");
271 err
= gpio_direction_input(TOSA_GPIO_nSD_INT
);
273 goto err_gpio_int_dir
;
278 gpio_free(TOSA_GPIO_nSD_INT
);
283 static void tosa_mci_exit(struct device
*dev
, void *data
)
285 gpio_free(TOSA_GPIO_nSD_INT
);
288 static struct pxamci_platform_data tosa_mci_platform_data
= {
289 .detect_delay_ms
= 250,
290 .ocr_mask
= MMC_VDD_32_33
|MMC_VDD_33_34
,
291 .init
= tosa_mci_init
,
292 .exit
= tosa_mci_exit
,
293 .gpio_card_detect
= TOSA_GPIO_nSD_DETECT
,
294 .gpio_card_ro
= TOSA_GPIO_SD_WP
,
295 .gpio_power
= TOSA_GPIO_PWR_ON
,
301 static void tosa_irda_transceiver_mode(struct device
*dev
, int mode
)
304 gpio_set_value(TOSA_GPIO_IR_POWERDWN
, 0);
305 pxa2xx_transceiver_mode(dev
, mode
);
306 gpio_direction_output(TOSA_GPIO_IRDA_TX
, 0);
308 pxa2xx_transceiver_mode(dev
, mode
);
309 gpio_set_value(TOSA_GPIO_IR_POWERDWN
, 1);
313 static int tosa_irda_startup(struct device
*dev
)
317 ret
= gpio_request(TOSA_GPIO_IRDA_TX
, "IrDA TX");
320 ret
= gpio_direction_output(TOSA_GPIO_IRDA_TX
, 0);
324 ret
= gpio_request(TOSA_GPIO_IR_POWERDWN
, "IrDA powerdown");
328 ret
= gpio_direction_output(TOSA_GPIO_IR_POWERDWN
, 0);
332 tosa_irda_transceiver_mode(dev
, IR_SIRMODE
| IR_OFF
);
337 gpio_free(TOSA_GPIO_IR_POWERDWN
);
340 gpio_free(TOSA_GPIO_IRDA_TX
);
345 static void tosa_irda_shutdown(struct device
*dev
)
347 tosa_irda_transceiver_mode(dev
, IR_SIRMODE
| IR_OFF
);
348 gpio_free(TOSA_GPIO_IR_POWERDWN
);
349 gpio_free(TOSA_GPIO_IRDA_TX
);
352 static struct pxaficp_platform_data tosa_ficp_platform_data
= {
354 .transceiver_cap
= IR_SIRMODE
| IR_OFF
,
355 .transceiver_mode
= tosa_irda_transceiver_mode
,
356 .startup
= tosa_irda_startup
,
357 .shutdown
= tosa_irda_shutdown
,
363 static int tosa_power_init(struct device
*dev
)
365 int ret
= gpio_request(TOSA_GPIO_AC_IN
, "ac in");
369 ret
= gpio_direction_input(TOSA_GPIO_AC_IN
);
376 gpio_free(TOSA_GPIO_AC_IN
);
381 static void tosa_power_exit(struct device
*dev
)
383 gpio_free(TOSA_GPIO_AC_IN
);
386 static int tosa_power_ac_online(void)
388 return gpio_get_value(TOSA_GPIO_AC_IN
) == 0;
391 static char *tosa_ac_supplied_to
[] = {
397 static struct pda_power_pdata tosa_power_data
= {
398 .init
= tosa_power_init
,
399 .is_ac_online
= tosa_power_ac_online
,
400 .exit
= tosa_power_exit
,
401 .supplied_to
= tosa_ac_supplied_to
,
402 .num_supplicants
= ARRAY_SIZE(tosa_ac_supplied_to
),
405 static struct resource tosa_power_resource
[] = {
408 .start
= PXA_GPIO_TO_IRQ(TOSA_GPIO_AC_IN
),
409 .end
= PXA_GPIO_TO_IRQ(TOSA_GPIO_AC_IN
),
410 .flags
= IORESOURCE_IRQ
|
411 IORESOURCE_IRQ_HIGHEDGE
|
412 IORESOURCE_IRQ_LOWEDGE
,
416 static struct platform_device tosa_power_device
= {
419 .dev
.platform_data
= &tosa_power_data
,
420 .resource
= tosa_power_resource
,
421 .num_resources
= ARRAY_SIZE(tosa_power_resource
),
427 static const uint32_t tosakbd_keymap
[] = {
430 KEY(0, 6, KEY_BACKSPACE
),
438 KEY(1, 7, KEY_COMMA
),
444 KEY(2, 6, KEY_ENTER
),
450 KEY(3, 4, TOSA_KEY_ADDRESSBOOK
),
451 KEY(3, 5, TOSA_KEY_CANCEL
),
452 KEY(3, 6, TOSA_KEY_CENTER
),
453 KEY(3, 7, TOSA_KEY_OK
),
454 KEY(3, 8, KEY_LEFTSHIFT
),
459 KEY(4, 4, TOSA_KEY_CALENDAR
),
460 KEY(4, 5, TOSA_KEY_HOMEPAGE
),
461 KEY(4, 6, KEY_LEFTCTRL
),
462 KEY(4, 7, TOSA_KEY_LIGHT
),
463 KEY(4, 9, KEY_RIGHTSHIFT
),
465 KEY(5, 1, KEY_SLASH
),
468 KEY(5, 4, TOSA_KEY_MENU
),
470 KEY(5, 10, TOSA_KEY_FN
),
473 KEY(6, 2, KEY_SPACE
),
474 KEY(6, 3, KEY_APOSTROPHE
),
475 KEY(6, 4, TOSA_KEY_MAIL
),
478 KEY(6, 7, KEY_RIGHT
),
481 static struct matrix_keymap_data tosakbd_keymap_data
= {
482 .keymap
= tosakbd_keymap
,
483 .keymap_size
= ARRAY_SIZE(tosakbd_keymap
),
486 static const int tosakbd_col_gpios
[] =
487 { 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68 };
488 static const int tosakbd_row_gpios
[] =
489 { 69, 70, 71, 72, 73, 74, 75 };
491 static struct matrix_keypad_platform_data tosakbd_pdata
= {
492 .keymap_data
= &tosakbd_keymap_data
,
493 .row_gpios
= tosakbd_row_gpios
,
494 .col_gpios
= tosakbd_col_gpios
,
495 .num_row_gpios
= ARRAY_SIZE(tosakbd_row_gpios
),
496 .num_col_gpios
= ARRAY_SIZE(tosakbd_col_gpios
),
497 .col_scan_delay_us
= 10,
502 static struct platform_device tosakbd_device
= {
503 .name
= "matrix-keypad",
506 .platform_data
= &tosakbd_pdata
,
510 static struct gpio_keys_button tosa_gpio_keys
[] = {
512 * Two following keys are directly tied to "ON" button of tosa. Why?
513 * The first one can be used as a wakeup source, the second can't;
514 * also the first one is OR of ac_powered and on_button.
518 .code
= KEY_RESERVED
,
519 .gpio
= TOSA_GPIO_POWERON
,
527 .gpio
= TOSA_GPIO_ON_KEY
,
530 * can't be used as wakeup
537 .code
= TOSA_KEY_RECORD
,
538 .gpio
= TOSA_GPIO_RECORD_BTN
,
539 .desc
= "Record Button",
545 .code
= TOSA_KEY_SYNC
,
546 .gpio
= TOSA_GPIO_SYNC
,
547 .desc
= "Sync Button",
553 .code
= SW_HEADPHONE_INSERT
,
554 .gpio
= TOSA_GPIO_EAR_IN
,
555 .desc
= "HeadPhone insert",
557 .debounce_interval
= 300,
561 static struct gpio_keys_platform_data tosa_gpio_keys_platform_data
= {
562 .buttons
= tosa_gpio_keys
,
563 .nbuttons
= ARRAY_SIZE(tosa_gpio_keys
),
566 static struct platform_device tosa_gpio_keys_device
= {
570 .platform_data
= &tosa_gpio_keys_platform_data
,
577 static struct gpio_led tosa_gpio_leds
[] = {
579 .name
= "tosa:amber:charge",
580 .default_trigger
= "main-battery-charging",
581 .gpio
= TOSA_GPIO_CHRG_ERR_LED
,
584 .name
= "tosa:green:mail",
585 .default_trigger
= "nand-disk",
586 .gpio
= TOSA_GPIO_NOTE_LED
,
589 .name
= "tosa:dual:wlan",
590 .default_trigger
= "none",
591 .gpio
= TOSA_GPIO_WLAN_LED
,
594 .name
= "tosa:blue:bluetooth",
595 .default_trigger
= "tosa-bt",
596 .gpio
= TOSA_GPIO_BT_LED
,
600 static struct gpio_led_platform_data tosa_gpio_leds_platform_data
= {
601 .leds
= tosa_gpio_leds
,
602 .num_leds
= ARRAY_SIZE(tosa_gpio_leds
),
605 static struct platform_device tosaled_device
= {
609 .platform_data
= &tosa_gpio_leds_platform_data
,
614 * Toshiba Mobile IO Controller
616 static struct resource tc6393xb_resources
[] = {
618 .start
= TOSA_LCDC_PHYS
,
619 .end
= TOSA_LCDC_PHYS
+ 0x3ffffff,
620 .flags
= IORESOURCE_MEM
,
624 .start
= TOSA_IRQ_GPIO_TC6393XB_INT
,
625 .end
= TOSA_IRQ_GPIO_TC6393XB_INT
,
626 .flags
= IORESOURCE_IRQ
,
631 static int tosa_tc6393xb_enable(struct platform_device
*dev
)
635 rc
= gpio_request(TOSA_GPIO_TC6393XB_REST_IN
, "tc6393xb #pclr");
638 rc
= gpio_request(TOSA_GPIO_TC6393XB_SUSPEND
, "tc6393xb #suspend");
640 goto err_req_suspend
;
641 rc
= gpio_request(TOSA_GPIO_TC6393XB_L3V_ON
, "tc6393xb l3v");
644 rc
= gpio_direction_output(TOSA_GPIO_TC6393XB_L3V_ON
, 0);
647 rc
= gpio_direction_output(TOSA_GPIO_TC6393XB_SUSPEND
, 0);
649 goto err_dir_suspend
;
650 rc
= gpio_direction_output(TOSA_GPIO_TC6393XB_REST_IN
, 0);
656 gpio_set_value(TOSA_GPIO_TC6393XB_SUSPEND
, 1);
660 gpio_set_value(TOSA_GPIO_TC6393XB_REST_IN
, 1);
661 gpio_set_value(TOSA_GPIO_TC6393XB_L3V_ON
, 1);
667 gpio_free(TOSA_GPIO_TC6393XB_L3V_ON
);
669 gpio_free(TOSA_GPIO_TC6393XB_SUSPEND
);
671 gpio_free(TOSA_GPIO_TC6393XB_REST_IN
);
676 static int tosa_tc6393xb_disable(struct platform_device
*dev
)
678 gpio_free(TOSA_GPIO_TC6393XB_L3V_ON
);
679 gpio_free(TOSA_GPIO_TC6393XB_SUSPEND
);
680 gpio_free(TOSA_GPIO_TC6393XB_REST_IN
);
685 static int tosa_tc6393xb_resume(struct platform_device
*dev
)
687 gpio_set_value(TOSA_GPIO_TC6393XB_SUSPEND
, 1);
689 gpio_set_value(TOSA_GPIO_TC6393XB_L3V_ON
, 1);
695 static int tosa_tc6393xb_suspend(struct platform_device
*dev
)
697 gpio_set_value(TOSA_GPIO_TC6393XB_L3V_ON
, 0);
698 gpio_set_value(TOSA_GPIO_TC6393XB_SUSPEND
, 0);
702 static struct mtd_partition tosa_nand_partition
[] = {
706 .size
= 7 * 1024 * 1024,
710 .offset
= MTDPART_OFS_APPEND
,
711 .size
= 28 * 1024 * 1024,
715 .offset
= MTDPART_OFS_APPEND
,
716 .size
= MTDPART_SIZ_FULL
,
720 static uint8_t scan_ff_pattern
[] = { 0xff, 0xff };
722 static struct nand_bbt_descr tosa_tc6393xb_nand_bbt
= {
726 .pattern
= scan_ff_pattern
729 static struct tmio_nand_data tosa_tc6393xb_nand_config
= {
730 .num_partitions
= ARRAY_SIZE(tosa_nand_partition
),
731 .partition
= tosa_nand_partition
,
732 .badblock_pattern
= &tosa_tc6393xb_nand_bbt
,
735 static int tosa_tc6393xb_setup(struct platform_device
*dev
)
739 rc
= gpio_request(TOSA_GPIO_CARD_VCC_ON
, "CARD_VCC_ON");
743 rc
= gpio_direction_output(TOSA_GPIO_CARD_VCC_ON
, 1);
750 gpio_free(TOSA_GPIO_CARD_VCC_ON
);
755 static void tosa_tc6393xb_teardown(struct platform_device
*dev
)
757 gpio_free(TOSA_GPIO_CARD_VCC_ON
);
760 #ifdef CONFIG_MFD_TC6393XB
761 static struct fb_videomode tosa_tc6393xb_lcd_mode
[] = {
765 .pixclock
= 0x002cdf00,/* PLL divisor */
766 .left_margin
= 0x004c,
767 .right_margin
= 0x005b,
768 .upper_margin
= 0x0001,
769 .lower_margin
= 0x000d,
772 .sync
= FB_SYNC_HOR_HIGH_ACT
| FB_SYNC_VERT_HIGH_ACT
,
773 .vmode
= FB_VMODE_NONINTERLACED
,
777 .pixclock
= 0x00e7f203,/* PLL divisor */
778 .left_margin
= 0x0024,
779 .right_margin
= 0x002f,
780 .upper_margin
= 0x0001,
781 .lower_margin
= 0x000d,
784 .sync
= FB_SYNC_HOR_HIGH_ACT
| FB_SYNC_VERT_HIGH_ACT
,
785 .vmode
= FB_VMODE_NONINTERLACED
,
789 static struct tmio_fb_data tosa_tc6393xb_fb_config
= {
790 .lcd_set_power
= tc6393xb_lcd_set_power
,
791 .lcd_mode
= tc6393xb_lcd_mode
,
792 .num_modes
= ARRAY_SIZE(tosa_tc6393xb_lcd_mode
),
793 .modes
= &tosa_tc6393xb_lcd_mode
[0],
799 static struct tc6393xb_platform_data tosa_tc6393xb_data
= {
800 .scr_pll2cr
= 0x0cc1,
803 .irq_base
= IRQ_BOARD_START
,
804 .gpio_base
= TOSA_TC6393XB_GPIO_BASE
,
805 .setup
= tosa_tc6393xb_setup
,
806 .teardown
= tosa_tc6393xb_teardown
,
808 .enable
= tosa_tc6393xb_enable
,
809 .disable
= tosa_tc6393xb_disable
,
810 .suspend
= tosa_tc6393xb_suspend
,
811 .resume
= tosa_tc6393xb_resume
,
813 .nand_data
= &tosa_tc6393xb_nand_config
,
814 #ifdef CONFIG_MFD_TC6393XB
815 .fb_data
= &tosa_tc6393xb_fb_config
,
822 static struct platform_device tc6393xb_device
= {
826 .platform_data
= &tosa_tc6393xb_data
,
828 .num_resources
= ARRAY_SIZE(tc6393xb_resources
),
829 .resource
= tc6393xb_resources
,
832 static struct tosa_bt_data tosa_bt_data
= {
833 .gpio_pwr
= TOSA_GPIO_BT_PWR_EN
,
834 .gpio_reset
= TOSA_GPIO_BT_RESET
,
837 static struct platform_device tosa_bt_device
= {
840 .dev
.platform_data
= &tosa_bt_data
,
843 static struct pxa2xx_spi_master pxa_ssp_master_info
= {
847 static struct spi_board_info spi_board_info
[] __initdata
= {
849 .modalias
= "tosa-lcd",
851 .max_speed_hz
= 28750,
858 static struct mtd_partition sharpsl_rom_parts
[] = {
860 .name
="Boot PROM Filesystem",
861 .offset
= 0x00160000,
862 .size
= MTDPART_SIZ_FULL
,
866 static struct physmap_flash_data sharpsl_rom_data
= {
868 .nr_parts
= ARRAY_SIZE(sharpsl_rom_parts
),
869 .parts
= sharpsl_rom_parts
,
872 static struct resource sharpsl_rom_resources
[] = {
876 .flags
= IORESOURCE_MEM
,
880 static struct platform_device sharpsl_rom_device
= {
881 .name
= "physmap-flash",
883 .resource
= sharpsl_rom_resources
,
884 .num_resources
= ARRAY_SIZE(sharpsl_rom_resources
),
885 .dev
.platform_data
= &sharpsl_rom_data
,
888 static struct platform_device wm9712_device
= {
889 .name
= "wm9712-codec",
893 static struct platform_device tosa_audio_device
= {
894 .name
= "tosa-audio",
898 static struct platform_device
*devices
[] __initdata
= {
900 &tosascoop_jc_device
,
904 &tosa_gpio_keys_device
,
913 static void tosa_poweroff(void)
915 pxa_restart(REBOOT_GPIO
, NULL
);
918 static void tosa_restart(enum reboot_mode mode
, const char *cmd
)
920 uint32_t msc0
= __raw_readl(MSC0
);
922 /* Bootloader magic for a reboot */
923 if((msc0
& 0xffff0000) == 0x7ff00000)
924 __raw_writel((msc0
& 0xffff) | 0x7ee00000, MSC0
);
929 static void __init
tosa_init(void)
931 pxa2xx_mfp_config(ARRAY_AND_SIZE(tosa_pin_config
));
933 pxa_set_ffuart_info(NULL
);
934 pxa_set_btuart_info(NULL
);
935 pxa_set_stuart_info(NULL
);
937 gpio_set_wake(MFP_PIN_GPIO1
, 1);
938 /* We can't pass to gpio-keys since it will drop the Reset altfunc */
940 init_gpio_reset(TOSA_GPIO_ON_RESET
, 0, 0);
942 pm_power_off
= tosa_poweroff
;
946 /* enable batt_fault */
949 pxa_set_mci_info(&tosa_mci_platform_data
);
950 pxa_set_ficp_info(&tosa_ficp_platform_data
);
951 pxa_set_i2c_info(NULL
);
952 pxa_set_ac97_info(NULL
);
953 platform_scoop_config
= &tosa_pcmcia_config
;
955 pxa2xx_set_spi_info(2, &pxa_ssp_master_info
);
956 spi_register_board_info(spi_board_info
, ARRAY_SIZE(spi_board_info
));
958 clk_add_alias("CLK_CK3P6MI", tc6393xb_device
.name
, "GPIO11_CLK", NULL
);
960 platform_add_devices(devices
, ARRAY_SIZE(devices
));
963 static void __init
fixup_tosa(struct tag
*tags
, char **cmdline
,
966 sharpsl_save_param();
968 mi
->bank
[0].start
= 0xa0000000;
969 mi
->bank
[0].size
= (64*1024*1024);
972 MACHINE_START(TOSA
, "SHARP Tosa")
974 .map_io
= pxa25x_map_io
,
975 .nr_irqs
= TOSA_NR_IRQS
,
976 .init_irq
= pxa25x_init_irq
,
977 .handle_irq
= pxa25x_handle_irq
,
978 .init_machine
= tosa_init
,
979 .init_time
= pxa_timer_init
,
980 .restart
= tosa_restart
,