eseries.c 23 KB

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