e750.c 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  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/mfp-pxa25x.h>
  23. #include <mach/pxa-regs.h>
  24. #include <mach/hardware.h>
  25. #include <mach/eseries-gpio.h>
  26. #include <mach/udc.h>
  27. #include <mach/irda.h>
  28. #include <mach/irqs.h>
  29. #include "generic.h"
  30. #include "eseries.h"
  31. #include "clock.h"
  32. /* ---------------------- E750 LCD definitions -------------------- */
  33. static struct w100_gen_regs e750_lcd_regs = {
  34. .lcd_format = 0x00008003,
  35. .lcdd_cntl1 = 0x00000000,
  36. .lcdd_cntl2 = 0x0003ffff,
  37. .genlcd_cntl1 = 0x00fff003,
  38. .genlcd_cntl2 = 0x003c0f03,
  39. .genlcd_cntl3 = 0x000143aa,
  40. };
  41. static struct w100_mode e750_lcd_mode = {
  42. .xres = 240,
  43. .yres = 320,
  44. .left_margin = 21,
  45. .right_margin = 22,
  46. .upper_margin = 5,
  47. .lower_margin = 4,
  48. .crtc_ss = 0x80150014,
  49. .crtc_ls = 0x8014000d,
  50. .crtc_gs = 0xc1000005,
  51. .crtc_vpos_gs = 0x00020147,
  52. .crtc_rev = 0x0040010a,
  53. .crtc_dclk = 0xa1700030,
  54. .crtc_gclk = 0x80cc0015,
  55. .crtc_goe = 0x80cc0015,
  56. .crtc_ps1_active = 0x61060017,
  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. };
  64. static struct w100_gpio_regs e750_w100_gpio_info = {
  65. .init_data1 = 0x01192f1b,
  66. .gpio_dir1 = 0xd5ffdeff,
  67. .gpio_oe1 = 0x000020bf,
  68. .init_data2 = 0x010f010f,
  69. .gpio_dir2 = 0xffffffff,
  70. .gpio_oe2 = 0x000001cf,
  71. };
  72. static struct w100fb_mach_info e750_fb_info = {
  73. .modelist = &e750_lcd_mode,
  74. .num_modes = 1,
  75. .regs = &e750_lcd_regs,
  76. .gpio = &e750_w100_gpio_info,
  77. .xtal_freq = 14318000,
  78. .xtal_dbl = 1,
  79. };
  80. static struct resource e750_fb_resources[] = {
  81. [0] = {
  82. .start = 0x0c000000,
  83. .end = 0x0cffffff,
  84. .flags = IORESOURCE_MEM,
  85. },
  86. };
  87. static struct platform_device e750_fb_device = {
  88. .name = "w100fb",
  89. .id = -1,
  90. .dev = {
  91. .platform_data = &e750_fb_info,
  92. },
  93. .num_resources = ARRAY_SIZE(e750_fb_resources),
  94. .resource = e750_fb_resources,
  95. };
  96. /* ----------------- e750 tc6393xb parameters ------------------ */
  97. static struct tc6393xb_platform_data e750_tc6393xb_info = {
  98. .irq_base = IRQ_BOARD_START,
  99. .scr_pll2cr = 0x0cc1,
  100. .scr_gper = 0,
  101. .gpio_base = -1,
  102. .suspend = &eseries_tmio_suspend,
  103. .resume = &eseries_tmio_resume,
  104. .enable = &eseries_tmio_enable,
  105. .disable = &eseries_tmio_disable,
  106. };
  107. static struct platform_device e750_tc6393xb_device = {
  108. .name = "tc6393xb",
  109. .id = -1,
  110. .dev = {
  111. .platform_data = &e750_tc6393xb_info,
  112. },
  113. .num_resources = 2,
  114. .resource = eseries_tmio_resources,
  115. };
  116. /* ------------------------------------------------------------- */
  117. static struct platform_device *devices[] __initdata = {
  118. &e750_fb_device,
  119. &e750_tc6393xb_device,
  120. };
  121. static void __init e750_init(void)
  122. {
  123. clk_add_alias("CLK_CK3P6MI", &e750_tc6393xb_device.dev,
  124. "GPIO11_CLK", NULL),
  125. eseries_get_tmio_gpios();
  126. platform_add_devices(devices, ARRAY_SIZE(devices));
  127. pxa_set_udc_info(&e7xx_udc_mach_info);
  128. e7xx_irda_init();
  129. pxa_set_ficp_info(&e7xx_ficp_platform_data);
  130. }
  131. MACHINE_START(E750, "Toshiba e750")
  132. /* Maintainer: Ian Molton (spyro@f2s.com) */
  133. .phys_io = 0x40000000,
  134. .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
  135. .boot_params = 0xa0000100,
  136. .map_io = pxa_map_io,
  137. .init_irq = pxa25x_init_irq,
  138. .fixup = eseries_fixup,
  139. .init_machine = e750_init,
  140. .timer = &pxa_timer,
  141. MACHINE_END