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/input/matrix_keypad.h>
37 #include <asm/setup.h>
38 #include <asm/mach-types.h>
40 #include <mach/pxa25x.h>
41 #include <mach/reset.h>
42 #include <mach/irda.h>
46 #include <mach/tosa_bt.h>
47 #include <mach/pxa2xx_spi.h>
48 #include <mach/audio.h>
50 #include <asm/mach/arch.h>
51 #include <mach/tosa.h>
53 #include <asm/hardware/scoop.h>
54 #include <asm/mach/sharpsl_param.h>
60 static unsigned long tosa_pin_config
[] = {
61 GPIO78_nCS_2
, /* Scoop */
62 GPIO80_nCS_4
, /* tg6393xb */
63 GPIO33_nCS_5
, /* Scoop */
65 // GPIO76 CARD_VCC_ON1
67 GPIO19_GPIO
, /* Reset out */
68 GPIO1_RST
| WAKEUP_ON_EDGE_FALL
,
70 GPIO0_GPIO
| WAKEUP_ON_EDGE_FALL
, /* WAKE_UP */
71 GPIO2_GPIO
| WAKEUP_ON_EDGE_BOTH
, /* AC_IN */
72 GPIO3_GPIO
| WAKEUP_ON_EDGE_FALL
, /* RECORD */
73 GPIO4_GPIO
| WAKEUP_ON_EDGE_FALL
, /* SYNC */
74 GPIO20_GPIO
, /* EAR_IN */
77 GPIO5_GPIO
, /* USB_IN */
78 GPIO32_GPIO
, /* Pen IRQ */
80 GPIO7_GPIO
, /* Jacket Detect */
81 GPIO14_GPIO
, /* BAT0_CRG */
82 GPIO12_GPIO
, /* BAT1_CRG */
83 GPIO17_GPIO
, /* BAT0_LOW */
84 GPIO84_GPIO
, /* BAT1_LOW */
85 GPIO38_GPIO
, /* BAT_LOCK */
88 GPIO15_GPIO
, /* TC6393XB IRQ */
90 GPIO27_GPIO
, /* LCD Sync */
95 GPIO9_GPIO
, /* Detect */
96 GPIO10_GPIO
, /* nSD_INT */
99 GPIO13_GPIO
, /* CD_IRQ */
100 GPIO21_GPIO
, /* Main Slot IRQ */
101 GPIO36_GPIO
, /* Jacket Slot IRQ */
115 GPIO30_AC97_SDATA_OUT
,
117 GPIO29_AC97_SDATA_IN_0
,
135 GPIO58_GPIO
| MFP_LPM_DRIVE_LOW
, /* Column 0 */
136 GPIO59_GPIO
| MFP_LPM_DRIVE_LOW
, /* Column 1 */
137 GPIO60_GPIO
| MFP_LPM_DRIVE_LOW
, /* Column 2 */
138 GPIO61_GPIO
| MFP_LPM_DRIVE_LOW
, /* Column 3 */
139 GPIO62_GPIO
| MFP_LPM_DRIVE_LOW
, /* Column 4 */
140 GPIO63_GPIO
| MFP_LPM_DRIVE_LOW
, /* Column 5 */
141 GPIO64_GPIO
| MFP_LPM_DRIVE_LOW
, /* Column 6 */
142 GPIO65_GPIO
| MFP_LPM_DRIVE_LOW
, /* Column 7 */
143 GPIO66_GPIO
| MFP_LPM_DRIVE_LOW
, /* Column 8 */
144 GPIO67_GPIO
| MFP_LPM_DRIVE_LOW
, /* Column 9 */
145 GPIO68_GPIO
| MFP_LPM_DRIVE_LOW
, /* Column 10 */
146 GPIO69_GPIO
| MFP_LPM_DRIVE_LOW
, /* Row 0 */
147 GPIO70_GPIO
| MFP_LPM_DRIVE_LOW
, /* Row 1 */
148 GPIO71_GPIO
| MFP_LPM_DRIVE_LOW
, /* Row 2 */
149 GPIO72_GPIO
| MFP_LPM_DRIVE_LOW
, /* Row 3 */
150 GPIO73_GPIO
| MFP_LPM_DRIVE_LOW
, /* Row 4 */
151 GPIO74_GPIO
| MFP_LPM_DRIVE_LOW
, /* Row 5 */
152 GPIO75_GPIO
| MFP_LPM_DRIVE_LOW
, /* Row 6 */
159 /* IrDA is managed in other way */
167 static struct resource tosa_scoop_resources
[] = {
169 .start
= TOSA_CF_PHYS
,
170 .end
= TOSA_CF_PHYS
+ 0xfff,
171 .flags
= IORESOURCE_MEM
,
175 static struct scoop_config tosa_scoop_setup
= {
176 .io_dir
= TOSA_SCOOP_IO_DIR
,
177 .gpio_base
= TOSA_SCOOP_GPIO_BASE
,
180 static struct platform_device tosascoop_device
= {
181 .name
= "sharp-scoop",
184 .platform_data
= &tosa_scoop_setup
,
186 .num_resources
= ARRAY_SIZE(tosa_scoop_resources
),
187 .resource
= tosa_scoop_resources
,
192 * SCOOP Device Jacket
194 static struct resource tosa_scoop_jc_resources
[] = {
196 .start
= TOSA_SCOOP_PHYS
+ 0x40,
197 .end
= TOSA_SCOOP_PHYS
+ 0xfff,
198 .flags
= IORESOURCE_MEM
,
202 static struct scoop_config tosa_scoop_jc_setup
= {
203 .io_dir
= TOSA_SCOOP_JC_IO_DIR
,
204 .gpio_base
= TOSA_SCOOP_JC_GPIO_BASE
,
207 static struct platform_device tosascoop_jc_device
= {
208 .name
= "sharp-scoop",
211 .platform_data
= &tosa_scoop_jc_setup
,
212 .parent
= &tosascoop_device
.dev
,
214 .num_resources
= ARRAY_SIZE(tosa_scoop_jc_resources
),
215 .resource
= tosa_scoop_jc_resources
,
221 static struct scoop_pcmcia_dev tosa_pcmcia_scoop
[] = {
223 .dev
= &tosascoop_device
.dev
,
224 .irq
= TOSA_IRQ_GPIO_CF_IRQ
,
225 .cd_irq
= TOSA_IRQ_GPIO_CF_CD
,
226 .cd_irq_str
= "PCMCIA0 CD",
228 .dev
= &tosascoop_jc_device
.dev
,
229 .irq
= TOSA_IRQ_GPIO_JC_CF_IRQ
,
234 static struct scoop_pcmcia_config tosa_pcmcia_config
= {
235 .devs
= &tosa_pcmcia_scoop
[0],
240 * USB Device Controller
242 static struct pxa2xx_udc_mach_info udc_info __initdata
= {
243 .gpio_pullup
= TOSA_GPIO_USB_PULLUP
,
244 .gpio_vbus
= TOSA_GPIO_USB_IN
,
245 .gpio_vbus_inverted
= 1,
251 static int tosa_mci_init(struct device
*dev
, irq_handler_t tosa_detect_int
, void *data
)
255 err
= gpio_request(TOSA_GPIO_nSD_INT
, "SD Int");
257 printk(KERN_ERR
"tosa_mci_init: can't request SD_PWR gpio\n");
260 err
= gpio_direction_input(TOSA_GPIO_nSD_INT
);
262 goto err_gpio_int_dir
;
267 gpio_free(TOSA_GPIO_nSD_INT
);
272 static void tosa_mci_exit(struct device
*dev
, void *data
)
274 gpio_free(TOSA_GPIO_nSD_INT
);
277 static struct pxamci_platform_data tosa_mci_platform_data
= {
278 .ocr_mask
= MMC_VDD_32_33
|MMC_VDD_33_34
,
279 .init
= tosa_mci_init
,
280 .exit
= tosa_mci_exit
,
281 .gpio_card_detect
= TOSA_GPIO_nSD_DETECT
,
282 .gpio_card_ro
= TOSA_GPIO_SD_WP
,
283 .gpio_power
= TOSA_GPIO_PWR_ON
,
289 static void tosa_irda_transceiver_mode(struct device
*dev
, int mode
)
292 gpio_set_value(TOSA_GPIO_IR_POWERDWN
, 0);
293 pxa2xx_transceiver_mode(dev
, mode
);
294 gpio_direction_output(TOSA_GPIO_IRDA_TX
, 0);
296 pxa2xx_transceiver_mode(dev
, mode
);
297 gpio_set_value(TOSA_GPIO_IR_POWERDWN
, 1);
301 static int tosa_irda_startup(struct device
*dev
)
305 ret
= gpio_request(TOSA_GPIO_IRDA_TX
, "IrDA TX");
308 ret
= gpio_direction_output(TOSA_GPIO_IRDA_TX
, 0);
312 ret
= gpio_request(TOSA_GPIO_IR_POWERDWN
, "IrDA powerdown");
316 ret
= gpio_direction_output(TOSA_GPIO_IR_POWERDWN
, 0);
320 tosa_irda_transceiver_mode(dev
, IR_SIRMODE
| IR_OFF
);
325 gpio_free(TOSA_GPIO_IR_POWERDWN
);
328 gpio_free(TOSA_GPIO_IRDA_TX
);
333 static void tosa_irda_shutdown(struct device
*dev
)
335 tosa_irda_transceiver_mode(dev
, IR_SIRMODE
| IR_OFF
);
336 gpio_free(TOSA_GPIO_IR_POWERDWN
);
337 gpio_free(TOSA_GPIO_IRDA_TX
);
340 static struct pxaficp_platform_data tosa_ficp_platform_data
= {
342 .transceiver_cap
= IR_SIRMODE
| IR_OFF
,
343 .transceiver_mode
= tosa_irda_transceiver_mode
,
344 .startup
= tosa_irda_startup
,
345 .shutdown
= tosa_irda_shutdown
,
351 static int tosa_power_init(struct device
*dev
)
353 int ret
= gpio_request(TOSA_GPIO_AC_IN
, "ac in");
357 ret
= gpio_direction_input(TOSA_GPIO_AC_IN
);
364 gpio_free(TOSA_GPIO_AC_IN
);
369 static void tosa_power_exit(struct device
*dev
)
371 gpio_free(TOSA_GPIO_AC_IN
);
374 static int tosa_power_ac_online(void)
376 return gpio_get_value(TOSA_GPIO_AC_IN
) == 0;
379 static char *tosa_ac_supplied_to
[] = {
385 static struct pda_power_pdata tosa_power_data
= {
386 .init
= tosa_power_init
,
387 .is_ac_online
= tosa_power_ac_online
,
388 .exit
= tosa_power_exit
,
389 .supplied_to
= tosa_ac_supplied_to
,
390 .num_supplicants
= ARRAY_SIZE(tosa_ac_supplied_to
),
393 static struct resource tosa_power_resource
[] = {
396 .start
= gpio_to_irq(TOSA_GPIO_AC_IN
),
397 .end
= gpio_to_irq(TOSA_GPIO_AC_IN
),
398 .flags
= IORESOURCE_IRQ
|
399 IORESOURCE_IRQ_HIGHEDGE
|
400 IORESOURCE_IRQ_LOWEDGE
,
404 static struct platform_device tosa_power_device
= {
407 .dev
.platform_data
= &tosa_power_data
,
408 .resource
= tosa_power_resource
,
409 .num_resources
= ARRAY_SIZE(tosa_power_resource
),
415 static const uint32_t tosakbd_keymap
[] = {
418 KEY(0, 7, KEY_BACKSPACE
),
426 KEY(1, 8, KEY_COMMA
),
432 KEY(2, 7, KEY_ENTER
),
438 KEY(3, 5, TOSA_KEY_ADDRESSBOOK
),
439 KEY(3, 6, TOSA_KEY_CANCEL
),
440 KEY(3, 7, TOSA_KEY_CENTER
),
441 KEY(3, 8, TOSA_KEY_OK
),
442 KEY(3, 9, KEY_LEFTSHIFT
),
447 KEY(4, 5, TOSA_KEY_CALENDAR
),
448 KEY(4, 6, TOSA_KEY_HOMEPAGE
),
449 KEY(4, 7, KEY_LEFTCTRL
),
450 KEY(4, 8, TOSA_KEY_LIGHT
),
451 KEY(4, 10, KEY_RIGHTSHIFT
),
453 KEY(5, 2, KEY_SLASH
),
456 KEY(5, 5, TOSA_KEY_MENU
),
458 KEY(5, 11, TOSA_KEY_FN
),
461 KEY(6, 3, KEY_SPACE
),
462 KEY(6, 4, KEY_APOSTROPHE
),
463 KEY(6, 5, TOSA_KEY_MAIL
),
466 KEY(6, 8, KEY_RIGHT
),
469 static struct matrix_keymap_data tosakbd_keymap_data
= {
470 .keymap
= tosakbd_keymap
,
471 .keymap_size
= ARRAY_SIZE(tosakbd_keymap
),
474 static const int tosakbd_col_gpios
[] =
475 { 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68 };
476 static const int tosakbd_row_gpios
[] =
477 { 69, 70, 71, 72, 73, 74, 75 };
479 static struct matrix_keypad_platform_data tosakbd_pdata
= {
480 .keymap_data
= &tosakbd_keymap_data
,
481 .row_gpios
= tosakbd_row_gpios
,
482 .col_gpios
= tosakbd_col_gpios
,
483 .num_row_gpios
= ARRAY_SIZE(tosakbd_row_gpios
),
484 .num_col_gpios
= ARRAY_SIZE(tosakbd_col_gpios
),
485 .col_scan_delay_us
= 10,
490 static struct platform_device tosakbd_device
= {
491 .name
= "matrix-keypad",
494 .platform_data
= &tosakbd_pdata
,
498 static struct gpio_keys_button tosa_gpio_keys
[] = {
500 * Two following keys are directly tied to "ON" button of tosa. Why?
501 * The first one can be used as a wakeup source, the second can't;
502 * also the first one is OR of ac_powered and on_button.
506 .code
= KEY_RESERVED
,
507 .gpio
= TOSA_GPIO_POWERON
,
515 .gpio
= TOSA_GPIO_ON_KEY
,
518 * can't be used as wakeup
525 .code
= TOSA_KEY_RECORD
,
526 .gpio
= TOSA_GPIO_RECORD_BTN
,
527 .desc
= "Record Button",
533 .code
= TOSA_KEY_SYNC
,
534 .gpio
= TOSA_GPIO_SYNC
,
535 .desc
= "Sync Button",
541 .code
= SW_HEADPHONE_INSERT
,
542 .gpio
= TOSA_GPIO_EAR_IN
,
543 .desc
= "HeadPhone insert",
545 .debounce_interval
= 300,
549 static struct gpio_keys_platform_data tosa_gpio_keys_platform_data
= {
550 .buttons
= tosa_gpio_keys
,
551 .nbuttons
= ARRAY_SIZE(tosa_gpio_keys
),
554 static struct platform_device tosa_gpio_keys_device
= {
558 .platform_data
= &tosa_gpio_keys_platform_data
,
565 static struct gpio_led tosa_gpio_leds
[] = {
567 .name
= "tosa:amber:charge",
568 .default_trigger
= "main-battery-charging",
569 .gpio
= TOSA_GPIO_CHRG_ERR_LED
,
572 .name
= "tosa:green:mail",
573 .default_trigger
= "nand-disk",
574 .gpio
= TOSA_GPIO_NOTE_LED
,
577 .name
= "tosa:dual:wlan",
578 .default_trigger
= "none",
579 .gpio
= TOSA_GPIO_WLAN_LED
,
582 .name
= "tosa:blue:bluetooth",
583 .default_trigger
= "tosa-bt",
584 .gpio
= TOSA_GPIO_BT_LED
,
588 static struct gpio_led_platform_data tosa_gpio_leds_platform_data
= {
589 .leds
= tosa_gpio_leds
,
590 .num_leds
= ARRAY_SIZE(tosa_gpio_leds
),
593 static struct platform_device tosaled_device
= {
597 .platform_data
= &tosa_gpio_leds_platform_data
,
602 * Toshiba Mobile IO Controller
604 static struct resource tc6393xb_resources
[] = {
606 .start
= TOSA_LCDC_PHYS
,
607 .end
= TOSA_LCDC_PHYS
+ 0x3ffffff,
608 .flags
= IORESOURCE_MEM
,
612 .start
= TOSA_IRQ_GPIO_TC6393XB_INT
,
613 .end
= TOSA_IRQ_GPIO_TC6393XB_INT
,
614 .flags
= IORESOURCE_IRQ
,
619 static int tosa_tc6393xb_enable(struct platform_device
*dev
)
623 rc
= gpio_request(TOSA_GPIO_TC6393XB_REST_IN
, "tc6393xb #pclr");
626 rc
= gpio_request(TOSA_GPIO_TC6393XB_SUSPEND
, "tc6393xb #suspend");
628 goto err_req_suspend
;
629 rc
= gpio_request(TOSA_GPIO_TC6393XB_L3V_ON
, "tc6393xb l3v");
632 rc
= gpio_direction_output(TOSA_GPIO_TC6393XB_L3V_ON
, 0);
635 rc
= gpio_direction_output(TOSA_GPIO_TC6393XB_SUSPEND
, 0);
637 goto err_dir_suspend
;
638 rc
= gpio_direction_output(TOSA_GPIO_TC6393XB_REST_IN
, 0);
644 gpio_set_value(TOSA_GPIO_TC6393XB_SUSPEND
, 1);
648 gpio_set_value(TOSA_GPIO_TC6393XB_REST_IN
, 1);
649 gpio_set_value(TOSA_GPIO_TC6393XB_L3V_ON
, 1);
655 gpio_free(TOSA_GPIO_TC6393XB_L3V_ON
);
657 gpio_free(TOSA_GPIO_TC6393XB_SUSPEND
);
659 gpio_free(TOSA_GPIO_TC6393XB_REST_IN
);
664 static int tosa_tc6393xb_disable(struct platform_device
*dev
)
666 gpio_free(TOSA_GPIO_TC6393XB_L3V_ON
);
667 gpio_free(TOSA_GPIO_TC6393XB_SUSPEND
);
668 gpio_free(TOSA_GPIO_TC6393XB_REST_IN
);
673 static int tosa_tc6393xb_resume(struct platform_device
*dev
)
675 gpio_set_value(TOSA_GPIO_TC6393XB_SUSPEND
, 1);
677 gpio_set_value(TOSA_GPIO_TC6393XB_L3V_ON
, 1);
683 static int tosa_tc6393xb_suspend(struct platform_device
*dev
)
685 gpio_set_value(TOSA_GPIO_TC6393XB_L3V_ON
, 0);
686 gpio_set_value(TOSA_GPIO_TC6393XB_SUSPEND
, 0);
690 static struct mtd_partition tosa_nand_partition
[] = {
694 .size
= 7 * 1024 * 1024,
698 .offset
= MTDPART_OFS_APPEND
,
699 .size
= 28 * 1024 * 1024,
703 .offset
= MTDPART_OFS_APPEND
,
704 .size
= MTDPART_SIZ_FULL
,
708 static uint8_t scan_ff_pattern
[] = { 0xff, 0xff };
710 static struct nand_bbt_descr tosa_tc6393xb_nand_bbt
= {
714 .pattern
= scan_ff_pattern
717 static struct tmio_nand_data tosa_tc6393xb_nand_config
= {
718 .num_partitions
= ARRAY_SIZE(tosa_nand_partition
),
719 .partition
= tosa_nand_partition
,
720 .badblock_pattern
= &tosa_tc6393xb_nand_bbt
,
723 static int tosa_tc6393xb_setup(struct platform_device
*dev
)
727 rc
= gpio_request(TOSA_GPIO_CARD_VCC_ON
, "CARD_VCC_ON");
731 rc
= gpio_direction_output(TOSA_GPIO_CARD_VCC_ON
, 1);
738 gpio_free(TOSA_GPIO_CARD_VCC_ON
);
743 static void tosa_tc6393xb_teardown(struct platform_device
*dev
)
745 gpio_free(TOSA_GPIO_CARD_VCC_ON
);
748 #ifdef CONFIG_MFD_TC6393XB
749 static struct fb_videomode tosa_tc6393xb_lcd_mode
[] = {
753 .pixclock
= 0x002cdf00,/* PLL divisor */
754 .left_margin
= 0x004c,
755 .right_margin
= 0x005b,
756 .upper_margin
= 0x0001,
757 .lower_margin
= 0x000d,
760 .sync
= FB_SYNC_HOR_HIGH_ACT
| FB_SYNC_VERT_HIGH_ACT
,
761 .vmode
= FB_VMODE_NONINTERLACED
,
765 .pixclock
= 0x00e7f203,/* PLL divisor */
766 .left_margin
= 0x0024,
767 .right_margin
= 0x002f,
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 static struct tmio_fb_data tosa_tc6393xb_fb_config
= {
778 .lcd_set_power
= tc6393xb_lcd_set_power
,
779 .lcd_mode
= tc6393xb_lcd_mode
,
780 .num_modes
= ARRAY_SIZE(tosa_tc6393xb_lcd_mode
),
781 .modes
= &tosa_tc6393xb_lcd_mode
[0],
787 static struct tc6393xb_platform_data tosa_tc6393xb_data
= {
788 .scr_pll2cr
= 0x0cc1,
791 .irq_base
= IRQ_BOARD_START
,
792 .gpio_base
= TOSA_TC6393XB_GPIO_BASE
,
793 .setup
= tosa_tc6393xb_setup
,
794 .teardown
= tosa_tc6393xb_teardown
,
796 .enable
= tosa_tc6393xb_enable
,
797 .disable
= tosa_tc6393xb_disable
,
798 .suspend
= tosa_tc6393xb_suspend
,
799 .resume
= tosa_tc6393xb_resume
,
801 .nand_data
= &tosa_tc6393xb_nand_config
,
802 #ifdef CONFIG_MFD_TC6393XB
803 .fb_data
= &tosa_tc6393xb_fb_config
,
810 static struct platform_device tc6393xb_device
= {
814 .platform_data
= &tosa_tc6393xb_data
,
816 .num_resources
= ARRAY_SIZE(tc6393xb_resources
),
817 .resource
= tc6393xb_resources
,
820 static struct tosa_bt_data tosa_bt_data
= {
821 .gpio_pwr
= TOSA_GPIO_BT_PWR_EN
,
822 .gpio_reset
= TOSA_GPIO_BT_RESET
,
825 static struct platform_device tosa_bt_device
= {
828 .dev
.platform_data
= &tosa_bt_data
,
831 static struct pxa2xx_spi_master pxa_ssp_master_info
= {
835 static struct spi_board_info spi_board_info
[] __initdata
= {
837 .modalias
= "tosa-lcd",
839 .max_speed_hz
= 28750,
846 static struct mtd_partition sharpsl_rom_parts
[] = {
848 .name
="Boot PROM Filesystem",
849 .offset
= 0x00160000,
850 .size
= MTDPART_SIZ_FULL
,
854 static struct physmap_flash_data sharpsl_rom_data
= {
856 .nr_parts
= ARRAY_SIZE(sharpsl_rom_parts
),
857 .parts
= sharpsl_rom_parts
,
860 static struct resource sharpsl_rom_resources
[] = {
864 .flags
= IORESOURCE_MEM
,
868 static struct platform_device sharpsl_rom_device
= {
869 .name
= "physmap-flash",
871 .resource
= sharpsl_rom_resources
,
872 .num_resources
= ARRAY_SIZE(sharpsl_rom_resources
),
873 .dev
.platform_data
= &sharpsl_rom_data
,
876 static struct platform_device
*devices
[] __initdata
= {
878 &tosascoop_jc_device
,
882 &tosa_gpio_keys_device
,
888 static void tosa_poweroff(void)
890 arm_machine_restart('g', NULL
);
893 static void tosa_restart(char mode
, const char *cmd
)
895 /* Bootloader magic for a reboot */
896 if((MSC0
& 0xffff0000) == 0x7ff00000)
897 MSC0
= (MSC0
& 0xffff) | 0x7ee00000;
902 static void __init
tosa_init(void)
906 pxa2xx_mfp_config(ARRAY_AND_SIZE(tosa_pin_config
));
908 pxa_set_ffuart_info(NULL
);
909 pxa_set_btuart_info(NULL
);
910 pxa_set_stuart_info(NULL
);
912 gpio_set_wake(MFP_PIN_GPIO1
, 1);
913 /* We can't pass to gpio-keys since it will drop the Reset altfunc */
915 init_gpio_reset(TOSA_GPIO_ON_RESET
, 0, 0);
917 pm_power_off
= tosa_poweroff
;
918 arm_pm_restart
= tosa_restart
;
922 /* enable batt_fault */
925 dummy
= gpiochip_reserve(TOSA_SCOOP_GPIO_BASE
, 12);
926 dummy
= gpiochip_reserve(TOSA_SCOOP_JC_GPIO_BASE
, 12);
927 dummy
= gpiochip_reserve(TOSA_TC6393XB_GPIO_BASE
, 16);
929 tosa_mci_platform_data
.detect_delay
= msecs_to_jiffies(250);
930 pxa_set_mci_info(&tosa_mci_platform_data
);
931 pxa_set_udc_info(&udc_info
);
932 pxa_set_ficp_info(&tosa_ficp_platform_data
);
933 pxa_set_i2c_info(NULL
);
934 pxa_set_ac97_info(NULL
);
935 platform_scoop_config
= &tosa_pcmcia_config
;
937 pxa2xx_set_spi_info(2, &pxa_ssp_master_info
);
938 spi_register_board_info(spi_board_info
, ARRAY_SIZE(spi_board_info
));
940 clk_add_alias("CLK_CK3P6MI", tc6393xb_device
.name
, "GPIO11_CLK", NULL
);
942 platform_add_devices(devices
, ARRAY_SIZE(devices
));
945 static void __init
fixup_tosa(struct machine_desc
*desc
,
946 struct tag
*tags
, char **cmdline
, struct meminfo
*mi
)
948 sharpsl_save_param();
950 mi
->bank
[0].start
= 0xa0000000;
951 mi
->bank
[0].node
= 0;
952 mi
->bank
[0].size
= (64*1024*1024);
955 MACHINE_START(TOSA
, "SHARP Tosa")
956 .phys_io
= 0x40000000,
957 .io_pg_offst
= (io_p2v(0x40000000) >> 18) & 0xfffc,
959 .map_io
= pxa_map_io
,
960 .init_irq
= pxa25x_init_irq
,
961 .init_machine
= tosa_init
,