e740.c 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  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/clk.h>
  18. #include <linux/mfd/t7l66xb.h>
  19. #include <video/w100fb.h>
  20. #include <asm/setup.h>
  21. #include <asm/mach/arch.h>
  22. #include <asm/mach-types.h>
  23. #include <mach/pxa25x.h>
  24. #include <mach/eseries-gpio.h>
  25. #include <mach/udc.h>
  26. #include <mach/irda.h>
  27. #include <mach/irqs.h>
  28. #include <mach/audio.h>
  29. #include "generic.h"
  30. #include "eseries.h"
  31. #include "clock.h"
  32. #include "devices.h"
  33. /* ------------------------ e740 video support --------------------------- */
  34. static struct w100_gen_regs e740_lcd_regs = {
  35. .lcd_format = 0x00008023,
  36. .lcdd_cntl1 = 0x0f000000,
  37. .lcdd_cntl2 = 0x0003ffff,
  38. .genlcd_cntl1 = 0x00ffff03,
  39. .genlcd_cntl2 = 0x003c0f03,
  40. .genlcd_cntl3 = 0x000143aa,
  41. };
  42. static struct w100_mode e740_lcd_mode = {
  43. .xres = 240,
  44. .yres = 320,
  45. .left_margin = 20,
  46. .right_margin = 28,
  47. .upper_margin = 9,
  48. .lower_margin = 8,
  49. .crtc_ss = 0x80140013,
  50. .crtc_ls = 0x81150110,
  51. .crtc_gs = 0x80050005,
  52. .crtc_vpos_gs = 0x000a0009,
  53. .crtc_rev = 0x0040010a,
  54. .crtc_dclk = 0xa906000a,
  55. .crtc_gclk = 0x80050108,
  56. .crtc_goe = 0x80050108,
  57. .pll_freq = 57,
  58. .pixclk_divider = 4,
  59. .pixclk_divider_rotated = 4,
  60. .pixclk_src = CLK_SRC_XTAL,
  61. .sysclk_divider = 1,
  62. .sysclk_src = CLK_SRC_PLL,
  63. .crtc_ps1_active = 0x41060010,
  64. };
  65. static struct w100_gpio_regs e740_w100_gpio_info = {
  66. .init_data1 = 0x21002103,
  67. .gpio_dir1 = 0xffffdeff,
  68. .gpio_oe1 = 0x03c00643,
  69. .init_data2 = 0x003f003f,
  70. .gpio_dir2 = 0xffffffff,
  71. .gpio_oe2 = 0x000000ff,
  72. };
  73. static struct w100fb_mach_info e740_fb_info = {
  74. .modelist = &e740_lcd_mode,
  75. .num_modes = 1,
  76. .regs = &e740_lcd_regs,
  77. .gpio = &e740_w100_gpio_info,
  78. .xtal_freq = 14318000,
  79. .xtal_dbl = 1,
  80. };
  81. static struct resource e740_fb_resources[] = {
  82. [0] = {
  83. .start = 0x0c000000,
  84. .end = 0x0cffffff,
  85. .flags = IORESOURCE_MEM,
  86. },
  87. };
  88. static struct platform_device e740_fb_device = {
  89. .name = "w100fb",
  90. .id = -1,
  91. .dev = {
  92. .platform_data = &e740_fb_info,
  93. },
  94. .num_resources = ARRAY_SIZE(e740_fb_resources),
  95. .resource = e740_fb_resources,
  96. };
  97. /* --------------------------- MFP Pin config -------------------------- */
  98. static unsigned long e740_pin_config[] __initdata = {
  99. /* Chip selects */
  100. GPIO15_nCS_1, /* CS1 - Flash */
  101. GPIO79_nCS_3, /* CS3 - IMAGEON */
  102. GPIO80_nCS_4, /* CS4 - TMIO */
  103. /* Clocks */
  104. GPIO12_32KHz,
  105. /* BTUART */
  106. GPIO42_BTUART_RXD,
  107. GPIO43_BTUART_TXD,
  108. GPIO44_BTUART_CTS,
  109. /* TMIO controller */
  110. GPIO19_GPIO, /* t7l66xb #PCLR */
  111. GPIO45_GPIO, /* t7l66xb #SUSPEND (NOT BTUART!) */
  112. /* UDC */
  113. GPIO13_GPIO,
  114. GPIO3_GPIO,
  115. /* IrDA */
  116. GPIO38_GPIO | MFP_LPM_DRIVE_HIGH,
  117. /* Audio power control */
  118. GPIO16_GPIO, /* AC97 codec AVDD2 supply (analogue power) */
  119. GPIO40_GPIO, /* Mic amp power */
  120. GPIO41_GPIO, /* Headphone amp power */
  121. /* PC Card */
  122. GPIO8_GPIO, /* CD0 */
  123. GPIO44_GPIO, /* CD1 */
  124. GPIO11_GPIO, /* IRQ0 */
  125. GPIO6_GPIO, /* IRQ1 */
  126. GPIO27_GPIO, /* RST0 */
  127. GPIO24_GPIO, /* RST1 */
  128. GPIO20_GPIO, /* PWR0 */
  129. GPIO23_GPIO, /* PWR1 */
  130. GPIO48_nPOE,
  131. GPIO49_nPWE,
  132. GPIO50_nPIOR,
  133. GPIO51_nPIOW,
  134. GPIO52_nPCE_1,
  135. GPIO53_nPCE_2,
  136. GPIO54_nPSKTSEL,
  137. GPIO55_nPREG,
  138. GPIO56_nPWAIT,
  139. GPIO57_nIOIS16,
  140. /* wakeup */
  141. GPIO0_GPIO | WAKEUP_ON_EDGE_RISE,
  142. };
  143. /* -------------------- e740 t7l66xb parameters -------------------- */
  144. static struct t7l66xb_platform_data e740_t7l66xb_info = {
  145. .irq_base = IRQ_BOARD_START,
  146. .enable = &eseries_tmio_enable,
  147. .suspend = &eseries_tmio_suspend,
  148. .resume = &eseries_tmio_resume,
  149. };
  150. static struct platform_device e740_t7l66xb_device = {
  151. .name = "t7l66xb",
  152. .id = -1,
  153. .dev = {
  154. .platform_data = &e740_t7l66xb_info,
  155. },
  156. .num_resources = 2,
  157. .resource = eseries_tmio_resources,
  158. };
  159. /* ----------------------------------------------------------------------- */
  160. static struct platform_device *devices[] __initdata = {
  161. &e740_fb_device,
  162. &e740_t7l66xb_device,
  163. };
  164. static void __init e740_init(void)
  165. {
  166. pxa2xx_mfp_config(ARRAY_AND_SIZE(e740_pin_config));
  167. eseries_register_clks();
  168. clk_add_alias("CLK_CK48M", e740_t7l66xb_device.name,
  169. "UDCCLK", &pxa25x_device_udc.dev),
  170. eseries_get_tmio_gpios();
  171. platform_add_devices(devices, ARRAY_SIZE(devices));
  172. pxa_set_udc_info(&e7xx_udc_mach_info);
  173. pxa_set_ac97_info(NULL);
  174. e7xx_irda_init();
  175. pxa_set_ficp_info(&e7xx_ficp_platform_data);
  176. }
  177. MACHINE_START(E740, "Toshiba e740")
  178. /* Maintainer: Ian Molton (spyro@f2s.com) */
  179. .phys_io = 0x40000000,
  180. .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
  181. .boot_params = 0xa0000100,
  182. .map_io = pxa_map_io,
  183. .init_irq = pxa25x_init_irq,
  184. .fixup = eseries_fixup,
  185. .init_machine = e740_init,
  186. .timer = &pxa_timer,
  187. MACHINE_END