eseries.c 23 KB

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