eseries.c 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982
  1. /*
  2. * Hardware definitions for the Toshiba eseries PDAs
  3. *
  4. * Copyright (c) 2003 Ian Molton <spyro@f2s.com>
  5. *
  6. * This file is licensed under
  7. * the terms of the GNU General Public License version 2. This program
  8. * is licensed "as is" without any warranty of any kind, whether express
  9. * or implied.
  10. *
  11. */
  12. #include <linux/kernel.h>
  13. #include <linux/init.h>
  14. #include <linux/gpio.h>
  15. #include <linux/delay.h>
  16. #include <linux/platform_device.h>
  17. #include <linux/mfd/tc6387xb.h>
  18. #include <linux/mfd/tc6393xb.h>
  19. #include <linux/mfd/t7l66xb.h>
  20. #include <linux/mtd/nand.h>
  21. #include <linux/mtd/partitions.h>
  22. #include <linux/usb/gpio_vbus.h>
  23. #include <linux/memblock.h>
  24. #include <video/w100fb.h>
  25. #include <asm/setup.h>
  26. #include <asm/mach/arch.h>
  27. #include <asm/mach-types.h>
  28. #include <mach/pxa25x.h>
  29. #include <mach/eseries-gpio.h>
  30. #include <mach/eseries-irq.h>
  31. #include <mach/audio.h>
  32. #include <linux/platform_data/video-pxafb.h>
  33. #include <mach/udc.h>
  34. #include <linux/platform_data/irda-pxaficp.h>
  35. #include "devices.h"
  36. #include "generic.h"
  37. #include "clock.h"
  38. /* Only e800 has 128MB RAM */
  39. void __init eseries_fixup(struct tag *tags, char **cmdline)
  40. {
  41. if (machine_is_e800())
  42. memblock_add(0xa0000000, SZ_128M);
  43. else
  44. memblock_add(0xa0000000, SZ_64M);
  45. }
  46. struct gpio_vbus_mach_info e7xx_udc_info = {
  47. .gpio_vbus = GPIO_E7XX_USB_DISC,
  48. .gpio_pullup = GPIO_E7XX_USB_PULLUP,
  49. .gpio_pullup_inverted = 1
  50. };
  51. static struct platform_device e7xx_gpio_vbus = {
  52. .name = "gpio-vbus",
  53. .id = -1,
  54. .dev = {
  55. .platform_data = &e7xx_udc_info,
  56. },
  57. };
  58. struct pxaficp_platform_data e7xx_ficp_platform_data = {
  59. .gpio_pwdown = GPIO_E7XX_IR_OFF,
  60. .transceiver_cap = IR_SIRMODE | IR_OFF,
  61. };
  62. int eseries_tmio_enable(struct platform_device *dev)
  63. {
  64. /* Reset - bring SUSPEND high before PCLR */
  65. gpio_set_value(GPIO_ESERIES_TMIO_SUSPEND, 0);
  66. gpio_set_value(GPIO_ESERIES_TMIO_PCLR, 0);
  67. msleep(1);
  68. gpio_set_value(GPIO_ESERIES_TMIO_SUSPEND, 1);
  69. msleep(1);
  70. gpio_set_value(GPIO_ESERIES_TMIO_PCLR, 1);
  71. msleep(1);
  72. return 0;
  73. }
  74. int eseries_tmio_disable(struct platform_device *dev)
  75. {
  76. gpio_set_value(GPIO_ESERIES_TMIO_SUSPEND, 0);
  77. gpio_set_value(GPIO_ESERIES_TMIO_PCLR, 0);
  78. return 0;
  79. }
  80. int eseries_tmio_suspend(struct platform_device *dev)
  81. {
  82. gpio_set_value(GPIO_ESERIES_TMIO_SUSPEND, 0);
  83. return 0;
  84. }
  85. int eseries_tmio_resume(struct platform_device *dev)
  86. {
  87. gpio_set_value(GPIO_ESERIES_TMIO_SUSPEND, 1);
  88. msleep(1);
  89. return 0;
  90. }
  91. void eseries_get_tmio_gpios(void)
  92. {
  93. gpio_request(GPIO_ESERIES_TMIO_SUSPEND, NULL);
  94. gpio_request(GPIO_ESERIES_TMIO_PCLR, NULL);
  95. gpio_direction_output(GPIO_ESERIES_TMIO_SUSPEND, 0);
  96. gpio_direction_output(GPIO_ESERIES_TMIO_PCLR, 0);
  97. }
  98. /* TMIO controller uses the same resources on all e-series machines. */
  99. struct resource eseries_tmio_resources[] = {
  100. [0] = {
  101. .start = PXA_CS4_PHYS,
  102. .end = PXA_CS4_PHYS + 0x1fffff,
  103. .flags = IORESOURCE_MEM,
  104. },
  105. [1] = {
  106. .start = PXA_GPIO_TO_IRQ(GPIO_ESERIES_TMIO_IRQ),
  107. .end = PXA_GPIO_TO_IRQ(GPIO_ESERIES_TMIO_IRQ),
  108. .flags = IORESOURCE_IRQ,
  109. },
  110. };
  111. /* Some e-series hardware cannot control the 32K clock */
  112. static void clk_32k_dummy(struct clk *clk)
  113. {
  114. }
  115. static const struct clkops clk_32k_dummy_ops = {
  116. .enable = clk_32k_dummy,
  117. .disable = clk_32k_dummy,
  118. };
  119. static struct clk tmio_dummy_clk = {
  120. .ops = &clk_32k_dummy_ops,
  121. .rate = 32768,
  122. };
  123. static struct clk_lookup eseries_clkregs[] = {
  124. INIT_CLKREG(&tmio_dummy_clk, NULL, "CLK_CK32K"),
  125. };
  126. static void __init eseries_register_clks(void)
  127. {
  128. clkdev_add_table(eseries_clkregs, ARRAY_SIZE(eseries_clkregs));
  129. }
  130. #ifdef CONFIG_MACH_E330
  131. /* -------------------- e330 tc6387xb parameters -------------------- */
  132. static struct tc6387xb_platform_data e330_tc6387xb_info = {
  133. .enable = &eseries_tmio_enable,
  134. .disable = &eseries_tmio_disable,
  135. .suspend = &eseries_tmio_suspend,
  136. .resume = &eseries_tmio_resume,
  137. };
  138. static struct platform_device e330_tc6387xb_device = {
  139. .name = "tc6387xb",
  140. .id = -1,
  141. .dev = {
  142. .platform_data = &e330_tc6387xb_info,
  143. },
  144. .num_resources = 2,
  145. .resource = eseries_tmio_resources,
  146. };
  147. /* --------------------------------------------------------------- */
  148. static struct platform_device *e330_devices[] __initdata = {
  149. &e330_tc6387xb_device,
  150. &e7xx_gpio_vbus,
  151. };
  152. static void __init e330_init(void)
  153. {
  154. pxa_set_ffuart_info(NULL);
  155. pxa_set_btuart_info(NULL);
  156. pxa_set_stuart_info(NULL);
  157. eseries_register_clks();
  158. eseries_get_tmio_gpios();
  159. platform_add_devices(ARRAY_AND_SIZE(e330_devices));
  160. }
  161. MACHINE_START(E330, "Toshiba e330")
  162. /* Maintainer: Ian Molton (spyro@f2s.com) */
  163. .atag_offset = 0x100,
  164. .map_io = pxa25x_map_io,
  165. .nr_irqs = ESERIES_NR_IRQS,
  166. .init_irq = pxa25x_init_irq,
  167. .handle_irq = pxa25x_handle_irq,
  168. .fixup = eseries_fixup,
  169. .init_machine = e330_init,
  170. .init_time = pxa_timer_init,
  171. .restart = pxa_restart,
  172. MACHINE_END
  173. #endif
  174. #ifdef CONFIG_MACH_E350
  175. /* -------------------- e350 t7l66xb parameters -------------------- */
  176. static struct t7l66xb_platform_data e350_t7l66xb_info = {
  177. .irq_base = IRQ_BOARD_START,
  178. .enable = &eseries_tmio_enable,
  179. .suspend = &eseries_tmio_suspend,
  180. .resume = &eseries_tmio_resume,
  181. };
  182. static struct platform_device e350_t7l66xb_device = {
  183. .name = "t7l66xb",
  184. .id = -1,
  185. .dev = {
  186. .platform_data = &e350_t7l66xb_info,
  187. },
  188. .num_resources = 2,
  189. .resource = eseries_tmio_resources,
  190. };
  191. /* ---------------------------------------------------------- */
  192. static struct platform_device *e350_devices[] __initdata = {
  193. &e350_t7l66xb_device,
  194. &e7xx_gpio_vbus,
  195. };
  196. static void __init e350_init(void)
  197. {
  198. pxa_set_ffuart_info(NULL);
  199. pxa_set_btuart_info(NULL);
  200. pxa_set_stuart_info(NULL);
  201. eseries_register_clks();
  202. eseries_get_tmio_gpios();
  203. platform_add_devices(ARRAY_AND_SIZE(e350_devices));
  204. }
  205. MACHINE_START(E350, "Toshiba e350")
  206. /* Maintainer: Ian Molton (spyro@f2s.com) */
  207. .atag_offset = 0x100,
  208. .map_io = pxa25x_map_io,
  209. .nr_irqs = ESERIES_NR_IRQS,
  210. .init_irq = pxa25x_init_irq,
  211. .handle_irq = pxa25x_handle_irq,
  212. .fixup = eseries_fixup,
  213. .init_machine = e350_init,
  214. .init_time = pxa_timer_init,
  215. .restart = pxa_restart,
  216. MACHINE_END
  217. #endif
  218. #ifdef CONFIG_MACH_E400
  219. /* ------------------------ E400 LCD definitions ------------------------ */
  220. static struct pxafb_mode_info e400_pxafb_mode_info = {
  221. .pixclock = 140703,
  222. .xres = 240,
  223. .yres = 320,
  224. .bpp = 16,
  225. .hsync_len = 4,
  226. .left_margin = 28,
  227. .right_margin = 8,
  228. .vsync_len = 3,
  229. .upper_margin = 5,
  230. .lower_margin = 6,
  231. .sync = 0,
  232. };
  233. static struct pxafb_mach_info e400_pxafb_mach_info = {
  234. .modes = &e400_pxafb_mode_info,
  235. .num_modes = 1,
  236. .lcd_conn = LCD_COLOR_TFT_16BPP,
  237. .lccr3 = 0,
  238. .pxafb_backlight_power = NULL,
  239. };
  240. /* ------------------------ E400 MFP config ----------------------------- */
  241. static unsigned long e400_pin_config[] __initdata = {
  242. /* Chip selects */
  243. GPIO15_nCS_1, /* CS1 - Flash */
  244. GPIO80_nCS_4, /* CS4 - TMIO */
  245. /* Clocks */
  246. GPIO12_32KHz,
  247. /* BTUART */
  248. GPIO42_BTUART_RXD,
  249. GPIO43_BTUART_TXD,
  250. GPIO44_BTUART_CTS,
  251. /* TMIO controller */
  252. GPIO19_GPIO, /* t7l66xb #PCLR */
  253. GPIO45_GPIO, /* t7l66xb #SUSPEND (NOT BTUART!) */
  254. /* wakeup */
  255. GPIO0_GPIO | WAKEUP_ON_EDGE_RISE,
  256. };
  257. /* ---------------------------------------------------------------------- */
  258. static struct mtd_partition partition_a = {
  259. .name = "Internal NAND flash",
  260. .offset = 0,
  261. .size = MTDPART_SIZ_FULL,
  262. };
  263. static uint8_t scan_ff_pattern[] = { 0xff, 0xff };
  264. static struct nand_bbt_descr e400_t7l66xb_nand_bbt = {
  265. .options = 0,
  266. .offs = 4,
  267. .len = 2,
  268. .pattern = scan_ff_pattern
  269. };
  270. static struct tmio_nand_data e400_t7l66xb_nand_config = {
  271. .num_partitions = 1,
  272. .partition = &partition_a,
  273. .badblock_pattern = &e400_t7l66xb_nand_bbt,
  274. };
  275. static struct t7l66xb_platform_data e400_t7l66xb_info = {
  276. .irq_base = IRQ_BOARD_START,
  277. .enable = &eseries_tmio_enable,
  278. .suspend = &eseries_tmio_suspend,
  279. .resume = &eseries_tmio_resume,
  280. .nand_data = &e400_t7l66xb_nand_config,
  281. };
  282. static struct platform_device e400_t7l66xb_device = {
  283. .name = "t7l66xb",
  284. .id = -1,
  285. .dev = {
  286. .platform_data = &e400_t7l66xb_info,
  287. },
  288. .num_resources = 2,
  289. .resource = eseries_tmio_resources,
  290. };
  291. /* ---------------------------------------------------------- */
  292. static struct platform_device *e400_devices[] __initdata = {
  293. &e400_t7l66xb_device,
  294. &e7xx_gpio_vbus,
  295. };
  296. static void __init e400_init(void)
  297. {
  298. pxa2xx_mfp_config(ARRAY_AND_SIZE(e400_pin_config));
  299. pxa_set_ffuart_info(NULL);
  300. pxa_set_btuart_info(NULL);
  301. pxa_set_stuart_info(NULL);
  302. /* Fixme - e400 may have a switched clock */
  303. eseries_register_clks();
  304. eseries_get_tmio_gpios();
  305. pxa_set_fb_info(NULL, &e400_pxafb_mach_info);
  306. platform_add_devices(ARRAY_AND_SIZE(e400_devices));
  307. }
  308. MACHINE_START(E400, "Toshiba e400")
  309. /* Maintainer: Ian Molton (spyro@f2s.com) */
  310. .atag_offset = 0x100,
  311. .map_io = pxa25x_map_io,
  312. .nr_irqs = ESERIES_NR_IRQS,
  313. .init_irq = pxa25x_init_irq,
  314. .handle_irq = pxa25x_handle_irq,
  315. .fixup = eseries_fixup,
  316. .init_machine = e400_init,
  317. .init_time = pxa_timer_init,
  318. .restart = pxa_restart,
  319. MACHINE_END
  320. #endif
  321. #ifdef CONFIG_MACH_E740
  322. /* ------------------------ e740 video support --------------------------- */
  323. static struct w100_gen_regs e740_lcd_regs = {
  324. .lcd_format = 0x00008023,
  325. .lcdd_cntl1 = 0x0f000000,
  326. .lcdd_cntl2 = 0x0003ffff,
  327. .genlcd_cntl1 = 0x00ffff03,
  328. .genlcd_cntl2 = 0x003c0f03,
  329. .genlcd_cntl3 = 0x000143aa,
  330. };
  331. static struct w100_mode e740_lcd_mode = {
  332. .xres = 240,
  333. .yres = 320,
  334. .left_margin = 20,
  335. .right_margin = 28,
  336. .upper_margin = 9,
  337. .lower_margin = 8,
  338. .crtc_ss = 0x80140013,
  339. .crtc_ls = 0x81150110,
  340. .crtc_gs = 0x80050005,
  341. .crtc_vpos_gs = 0x000a0009,
  342. .crtc_rev = 0x0040010a,
  343. .crtc_dclk = 0xa906000a,
  344. .crtc_gclk = 0x80050108,
  345. .crtc_goe = 0x80050108,
  346. .pll_freq = 57,
  347. .pixclk_divider = 4,
  348. .pixclk_divider_rotated = 4,
  349. .pixclk_src = CLK_SRC_XTAL,
  350. .sysclk_divider = 1,
  351. .sysclk_src = CLK_SRC_PLL,
  352. .crtc_ps1_active = 0x41060010,
  353. };
  354. static struct w100_gpio_regs e740_w100_gpio_info = {
  355. .init_data1 = 0x21002103,
  356. .gpio_dir1 = 0xffffdeff,
  357. .gpio_oe1 = 0x03c00643,
  358. .init_data2 = 0x003f003f,
  359. .gpio_dir2 = 0xffffffff,
  360. .gpio_oe2 = 0x000000ff,
  361. };
  362. static struct w100fb_mach_info e740_fb_info = {
  363. .modelist = &e740_lcd_mode,
  364. .num_modes = 1,
  365. .regs = &e740_lcd_regs,
  366. .gpio = &e740_w100_gpio_info,
  367. .xtal_freq = 14318000,
  368. .xtal_dbl = 1,
  369. };
  370. static struct resource e740_fb_resources[] = {
  371. [0] = {
  372. .start = 0x0c000000,
  373. .end = 0x0cffffff,
  374. .flags = IORESOURCE_MEM,
  375. },
  376. };
  377. static struct platform_device e740_fb_device = {
  378. .name = "w100fb",
  379. .id = -1,
  380. .dev = {
  381. .platform_data = &e740_fb_info,
  382. },
  383. .num_resources = ARRAY_SIZE(e740_fb_resources),
  384. .resource = e740_fb_resources,
  385. };
  386. /* --------------------------- MFP Pin config -------------------------- */
  387. static unsigned long e740_pin_config[] __initdata = {
  388. /* Chip selects */
  389. GPIO15_nCS_1, /* CS1 - Flash */
  390. GPIO79_nCS_3, /* CS3 - IMAGEON */
  391. GPIO80_nCS_4, /* CS4 - TMIO */
  392. /* Clocks */
  393. GPIO12_32KHz,
  394. /* BTUART */
  395. GPIO42_BTUART_RXD,
  396. GPIO43_BTUART_TXD,
  397. GPIO44_BTUART_CTS,
  398. /* TMIO controller */
  399. GPIO19_GPIO, /* t7l66xb #PCLR */
  400. GPIO45_GPIO, /* t7l66xb #SUSPEND (NOT BTUART!) */
  401. /* UDC */
  402. GPIO13_GPIO,
  403. GPIO3_GPIO,
  404. /* IrDA */
  405. GPIO38_GPIO | MFP_LPM_DRIVE_HIGH,
  406. /* AC97 */
  407. GPIO28_AC97_BITCLK,
  408. GPIO29_AC97_SDATA_IN_0,
  409. GPIO30_AC97_SDATA_OUT,
  410. GPIO31_AC97_SYNC,
  411. /* Audio power control */
  412. GPIO16_GPIO, /* AC97 codec AVDD2 supply (analogue power) */
  413. GPIO40_GPIO, /* Mic amp power */
  414. GPIO41_GPIO, /* Headphone amp power */
  415. /* PC Card */
  416. GPIO8_GPIO, /* CD0 */
  417. GPIO44_GPIO, /* CD1 */
  418. GPIO11_GPIO, /* IRQ0 */
  419. GPIO6_GPIO, /* IRQ1 */
  420. GPIO27_GPIO, /* RST0 */
  421. GPIO24_GPIO, /* RST1 */
  422. GPIO20_GPIO, /* PWR0 */
  423. GPIO23_GPIO, /* PWR1 */
  424. GPIO48_nPOE,
  425. GPIO49_nPWE,
  426. GPIO50_nPIOR,
  427. GPIO51_nPIOW,
  428. GPIO52_nPCE_1,
  429. GPIO53_nPCE_2,
  430. GPIO54_nPSKTSEL,
  431. GPIO55_nPREG,
  432. GPIO56_nPWAIT,
  433. GPIO57_nIOIS16,
  434. /* wakeup */
  435. GPIO0_GPIO | WAKEUP_ON_EDGE_RISE,
  436. };
  437. /* -------------------- e740 t7l66xb parameters -------------------- */
  438. static struct t7l66xb_platform_data e740_t7l66xb_info = {
  439. .irq_base = IRQ_BOARD_START,
  440. .enable = &eseries_tmio_enable,
  441. .suspend = &eseries_tmio_suspend,
  442. .resume = &eseries_tmio_resume,
  443. };
  444. static struct platform_device e740_t7l66xb_device = {
  445. .name = "t7l66xb",
  446. .id = -1,
  447. .dev = {
  448. .platform_data = &e740_t7l66xb_info,
  449. },
  450. .num_resources = 2,
  451. .resource = eseries_tmio_resources,
  452. };
  453. static struct platform_device e740_audio_device = {
  454. .name = "e740-audio",
  455. .id = -1,
  456. };
  457. /* ----------------------------------------------------------------------- */
  458. static struct platform_device *e740_devices[] __initdata = {
  459. &e740_fb_device,
  460. &e740_t7l66xb_device,
  461. &e7xx_gpio_vbus,
  462. &e740_audio_device,
  463. };
  464. static void __init e740_init(void)
  465. {
  466. pxa2xx_mfp_config(ARRAY_AND_SIZE(e740_pin_config));
  467. pxa_set_ffuart_info(NULL);
  468. pxa_set_btuart_info(NULL);
  469. pxa_set_stuart_info(NULL);
  470. eseries_register_clks();
  471. clk_add_alias("CLK_CK48M", e740_t7l66xb_device.name,
  472. "UDCCLK", &pxa25x_device_udc.dev),
  473. eseries_get_tmio_gpios();
  474. platform_add_devices(ARRAY_AND_SIZE(e740_devices));
  475. pxa_set_ac97_info(NULL);
  476. pxa_set_ficp_info(&e7xx_ficp_platform_data);
  477. }
  478. MACHINE_START(E740, "Toshiba e740")
  479. /* Maintainer: Ian Molton (spyro@f2s.com) */
  480. .atag_offset = 0x100,
  481. .map_io = pxa25x_map_io,
  482. .nr_irqs = ESERIES_NR_IRQS,
  483. .init_irq = pxa25x_init_irq,
  484. .handle_irq = pxa25x_handle_irq,
  485. .fixup = eseries_fixup,
  486. .init_machine = e740_init,
  487. .init_time = pxa_timer_init,
  488. .restart = pxa_restart,
  489. MACHINE_END
  490. #endif
  491. #ifdef CONFIG_MACH_E750
  492. /* ---------------------- E750 LCD definitions -------------------- */
  493. static struct w100_gen_regs e750_lcd_regs = {
  494. .lcd_format = 0x00008003,
  495. .lcdd_cntl1 = 0x00000000,
  496. .lcdd_cntl2 = 0x0003ffff,
  497. .genlcd_cntl1 = 0x00fff003,
  498. .genlcd_cntl2 = 0x003c0f03,
  499. .genlcd_cntl3 = 0x000143aa,
  500. };
  501. static struct w100_mode e750_lcd_mode = {
  502. .xres = 240,
  503. .yres = 320,
  504. .left_margin = 21,
  505. .right_margin = 22,
  506. .upper_margin = 5,
  507. .lower_margin = 4,
  508. .crtc_ss = 0x80150014,
  509. .crtc_ls = 0x8014000d,
  510. .crtc_gs = 0xc1000005,
  511. .crtc_vpos_gs = 0x00020147,
  512. .crtc_rev = 0x0040010a,
  513. .crtc_dclk = 0xa1700030,
  514. .crtc_gclk = 0x80cc0015,
  515. .crtc_goe = 0x80cc0015,
  516. .crtc_ps1_active = 0x61060017,
  517. .pll_freq = 57,
  518. .pixclk_divider = 4,
  519. .pixclk_divider_rotated = 4,
  520. .pixclk_src = CLK_SRC_XTAL,
  521. .sysclk_divider = 1,
  522. .sysclk_src = CLK_SRC_PLL,
  523. };
  524. static struct w100_gpio_regs e750_w100_gpio_info = {
  525. .init_data1 = 0x01192f1b,
  526. .gpio_dir1 = 0xd5ffdeff,
  527. .gpio_oe1 = 0x000020bf,
  528. .init_data2 = 0x010f010f,
  529. .gpio_dir2 = 0xffffffff,
  530. .gpio_oe2 = 0x000001cf,
  531. };
  532. static struct w100fb_mach_info e750_fb_info = {
  533. .modelist = &e750_lcd_mode,
  534. .num_modes = 1,
  535. .regs = &e750_lcd_regs,
  536. .gpio = &e750_w100_gpio_info,
  537. .xtal_freq = 14318000,
  538. .xtal_dbl = 1,
  539. };
  540. static struct resource e750_fb_resources[] = {
  541. [0] = {
  542. .start = 0x0c000000,
  543. .end = 0x0cffffff,
  544. .flags = IORESOURCE_MEM,
  545. },
  546. };
  547. static struct platform_device e750_fb_device = {
  548. .name = "w100fb",
  549. .id = -1,
  550. .dev = {
  551. .platform_data = &e750_fb_info,
  552. },
  553. .num_resources = ARRAY_SIZE(e750_fb_resources),
  554. .resource = e750_fb_resources,
  555. };
  556. /* -------------------- e750 MFP parameters -------------------- */
  557. static unsigned long e750_pin_config[] __initdata = {
  558. /* Chip selects */
  559. GPIO15_nCS_1, /* CS1 - Flash */
  560. GPIO79_nCS_3, /* CS3 - IMAGEON */
  561. GPIO80_nCS_4, /* CS4 - TMIO */
  562. /* Clocks */
  563. GPIO11_3_6MHz,
  564. /* BTUART */
  565. GPIO42_BTUART_RXD,
  566. GPIO43_BTUART_TXD,
  567. GPIO44_BTUART_CTS,
  568. /* TMIO controller */
  569. GPIO19_GPIO, /* t7l66xb #PCLR */
  570. GPIO45_GPIO, /* t7l66xb #SUSPEND (NOT BTUART!) */
  571. /* UDC */
  572. GPIO13_GPIO,
  573. GPIO3_GPIO,
  574. /* IrDA */
  575. GPIO38_GPIO | MFP_LPM_DRIVE_HIGH,
  576. /* AC97 */
  577. GPIO28_AC97_BITCLK,
  578. GPIO29_AC97_SDATA_IN_0,
  579. GPIO30_AC97_SDATA_OUT,
  580. GPIO31_AC97_SYNC,
  581. /* Audio power control */
  582. GPIO4_GPIO, /* Headphone amp power */
  583. GPIO7_GPIO, /* Speaker amp power */
  584. GPIO37_GPIO, /* Headphone detect */
  585. /* PC Card */
  586. GPIO8_GPIO, /* CD0 */
  587. GPIO44_GPIO, /* CD1 */
  588. GPIO11_GPIO, /* IRQ0 */
  589. GPIO6_GPIO, /* IRQ1 */
  590. GPIO27_GPIO, /* RST0 */
  591. GPIO24_GPIO, /* RST1 */
  592. GPIO20_GPIO, /* PWR0 */
  593. GPIO23_GPIO, /* PWR1 */
  594. GPIO48_nPOE,
  595. GPIO49_nPWE,
  596. GPIO50_nPIOR,
  597. GPIO51_nPIOW,
  598. GPIO52_nPCE_1,
  599. GPIO53_nPCE_2,
  600. GPIO54_nPSKTSEL,
  601. GPIO55_nPREG,
  602. GPIO56_nPWAIT,
  603. GPIO57_nIOIS16,
  604. /* wakeup */
  605. GPIO0_GPIO | WAKEUP_ON_EDGE_RISE,
  606. };
  607. /* ----------------- e750 tc6393xb parameters ------------------ */
  608. static struct tc6393xb_platform_data e750_tc6393xb_info = {
  609. .irq_base = IRQ_BOARD_START,
  610. .scr_pll2cr = 0x0cc1,
  611. .scr_gper = 0,
  612. .gpio_base = -1,
  613. .suspend = &eseries_tmio_suspend,
  614. .resume = &eseries_tmio_resume,
  615. .enable = &eseries_tmio_enable,
  616. .disable = &eseries_tmio_disable,
  617. };
  618. static struct platform_device e750_tc6393xb_device = {
  619. .name = "tc6393xb",
  620. .id = -1,
  621. .dev = {
  622. .platform_data = &e750_tc6393xb_info,
  623. },
  624. .num_resources = 2,
  625. .resource = eseries_tmio_resources,
  626. };
  627. static struct platform_device e750_audio_device = {
  628. .name = "e750-audio",
  629. .id = -1,
  630. };
  631. /* ------------------------------------------------------------- */
  632. static struct platform_device *e750_devices[] __initdata = {
  633. &e750_fb_device,
  634. &e750_tc6393xb_device,
  635. &e7xx_gpio_vbus,
  636. &e750_audio_device,
  637. };
  638. static void __init e750_init(void)
  639. {
  640. pxa2xx_mfp_config(ARRAY_AND_SIZE(e750_pin_config));
  641. pxa_set_ffuart_info(NULL);
  642. pxa_set_btuart_info(NULL);
  643. pxa_set_stuart_info(NULL);
  644. clk_add_alias("CLK_CK3P6MI", e750_tc6393xb_device.name,
  645. "GPIO11_CLK", NULL),
  646. eseries_get_tmio_gpios();
  647. platform_add_devices(ARRAY_AND_SIZE(e750_devices));
  648. pxa_set_ac97_info(NULL);
  649. pxa_set_ficp_info(&e7xx_ficp_platform_data);
  650. }
  651. MACHINE_START(E750, "Toshiba e750")
  652. /* Maintainer: Ian Molton (spyro@f2s.com) */
  653. .atag_offset = 0x100,
  654. .map_io = pxa25x_map_io,
  655. .nr_irqs = ESERIES_NR_IRQS,
  656. .init_irq = pxa25x_init_irq,
  657. .handle_irq = pxa25x_handle_irq,
  658. .fixup = eseries_fixup,
  659. .init_machine = e750_init,
  660. .init_time = pxa_timer_init,
  661. .restart = pxa_restart,
  662. MACHINE_END
  663. #endif
  664. #ifdef CONFIG_MACH_E800
  665. /* ------------------------ e800 LCD definitions ------------------------- */
  666. static unsigned long e800_pin_config[] __initdata = {
  667. /* AC97 */
  668. GPIO28_AC97_BITCLK,
  669. GPIO29_AC97_SDATA_IN_0,
  670. GPIO30_AC97_SDATA_OUT,
  671. GPIO31_AC97_SYNC,
  672. };
  673. static struct w100_gen_regs e800_lcd_regs = {
  674. .lcd_format = 0x00008003,
  675. .lcdd_cntl1 = 0x02a00000,
  676. .lcdd_cntl2 = 0x0003ffff,
  677. .genlcd_cntl1 = 0x000ff2a3,
  678. .genlcd_cntl2 = 0x000002a3,
  679. .genlcd_cntl3 = 0x000102aa,
  680. };
  681. static struct w100_mode e800_lcd_mode[2] = {
  682. [0] = {
  683. .xres = 480,
  684. .yres = 640,
  685. .left_margin = 52,
  686. .right_margin = 148,
  687. .upper_margin = 2,
  688. .lower_margin = 6,
  689. .crtc_ss = 0x80350034,
  690. .crtc_ls = 0x802b0026,
  691. .crtc_gs = 0x80160016,
  692. .crtc_vpos_gs = 0x00020003,
  693. .crtc_rev = 0x0040001d,
  694. .crtc_dclk = 0xe0000000,
  695. .crtc_gclk = 0x82a50049,
  696. .crtc_goe = 0x80ee001c,
  697. .crtc_ps1_active = 0x00000000,
  698. .pll_freq = 128,
  699. .pixclk_divider = 4,
  700. .pixclk_divider_rotated = 6,
  701. .pixclk_src = CLK_SRC_PLL,
  702. .sysclk_divider = 0,
  703. .sysclk_src = CLK_SRC_PLL,
  704. },
  705. [1] = {
  706. .xres = 240,
  707. .yres = 320,
  708. .left_margin = 15,
  709. .right_margin = 88,
  710. .upper_margin = 0,
  711. .lower_margin = 7,
  712. .crtc_ss = 0xd010000f,
  713. .crtc_ls = 0x80070003,
  714. .crtc_gs = 0x80000000,
  715. .crtc_vpos_gs = 0x01460147,
  716. .crtc_rev = 0x00400003,
  717. .crtc_dclk = 0xa1700030,
  718. .crtc_gclk = 0x814b0008,
  719. .crtc_goe = 0x80cc0015,
  720. .crtc_ps1_active = 0x00000000,
  721. .pll_freq = 100,
  722. .pixclk_divider = 6, /* Wince uses 14 which gives a */
  723. .pixclk_divider_rotated = 6, /* 7MHz Pclk. We use a 14MHz one */
  724. .pixclk_src = CLK_SRC_PLL,
  725. .sysclk_divider = 0,
  726. .sysclk_src = CLK_SRC_PLL,
  727. }
  728. };
  729. static struct w100_gpio_regs e800_w100_gpio_info = {
  730. .init_data1 = 0xc13fc019,
  731. .gpio_dir1 = 0x3e40df7f,
  732. .gpio_oe1 = 0x003c3000,
  733. .init_data2 = 0x00000000,
  734. .gpio_dir2 = 0x00000000,
  735. .gpio_oe2 = 0x00000000,
  736. };
  737. static struct w100_mem_info e800_w100_mem_info = {
  738. .ext_cntl = 0x09640011,
  739. .sdram_mode_reg = 0x00600021,
  740. .ext_timing_cntl = 0x10001545,
  741. .io_cntl = 0x7ddd7333,
  742. .size = 0x1fffff,
  743. };
  744. static void e800_tg_change(struct w100fb_par *par)
  745. {
  746. unsigned long tmp;
  747. tmp = w100fb_gpio_read(W100_GPIO_PORT_A);
  748. if (par->mode->xres == 480)
  749. tmp |= 0x100;
  750. else
  751. tmp &= ~0x100;
  752. w100fb_gpio_write(W100_GPIO_PORT_A, tmp);
  753. }
  754. static struct w100_tg_info e800_tg_info = {
  755. .change = e800_tg_change,
  756. };
  757. static struct w100fb_mach_info e800_fb_info = {
  758. .modelist = e800_lcd_mode,
  759. .num_modes = 2,
  760. .regs = &e800_lcd_regs,
  761. .gpio = &e800_w100_gpio_info,
  762. .mem = &e800_w100_mem_info,
  763. .tg = &e800_tg_info,
  764. .xtal_freq = 16000000,
  765. };
  766. static struct resource e800_fb_resources[] = {
  767. [0] = {
  768. .start = 0x0c000000,
  769. .end = 0x0cffffff,
  770. .flags = IORESOURCE_MEM,
  771. },
  772. };
  773. static struct platform_device e800_fb_device = {
  774. .name = "w100fb",
  775. .id = -1,
  776. .dev = {
  777. .platform_data = &e800_fb_info,
  778. },
  779. .num_resources = ARRAY_SIZE(e800_fb_resources),
  780. .resource = e800_fb_resources,
  781. };
  782. /* --------------------------- UDC definitions --------------------------- */
  783. static struct gpio_vbus_mach_info e800_udc_info = {
  784. .gpio_vbus = GPIO_E800_USB_DISC,
  785. .gpio_pullup = GPIO_E800_USB_PULLUP,
  786. .gpio_pullup_inverted = 1
  787. };
  788. static struct platform_device e800_gpio_vbus = {
  789. .name = "gpio-vbus",
  790. .id = -1,
  791. .dev = {
  792. .platform_data = &e800_udc_info,
  793. },
  794. };
  795. /* ----------------- e800 tc6393xb parameters ------------------ */
  796. static struct tc6393xb_platform_data e800_tc6393xb_info = {
  797. .irq_base = IRQ_BOARD_START,
  798. .scr_pll2cr = 0x0cc1,
  799. .scr_gper = 0,
  800. .gpio_base = -1,
  801. .suspend = &eseries_tmio_suspend,
  802. .resume = &eseries_tmio_resume,
  803. .enable = &eseries_tmio_enable,
  804. .disable = &eseries_tmio_disable,
  805. };
  806. static struct platform_device e800_tc6393xb_device = {
  807. .name = "tc6393xb",
  808. .id = -1,
  809. .dev = {
  810. .platform_data = &e800_tc6393xb_info,
  811. },
  812. .num_resources = 2,
  813. .resource = eseries_tmio_resources,
  814. };
  815. static struct platform_device e800_audio_device = {
  816. .name = "e800-audio",
  817. .id = -1,
  818. };
  819. /* ----------------------------------------------------------------------- */
  820. static struct platform_device *e800_devices[] __initdata = {
  821. &e800_fb_device,
  822. &e800_tc6393xb_device,
  823. &e800_gpio_vbus,
  824. &e800_audio_device,
  825. };
  826. static void __init e800_init(void)
  827. {
  828. pxa2xx_mfp_config(ARRAY_AND_SIZE(e800_pin_config));
  829. pxa_set_ffuart_info(NULL);
  830. pxa_set_btuart_info(NULL);
  831. pxa_set_stuart_info(NULL);
  832. clk_add_alias("CLK_CK3P6MI", e800_tc6393xb_device.name,
  833. "GPIO11_CLK", NULL),
  834. eseries_get_tmio_gpios();
  835. platform_add_devices(ARRAY_AND_SIZE(e800_devices));
  836. pxa_set_ac97_info(NULL);
  837. }
  838. MACHINE_START(E800, "Toshiba e800")
  839. /* Maintainer: Ian Molton (spyro@f2s.com) */
  840. .atag_offset = 0x100,
  841. .map_io = pxa25x_map_io,
  842. .nr_irqs = ESERIES_NR_IRQS,
  843. .init_irq = pxa25x_init_irq,
  844. .handle_irq = pxa25x_handle_irq,
  845. .fixup = eseries_fixup,
  846. .init_machine = e800_init,
  847. .init_time = pxa_timer_init,
  848. .restart = pxa_restart,
  849. MACHINE_END
  850. #endif