eseries.c 24 KB

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