setup.c 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. /*
  2. * arch/sh/boards/superh/microdev/setup.c
  3. *
  4. * Copyright (C) 2003 Sean McGoogan (Sean.McGoogan@superh.com)
  5. * Copyright (C) 2003, 2004 SuperH, Inc.
  6. * Copyright (C) 2004, 2005 Paul Mundt
  7. *
  8. * SuperH SH4-202 MicroDev board support.
  9. *
  10. * May be copied or modified under the terms of the GNU General Public
  11. * License. See linux/COPYING for more information.
  12. */
  13. #include <linux/init.h>
  14. #include <linux/platform_device.h>
  15. #include <linux/ioport.h>
  16. #include <video/s1d13xxxfb.h>
  17. #include <mach/microdev.h>
  18. #include <asm/io.h>
  19. #include <asm/machvec.h>
  20. #include <asm/sizes.h>
  21. static struct resource smc91x_resources[] = {
  22. [0] = {
  23. .start = 0x300,
  24. .end = 0x300 + SZ_4K - 1,
  25. .flags = IORESOURCE_MEM,
  26. },
  27. [1] = {
  28. .start = MICRODEV_LINUX_IRQ_ETHERNET,
  29. .end = MICRODEV_LINUX_IRQ_ETHERNET,
  30. .flags = IORESOURCE_IRQ,
  31. },
  32. };
  33. static struct platform_device smc91x_device = {
  34. .name = "smc91x",
  35. .id = -1,
  36. .num_resources = ARRAY_SIZE(smc91x_resources),
  37. .resource = smc91x_resources,
  38. };
  39. static struct s1d13xxxfb_regval s1d13806_initregs[] = {
  40. { S1DREG_MISC, 0x00 },
  41. { S1DREG_COM_DISP_MODE, 0x00 },
  42. { S1DREG_GPIO_CNF0, 0x00 },
  43. { S1DREG_GPIO_CNF1, 0x00 },
  44. { S1DREG_GPIO_CTL0, 0x00 },
  45. { S1DREG_GPIO_CTL1, 0x00 },
  46. { S1DREG_CLK_CNF, 0x02 },
  47. { S1DREG_LCD_CLK_CNF, 0x01 },
  48. { S1DREG_CRT_CLK_CNF, 0x03 },
  49. { S1DREG_MPLUG_CLK_CNF, 0x03 },
  50. { S1DREG_CPU2MEM_WST_SEL, 0x02 },
  51. { S1DREG_SDRAM_REF_RATE, 0x03 },
  52. { S1DREG_SDRAM_TC0, 0x00 },
  53. { S1DREG_SDRAM_TC1, 0x01 },
  54. { S1DREG_MEM_CNF, 0x80 },
  55. { S1DREG_PANEL_TYPE, 0x25 },
  56. { S1DREG_MOD_RATE, 0x00 },
  57. { S1DREG_LCD_DISP_HWIDTH, 0x63 },
  58. { S1DREG_LCD_NDISP_HPER, 0x1e },
  59. { S1DREG_TFT_FPLINE_START, 0x06 },
  60. { S1DREG_TFT_FPLINE_PWIDTH, 0x03 },
  61. { S1DREG_LCD_DISP_VHEIGHT0, 0x57 },
  62. { S1DREG_LCD_DISP_VHEIGHT1, 0x02 },
  63. { S1DREG_LCD_NDISP_VPER, 0x00 },
  64. { S1DREG_TFT_FPFRAME_START, 0x0a },
  65. { S1DREG_TFT_FPFRAME_PWIDTH, 0x81 },
  66. { S1DREG_LCD_DISP_MODE, 0x03 },
  67. { S1DREG_LCD_MISC, 0x00 },
  68. { S1DREG_LCD_DISP_START0, 0x00 },
  69. { S1DREG_LCD_DISP_START1, 0x00 },
  70. { S1DREG_LCD_DISP_START2, 0x00 },
  71. { S1DREG_LCD_MEM_OFF0, 0x90 },
  72. { S1DREG_LCD_MEM_OFF1, 0x01 },
  73. { S1DREG_LCD_PIX_PAN, 0x00 },
  74. { S1DREG_LCD_DISP_FIFO_HTC, 0x00 },
  75. { S1DREG_LCD_DISP_FIFO_LTC, 0x00 },
  76. { S1DREG_CRT_DISP_HWIDTH, 0x63 },
  77. { S1DREG_CRT_NDISP_HPER, 0x1f },
  78. { S1DREG_CRT_HRTC_START, 0x04 },
  79. { S1DREG_CRT_HRTC_PWIDTH, 0x8f },
  80. { S1DREG_CRT_DISP_VHEIGHT0, 0x57 },
  81. { S1DREG_CRT_DISP_VHEIGHT1, 0x02 },
  82. { S1DREG_CRT_NDISP_VPER, 0x1b },
  83. { S1DREG_CRT_VRTC_START, 0x00 },
  84. { S1DREG_CRT_VRTC_PWIDTH, 0x83 },
  85. { S1DREG_TV_OUT_CTL, 0x10 },
  86. { S1DREG_CRT_DISP_MODE, 0x05 },
  87. { S1DREG_CRT_DISP_START0, 0x00 },
  88. { S1DREG_CRT_DISP_START1, 0x00 },
  89. { S1DREG_CRT_DISP_START2, 0x00 },
  90. { S1DREG_CRT_MEM_OFF0, 0x20 },
  91. { S1DREG_CRT_MEM_OFF1, 0x03 },
  92. { S1DREG_CRT_PIX_PAN, 0x00 },
  93. { S1DREG_CRT_DISP_FIFO_HTC, 0x00 },
  94. { S1DREG_CRT_DISP_FIFO_LTC, 0x00 },
  95. { S1DREG_LCD_CUR_CTL, 0x00 },
  96. { S1DREG_LCD_CUR_START, 0x01 },
  97. { S1DREG_LCD_CUR_XPOS0, 0x00 },
  98. { S1DREG_LCD_CUR_XPOS1, 0x00 },
  99. { S1DREG_LCD_CUR_YPOS0, 0x00 },
  100. { S1DREG_LCD_CUR_YPOS1, 0x00 },
  101. { S1DREG_LCD_CUR_BCTL0, 0x00 },
  102. { S1DREG_LCD_CUR_GCTL0, 0x00 },
  103. { S1DREG_LCD_CUR_RCTL0, 0x00 },
  104. { S1DREG_LCD_CUR_BCTL1, 0x1f },
  105. { S1DREG_LCD_CUR_GCTL1, 0x3f },
  106. { S1DREG_LCD_CUR_RCTL1, 0x1f },
  107. { S1DREG_LCD_CUR_FIFO_HTC, 0x00 },
  108. { S1DREG_CRT_CUR_CTL, 0x00 },
  109. { S1DREG_CRT_CUR_START, 0x01 },
  110. { S1DREG_CRT_CUR_XPOS0, 0x00 },
  111. { S1DREG_CRT_CUR_XPOS1, 0x00 },
  112. { S1DREG_CRT_CUR_YPOS0, 0x00 },
  113. { S1DREG_CRT_CUR_YPOS1, 0x00 },
  114. { S1DREG_CRT_CUR_BCTL0, 0x00 },
  115. { S1DREG_CRT_CUR_GCTL0, 0x00 },
  116. { S1DREG_CRT_CUR_RCTL0, 0x00 },
  117. { S1DREG_CRT_CUR_BCTL1, 0x1f },
  118. { S1DREG_CRT_CUR_GCTL1, 0x3f },
  119. { S1DREG_CRT_CUR_RCTL1, 0x1f },
  120. { S1DREG_CRT_CUR_FIFO_HTC, 0x00 },
  121. { S1DREG_BBLT_CTL0, 0x00 },
  122. { S1DREG_BBLT_CTL1, 0x00 },
  123. { S1DREG_BBLT_CC_EXP, 0x00 },
  124. { S1DREG_BBLT_OP, 0x00 },
  125. { S1DREG_BBLT_SRC_START0, 0x00 },
  126. { S1DREG_BBLT_SRC_START1, 0x00 },
  127. { S1DREG_BBLT_SRC_START2, 0x00 },
  128. { S1DREG_BBLT_DST_START0, 0x00 },
  129. { S1DREG_BBLT_DST_START1, 0x00 },
  130. { S1DREG_BBLT_DST_START2, 0x00 },
  131. { S1DREG_BBLT_MEM_OFF0, 0x00 },
  132. { S1DREG_BBLT_MEM_OFF1, 0x00 },
  133. { S1DREG_BBLT_WIDTH0, 0x00 },
  134. { S1DREG_BBLT_WIDTH1, 0x00 },
  135. { S1DREG_BBLT_HEIGHT0, 0x00 },
  136. { S1DREG_BBLT_HEIGHT1, 0x00 },
  137. { S1DREG_BBLT_BGC0, 0x00 },
  138. { S1DREG_BBLT_BGC1, 0x00 },
  139. { S1DREG_BBLT_FGC0, 0x00 },
  140. { S1DREG_BBLT_FGC1, 0x00 },
  141. { S1DREG_LKUP_MODE, 0x00 },
  142. { S1DREG_LKUP_ADDR, 0x00 },
  143. { S1DREG_PS_CNF, 0x10 },
  144. { S1DREG_PS_STATUS, 0x00 },
  145. { S1DREG_CPU2MEM_WDOGT, 0x00 },
  146. { S1DREG_COM_DISP_MODE, 0x02 },
  147. };
  148. static struct s1d13xxxfb_pdata s1d13806_platform_data = {
  149. .initregs = s1d13806_initregs,
  150. .initregssize = ARRAY_SIZE(s1d13806_initregs),
  151. };
  152. static struct resource s1d13806_resources[] = {
  153. [0] = {
  154. .start = 0x07200000,
  155. .end = 0x07200000 + SZ_2M - 1,
  156. .flags = IORESOURCE_MEM,
  157. },
  158. [1] = {
  159. .start = 0x07000000,
  160. .end = 0x07000000 + SZ_2M - 1,
  161. .flags = IORESOURCE_MEM,
  162. },
  163. };
  164. static struct platform_device s1d13806_device = {
  165. .name = "s1d13806fb",
  166. .id = -1,
  167. .num_resources = ARRAY_SIZE(s1d13806_resources),
  168. .resource = s1d13806_resources,
  169. .dev = {
  170. .platform_data = &s1d13806_platform_data,
  171. },
  172. };
  173. static struct platform_device *microdev_devices[] __initdata = {
  174. &smc91x_device,
  175. &s1d13806_device,
  176. };
  177. static int __init microdev_devices_setup(void)
  178. {
  179. return platform_add_devices(microdev_devices, ARRAY_SIZE(microdev_devices));
  180. }
  181. device_initcall(microdev_devices_setup);
  182. /*
  183. * The Machine Vector
  184. */
  185. static struct sh_machine_vector mv_sh4202_microdev __initmv = {
  186. .mv_name = "SH4-202 MicroDev",
  187. .mv_ioport_map = microdev_ioport_map,
  188. .mv_init_irq = init_microdev_irq,
  189. };