eseries.c 23 KB

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