eseries.c 24 KB

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