e740.c 5.1 KB

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