e750.c 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  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/device.h>
  15. #include <linux/platform_device.h>
  16. #include <linux/fb.h>
  17. #include <linux/mfd/tc6393xb.h>
  18. #include <video/w100fb.h>
  19. #include <asm/setup.h>
  20. #include <asm/mach/arch.h>
  21. #include <asm/mach-types.h>
  22. #include <mach/pxa25x.h>
  23. #include <mach/eseries-gpio.h>
  24. #include <mach/udc.h>
  25. #include <mach/irda.h>
  26. #include <mach/irqs.h>
  27. #include "generic.h"
  28. #include "eseries.h"
  29. #include "clock.h"
  30. /* ---------------------- E750 LCD definitions -------------------- */
  31. static struct w100_gen_regs e750_lcd_regs = {
  32. .lcd_format = 0x00008003,
  33. .lcdd_cntl1 = 0x00000000,
  34. .lcdd_cntl2 = 0x0003ffff,
  35. .genlcd_cntl1 = 0x00fff003,
  36. .genlcd_cntl2 = 0x003c0f03,
  37. .genlcd_cntl3 = 0x000143aa,
  38. };
  39. static struct w100_mode e750_lcd_mode = {
  40. .xres = 240,
  41. .yres = 320,
  42. .left_margin = 21,
  43. .right_margin = 22,
  44. .upper_margin = 5,
  45. .lower_margin = 4,
  46. .crtc_ss = 0x80150014,
  47. .crtc_ls = 0x8014000d,
  48. .crtc_gs = 0xc1000005,
  49. .crtc_vpos_gs = 0x00020147,
  50. .crtc_rev = 0x0040010a,
  51. .crtc_dclk = 0xa1700030,
  52. .crtc_gclk = 0x80cc0015,
  53. .crtc_goe = 0x80cc0015,
  54. .crtc_ps1_active = 0x61060017,
  55. .pll_freq = 57,
  56. .pixclk_divider = 4,
  57. .pixclk_divider_rotated = 4,
  58. .pixclk_src = CLK_SRC_XTAL,
  59. .sysclk_divider = 1,
  60. .sysclk_src = CLK_SRC_PLL,
  61. };
  62. static struct w100_gpio_regs e750_w100_gpio_info = {
  63. .init_data1 = 0x01192f1b,
  64. .gpio_dir1 = 0xd5ffdeff,
  65. .gpio_oe1 = 0x000020bf,
  66. .init_data2 = 0x010f010f,
  67. .gpio_dir2 = 0xffffffff,
  68. .gpio_oe2 = 0x000001cf,
  69. };
  70. static struct w100fb_mach_info e750_fb_info = {
  71. .modelist = &e750_lcd_mode,
  72. .num_modes = 1,
  73. .regs = &e750_lcd_regs,
  74. .gpio = &e750_w100_gpio_info,
  75. .xtal_freq = 14318000,
  76. .xtal_dbl = 1,
  77. };
  78. static struct resource e750_fb_resources[] = {
  79. [0] = {
  80. .start = 0x0c000000,
  81. .end = 0x0cffffff,
  82. .flags = IORESOURCE_MEM,
  83. },
  84. };
  85. static struct platform_device e750_fb_device = {
  86. .name = "w100fb",
  87. .id = -1,
  88. .dev = {
  89. .platform_data = &e750_fb_info,
  90. },
  91. .num_resources = ARRAY_SIZE(e750_fb_resources),
  92. .resource = e750_fb_resources,
  93. };
  94. /* -------------------- e750 MFP parameters -------------------- */
  95. static unsigned long e750_pin_config[] __initdata = {
  96. /* Chip selects */
  97. GPIO15_nCS_1, /* CS1 - Flash */
  98. GPIO79_nCS_3, /* CS3 - IMAGEON */
  99. GPIO80_nCS_4, /* CS4 - TMIO */
  100. /* Clocks */
  101. GPIO11_3_6MHz,
  102. /* BTUART */
  103. GPIO42_BTUART_RXD,
  104. GPIO43_BTUART_TXD,
  105. GPIO44_BTUART_CTS,
  106. /* TMIO controller */
  107. GPIO19_GPIO, /* t7l66xb #PCLR */
  108. GPIO45_GPIO, /* t7l66xb #SUSPEND (NOT BTUART!) */
  109. /* UDC */
  110. GPIO13_GPIO,
  111. GPIO3_GPIO,
  112. /* IrDA */
  113. GPIO38_GPIO | MFP_LPM_DRIVE_HIGH,
  114. /* Audio power control */
  115. GPIO4_GPIO, /* Headphone amp power */
  116. GPIO7_GPIO, /* Speaker amp power */
  117. GPIO37_GPIO, /* Headphone detect */
  118. /* PC Card */
  119. GPIO8_GPIO, /* CD0 */
  120. GPIO44_GPIO, /* CD1 */
  121. GPIO11_GPIO, /* IRQ0 */
  122. GPIO6_GPIO, /* IRQ1 */
  123. GPIO27_GPIO, /* RST0 */
  124. GPIO24_GPIO, /* RST1 */
  125. GPIO20_GPIO, /* PWR0 */
  126. GPIO23_GPIO, /* PWR1 */
  127. GPIO48_nPOE,
  128. GPIO49_nPWE,
  129. GPIO50_nPIOR,
  130. GPIO51_nPIOW,
  131. GPIO52_nPCE_1,
  132. GPIO53_nPCE_2,
  133. GPIO54_nPSKTSEL,
  134. GPIO55_nPREG,
  135. GPIO56_nPWAIT,
  136. GPIO57_nIOIS16,
  137. /* wakeup */
  138. GPIO0_GPIO | WAKEUP_ON_EDGE_RISE,
  139. };
  140. /* ----------------- e750 tc6393xb parameters ------------------ */
  141. static struct tc6393xb_platform_data e750_tc6393xb_info = {
  142. .irq_base = IRQ_BOARD_START,
  143. .scr_pll2cr = 0x0cc1,
  144. .scr_gper = 0,
  145. .gpio_base = -1,
  146. .suspend = &eseries_tmio_suspend,
  147. .resume = &eseries_tmio_resume,
  148. .enable = &eseries_tmio_enable,
  149. .disable = &eseries_tmio_disable,
  150. };
  151. static struct platform_device e750_tc6393xb_device = {
  152. .name = "tc6393xb",
  153. .id = -1,
  154. .dev = {
  155. .platform_data = &e750_tc6393xb_info,
  156. },
  157. .num_resources = 2,
  158. .resource = eseries_tmio_resources,
  159. };
  160. /* ------------------------------------------------------------- */
  161. static struct platform_device *devices[] __initdata = {
  162. &e750_fb_device,
  163. &e750_tc6393xb_device,
  164. };
  165. static void __init e750_init(void)
  166. {
  167. pxa2xx_mfp_config(ARRAY_AND_SIZE(e750_pin_config));
  168. clk_add_alias("CLK_CK3P6MI", e750_tc6393xb_device.name,
  169. "GPIO11_CLK", NULL),
  170. eseries_get_tmio_gpios();
  171. platform_add_devices(devices, ARRAY_SIZE(devices));
  172. pxa_set_udc_info(&e7xx_udc_mach_info);
  173. e7xx_irda_init();
  174. pxa_set_ficp_info(&e7xx_ficp_platform_data);
  175. }
  176. MACHINE_START(E750, "Toshiba e750")
  177. /* Maintainer: Ian Molton (spyro@f2s.com) */
  178. .phys_io = 0x40000000,
  179. .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
  180. .boot_params = 0xa0000100,
  181. .map_io = pxa_map_io,
  182. .init_irq = pxa25x_init_irq,
  183. .fixup = eseries_fixup,
  184. .init_machine = e750_init,
  185. .timer = &pxa_timer,
  186. MACHINE_END