spitz.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708
  1. /*
  2. * Support for Sharp SL-Cxx00 Series of PDAs
  3. * Models: SL-C3000 (Spitz), SL-C1000 (Akita) and SL-C3100 (Borzoi)
  4. *
  5. * Copyright (c) 2005 Richard Purdie
  6. *
  7. * Based on Sharp's 2.4 kernel patches/lubbock.c
  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. #include <linux/kernel.h>
  15. #include <linux/init.h>
  16. #include <linux/platform_device.h>
  17. #include <linux/delay.h>
  18. #include <linux/major.h>
  19. #include <linux/fs.h>
  20. #include <linux/interrupt.h>
  21. #include <linux/gpio.h>
  22. #include <linux/mmc/host.h>
  23. #include <linux/pm.h>
  24. #include <linux/backlight.h>
  25. #include <linux/spi/spi.h>
  26. #include <linux/spi/ads7846.h>
  27. #include <linux/spi/corgi_lcd.h>
  28. #include <asm/setup.h>
  29. #include <asm/memory.h>
  30. #include <asm/mach-types.h>
  31. #include <mach/hardware.h>
  32. #include <asm/irq.h>
  33. #include <asm/io.h>
  34. #include <asm/system.h>
  35. #include <asm/mach/arch.h>
  36. #include <asm/mach/map.h>
  37. #include <asm/mach/irq.h>
  38. #include <mach/pxa-regs.h>
  39. #include <mach/pxa2xx-regs.h>
  40. #include <mach/mfp-pxa27x.h>
  41. #include <mach/pxa27x-udc.h>
  42. #include <mach/reset.h>
  43. #include <mach/i2c.h>
  44. #include <mach/irda.h>
  45. #include <mach/mmc.h>
  46. #include <mach/ohci.h>
  47. #include <mach/udc.h>
  48. #include <mach/pxafb.h>
  49. #include <mach/pxa2xx_spi.h>
  50. #include <mach/akita.h>
  51. #include <mach/spitz.h>
  52. #include <mach/sharpsl.h>
  53. #include <asm/mach/sharpsl_param.h>
  54. #include <asm/hardware/scoop.h>
  55. #include "generic.h"
  56. #include "devices.h"
  57. #include "sharpsl.h"
  58. static unsigned long spitz_pin_config[] __initdata = {
  59. /* Chip Selects */
  60. GPIO78_nCS_2, /* SCOOP #2 */
  61. GPIO80_nCS_4, /* SCOOP #1 */
  62. /* LCD - 16bpp Active TFT */
  63. GPIO58_LCD_LDD_0,
  64. GPIO59_LCD_LDD_1,
  65. GPIO60_LCD_LDD_2,
  66. GPIO61_LCD_LDD_3,
  67. GPIO62_LCD_LDD_4,
  68. GPIO63_LCD_LDD_5,
  69. GPIO64_LCD_LDD_6,
  70. GPIO65_LCD_LDD_7,
  71. GPIO66_LCD_LDD_8,
  72. GPIO67_LCD_LDD_9,
  73. GPIO68_LCD_LDD_10,
  74. GPIO69_LCD_LDD_11,
  75. GPIO70_LCD_LDD_12,
  76. GPIO71_LCD_LDD_13,
  77. GPIO72_LCD_LDD_14,
  78. GPIO73_LCD_LDD_15,
  79. GPIO74_LCD_FCLK,
  80. GPIO75_LCD_LCLK,
  81. GPIO76_LCD_PCLK,
  82. /* PC Card */
  83. GPIO48_nPOE,
  84. GPIO49_nPWE,
  85. GPIO50_nPIOR,
  86. GPIO51_nPIOW,
  87. GPIO85_nPCE_1,
  88. GPIO54_nPCE_2,
  89. GPIO79_PSKTSEL,
  90. GPIO55_nPREG,
  91. GPIO56_nPWAIT,
  92. GPIO57_nIOIS16,
  93. /* MMC */
  94. GPIO32_MMC_CLK,
  95. GPIO112_MMC_CMD,
  96. GPIO92_MMC_DAT_0,
  97. GPIO109_MMC_DAT_1,
  98. GPIO110_MMC_DAT_2,
  99. GPIO111_MMC_DAT_3,
  100. /* GPIOs */
  101. GPIO9_GPIO, /* SPITZ_GPIO_nSD_DETECT */
  102. GPIO81_GPIO, /* SPITZ_GPIO_nSD_WP */
  103. GPIO41_GPIO, /* SPITZ_GPIO_USB_CONNECT */
  104. GPIO37_GPIO, /* SPITZ_GPIO_USB_HOST */
  105. GPIO35_GPIO, /* SPITZ_GPIO_USB_DEVICE */
  106. GPIO22_GPIO, /* SPITZ_GPIO_HSYNC */
  107. GPIO94_GPIO, /* SPITZ_GPIO_CF_CD */
  108. GPIO105_GPIO, /* SPITZ_GPIO_CF_IRQ */
  109. GPIO106_GPIO, /* SPITZ_GPIO_CF2_IRQ */
  110. GPIO1_GPIO | WAKEUP_ON_EDGE_RISE,
  111. };
  112. /*
  113. * Spitz SCOOP Device #1
  114. */
  115. static struct resource spitz_scoop_resources[] = {
  116. [0] = {
  117. .start = 0x10800000,
  118. .end = 0x10800fff,
  119. .flags = IORESOURCE_MEM,
  120. },
  121. };
  122. static struct scoop_config spitz_scoop_setup = {
  123. .io_dir = SPITZ_SCP_IO_DIR,
  124. .io_out = SPITZ_SCP_IO_OUT,
  125. .suspend_clr = SPITZ_SCP_SUS_CLR,
  126. .suspend_set = SPITZ_SCP_SUS_SET,
  127. };
  128. struct platform_device spitzscoop_device = {
  129. .name = "sharp-scoop",
  130. .id = 0,
  131. .dev = {
  132. .platform_data = &spitz_scoop_setup,
  133. },
  134. .num_resources = ARRAY_SIZE(spitz_scoop_resources),
  135. .resource = spitz_scoop_resources,
  136. };
  137. /*
  138. * Spitz SCOOP Device #2
  139. */
  140. static struct resource spitz_scoop2_resources[] = {
  141. [0] = {
  142. .start = 0x08800040,
  143. .end = 0x08800fff,
  144. .flags = IORESOURCE_MEM,
  145. },
  146. };
  147. static struct scoop_config spitz_scoop2_setup = {
  148. .io_dir = SPITZ_SCP2_IO_DIR,
  149. .io_out = SPITZ_SCP2_IO_OUT,
  150. .suspend_clr = SPITZ_SCP2_SUS_CLR,
  151. .suspend_set = SPITZ_SCP2_SUS_SET,
  152. };
  153. struct platform_device spitzscoop2_device = {
  154. .name = "sharp-scoop",
  155. .id = 1,
  156. .dev = {
  157. .platform_data = &spitz_scoop2_setup,
  158. },
  159. .num_resources = ARRAY_SIZE(spitz_scoop2_resources),
  160. .resource = spitz_scoop2_resources,
  161. };
  162. #define SPITZ_PWR_SD 0x01
  163. #define SPITZ_PWR_CF 0x02
  164. /* Power control is shared with between one of the CF slots and SD */
  165. static void spitz_card_pwr_ctrl(int device, unsigned short new_cpr)
  166. {
  167. unsigned short cpr = read_scoop_reg(&spitzscoop_device.dev, SCOOP_CPR);
  168. if (new_cpr & 0x0007) {
  169. set_scoop_gpio(&spitzscoop_device.dev, SPITZ_SCP_CF_POWER);
  170. if (!(cpr & 0x0002) && !(cpr & 0x0004))
  171. mdelay(5);
  172. if (device == SPITZ_PWR_CF)
  173. cpr |= 0x0002;
  174. if (device == SPITZ_PWR_SD)
  175. cpr |= 0x0004;
  176. write_scoop_reg(&spitzscoop_device.dev, SCOOP_CPR, cpr | new_cpr);
  177. } else {
  178. if (device == SPITZ_PWR_CF)
  179. cpr &= ~0x0002;
  180. if (device == SPITZ_PWR_SD)
  181. cpr &= ~0x0004;
  182. if (!(cpr & 0x0002) && !(cpr & 0x0004)) {
  183. write_scoop_reg(&spitzscoop_device.dev, SCOOP_CPR, 0x0000);
  184. mdelay(1);
  185. reset_scoop_gpio(&spitzscoop_device.dev, SPITZ_SCP_CF_POWER);
  186. } else {
  187. write_scoop_reg(&spitzscoop_device.dev, SCOOP_CPR, cpr | new_cpr);
  188. }
  189. }
  190. }
  191. static void spitz_pcmcia_pwr(struct device *scoop, unsigned short cpr, int nr)
  192. {
  193. /* Only need to override behaviour for slot 0 */
  194. if (nr == 0)
  195. spitz_card_pwr_ctrl(SPITZ_PWR_CF, cpr);
  196. else
  197. write_scoop_reg(scoop, SCOOP_CPR, cpr);
  198. }
  199. static struct scoop_pcmcia_dev spitz_pcmcia_scoop[] = {
  200. {
  201. .dev = &spitzscoop_device.dev,
  202. .irq = SPITZ_IRQ_GPIO_CF_IRQ,
  203. .cd_irq = SPITZ_IRQ_GPIO_CF_CD,
  204. .cd_irq_str = "PCMCIA0 CD",
  205. },{
  206. .dev = &spitzscoop2_device.dev,
  207. .irq = SPITZ_IRQ_GPIO_CF2_IRQ,
  208. .cd_irq = -1,
  209. },
  210. };
  211. static struct scoop_pcmcia_config spitz_pcmcia_config = {
  212. .devs = &spitz_pcmcia_scoop[0],
  213. .num_devs = 2,
  214. .power_ctrl = spitz_pcmcia_pwr,
  215. };
  216. EXPORT_SYMBOL(spitzscoop_device);
  217. EXPORT_SYMBOL(spitzscoop2_device);
  218. /*
  219. * Spitz Keyboard Device
  220. */
  221. static struct platform_device spitzkbd_device = {
  222. .name = "spitz-keyboard",
  223. .id = -1,
  224. };
  225. /*
  226. * Spitz LEDs
  227. */
  228. static struct platform_device spitzled_device = {
  229. .name = "spitz-led",
  230. .id = -1,
  231. };
  232. #if defined(CONFIG_SPI_PXA2XX) || defined(CONFIG_SPI_PXA2XX_MODULE)
  233. static struct pxa2xx_spi_master spitz_spi_info = {
  234. .num_chipselect = 3,
  235. };
  236. static struct ads7846_platform_data spitz_ads7846_info = {
  237. .model = 7846,
  238. .vref_delay_usecs = 100,
  239. .x_plate_ohms = 419,
  240. .y_plate_ohms = 486,
  241. .gpio_pendown = SPITZ_GPIO_TP_INT,
  242. };
  243. static void spitz_ads7846_cs(u32 command)
  244. {
  245. gpio_set_value(SPITZ_GPIO_ADS7846_CS, !(command == PXA2XX_CS_ASSERT));
  246. }
  247. static struct pxa2xx_spi_chip spitz_ads7846_chip = {
  248. .cs_control = spitz_ads7846_cs,
  249. };
  250. static void spitz_notify_intensity(int intensity)
  251. {
  252. if (machine_is_spitz() || machine_is_borzoi()) {
  253. /* Bit 5 is via SCOOP */
  254. if (intensity & 0x0020)
  255. reset_scoop_gpio(&spitzscoop2_device.dev, SPITZ_SCP2_BACKLIGHT_CONT);
  256. else
  257. set_scoop_gpio(&spitzscoop2_device.dev, SPITZ_SCP2_BACKLIGHT_CONT);
  258. if (intensity)
  259. set_scoop_gpio(&spitzscoop2_device.dev, SPITZ_SCP2_BACKLIGHT_ON);
  260. else
  261. reset_scoop_gpio(&spitzscoop2_device.dev, SPITZ_SCP2_BACKLIGHT_ON);
  262. return;
  263. }
  264. if (machine_is_akita()) {
  265. /* Bit 5 is via IO-Expander */
  266. if (intensity & 0x0020)
  267. akita_reset_ioexp(&akitaioexp_device.dev, AKITA_IOEXP_BACKLIGHT_CONT);
  268. else
  269. akita_set_ioexp(&akitaioexp_device.dev, AKITA_IOEXP_BACKLIGHT_CONT);
  270. if (intensity)
  271. akita_set_ioexp(&akitaioexp_device.dev, AKITA_IOEXP_BACKLIGHT_ON);
  272. else
  273. akita_reset_ioexp(&akitaioexp_device.dev, AKITA_IOEXP_BACKLIGHT_ON);
  274. return;
  275. }
  276. }
  277. static void spitz_bl_kick_battery(void)
  278. {
  279. void (*kick_batt)(void);
  280. kick_batt = symbol_get(sharpsl_battery_kick);
  281. if (kick_batt) {
  282. kick_batt();
  283. symbol_put(sharpsl_battery_kick);
  284. }
  285. }
  286. static struct corgi_lcd_platform_data spitz_lcdcon_info = {
  287. .init_mode = CORGI_LCD_MODE_VGA,
  288. .max_intensity = 0x2f,
  289. .default_intensity = 0x1f,
  290. .limit_mask = 0x0b,
  291. .notify = spitz_notify_intensity,
  292. .kick_battery = spitz_bl_kick_battery,
  293. };
  294. static void spitz_lcdcon_cs(u32 command)
  295. {
  296. gpio_set_value(SPITZ_GPIO_LCDCON_CS, !(command == PXA2XX_CS_ASSERT));
  297. }
  298. static struct pxa2xx_spi_chip spitz_lcdcon_chip = {
  299. .cs_control = spitz_lcdcon_cs,
  300. };
  301. static void spitz_max1111_cs(u32 command)
  302. {
  303. gpio_set_value(SPITZ_GPIO_MAX1111_CS, !(command == PXA2XX_CS_ASSERT));
  304. }
  305. static struct pxa2xx_spi_chip spitz_max1111_chip = {
  306. .cs_control = spitz_max1111_cs,
  307. };
  308. static struct spi_board_info spitz_spi_devices[] = {
  309. {
  310. .modalias = "ads7846",
  311. .max_speed_hz = 1200000,
  312. .bus_num = 2,
  313. .chip_select = 0,
  314. .platform_data = &spitz_ads7846_info,
  315. .controller_data= &spitz_ads7846_chip,
  316. .irq = gpio_to_irq(SPITZ_GPIO_TP_INT),
  317. }, {
  318. .modalias = "corgi-lcd",
  319. .max_speed_hz = 50000,
  320. .bus_num = 2,
  321. .chip_select = 1,
  322. .platform_data = &spitz_lcdcon_info,
  323. .controller_data= &spitz_lcdcon_chip,
  324. }, {
  325. .modalias = "max1111",
  326. .max_speed_hz = 450000,
  327. .bus_num = 2,
  328. .chip_select = 2,
  329. .controller_data= &spitz_max1111_chip,
  330. },
  331. };
  332. static void __init spitz_init_spi(void)
  333. {
  334. int err;
  335. err = gpio_request(SPITZ_GPIO_ADS7846_CS, "ADS7846_CS");
  336. if (err)
  337. return;
  338. err = gpio_request(SPITZ_GPIO_LCDCON_CS, "LCDCON_CS");
  339. if (err)
  340. goto err_free_1;
  341. err = gpio_request(SPITZ_GPIO_MAX1111_CS, "MAX1111_CS");
  342. if (err)
  343. goto err_free_2;
  344. pxa2xx_set_spi_info(2, &spitz_spi_info);
  345. spi_register_board_info(ARRAY_AND_SIZE(spitz_spi_devices));
  346. return;
  347. err_free_2:
  348. gpio_free(SPITZ_GPIO_LCDCON_CS);
  349. err_free_1:
  350. gpio_free(SPITZ_GPIO_ADS7846_CS);
  351. }
  352. #else
  353. static inline void spitz_init_spi(void) {}
  354. #endif
  355. /*
  356. * MMC/SD Device
  357. *
  358. * The card detect interrupt isn't debounced so we delay it by 250ms
  359. * to give the card a chance to fully insert/eject.
  360. */
  361. static struct pxamci_platform_data spitz_mci_platform_data;
  362. static int spitz_mci_init(struct device *dev, irq_handler_t spitz_detect_int, void *data)
  363. {
  364. int err;
  365. err = gpio_request(SPITZ_GPIO_nSD_DETECT, "nSD_DETECT");
  366. if (err)
  367. goto err_out;
  368. err = gpio_request(SPITZ_GPIO_nSD_WP, "nSD_WP");
  369. if (err)
  370. goto err_free_1;
  371. gpio_direction_input(SPITZ_GPIO_nSD_DETECT);
  372. gpio_direction_input(SPITZ_GPIO_nSD_WP);
  373. spitz_mci_platform_data.detect_delay = msecs_to_jiffies(250);
  374. err = request_irq(SPITZ_IRQ_GPIO_nSD_DETECT, spitz_detect_int,
  375. IRQF_DISABLED | IRQF_TRIGGER_RISING |
  376. IRQF_TRIGGER_FALLING,
  377. "MMC card detect", data);
  378. if (err) {
  379. pr_err("%s: MMC/SD: can't request MMC card detect IRQ\n",
  380. __func__);
  381. goto err_free_2;
  382. }
  383. return 0;
  384. err_free_2:
  385. gpio_free(SPITZ_GPIO_nSD_WP);
  386. err_free_1:
  387. gpio_free(SPITZ_GPIO_nSD_DETECT);
  388. err_out:
  389. return err;
  390. }
  391. static void spitz_mci_setpower(struct device *dev, unsigned int vdd)
  392. {
  393. struct pxamci_platform_data* p_d = dev->platform_data;
  394. if (( 1 << vdd) & p_d->ocr_mask)
  395. spitz_card_pwr_ctrl(SPITZ_PWR_SD, 0x0004);
  396. else
  397. spitz_card_pwr_ctrl(SPITZ_PWR_SD, 0x0000);
  398. }
  399. static int spitz_mci_get_ro(struct device *dev)
  400. {
  401. return gpio_get_value(SPITZ_GPIO_nSD_WP);
  402. }
  403. static void spitz_mci_exit(struct device *dev, void *data)
  404. {
  405. free_irq(SPITZ_IRQ_GPIO_nSD_DETECT, data);
  406. gpio_free(SPITZ_GPIO_nSD_WP);
  407. gpio_free(SPITZ_GPIO_nSD_DETECT);
  408. }
  409. static struct pxamci_platform_data spitz_mci_platform_data = {
  410. .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34,
  411. .init = spitz_mci_init,
  412. .get_ro = spitz_mci_get_ro,
  413. .setpower = spitz_mci_setpower,
  414. .exit = spitz_mci_exit,
  415. };
  416. /*
  417. * USB Host (OHCI)
  418. */
  419. static int spitz_ohci_init(struct device *dev)
  420. {
  421. int err;
  422. err = gpio_request(SPITZ_GPIO_USB_HOST, "USB_HOST");
  423. if (err)
  424. return err;
  425. /* Only Port 2 is connected
  426. * Setup USB Port 2 Output Control Register
  427. */
  428. UP2OCR = UP2OCR_HXS | UP2OCR_HXOE | UP2OCR_DPPDE | UP2OCR_DMPDE;
  429. gpio_direction_output(SPITZ_GPIO_USB_HOST, 1);
  430. UHCHR = (UHCHR) &
  431. ~(UHCHR_SSEP1 | UHCHR_SSEP2 | UHCHR_SSEP3 | UHCHR_SSE);
  432. UHCRHDA |= UHCRHDA_NOCP;
  433. return 0;
  434. }
  435. static struct pxaohci_platform_data spitz_ohci_platform_data = {
  436. .port_mode = PMM_NPS_MODE,
  437. .init = spitz_ohci_init,
  438. .power_budget = 150,
  439. };
  440. /*
  441. * Irda
  442. */
  443. static void spitz_irda_transceiver_mode(struct device *dev, int mode)
  444. {
  445. if (mode & IR_OFF)
  446. set_scoop_gpio(&spitzscoop2_device.dev, SPITZ_SCP2_IR_ON);
  447. else
  448. reset_scoop_gpio(&spitzscoop2_device.dev, SPITZ_SCP2_IR_ON);
  449. pxa2xx_transceiver_mode(dev, mode);
  450. }
  451. #ifdef CONFIG_MACH_AKITA
  452. static void akita_irda_transceiver_mode(struct device *dev, int mode)
  453. {
  454. if (mode & IR_OFF)
  455. akita_set_ioexp(&akitaioexp_device.dev, AKITA_IOEXP_IR_ON);
  456. else
  457. akita_reset_ioexp(&akitaioexp_device.dev, AKITA_IOEXP_IR_ON);
  458. pxa2xx_transceiver_mode(dev, mode);
  459. }
  460. #endif
  461. static struct pxaficp_platform_data spitz_ficp_platform_data = {
  462. .transceiver_cap = IR_SIRMODE | IR_OFF,
  463. .transceiver_mode = spitz_irda_transceiver_mode,
  464. };
  465. /*
  466. * Spitz PXA Framebuffer
  467. */
  468. static struct pxafb_mode_info spitz_pxafb_modes[] = {
  469. {
  470. .pixclock = 19231,
  471. .xres = 480,
  472. .yres = 640,
  473. .bpp = 16,
  474. .hsync_len = 40,
  475. .left_margin = 46,
  476. .right_margin = 125,
  477. .vsync_len = 3,
  478. .upper_margin = 1,
  479. .lower_margin = 0,
  480. .sync = 0,
  481. },{
  482. .pixclock = 134617,
  483. .xres = 240,
  484. .yres = 320,
  485. .bpp = 16,
  486. .hsync_len = 20,
  487. .left_margin = 20,
  488. .right_margin = 46,
  489. .vsync_len = 2,
  490. .upper_margin = 1,
  491. .lower_margin = 0,
  492. .sync = 0,
  493. },
  494. };
  495. static struct pxafb_mach_info spitz_pxafb_info = {
  496. .modes = &spitz_pxafb_modes[0],
  497. .num_modes = 2,
  498. .fixed_modes = 1,
  499. .lcd_conn = LCD_COLOR_TFT_16BPP | LCD_ALTERNATE_MAPPING,
  500. };
  501. static struct platform_device *devices[] __initdata = {
  502. &spitzscoop_device,
  503. &spitzkbd_device,
  504. &spitzled_device,
  505. };
  506. static void spitz_poweroff(void)
  507. {
  508. arm_machine_restart('g');
  509. }
  510. static void spitz_restart(char mode)
  511. {
  512. /* Bootloader magic for a reboot */
  513. if((MSC0 & 0xffff0000) == 0x7ff00000)
  514. MSC0 = (MSC0 & 0xffff) | 0x7ee00000;
  515. spitz_poweroff();
  516. }
  517. static void __init common_init(void)
  518. {
  519. init_gpio_reset(SPITZ_GPIO_ON_RESET);
  520. pm_power_off = spitz_poweroff;
  521. arm_pm_restart = spitz_restart;
  522. PMCR = 0x00;
  523. /* Stop 3.6MHz and drive HIGH to PCMCIA and CS */
  524. PCFR |= PCFR_OPDE;
  525. pxa2xx_mfp_config(ARRAY_AND_SIZE(spitz_pin_config));
  526. spitz_init_spi();
  527. platform_add_devices(devices, ARRAY_SIZE(devices));
  528. pxa_set_mci_info(&spitz_mci_platform_data);
  529. pxa_set_ohci_info(&spitz_ohci_platform_data);
  530. pxa_set_ficp_info(&spitz_ficp_platform_data);
  531. set_pxa_fb_info(&spitz_pxafb_info);
  532. pxa_set_i2c_info(NULL);
  533. }
  534. #if defined(CONFIG_MACH_SPITZ) || defined(CONFIG_MACH_BORZOI)
  535. static void __init spitz_init(void)
  536. {
  537. platform_scoop_config = &spitz_pcmcia_config;
  538. common_init();
  539. platform_device_register(&spitzscoop2_device);
  540. }
  541. #endif
  542. #ifdef CONFIG_MACH_AKITA
  543. /*
  544. * Akita IO Expander
  545. */
  546. struct platform_device akitaioexp_device = {
  547. .name = "akita-ioexp",
  548. .id = -1,
  549. };
  550. EXPORT_SYMBOL_GPL(akitaioexp_device);
  551. static void __init akita_init(void)
  552. {
  553. spitz_ficp_platform_data.transceiver_mode = akita_irda_transceiver_mode;
  554. /* We just pretend the second element of the array doesn't exist */
  555. spitz_pcmcia_config.num_devs = 1;
  556. platform_scoop_config = &spitz_pcmcia_config;
  557. platform_device_register(&akitaioexp_device);
  558. spitzscoop_device.dev.parent = &akitaioexp_device.dev;
  559. common_init();
  560. }
  561. #endif
  562. static void __init fixup_spitz(struct machine_desc *desc,
  563. struct tag *tags, char **cmdline, struct meminfo *mi)
  564. {
  565. sharpsl_save_param();
  566. mi->nr_banks = 1;
  567. mi->bank[0].start = 0xa0000000;
  568. mi->bank[0].node = 0;
  569. mi->bank[0].size = (64*1024*1024);
  570. }
  571. #ifdef CONFIG_MACH_SPITZ
  572. MACHINE_START(SPITZ, "SHARP Spitz")
  573. .phys_io = 0x40000000,
  574. .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
  575. .fixup = fixup_spitz,
  576. .map_io = pxa_map_io,
  577. .init_irq = pxa27x_init_irq,
  578. .init_machine = spitz_init,
  579. .timer = &pxa_timer,
  580. MACHINE_END
  581. #endif
  582. #ifdef CONFIG_MACH_BORZOI
  583. MACHINE_START(BORZOI, "SHARP Borzoi")
  584. .phys_io = 0x40000000,
  585. .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
  586. .fixup = fixup_spitz,
  587. .map_io = pxa_map_io,
  588. .init_irq = pxa27x_init_irq,
  589. .init_machine = spitz_init,
  590. .timer = &pxa_timer,
  591. MACHINE_END
  592. #endif
  593. #ifdef CONFIG_MACH_AKITA
  594. MACHINE_START(AKITA, "SHARP Akita")
  595. .phys_io = 0x40000000,
  596. .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
  597. .fixup = fixup_spitz,
  598. .map_io = pxa_map_io,
  599. .init_irq = pxa27x_init_irq,
  600. .init_machine = akita_init,
  601. .timer = &pxa_timer,
  602. MACHINE_END
  603. #endif