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>
40 #include <linux/memblock.h>
42 #include <asm/setup.h>
43 #include <asm/mach-types.h>
45 #include <mach/pxa25x.h>
46 #include <mach/reset.h>
47 #include <linux/platform_data/irda-pxaficp.h>
48 #include <linux/platform_data/mmc-pxamci.h>
50 #include <mach/tosa_bt.h>
51 #include <mach/audio.h>
52 #include <mach/smemc.h>
54 #include <asm/mach/arch.h>
55 #include <mach/tosa.h>
57 #include <asm/hardware/scoop.h>
58 #include <asm/mach/sharpsl_param.h>
64 static unsigned long tosa_pin_config
[] = {
65 GPIO78_nCS_2
, /* Scoop */
66 GPIO80_nCS_4
, /* tg6393xb */
67 GPIO33_nCS_5
, /* Scoop */
69 // GPIO76 CARD_VCC_ON1
71 GPIO19_GPIO
, /* Reset out */
72 GPIO1_RST
| WAKEUP_ON_EDGE_FALL
,
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 */
81 GPIO5_GPIO
, /* USB_IN */
82 GPIO32_GPIO
, /* Pen IRQ */
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 */
92 GPIO15_GPIO
, /* TC6393XB IRQ */
94 GPIO27_GPIO
, /* LCD Sync */
99 GPIO9_GPIO
, /* Detect */
100 GPIO10_GPIO
, /* nSD_INT */
103 GPIO13_GPIO
, /* CD_IRQ */
104 GPIO21_GPIO
, /* Main Slot IRQ */
105 GPIO36_GPIO
, /* Jacket Slot IRQ */
119 GPIO30_AC97_SDATA_OUT
,
121 GPIO29_AC97_SDATA_IN_0
,
139 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 */
163 /* IrDA is managed in other way */
171 static struct resource tosa_scoop_resources
[] = {
173 .start
= TOSA_CF_PHYS
,
174 .end
= TOSA_CF_PHYS
+ 0xfff,
175 .flags
= IORESOURCE_MEM
,
179 static struct scoop_config tosa_scoop_setup
= {
180 .io_dir
= TOSA_SCOOP_IO_DIR
,
181 .gpio_base
= TOSA_SCOOP_GPIO_BASE
,
184 static struct platform_device tosascoop_device
= {
185 .name
= "sharp-scoop",
188 .platform_data
= &tosa_scoop_setup
,
190 .num_resources
= ARRAY_SIZE(tosa_scoop_resources
),
191 .resource
= tosa_scoop_resources
,
196 * SCOOP Device Jacket
198 static struct resource tosa_scoop_jc_resources
[] = {
200 .start
= TOSA_SCOOP_PHYS
+ 0x40,
201 .end
= TOSA_SCOOP_PHYS
+ 0xfff,
202 .flags
= IORESOURCE_MEM
,
206 static struct scoop_config tosa_scoop_jc_setup
= {
207 .io_dir
= TOSA_SCOOP_JC_IO_DIR
,
208 .gpio_base
= TOSA_SCOOP_JC_GPIO_BASE
,
211 static struct platform_device tosascoop_jc_device
= {
212 .name
= "sharp-scoop",
215 .platform_data
= &tosa_scoop_jc_setup
,
216 .parent
= &tosascoop_device
.dev
,
218 .num_resources
= ARRAY_SIZE(tosa_scoop_jc_resources
),
219 .resource
= tosa_scoop_jc_resources
,
225 static struct scoop_pcmcia_dev tosa_pcmcia_scoop
[] = {
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",
232 .dev
= &tosascoop_jc_device
.dev
,
233 .irq
= TOSA_IRQ_GPIO_JC_CF_IRQ
,
238 static struct scoop_pcmcia_config tosa_pcmcia_config
= {
239 .devs
= &tosa_pcmcia_scoop
[0],
244 * USB Device Controller
246 static struct gpio_vbus_mach_info tosa_udc_info
= {
247 .gpio_pullup
= TOSA_GPIO_USB_PULLUP
,
248 .gpio_vbus
= TOSA_GPIO_USB_IN
,
249 .gpio_vbus_inverted
= 1,
252 static struct platform_device tosa_gpio_vbus
= {
256 .platform_data
= &tosa_udc_info
,
263 static int tosa_mci_init(struct device
*dev
, irq_handler_t tosa_detect_int
, void *data
)
267 err
= gpio_request(TOSA_GPIO_nSD_INT
, "SD Int");
269 printk(KERN_ERR
"tosa_mci_init: can't request SD_PWR gpio\n");
272 err
= gpio_direction_input(TOSA_GPIO_nSD_INT
);
274 goto err_gpio_int_dir
;
279 gpio_free(TOSA_GPIO_nSD_INT
);
284 static void tosa_mci_exit(struct device
*dev
, void *data
)
286 gpio_free(TOSA_GPIO_nSD_INT
);
289 static struct pxamci_platform_data tosa_mci_platform_data
= {
290 .detect_delay_ms
= 250,
291 .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
,
302 static void tosa_irda_transceiver_mode(struct device
*dev
, int mode
)
305 gpio_set_value(TOSA_GPIO_IR_POWERDWN
, 0);
306 pxa2xx_transceiver_mode(dev
, mode
);
307 gpio_direction_output(TOSA_GPIO_IRDA_TX
, 0);
309 pxa2xx_transceiver_mode(dev
, mode
);
310 gpio_set_value(TOSA_GPIO_IR_POWERDWN
, 1);
314 static int tosa_irda_startup(struct device
*dev
)
318 ret
= gpio_request(TOSA_GPIO_IRDA_TX
, "IrDA TX");
321 ret
= gpio_direction_output(TOSA_GPIO_IRDA_TX
, 0);
325 ret
= gpio_request(TOSA_GPIO_IR_POWERDWN
, "IrDA powerdown");
329 ret
= gpio_direction_output(TOSA_GPIO_IR_POWERDWN
, 0);
333 tosa_irda_transceiver_mode(dev
, IR_SIRMODE
| IR_OFF
);
338 gpio_free(TOSA_GPIO_IR_POWERDWN
);
341 gpio_free(TOSA_GPIO_IRDA_TX
);
346 static void tosa_irda_shutdown(struct device
*dev
)
348 tosa_irda_transceiver_mode(dev
, IR_SIRMODE
| IR_OFF
);
349 gpio_free(TOSA_GPIO_IR_POWERDWN
);
350 gpio_free(TOSA_GPIO_IRDA_TX
);
353 static struct pxaficp_platform_data tosa_ficp_platform_data
= {
355 .transceiver_cap
= IR_SIRMODE
| IR_OFF
,
356 .transceiver_mode
= tosa_irda_transceiver_mode
,
357 .startup
= tosa_irda_startup
,
358 .shutdown
= tosa_irda_shutdown
,
364 static int tosa_power_init(struct device
*dev
)
366 int ret
= gpio_request(TOSA_GPIO_AC_IN
, "ac in");
370 ret
= gpio_direction_input(TOSA_GPIO_AC_IN
);
377 gpio_free(TOSA_GPIO_AC_IN
);
382 static void tosa_power_exit(struct device
*dev
)
384 gpio_free(TOSA_GPIO_AC_IN
);
387 static int tosa_power_ac_online(void)
389 return gpio_get_value(TOSA_GPIO_AC_IN
) == 0;
392 static char *tosa_ac_supplied_to
[] = {
398 static 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
),
406 static struct resource tosa_power_resource
[] = {
409 .start
= PXA_GPIO_TO_IRQ(TOSA_GPIO_AC_IN
),
410 .end
= PXA_GPIO_TO_IRQ(TOSA_GPIO_AC_IN
),
411 .flags
= IORESOURCE_IRQ
|
412 IORESOURCE_IRQ_HIGHEDGE
|
413 IORESOURCE_IRQ_LOWEDGE
,
417 static struct platform_device tosa_power_device
= {
420 .dev
.platform_data
= &tosa_power_data
,
421 .resource
= tosa_power_resource
,
422 .num_resources
= ARRAY_SIZE(tosa_power_resource
),
428 static const uint32_t tosakbd_keymap
[] = {
431 KEY(0, 6, KEY_BACKSPACE
),
439 KEY(1, 7, KEY_COMMA
),
445 KEY(2, 6, KEY_ENTER
),
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
),
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
),
466 KEY(5, 1, KEY_SLASH
),
469 KEY(5, 4, TOSA_KEY_MENU
),
471 KEY(5, 10, TOSA_KEY_FN
),
474 KEY(6, 2, KEY_SPACE
),
475 KEY(6, 3, KEY_APOSTROPHE
),
476 KEY(6, 4, TOSA_KEY_MAIL
),
479 KEY(6, 7, KEY_RIGHT
),
482 static struct matrix_keymap_data tosakbd_keymap_data
= {
483 .keymap
= tosakbd_keymap
,
484 .keymap_size
= ARRAY_SIZE(tosakbd_keymap
),
487 static const int tosakbd_col_gpios
[] =
488 { 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68 };
489 static const int tosakbd_row_gpios
[] =
490 { 69, 70, 71, 72, 73, 74, 75 };
492 static 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,
503 static struct platform_device tosakbd_device
= {
504 .name
= "matrix-keypad",
507 .platform_data
= &tosakbd_pdata
,
511 static struct gpio_keys_button tosa_gpio_keys
[] = {
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.
519 .code
= KEY_RESERVED
,
520 .gpio
= TOSA_GPIO_POWERON
,
528 .gpio
= TOSA_GPIO_ON_KEY
,
531 * can't be used as wakeup
538 .code
= TOSA_KEY_RECORD
,
539 .gpio
= TOSA_GPIO_RECORD_BTN
,
540 .desc
= "Record Button",
546 .code
= TOSA_KEY_SYNC
,
547 .gpio
= TOSA_GPIO_SYNC
,
548 .desc
= "Sync Button",
554 .code
= SW_HEADPHONE_INSERT
,
555 .gpio
= TOSA_GPIO_EAR_IN
,
556 .desc
= "HeadPhone insert",
558 .debounce_interval
= 300,
562 static struct gpio_keys_platform_data tosa_gpio_keys_platform_data
= {
563 .buttons
= tosa_gpio_keys
,
564 .nbuttons
= ARRAY_SIZE(tosa_gpio_keys
),
567 static struct platform_device tosa_gpio_keys_device
= {
571 .platform_data
= &tosa_gpio_keys_platform_data
,
578 static struct gpio_led tosa_gpio_leds
[] = {
580 .name
= "tosa:amber:charge",
581 .default_trigger
= "main-battery-charging",
582 .gpio
= TOSA_GPIO_CHRG_ERR_LED
,
585 .name
= "tosa:green:mail",
586 .default_trigger
= "nand-disk",
587 .gpio
= TOSA_GPIO_NOTE_LED
,
590 .name
= "tosa:dual:wlan",
591 .default_trigger
= "none",
592 .gpio
= TOSA_GPIO_WLAN_LED
,
595 .name
= "tosa:blue:bluetooth",
596 .default_trigger
= "tosa-bt",
597 .gpio
= TOSA_GPIO_BT_LED
,
601 static struct gpio_led_platform_data tosa_gpio_leds_platform_data
= {
602 .leds
= tosa_gpio_leds
,
603 .num_leds
= ARRAY_SIZE(tosa_gpio_leds
),
606 static struct platform_device tosaled_device
= {
610 .platform_data
= &tosa_gpio_leds_platform_data
,
615 * Toshiba Mobile IO Controller
617 static struct resource tc6393xb_resources
[] = {
619 .start
= TOSA_LCDC_PHYS
,
620 .end
= TOSA_LCDC_PHYS
+ 0x3ffffff,
621 .flags
= IORESOURCE_MEM
,
625 .start
= TOSA_IRQ_GPIO_TC6393XB_INT
,
626 .end
= TOSA_IRQ_GPIO_TC6393XB_INT
,
627 .flags
= IORESOURCE_IRQ
,
632 static int tosa_tc6393xb_enable(struct platform_device
*dev
)
636 rc
= gpio_request(TOSA_GPIO_TC6393XB_REST_IN
, "tc6393xb #pclr");
639 rc
= gpio_request(TOSA_GPIO_TC6393XB_SUSPEND
, "tc6393xb #suspend");
641 goto err_req_suspend
;
642 rc
= gpio_request(TOSA_GPIO_TC6393XB_L3V_ON
, "tc6393xb l3v");
645 rc
= gpio_direction_output(TOSA_GPIO_TC6393XB_L3V_ON
, 0);
648 rc
= gpio_direction_output(TOSA_GPIO_TC6393XB_SUSPEND
, 0);
650 goto err_dir_suspend
;
651 rc
= gpio_direction_output(TOSA_GPIO_TC6393XB_REST_IN
, 0);
657 gpio_set_value(TOSA_GPIO_TC6393XB_SUSPEND
, 1);
661 gpio_set_value(TOSA_GPIO_TC6393XB_REST_IN
, 1);
662 gpio_set_value(TOSA_GPIO_TC6393XB_L3V_ON
, 1);
668 gpio_free(TOSA_GPIO_TC6393XB_L3V_ON
);
670 gpio_free(TOSA_GPIO_TC6393XB_SUSPEND
);
672 gpio_free(TOSA_GPIO_TC6393XB_REST_IN
);
677 static int tosa_tc6393xb_disable(struct platform_device
*dev
)
679 gpio_free(TOSA_GPIO_TC6393XB_L3V_ON
);
680 gpio_free(TOSA_GPIO_TC6393XB_SUSPEND
);
681 gpio_free(TOSA_GPIO_TC6393XB_REST_IN
);
686 static int tosa_tc6393xb_resume(struct platform_device
*dev
)
688 gpio_set_value(TOSA_GPIO_TC6393XB_SUSPEND
, 1);
690 gpio_set_value(TOSA_GPIO_TC6393XB_L3V_ON
, 1);
696 static int tosa_tc6393xb_suspend(struct platform_device
*dev
)
698 gpio_set_value(TOSA_GPIO_TC6393XB_L3V_ON
, 0);
699 gpio_set_value(TOSA_GPIO_TC6393XB_SUSPEND
, 0);
703 static struct mtd_partition tosa_nand_partition
[] = {
707 .size
= 7 * 1024 * 1024,
711 .offset
= MTDPART_OFS_APPEND
,
712 .size
= 28 * 1024 * 1024,
716 .offset
= MTDPART_OFS_APPEND
,
717 .size
= MTDPART_SIZ_FULL
,
721 static uint8_t scan_ff_pattern
[] = { 0xff, 0xff };
723 static struct nand_bbt_descr tosa_tc6393xb_nand_bbt
= {
727 .pattern
= scan_ff_pattern
730 static 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
,
736 static int tosa_tc6393xb_setup(struct platform_device
*dev
)
740 rc
= gpio_request(TOSA_GPIO_CARD_VCC_ON
, "CARD_VCC_ON");
744 rc
= gpio_direction_output(TOSA_GPIO_CARD_VCC_ON
, 1);
751 gpio_free(TOSA_GPIO_CARD_VCC_ON
);
756 static void tosa_tc6393xb_teardown(struct platform_device
*dev
)
758 gpio_free(TOSA_GPIO_CARD_VCC_ON
);
761 #ifdef CONFIG_MFD_TC6393XB
762 static struct fb_videomode tosa_tc6393xb_lcd_mode
[] = {
766 .pixclock
= 0x002cdf00,/* PLL divisor */
767 .left_margin
= 0x004c,
768 .right_margin
= 0x005b,
769 .upper_margin
= 0x0001,
770 .lower_margin
= 0x000d,
773 .sync
= FB_SYNC_HOR_HIGH_ACT
| FB_SYNC_VERT_HIGH_ACT
,
774 .vmode
= FB_VMODE_NONINTERLACED
,
778 .pixclock
= 0x00e7f203,/* PLL divisor */
779 .left_margin
= 0x0024,
780 .right_margin
= 0x002f,
781 .upper_margin
= 0x0001,
782 .lower_margin
= 0x000d,
785 .sync
= FB_SYNC_HOR_HIGH_ACT
| FB_SYNC_VERT_HIGH_ACT
,
786 .vmode
= FB_VMODE_NONINTERLACED
,
790 static 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],
800 static struct tc6393xb_platform_data tosa_tc6393xb_data
= {
801 .scr_pll2cr
= 0x0cc1,
804 .irq_base
= IRQ_BOARD_START
,
805 .gpio_base
= TOSA_TC6393XB_GPIO_BASE
,
806 .setup
= tosa_tc6393xb_setup
,
807 .teardown
= tosa_tc6393xb_teardown
,
809 .enable
= tosa_tc6393xb_enable
,
810 .disable
= tosa_tc6393xb_disable
,
811 .suspend
= tosa_tc6393xb_suspend
,
812 .resume
= tosa_tc6393xb_resume
,
814 .nand_data
= &tosa_tc6393xb_nand_config
,
815 #ifdef CONFIG_MFD_TC6393XB
816 .fb_data
= &tosa_tc6393xb_fb_config
,
823 static struct platform_device tc6393xb_device
= {
827 .platform_data
= &tosa_tc6393xb_data
,
829 .num_resources
= ARRAY_SIZE(tc6393xb_resources
),
830 .resource
= tc6393xb_resources
,
833 static struct tosa_bt_data tosa_bt_data
= {
834 .gpio_pwr
= TOSA_GPIO_BT_PWR_EN
,
835 .gpio_reset
= TOSA_GPIO_BT_RESET
,
838 static struct platform_device tosa_bt_device
= {
841 .dev
.platform_data
= &tosa_bt_data
,
844 static struct pxa2xx_spi_master pxa_ssp_master_info
= {
848 static struct spi_board_info spi_board_info
[] __initdata
= {
850 .modalias
= "tosa-lcd",
852 .max_speed_hz
= 28750,
859 static struct mtd_partition sharpsl_rom_parts
[] = {
861 .name
="Boot PROM Filesystem",
862 .offset
= 0x00160000,
863 .size
= MTDPART_SIZ_FULL
,
867 static struct physmap_flash_data sharpsl_rom_data
= {
869 .nr_parts
= ARRAY_SIZE(sharpsl_rom_parts
),
870 .parts
= sharpsl_rom_parts
,
873 static struct resource sharpsl_rom_resources
[] = {
877 .flags
= IORESOURCE_MEM
,
881 static struct platform_device sharpsl_rom_device
= {
882 .name
= "physmap-flash",
884 .resource
= sharpsl_rom_resources
,
885 .num_resources
= ARRAY_SIZE(sharpsl_rom_resources
),
886 .dev
.platform_data
= &sharpsl_rom_data
,
889 static struct platform_device wm9712_device
= {
890 .name
= "wm9712-codec",
894 static struct platform_device tosa_audio_device
= {
895 .name
= "tosa-audio",
899 static struct platform_device
*devices
[] __initdata
= {
901 &tosascoop_jc_device
,
905 &tosa_gpio_keys_device
,
914 static void tosa_poweroff(void)
916 pxa_restart(REBOOT_GPIO
, NULL
);
919 static void tosa_restart(enum reboot_mode mode
, const char *cmd
)
921 uint32_t msc0
= __raw_readl(MSC0
);
923 /* Bootloader magic for a reboot */
924 if((msc0
& 0xffff0000) == 0x7ff00000)
925 __raw_writel((msc0
& 0xffff) | 0x7ee00000, MSC0
);
930 static void __init
tosa_init(void)
932 pxa2xx_mfp_config(ARRAY_AND_SIZE(tosa_pin_config
));
934 pxa_set_ffuart_info(NULL
);
935 pxa_set_btuart_info(NULL
);
936 pxa_set_stuart_info(NULL
);
938 gpio_set_wake(MFP_PIN_GPIO1
, 1);
939 /* We can't pass to gpio-keys since it will drop the Reset altfunc */
941 init_gpio_reset(TOSA_GPIO_ON_RESET
, 0, 0);
943 pm_power_off
= tosa_poweroff
;
947 /* enable batt_fault */
950 pxa_set_mci_info(&tosa_mci_platform_data
);
951 pxa_set_ficp_info(&tosa_ficp_platform_data
);
952 pxa_set_i2c_info(NULL
);
953 pxa_set_ac97_info(NULL
);
954 platform_scoop_config
= &tosa_pcmcia_config
;
956 pxa2xx_set_spi_info(2, &pxa_ssp_master_info
);
957 spi_register_board_info(spi_board_info
, ARRAY_SIZE(spi_board_info
));
959 clk_add_alias("CLK_CK3P6MI", tc6393xb_device
.name
, "GPIO11_CLK", NULL
);
961 platform_add_devices(devices
, ARRAY_SIZE(devices
));
964 static void __init
fixup_tosa(struct tag
*tags
, char **cmdline
)
966 sharpsl_save_param();
967 memblock_add(0xa0000000, SZ_64M
);
970 MACHINE_START(TOSA
, "SHARP Tosa")
972 .map_io
= pxa25x_map_io
,
973 .nr_irqs
= TOSA_NR_IRQS
,
974 .init_irq
= pxa25x_init_irq
,
975 .handle_irq
= pxa25x_handle_irq
,
976 .init_machine
= tosa_init
,
977 .init_time
= pxa_timer_init
,
978 .restart
= tosa_restart
,