eseries.c 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959
  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. /* ----------------------------------------------------------------------- */
  452. static struct platform_device *e740_devices[] __initdata = {
  453. &e740_fb_device,
  454. &e740_t7l66xb_device,
  455. &e7xx_gpio_vbus,
  456. };
  457. static void __init e740_init(void)
  458. {
  459. pxa2xx_mfp_config(ARRAY_AND_SIZE(e740_pin_config));
  460. pxa_set_ffuart_info(NULL);
  461. pxa_set_btuart_info(NULL);
  462. pxa_set_stuart_info(NULL);
  463. eseries_register_clks();
  464. clk_add_alias("CLK_CK48M", e740_t7l66xb_device.name,
  465. "UDCCLK", &pxa25x_device_udc.dev),
  466. eseries_get_tmio_gpios();
  467. platform_add_devices(ARRAY_AND_SIZE(e740_devices));
  468. pxa_set_ac97_info(NULL);
  469. pxa_set_ficp_info(&e7xx_ficp_platform_data);
  470. }
  471. MACHINE_START(E740, "Toshiba e740")
  472. /* Maintainer: Ian Molton (spyro@f2s.com) */
  473. .atag_offset = 0x100,
  474. .map_io = pxa25x_map_io,
  475. .nr_irqs = ESERIES_NR_IRQS,
  476. .init_irq = pxa25x_init_irq,
  477. .handle_irq = pxa25x_handle_irq,
  478. .fixup = eseries_fixup,
  479. .init_machine = e740_init,
  480. .timer = &pxa_timer,
  481. MACHINE_END
  482. #endif
  483. #ifdef CONFIG_MACH_E750
  484. /* ---------------------- E750 LCD definitions -------------------- */
  485. static struct w100_gen_regs e750_lcd_regs = {
  486. .lcd_format = 0x00008003,
  487. .lcdd_cntl1 = 0x00000000,
  488. .lcdd_cntl2 = 0x0003ffff,
  489. .genlcd_cntl1 = 0x00fff003,
  490. .genlcd_cntl2 = 0x003c0f03,
  491. .genlcd_cntl3 = 0x000143aa,
  492. };
  493. static struct w100_mode e750_lcd_mode = {
  494. .xres = 240,
  495. .yres = 320,
  496. .left_margin = 21,
  497. .right_margin = 22,
  498. .upper_margin = 5,
  499. .lower_margin = 4,
  500. .crtc_ss = 0x80150014,
  501. .crtc_ls = 0x8014000d,
  502. .crtc_gs = 0xc1000005,
  503. .crtc_vpos_gs = 0x00020147,
  504. .crtc_rev = 0x0040010a,
  505. .crtc_dclk = 0xa1700030,
  506. .crtc_gclk = 0x80cc0015,
  507. .crtc_goe = 0x80cc0015,
  508. .crtc_ps1_active = 0x61060017,
  509. .pll_freq = 57,
  510. .pixclk_divider = 4,
  511. .pixclk_divider_rotated = 4,
  512. .pixclk_src = CLK_SRC_XTAL,
  513. .sysclk_divider = 1,
  514. .sysclk_src = CLK_SRC_PLL,
  515. };
  516. static struct w100_gpio_regs e750_w100_gpio_info = {
  517. .init_data1 = 0x01192f1b,
  518. .gpio_dir1 = 0xd5ffdeff,
  519. .gpio_oe1 = 0x000020bf,
  520. .init_data2 = 0x010f010f,
  521. .gpio_dir2 = 0xffffffff,
  522. .gpio_oe2 = 0x000001cf,
  523. };
  524. static struct w100fb_mach_info e750_fb_info = {
  525. .modelist = &e750_lcd_mode,
  526. .num_modes = 1,
  527. .regs = &e750_lcd_regs,
  528. .gpio = &e750_w100_gpio_info,
  529. .xtal_freq = 14318000,
  530. .xtal_dbl = 1,
  531. };
  532. static struct resource e750_fb_resources[] = {
  533. [0] = {
  534. .start = 0x0c000000,
  535. .end = 0x0cffffff,
  536. .flags = IORESOURCE_MEM,
  537. },
  538. };
  539. static struct platform_device e750_fb_device = {
  540. .name = "w100fb",
  541. .id = -1,
  542. .dev = {
  543. .platform_data = &e750_fb_info,
  544. },
  545. .num_resources = ARRAY_SIZE(e750_fb_resources),
  546. .resource = e750_fb_resources,
  547. };
  548. /* -------------------- e750 MFP parameters -------------------- */
  549. static unsigned long e750_pin_config[] __initdata = {
  550. /* Chip selects */
  551. GPIO15_nCS_1, /* CS1 - Flash */
  552. GPIO79_nCS_3, /* CS3 - IMAGEON */
  553. GPIO80_nCS_4, /* CS4 - TMIO */
  554. /* Clocks */
  555. GPIO11_3_6MHz,
  556. /* BTUART */
  557. GPIO42_BTUART_RXD,
  558. GPIO43_BTUART_TXD,
  559. GPIO44_BTUART_CTS,
  560. /* TMIO controller */
  561. GPIO19_GPIO, /* t7l66xb #PCLR */
  562. GPIO45_GPIO, /* t7l66xb #SUSPEND (NOT BTUART!) */
  563. /* UDC */
  564. GPIO13_GPIO,
  565. GPIO3_GPIO,
  566. /* IrDA */
  567. GPIO38_GPIO | MFP_LPM_DRIVE_HIGH,
  568. /* AC97 */
  569. GPIO28_AC97_BITCLK,
  570. GPIO29_AC97_SDATA_IN_0,
  571. GPIO30_AC97_SDATA_OUT,
  572. GPIO31_AC97_SYNC,
  573. /* Audio power control */
  574. GPIO4_GPIO, /* Headphone amp power */
  575. GPIO7_GPIO, /* Speaker amp power */
  576. GPIO37_GPIO, /* Headphone detect */
  577. /* PC Card */
  578. GPIO8_GPIO, /* CD0 */
  579. GPIO44_GPIO, /* CD1 */
  580. GPIO11_GPIO, /* IRQ0 */
  581. GPIO6_GPIO, /* IRQ1 */
  582. GPIO27_GPIO, /* RST0 */
  583. GPIO24_GPIO, /* RST1 */
  584. GPIO20_GPIO, /* PWR0 */
  585. GPIO23_GPIO, /* PWR1 */
  586. GPIO48_nPOE,
  587. GPIO49_nPWE,
  588. GPIO50_nPIOR,
  589. GPIO51_nPIOW,
  590. GPIO52_nPCE_1,
  591. GPIO53_nPCE_2,
  592. GPIO54_nPSKTSEL,
  593. GPIO55_nPREG,
  594. GPIO56_nPWAIT,
  595. GPIO57_nIOIS16,
  596. /* wakeup */
  597. GPIO0_GPIO | WAKEUP_ON_EDGE_RISE,
  598. };
  599. /* ----------------- e750 tc6393xb parameters ------------------ */
  600. static struct tc6393xb_platform_data e750_tc6393xb_info = {
  601. .irq_base = IRQ_BOARD_START,
  602. .scr_pll2cr = 0x0cc1,
  603. .scr_gper = 0,
  604. .gpio_base = -1,
  605. .suspend = &eseries_tmio_suspend,
  606. .resume = &eseries_tmio_resume,
  607. .enable = &eseries_tmio_enable,
  608. .disable = &eseries_tmio_disable,
  609. };
  610. static struct platform_device e750_tc6393xb_device = {
  611. .name = "tc6393xb",
  612. .id = -1,
  613. .dev = {
  614. .platform_data = &e750_tc6393xb_info,
  615. },
  616. .num_resources = 2,
  617. .resource = eseries_tmio_resources,
  618. };
  619. /* ------------------------------------------------------------- */
  620. static struct platform_device *e750_devices[] __initdata = {
  621. &e750_fb_device,
  622. &e750_tc6393xb_device,
  623. &e7xx_gpio_vbus,
  624. };
  625. static void __init e750_init(void)
  626. {
  627. pxa2xx_mfp_config(ARRAY_AND_SIZE(e750_pin_config));
  628. pxa_set_ffuart_info(NULL);
  629. pxa_set_btuart_info(NULL);
  630. pxa_set_stuart_info(NULL);
  631. clk_add_alias("CLK_CK3P6MI", e750_tc6393xb_device.name,
  632. "GPIO11_CLK", NULL),
  633. eseries_get_tmio_gpios();
  634. platform_add_devices(ARRAY_AND_SIZE(e750_devices));
  635. pxa_set_ac97_info(NULL);
  636. pxa_set_ficp_info(&e7xx_ficp_platform_data);
  637. }
  638. MACHINE_START(E750, "Toshiba e750")
  639. /* Maintainer: Ian Molton (spyro@f2s.com) */
  640. .atag_offset = 0x100,
  641. .map_io = pxa25x_map_io,
  642. .nr_irqs = ESERIES_NR_IRQS,
  643. .init_irq = pxa25x_init_irq,
  644. .handle_irq = pxa25x_handle_irq,
  645. .fixup = eseries_fixup,
  646. .init_machine = e750_init,
  647. .timer = &pxa_timer,
  648. MACHINE_END
  649. #endif
  650. #ifdef CONFIG_MACH_E800
  651. /* ------------------------ e800 LCD definitions ------------------------- */
  652. static unsigned long e800_pin_config[] __initdata = {
  653. /* AC97 */
  654. GPIO28_AC97_BITCLK,
  655. GPIO29_AC97_SDATA_IN_0,
  656. GPIO30_AC97_SDATA_OUT,
  657. GPIO31_AC97_SYNC,
  658. };
  659. static struct w100_gen_regs e800_lcd_regs = {
  660. .lcd_format = 0x00008003,
  661. .lcdd_cntl1 = 0x02a00000,
  662. .lcdd_cntl2 = 0x0003ffff,
  663. .genlcd_cntl1 = 0x000ff2a3,
  664. .genlcd_cntl2 = 0x000002a3,
  665. .genlcd_cntl3 = 0x000102aa,
  666. };
  667. static struct w100_mode e800_lcd_mode[2] = {
  668. [0] = {
  669. .xres = 480,
  670. .yres = 640,
  671. .left_margin = 52,
  672. .right_margin = 148,
  673. .upper_margin = 2,
  674. .lower_margin = 6,
  675. .crtc_ss = 0x80350034,
  676. .crtc_ls = 0x802b0026,
  677. .crtc_gs = 0x80160016,
  678. .crtc_vpos_gs = 0x00020003,
  679. .crtc_rev = 0x0040001d,
  680. .crtc_dclk = 0xe0000000,
  681. .crtc_gclk = 0x82a50049,
  682. .crtc_goe = 0x80ee001c,
  683. .crtc_ps1_active = 0x00000000,
  684. .pll_freq = 128,
  685. .pixclk_divider = 4,
  686. .pixclk_divider_rotated = 6,
  687. .pixclk_src = CLK_SRC_PLL,
  688. .sysclk_divider = 0,
  689. .sysclk_src = CLK_SRC_PLL,
  690. },
  691. [1] = {
  692. .xres = 240,
  693. .yres = 320,
  694. .left_margin = 15,
  695. .right_margin = 88,
  696. .upper_margin = 0,
  697. .lower_margin = 7,
  698. .crtc_ss = 0xd010000f,
  699. .crtc_ls = 0x80070003,
  700. .crtc_gs = 0x80000000,
  701. .crtc_vpos_gs = 0x01460147,
  702. .crtc_rev = 0x00400003,
  703. .crtc_dclk = 0xa1700030,
  704. .crtc_gclk = 0x814b0008,
  705. .crtc_goe = 0x80cc0015,
  706. .crtc_ps1_active = 0x00000000,
  707. .pll_freq = 100,
  708. .pixclk_divider = 6, /* Wince uses 14 which gives a */
  709. .pixclk_divider_rotated = 6, /* 7MHz Pclk. We use a 14MHz one */
  710. .pixclk_src = CLK_SRC_PLL,
  711. .sysclk_divider = 0,
  712. .sysclk_src = CLK_SRC_PLL,
  713. }
  714. };
  715. static struct w100_gpio_regs e800_w100_gpio_info = {
  716. .init_data1 = 0xc13fc019,
  717. .gpio_dir1 = 0x3e40df7f,
  718. .gpio_oe1 = 0x003c3000,
  719. .init_data2 = 0x00000000,
  720. .gpio_dir2 = 0x00000000,
  721. .gpio_oe2 = 0x00000000,
  722. };
  723. static struct w100_mem_info e800_w100_mem_info = {
  724. .ext_cntl = 0x09640011,
  725. .sdram_mode_reg = 0x00600021,
  726. .ext_timing_cntl = 0x10001545,
  727. .io_cntl = 0x7ddd7333,
  728. .size = 0x1fffff,
  729. };
  730. static void e800_tg_change(struct w100fb_par *par)
  731. {
  732. unsigned long tmp;
  733. tmp = w100fb_gpio_read(W100_GPIO_PORT_A);
  734. if (par->mode->xres == 480)
  735. tmp |= 0x100;
  736. else
  737. tmp &= ~0x100;
  738. w100fb_gpio_write(W100_GPIO_PORT_A, tmp);
  739. }
  740. static struct w100_tg_info e800_tg_info = {
  741. .change = e800_tg_change,
  742. };
  743. static struct w100fb_mach_info e800_fb_info = {
  744. .modelist = e800_lcd_mode,
  745. .num_modes = 2,
  746. .regs = &e800_lcd_regs,
  747. .gpio = &e800_w100_gpio_info,
  748. .mem = &e800_w100_mem_info,
  749. .tg = &e800_tg_info,
  750. .xtal_freq = 16000000,
  751. };
  752. static struct resource e800_fb_resources[] = {
  753. [0] = {
  754. .start = 0x0c000000,
  755. .end = 0x0cffffff,
  756. .flags = IORESOURCE_MEM,
  757. },
  758. };
  759. static struct platform_device e800_fb_device = {
  760. .name = "w100fb",
  761. .id = -1,
  762. .dev = {
  763. .platform_data = &e800_fb_info,
  764. },
  765. .num_resources = ARRAY_SIZE(e800_fb_resources),
  766. .resource = e800_fb_resources,
  767. };
  768. /* --------------------------- UDC definitions --------------------------- */
  769. static struct gpio_vbus_mach_info e800_udc_info = {
  770. .gpio_vbus = GPIO_E800_USB_DISC,
  771. .gpio_pullup = GPIO_E800_USB_PULLUP,
  772. .gpio_pullup_inverted = 1
  773. };
  774. static struct platform_device e800_gpio_vbus = {
  775. .name = "gpio-vbus",
  776. .id = -1,
  777. .dev = {
  778. .platform_data = &e800_udc_info,
  779. },
  780. };
  781. /* ----------------- e800 tc6393xb parameters ------------------ */
  782. static struct tc6393xb_platform_data e800_tc6393xb_info = {
  783. .irq_base = IRQ_BOARD_START,
  784. .scr_pll2cr = 0x0cc1,
  785. .scr_gper = 0,
  786. .gpio_base = -1,
  787. .suspend = &eseries_tmio_suspend,
  788. .resume = &eseries_tmio_resume,
  789. .enable = &eseries_tmio_enable,
  790. .disable = &eseries_tmio_disable,
  791. };
  792. static struct platform_device e800_tc6393xb_device = {
  793. .name = "tc6393xb",
  794. .id = -1,
  795. .dev = {
  796. .platform_data = &e800_tc6393xb_info,
  797. },
  798. .num_resources = 2,
  799. .resource = eseries_tmio_resources,
  800. };
  801. /* ----------------------------------------------------------------------- */
  802. static struct platform_device *e800_devices[] __initdata = {
  803. &e800_fb_device,
  804. &e800_tc6393xb_device,
  805. &e800_gpio_vbus,
  806. };
  807. static void __init e800_init(void)
  808. {
  809. pxa2xx_mfp_config(ARRAY_AND_SIZE(e800_pin_config));
  810. pxa_set_ffuart_info(NULL);
  811. pxa_set_btuart_info(NULL);
  812. pxa_set_stuart_info(NULL);
  813. clk_add_alias("CLK_CK3P6MI", e800_tc6393xb_device.name,
  814. "GPIO11_CLK", NULL),
  815. eseries_get_tmio_gpios();
  816. platform_add_devices(ARRAY_AND_SIZE(e800_devices));
  817. pxa_set_ac97_info(NULL);
  818. }
  819. MACHINE_START(E800, "Toshiba e800")
  820. /* Maintainer: Ian Molton (spyro@f2s.com) */
  821. .atag_offset = 0x100,
  822. .map_io = pxa25x_map_io,
  823. .nr_irqs = ESERIES_NR_IRQS,
  824. .init_irq = pxa25x_init_irq,
  825. .handle_irq = pxa25x_handle_irq,
  826. .fixup = eseries_fixup,
  827. .init_machine = e800_init,
  828. .timer = &pxa_timer,
  829. MACHINE_END
  830. #endif