eseries.c 23 KB

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