eseries.c 23 KB

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