acornfb.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. /*
  2. * linux/drivers/video/acornfb.h
  3. *
  4. * Copyright (C) 1998,1999 Russell King
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License version 2 as
  8. * published by the Free Software Foundation.
  9. *
  10. * Frame buffer code for Acorn platforms
  11. */
  12. #if defined(HAS_VIDC20)
  13. #include <asm/hardware/iomd.h>
  14. #define VIDC_PALETTE_SIZE 256
  15. #define VIDC_NAME "VIDC20"
  16. #endif
  17. #define EXTEND8(x) ((x)|(x)<<8)
  18. #define EXTEND4(x) ((x)|(x)<<4|(x)<<8|(x)<<12)
  19. struct vidc20_palette {
  20. u_int red:8;
  21. u_int green:8;
  22. u_int blue:8;
  23. u_int ext:4;
  24. u_int unused:4;
  25. };
  26. struct vidc_palette {
  27. u_int red:4;
  28. u_int green:4;
  29. u_int blue:4;
  30. u_int trans:1;
  31. u_int sbz1:13;
  32. u_int reg:4;
  33. u_int sbz2:2;
  34. };
  35. union palette {
  36. struct vidc20_palette vidc20;
  37. struct vidc_palette vidc;
  38. u_int p;
  39. };
  40. struct acornfb_par {
  41. struct device *dev;
  42. unsigned long screen_end;
  43. unsigned int dram_size;
  44. unsigned int vram_half_sam;
  45. unsigned int palette_size;
  46. signed int montype;
  47. unsigned int using_vram : 1;
  48. unsigned int dpms : 1;
  49. union palette palette[VIDC_PALETTE_SIZE];
  50. u32 pseudo_palette[16];
  51. };
  52. struct vidc_timing {
  53. u_int h_cycle;
  54. u_int h_sync_width;
  55. u_int h_border_start;
  56. u_int h_display_start;
  57. u_int h_display_end;
  58. u_int h_border_end;
  59. u_int h_interlace;
  60. u_int v_cycle;
  61. u_int v_sync_width;
  62. u_int v_border_start;
  63. u_int v_display_start;
  64. u_int v_display_end;
  65. u_int v_border_end;
  66. u_int control;
  67. /* VIDC20 only */
  68. u_int pll_ctl;
  69. };
  70. struct modey_params {
  71. u_int y_res;
  72. u_int u_margin;
  73. u_int b_margin;
  74. u_int vsync_len;
  75. u_int vf;
  76. };
  77. struct modex_params {
  78. u_int x_res;
  79. u_int l_margin;
  80. u_int r_margin;
  81. u_int hsync_len;
  82. u_int clock;
  83. u_int hf;
  84. const struct modey_params *modey;
  85. };
  86. #ifdef HAS_VIDC20
  87. /*
  88. * VIDC20 registers
  89. */
  90. #define VIDC20_CTRL 0xe0000000
  91. #define VIDC20_CTRL_PIX_VCLK (0 << 0)
  92. #define VIDC20_CTRL_PIX_HCLK (1 << 0)
  93. #define VIDC20_CTRL_PIX_RCLK (2 << 0)
  94. #define VIDC20_CTRL_PIX_CK (0 << 2)
  95. #define VIDC20_CTRL_PIX_CK2 (1 << 2)
  96. #define VIDC20_CTRL_PIX_CK3 (2 << 2)
  97. #define VIDC20_CTRL_PIX_CK4 (3 << 2)
  98. #define VIDC20_CTRL_PIX_CK5 (4 << 2)
  99. #define VIDC20_CTRL_PIX_CK6 (5 << 2)
  100. #define VIDC20_CTRL_PIX_CK7 (6 << 2)
  101. #define VIDC20_CTRL_PIX_CK8 (7 << 2)
  102. #define VIDC20_CTRL_1BPP (0 << 5)
  103. #define VIDC20_CTRL_2BPP (1 << 5)
  104. #define VIDC20_CTRL_4BPP (2 << 5)
  105. #define VIDC20_CTRL_8BPP (3 << 5)
  106. #define VIDC20_CTRL_16BPP (4 << 5)
  107. #define VIDC20_CTRL_32BPP (6 << 5)
  108. #define VIDC20_CTRL_FIFO_NS (0 << 8)
  109. #define VIDC20_CTRL_FIFO_4 (1 << 8)
  110. #define VIDC20_CTRL_FIFO_8 (2 << 8)
  111. #define VIDC20_CTRL_FIFO_12 (3 << 8)
  112. #define VIDC20_CTRL_FIFO_16 (4 << 8)
  113. #define VIDC20_CTRL_FIFO_20 (5 << 8)
  114. #define VIDC20_CTRL_FIFO_24 (6 << 8)
  115. #define VIDC20_CTRL_FIFO_28 (7 << 8)
  116. #define VIDC20_CTRL_INT (1 << 12)
  117. #define VIDC20_CTRL_DUP (1 << 13)
  118. #define VIDC20_CTRL_PDOWN (1 << 14)
  119. #define VIDC20_ECTL 0xc0000000
  120. #define VIDC20_ECTL_REG(x) ((x) & 0xf3)
  121. #define VIDC20_ECTL_ECK (1 << 2)
  122. #define VIDC20_ECTL_REDPED (1 << 8)
  123. #define VIDC20_ECTL_GREENPED (1 << 9)
  124. #define VIDC20_ECTL_BLUEPED (1 << 10)
  125. #define VIDC20_ECTL_DAC (1 << 12)
  126. #define VIDC20_ECTL_LCDGS (1 << 13)
  127. #define VIDC20_ECTL_HRM (1 << 14)
  128. #define VIDC20_ECTL_HS_MASK (3 << 16)
  129. #define VIDC20_ECTL_HS_HSYNC (0 << 16)
  130. #define VIDC20_ECTL_HS_NHSYNC (1 << 16)
  131. #define VIDC20_ECTL_HS_CSYNC (2 << 16)
  132. #define VIDC20_ECTL_HS_NCSYNC (3 << 16)
  133. #define VIDC20_ECTL_VS_MASK (3 << 18)
  134. #define VIDC20_ECTL_VS_VSYNC (0 << 18)
  135. #define VIDC20_ECTL_VS_NVSYNC (1 << 18)
  136. #define VIDC20_ECTL_VS_CSYNC (2 << 18)
  137. #define VIDC20_ECTL_VS_NCSYNC (3 << 18)
  138. #define VIDC20_DCTL 0xf0000000
  139. /* 0-9 = number of words in scanline */
  140. #define VIDC20_DCTL_SNA (1 << 12)
  141. #define VIDC20_DCTL_HDIS (1 << 13)
  142. #define VIDC20_DCTL_BUS_NS (0 << 16)
  143. #define VIDC20_DCTL_BUS_D31_0 (1 << 16)
  144. #define VIDC20_DCTL_BUS_D63_32 (2 << 16)
  145. #define VIDC20_DCTL_BUS_D63_0 (3 << 16)
  146. #define VIDC20_DCTL_VRAM_DIS (0 << 18)
  147. #define VIDC20_DCTL_VRAM_PXCLK (1 << 18)
  148. #define VIDC20_DCTL_VRAM_PXCLK2 (2 << 18)
  149. #define VIDC20_DCTL_VRAM_PXCLK4 (3 << 18)
  150. #endif