eseries.c 23 KB

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