eseries.c 23 KB

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