mainstone.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626
  1. /*
  2. * linux/arch/arm/mach-pxa/mainstone.c
  3. *
  4. * Support for the Intel HCDDBBVA0 Development Platform.
  5. * (go figure how they came up with such name...)
  6. *
  7. * Author: Nicolas Pitre
  8. * Created: Nov 05, 2002
  9. * Copyright: MontaVista Software Inc.
  10. *
  11. * This program is free software; you can redistribute it and/or modify
  12. * it under the terms of the GNU General Public License version 2 as
  13. * published by the Free Software Foundation.
  14. */
  15. #include <linux/init.h>
  16. #include <linux/platform_device.h>
  17. #include <linux/syscore_ops.h>
  18. #include <linux/interrupt.h>
  19. #include <linux/sched.h>
  20. #include <linux/bitops.h>
  21. #include <linux/fb.h>
  22. #include <linux/ioport.h>
  23. #include <linux/mtd/mtd.h>
  24. #include <linux/mtd/partitions.h>
  25. #include <linux/input.h>
  26. #include <linux/gpio_keys.h>
  27. #include <linux/pwm_backlight.h>
  28. #include <linux/smc91x.h>
  29. #include <linux/i2c/pxa-i2c.h>
  30. #include <asm/types.h>
  31. #include <asm/setup.h>
  32. #include <asm/memory.h>
  33. #include <asm/mach-types.h>
  34. #include <mach/hardware.h>
  35. #include <asm/irq.h>
  36. #include <asm/sizes.h>
  37. #include <asm/mach/arch.h>
  38. #include <asm/mach/map.h>
  39. #include <asm/mach/irq.h>
  40. #include <asm/mach/flash.h>
  41. #include <mach/pxa27x.h>
  42. #include <mach/gpio.h>
  43. #include <mach/mainstone.h>
  44. #include <mach/audio.h>
  45. #include <mach/pxafb.h>
  46. #include <mach/mmc.h>
  47. #include <mach/irda.h>
  48. #include <mach/ohci.h>
  49. #include <plat/pxa27x_keypad.h>
  50. #include <mach/smemc.h>
  51. #include "generic.h"
  52. #include "devices.h"
  53. static unsigned long mainstone_pin_config[] = {
  54. /* Chip Select */
  55. GPIO15_nCS_1,
  56. /* LCD - 16bpp Active TFT */
  57. GPIOxx_LCD_TFT_16BPP,
  58. GPIO16_PWM0_OUT, /* Backlight */
  59. /* MMC */
  60. GPIO32_MMC_CLK,
  61. GPIO112_MMC_CMD,
  62. GPIO92_MMC_DAT_0,
  63. GPIO109_MMC_DAT_1,
  64. GPIO110_MMC_DAT_2,
  65. GPIO111_MMC_DAT_3,
  66. /* USB Host Port 1 */
  67. GPIO88_USBH1_PWR,
  68. GPIO89_USBH1_PEN,
  69. /* PC Card */
  70. GPIO48_nPOE,
  71. GPIO49_nPWE,
  72. GPIO50_nPIOR,
  73. GPIO51_nPIOW,
  74. GPIO85_nPCE_1,
  75. GPIO54_nPCE_2,
  76. GPIO79_PSKTSEL,
  77. GPIO55_nPREG,
  78. GPIO56_nPWAIT,
  79. GPIO57_nIOIS16,
  80. /* AC97 */
  81. GPIO28_AC97_BITCLK,
  82. GPIO29_AC97_SDATA_IN_0,
  83. GPIO30_AC97_SDATA_OUT,
  84. GPIO31_AC97_SYNC,
  85. GPIO45_AC97_SYSCLK,
  86. /* Keypad */
  87. GPIO93_KP_DKIN_0,
  88. GPIO94_KP_DKIN_1,
  89. GPIO95_KP_DKIN_2,
  90. GPIO100_KP_MKIN_0 | WAKEUP_ON_LEVEL_HIGH,
  91. GPIO101_KP_MKIN_1 | WAKEUP_ON_LEVEL_HIGH,
  92. GPIO102_KP_MKIN_2 | WAKEUP_ON_LEVEL_HIGH,
  93. GPIO97_KP_MKIN_3 | WAKEUP_ON_LEVEL_HIGH,
  94. GPIO98_KP_MKIN_4 | WAKEUP_ON_LEVEL_HIGH,
  95. GPIO99_KP_MKIN_5 | WAKEUP_ON_LEVEL_HIGH,
  96. GPIO103_KP_MKOUT_0,
  97. GPIO104_KP_MKOUT_1,
  98. GPIO105_KP_MKOUT_2,
  99. GPIO106_KP_MKOUT_3,
  100. GPIO107_KP_MKOUT_4,
  101. GPIO108_KP_MKOUT_5,
  102. GPIO96_KP_MKOUT_6,
  103. /* I2C */
  104. GPIO117_I2C_SCL,
  105. GPIO118_I2C_SDA,
  106. /* GPIO */
  107. GPIO1_GPIO | WAKEUP_ON_EDGE_BOTH,
  108. };
  109. static unsigned long mainstone_irq_enabled;
  110. static void mainstone_mask_irq(struct irq_data *d)
  111. {
  112. int mainstone_irq = (d->irq - MAINSTONE_IRQ(0));
  113. MST_INTMSKENA = (mainstone_irq_enabled &= ~(1 << mainstone_irq));
  114. }
  115. static void mainstone_unmask_irq(struct irq_data *d)
  116. {
  117. int mainstone_irq = (d->irq - MAINSTONE_IRQ(0));
  118. /* the irq can be acknowledged only if deasserted, so it's done here */
  119. MST_INTSETCLR &= ~(1 << mainstone_irq);
  120. MST_INTMSKENA = (mainstone_irq_enabled |= (1 << mainstone_irq));
  121. }
  122. static struct irq_chip mainstone_irq_chip = {
  123. .name = "FPGA",
  124. .irq_ack = mainstone_mask_irq,
  125. .irq_mask = mainstone_mask_irq,
  126. .irq_unmask = mainstone_unmask_irq,
  127. };
  128. static void mainstone_irq_handler(unsigned int irq, struct irq_desc *desc)
  129. {
  130. unsigned long pending = MST_INTSETCLR & mainstone_irq_enabled;
  131. do {
  132. /* clear useless edge notification */
  133. desc->irq_data.chip->irq_ack(&desc->irq_data);
  134. if (likely(pending)) {
  135. irq = MAINSTONE_IRQ(0) + __ffs(pending);
  136. generic_handle_irq(irq);
  137. }
  138. pending = MST_INTSETCLR & mainstone_irq_enabled;
  139. } while (pending);
  140. }
  141. static void __init mainstone_init_irq(void)
  142. {
  143. int irq;
  144. pxa27x_init_irq();
  145. /* setup extra Mainstone irqs */
  146. for(irq = MAINSTONE_IRQ(0); irq <= MAINSTONE_IRQ(15); irq++) {
  147. irq_set_chip_and_handler(irq, &mainstone_irq_chip,
  148. handle_level_irq);
  149. if (irq == MAINSTONE_IRQ(10) || irq == MAINSTONE_IRQ(14))
  150. set_irq_flags(irq, IRQF_VALID | IRQF_PROBE | IRQF_NOAUTOEN);
  151. else
  152. set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
  153. }
  154. set_irq_flags(MAINSTONE_IRQ(8), 0);
  155. set_irq_flags(MAINSTONE_IRQ(12), 0);
  156. MST_INTMSKENA = 0;
  157. MST_INTSETCLR = 0;
  158. irq_set_chained_handler(IRQ_GPIO(0), mainstone_irq_handler);
  159. irq_set_irq_type(IRQ_GPIO(0), IRQ_TYPE_EDGE_FALLING);
  160. }
  161. #ifdef CONFIG_PM
  162. static void mainstone_irq_resume(void)
  163. {
  164. MST_INTMSKENA = mainstone_irq_enabled;
  165. }
  166. static struct syscore_ops mainstone_irq_syscore_ops = {
  167. .resume = mainstone_irq_resume,
  168. };
  169. static int __init mainstone_irq_device_init(void)
  170. {
  171. if (machine_is_mainstone())
  172. register_syscore_ops(&mainstone_irq_syscore_ops);
  173. return 0;
  174. }
  175. device_initcall(mainstone_irq_device_init);
  176. #endif
  177. static struct resource smc91x_resources[] = {
  178. [0] = {
  179. .start = (MST_ETH_PHYS + 0x300),
  180. .end = (MST_ETH_PHYS + 0xfffff),
  181. .flags = IORESOURCE_MEM,
  182. },
  183. [1] = {
  184. .start = MAINSTONE_IRQ(3),
  185. .end = MAINSTONE_IRQ(3),
  186. .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
  187. }
  188. };
  189. static struct smc91x_platdata mainstone_smc91x_info = {
  190. .flags = SMC91X_USE_8BIT | SMC91X_USE_16BIT | SMC91X_USE_32BIT |
  191. SMC91X_NOWAIT | SMC91X_USE_DMA,
  192. };
  193. static struct platform_device smc91x_device = {
  194. .name = "smc91x",
  195. .id = 0,
  196. .num_resources = ARRAY_SIZE(smc91x_resources),
  197. .resource = smc91x_resources,
  198. .dev = {
  199. .platform_data = &mainstone_smc91x_info,
  200. },
  201. };
  202. static int mst_audio_startup(struct snd_pcm_substream *substream, void *priv)
  203. {
  204. if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
  205. MST_MSCWR2 &= ~MST_MSCWR2_AC97_SPKROFF;
  206. return 0;
  207. }
  208. static void mst_audio_shutdown(struct snd_pcm_substream *substream, void *priv)
  209. {
  210. if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
  211. MST_MSCWR2 |= MST_MSCWR2_AC97_SPKROFF;
  212. }
  213. static long mst_audio_suspend_mask;
  214. static void mst_audio_suspend(void *priv)
  215. {
  216. mst_audio_suspend_mask = MST_MSCWR2;
  217. MST_MSCWR2 |= MST_MSCWR2_AC97_SPKROFF;
  218. }
  219. static void mst_audio_resume(void *priv)
  220. {
  221. MST_MSCWR2 &= mst_audio_suspend_mask | ~MST_MSCWR2_AC97_SPKROFF;
  222. }
  223. static pxa2xx_audio_ops_t mst_audio_ops = {
  224. .startup = mst_audio_startup,
  225. .shutdown = mst_audio_shutdown,
  226. .suspend = mst_audio_suspend,
  227. .resume = mst_audio_resume,
  228. };
  229. static struct resource flash_resources[] = {
  230. [0] = {
  231. .start = PXA_CS0_PHYS,
  232. .end = PXA_CS0_PHYS + SZ_64M - 1,
  233. .flags = IORESOURCE_MEM,
  234. },
  235. [1] = {
  236. .start = PXA_CS1_PHYS,
  237. .end = PXA_CS1_PHYS + SZ_64M - 1,
  238. .flags = IORESOURCE_MEM,
  239. },
  240. };
  241. static struct mtd_partition mainstoneflash0_partitions[] = {
  242. {
  243. .name = "Bootloader",
  244. .size = 0x00040000,
  245. .offset = 0,
  246. .mask_flags = MTD_WRITEABLE /* force read-only */
  247. },{
  248. .name = "Kernel",
  249. .size = 0x00400000,
  250. .offset = 0x00040000,
  251. },{
  252. .name = "Filesystem",
  253. .size = MTDPART_SIZ_FULL,
  254. .offset = 0x00440000
  255. }
  256. };
  257. static struct flash_platform_data mst_flash_data[2] = {
  258. {
  259. .map_name = "cfi_probe",
  260. .parts = mainstoneflash0_partitions,
  261. .nr_parts = ARRAY_SIZE(mainstoneflash0_partitions),
  262. }, {
  263. .map_name = "cfi_probe",
  264. .parts = NULL,
  265. .nr_parts = 0,
  266. }
  267. };
  268. static struct platform_device mst_flash_device[2] = {
  269. {
  270. .name = "pxa2xx-flash",
  271. .id = 0,
  272. .dev = {
  273. .platform_data = &mst_flash_data[0],
  274. },
  275. .resource = &flash_resources[0],
  276. .num_resources = 1,
  277. },
  278. {
  279. .name = "pxa2xx-flash",
  280. .id = 1,
  281. .dev = {
  282. .platform_data = &mst_flash_data[1],
  283. },
  284. .resource = &flash_resources[1],
  285. .num_resources = 1,
  286. },
  287. };
  288. #if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE)
  289. static struct platform_pwm_backlight_data mainstone_backlight_data = {
  290. .pwm_id = 0,
  291. .max_brightness = 1023,
  292. .dft_brightness = 1023,
  293. .pwm_period_ns = 78770,
  294. };
  295. static struct platform_device mainstone_backlight_device = {
  296. .name = "pwm-backlight",
  297. .dev = {
  298. .parent = &pxa27x_device_pwm0.dev,
  299. .platform_data = &mainstone_backlight_data,
  300. },
  301. };
  302. static void __init mainstone_backlight_register(void)
  303. {
  304. int ret = platform_device_register(&mainstone_backlight_device);
  305. if (ret)
  306. printk(KERN_ERR "mainstone: failed to register backlight device: %d\n", ret);
  307. }
  308. #else
  309. #define mainstone_backlight_register() do { } while (0)
  310. #endif
  311. static struct pxafb_mode_info toshiba_ltm04c380k_mode = {
  312. .pixclock = 50000,
  313. .xres = 640,
  314. .yres = 480,
  315. .bpp = 16,
  316. .hsync_len = 1,
  317. .left_margin = 0x9f,
  318. .right_margin = 1,
  319. .vsync_len = 44,
  320. .upper_margin = 0,
  321. .lower_margin = 0,
  322. .sync = FB_SYNC_HOR_HIGH_ACT|FB_SYNC_VERT_HIGH_ACT,
  323. };
  324. static struct pxafb_mode_info toshiba_ltm035a776c_mode = {
  325. .pixclock = 110000,
  326. .xres = 240,
  327. .yres = 320,
  328. .bpp = 16,
  329. .hsync_len = 4,
  330. .left_margin = 8,
  331. .right_margin = 20,
  332. .vsync_len = 3,
  333. .upper_margin = 1,
  334. .lower_margin = 10,
  335. .sync = FB_SYNC_HOR_HIGH_ACT|FB_SYNC_VERT_HIGH_ACT,
  336. };
  337. static struct pxafb_mach_info mainstone_pxafb_info = {
  338. .num_modes = 1,
  339. .lcd_conn = LCD_COLOR_TFT_16BPP | LCD_PCLK_EDGE_FALL,
  340. };
  341. static int mainstone_mci_init(struct device *dev, irq_handler_t mstone_detect_int, void *data)
  342. {
  343. int err;
  344. /* make sure SD/Memory Stick multiplexer's signals
  345. * are routed to MMC controller
  346. */
  347. MST_MSCWR1 &= ~MST_MSCWR1_MS_SEL;
  348. err = request_irq(MAINSTONE_MMC_IRQ, mstone_detect_int, IRQF_DISABLED,
  349. "MMC card detect", data);
  350. if (err)
  351. printk(KERN_ERR "mainstone_mci_init: MMC/SD: can't request MMC card detect IRQ\n");
  352. return err;
  353. }
  354. static void mainstone_mci_setpower(struct device *dev, unsigned int vdd)
  355. {
  356. struct pxamci_platform_data* p_d = dev->platform_data;
  357. if (( 1 << vdd) & p_d->ocr_mask) {
  358. printk(KERN_DEBUG "%s: on\n", __func__);
  359. MST_MSCWR1 |= MST_MSCWR1_MMC_ON;
  360. MST_MSCWR1 &= ~MST_MSCWR1_MS_SEL;
  361. } else {
  362. printk(KERN_DEBUG "%s: off\n", __func__);
  363. MST_MSCWR1 &= ~MST_MSCWR1_MMC_ON;
  364. }
  365. }
  366. static void mainstone_mci_exit(struct device *dev, void *data)
  367. {
  368. free_irq(MAINSTONE_MMC_IRQ, data);
  369. }
  370. static struct pxamci_platform_data mainstone_mci_platform_data = {
  371. .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34,
  372. .init = mainstone_mci_init,
  373. .setpower = mainstone_mci_setpower,
  374. .exit = mainstone_mci_exit,
  375. .gpio_card_detect = -1,
  376. .gpio_card_ro = -1,
  377. .gpio_power = -1,
  378. };
  379. static void mainstone_irda_transceiver_mode(struct device *dev, int mode)
  380. {
  381. unsigned long flags;
  382. local_irq_save(flags);
  383. if (mode & IR_SIRMODE) {
  384. MST_MSCWR1 &= ~MST_MSCWR1_IRDA_FIR;
  385. } else if (mode & IR_FIRMODE) {
  386. MST_MSCWR1 |= MST_MSCWR1_IRDA_FIR;
  387. }
  388. pxa2xx_transceiver_mode(dev, mode);
  389. if (mode & IR_OFF) {
  390. MST_MSCWR1 = (MST_MSCWR1 & ~MST_MSCWR1_IRDA_MASK) | MST_MSCWR1_IRDA_OFF;
  391. } else {
  392. MST_MSCWR1 = (MST_MSCWR1 & ~MST_MSCWR1_IRDA_MASK) | MST_MSCWR1_IRDA_FULL;
  393. }
  394. local_irq_restore(flags);
  395. }
  396. static struct pxaficp_platform_data mainstone_ficp_platform_data = {
  397. .gpio_pwdown = -1,
  398. .transceiver_cap = IR_SIRMODE | IR_FIRMODE | IR_OFF,
  399. .transceiver_mode = mainstone_irda_transceiver_mode,
  400. };
  401. static struct gpio_keys_button gpio_keys_button[] = {
  402. [0] = {
  403. .desc = "wakeup",
  404. .code = KEY_SUSPEND,
  405. .type = EV_KEY,
  406. .gpio = 1,
  407. .wakeup = 1,
  408. },
  409. };
  410. static struct gpio_keys_platform_data mainstone_gpio_keys = {
  411. .buttons = gpio_keys_button,
  412. .nbuttons = 1,
  413. };
  414. static struct platform_device mst_gpio_keys_device = {
  415. .name = "gpio-keys",
  416. .id = -1,
  417. .dev = {
  418. .platform_data = &mainstone_gpio_keys,
  419. },
  420. };
  421. static struct platform_device *platform_devices[] __initdata = {
  422. &smc91x_device,
  423. &mst_flash_device[0],
  424. &mst_flash_device[1],
  425. &mst_gpio_keys_device,
  426. };
  427. static struct pxaohci_platform_data mainstone_ohci_platform_data = {
  428. .port_mode = PMM_PERPORT_MODE,
  429. .flags = ENABLE_PORT_ALL | POWER_CONTROL_LOW | POWER_SENSE_LOW,
  430. };
  431. #if defined(CONFIG_KEYBOARD_PXA27x) || defined(CONFIG_KEYBOARD_PXA27x_MODULE)
  432. static unsigned int mainstone_matrix_keys[] = {
  433. KEY(0, 0, KEY_A), KEY(1, 0, KEY_B), KEY(2, 0, KEY_C),
  434. KEY(3, 0, KEY_D), KEY(4, 0, KEY_E), KEY(5, 0, KEY_F),
  435. KEY(0, 1, KEY_G), KEY(1, 1, KEY_H), KEY(2, 1, KEY_I),
  436. KEY(3, 1, KEY_J), KEY(4, 1, KEY_K), KEY(5, 1, KEY_L),
  437. KEY(0, 2, KEY_M), KEY(1, 2, KEY_N), KEY(2, 2, KEY_O),
  438. KEY(3, 2, KEY_P), KEY(4, 2, KEY_Q), KEY(5, 2, KEY_R),
  439. KEY(0, 3, KEY_S), KEY(1, 3, KEY_T), KEY(2, 3, KEY_U),
  440. KEY(3, 3, KEY_V), KEY(4, 3, KEY_W), KEY(5, 3, KEY_X),
  441. KEY(2, 4, KEY_Y), KEY(3, 4, KEY_Z),
  442. KEY(0, 4, KEY_DOT), /* . */
  443. KEY(1, 4, KEY_CLOSE), /* @ */
  444. KEY(4, 4, KEY_SLASH),
  445. KEY(5, 4, KEY_BACKSLASH),
  446. KEY(0, 5, KEY_HOME),
  447. KEY(1, 5, KEY_LEFTSHIFT),
  448. KEY(2, 5, KEY_SPACE),
  449. KEY(3, 5, KEY_SPACE),
  450. KEY(4, 5, KEY_ENTER),
  451. KEY(5, 5, KEY_BACKSPACE),
  452. KEY(0, 6, KEY_UP),
  453. KEY(1, 6, KEY_DOWN),
  454. KEY(2, 6, KEY_LEFT),
  455. KEY(3, 6, KEY_RIGHT),
  456. KEY(4, 6, KEY_SELECT),
  457. };
  458. struct pxa27x_keypad_platform_data mainstone_keypad_info = {
  459. .matrix_key_rows = 6,
  460. .matrix_key_cols = 7,
  461. .matrix_key_map = mainstone_matrix_keys,
  462. .matrix_key_map_size = ARRAY_SIZE(mainstone_matrix_keys),
  463. .enable_rotary0 = 1,
  464. .rotary0_up_key = KEY_UP,
  465. .rotary0_down_key = KEY_DOWN,
  466. .debounce_interval = 30,
  467. };
  468. static void __init mainstone_init_keypad(void)
  469. {
  470. pxa_set_keypad_info(&mainstone_keypad_info);
  471. }
  472. #else
  473. static inline void mainstone_init_keypad(void) {}
  474. #endif
  475. static void __init mainstone_init(void)
  476. {
  477. int SW7 = 0; /* FIXME: get from SCR (Mst doc section 3.2.1.1) */
  478. pxa2xx_mfp_config(ARRAY_AND_SIZE(mainstone_pin_config));
  479. pxa_set_ffuart_info(NULL);
  480. pxa_set_btuart_info(NULL);
  481. pxa_set_stuart_info(NULL);
  482. mst_flash_data[0].width = (__raw_readl(BOOT_DEF) & 1) ? 2 : 4;
  483. mst_flash_data[1].width = 4;
  484. /* Compensate for SW7 which swaps the flash banks */
  485. mst_flash_data[SW7].name = "processor-flash";
  486. mst_flash_data[SW7 ^ 1].name = "mainboard-flash";
  487. printk(KERN_NOTICE "Mainstone configured to boot from %s\n",
  488. mst_flash_data[0].name);
  489. /* system bus arbiter setting
  490. * - Core_Park
  491. * - LCD_wt:DMA_wt:CORE_Wt = 2:3:4
  492. */
  493. ARB_CNTRL = ARB_CORE_PARK | 0x234;
  494. platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices));
  495. /* reading Mainstone's "Virtual Configuration Register"
  496. might be handy to select LCD type here */
  497. if (0)
  498. mainstone_pxafb_info.modes = &toshiba_ltm04c380k_mode;
  499. else
  500. mainstone_pxafb_info.modes = &toshiba_ltm035a776c_mode;
  501. pxa_set_fb_info(NULL, &mainstone_pxafb_info);
  502. mainstone_backlight_register();
  503. pxa_set_mci_info(&mainstone_mci_platform_data);
  504. pxa_set_ficp_info(&mainstone_ficp_platform_data);
  505. pxa_set_ohci_info(&mainstone_ohci_platform_data);
  506. pxa_set_i2c_info(NULL);
  507. pxa_set_ac97_info(&mst_audio_ops);
  508. mainstone_init_keypad();
  509. }
  510. static struct map_desc mainstone_io_desc[] __initdata = {
  511. { /* CPLD */
  512. .virtual = MST_FPGA_VIRT,
  513. .pfn = __phys_to_pfn(MST_FPGA_PHYS),
  514. .length = 0x00100000,
  515. .type = MT_DEVICE
  516. }
  517. };
  518. static void __init mainstone_map_io(void)
  519. {
  520. pxa27x_map_io();
  521. iotable_init(mainstone_io_desc, ARRAY_SIZE(mainstone_io_desc));
  522. /* for use I SRAM as framebuffer. */
  523. PSLR |= 0xF04;
  524. PCFR = 0x66;
  525. }
  526. MACHINE_START(MAINSTONE, "Intel HCDDBBVA0 Development Platform (aka Mainstone)")
  527. /* Maintainer: MontaVista Software Inc. */
  528. .boot_params = 0xa0000100, /* BLOB boot parameter setting */
  529. .map_io = mainstone_map_io,
  530. .nr_irqs = MAINSTONE_NR_IRQS,
  531. .init_irq = mainstone_init_irq,
  532. .handle_irq = pxa27x_handle_irq,
  533. .timer = &pxa_timer,
  534. .init_machine = mainstone_init,
  535. MACHINE_END