controlfb.h 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. /*
  2. * controlfb_hw.h: Constants of all sorts for controlfb
  3. *
  4. * Copyright (C) 1998 Daniel Jacobowitz <dan@debian.org>
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public License
  8. * as published by the Free Software Foundation; either version
  9. * 2 of the License, or (at your option) any later version.
  10. *
  11. * Based on an awful lot of code, including:
  12. *
  13. * control.c: Console support for PowerMac "control" display adaptor.
  14. * Copyright (C) 1996 Paul Mackerras.
  15. *
  16. * The so far unpublished platinumfb.c
  17. * Copyright (C) 1998 Jon Howell
  18. */
  19. /*
  20. * Structure of the registers for the RADACAL colormap device.
  21. */
  22. struct cmap_regs {
  23. unsigned char addr; /* index for both cmap and misc registers */
  24. char pad1[15];
  25. unsigned char crsr; /* cursor palette */
  26. char pad2[15];
  27. unsigned char dat; /* RADACAL misc register data */
  28. char pad3[15];
  29. unsigned char lut; /* cmap data */
  30. char pad4[15];
  31. };
  32. /*
  33. * Structure of the registers for the "control" display adaptor.
  34. */
  35. #define PAD(x) char x[12]
  36. struct preg { /* padded register */
  37. unsigned r;
  38. char pad[12];
  39. };
  40. struct control_regs {
  41. struct preg vcount; /* vertical counter */
  42. /* Vertical parameters are in units of 1/2 scan line */
  43. struct preg vswin; /* between vsblank and vssync */
  44. struct preg vsblank; /* vert start blank */
  45. struct preg veblank; /* vert end blank (display start) */
  46. struct preg vewin; /* between vesync and veblank */
  47. struct preg vesync; /* vert end sync */
  48. struct preg vssync; /* vert start sync */
  49. struct preg vperiod; /* vert period */
  50. struct preg piped; /* pipe delay hardware cursor */
  51. /* Horizontal params are in units of 2 pixels */
  52. struct preg hperiod; /* horiz period - 2 */
  53. struct preg hsblank; /* horiz start blank */
  54. struct preg heblank; /* horiz end blank */
  55. struct preg hesync; /* horiz end sync */
  56. struct preg hssync; /* horiz start sync */
  57. struct preg heq; /* half horiz sync len */
  58. struct preg hlfln; /* half horiz period */
  59. struct preg hserr; /* horiz period - horiz sync len */
  60. struct preg cnttst;
  61. struct preg ctrl; /* display control */
  62. struct preg start_addr; /* start address: 5 lsbs zero */
  63. struct preg pitch; /* addrs diff between scan lines */
  64. struct preg mon_sense; /* monitor sense bits */
  65. struct preg vram_attr; /* enable vram banks */
  66. struct preg mode;
  67. struct preg rfrcnt; /* refresh count */
  68. struct preg intr_ena; /* interrupt enable */
  69. struct preg intr_stat; /* interrupt status */
  70. struct preg res[5];
  71. };
  72. struct control_regints {
  73. /* Vertical parameters are in units of 1/2 scan line */
  74. unsigned vswin; /* between vsblank and vssync */
  75. unsigned vsblank; /* vert start blank */
  76. unsigned veblank; /* vert end blank (display start) */
  77. unsigned vewin; /* between vesync and veblank */
  78. unsigned vesync; /* vert end sync */
  79. unsigned vssync; /* vert start sync */
  80. unsigned vperiod; /* vert period */
  81. unsigned piped; /* pipe delay hardware cursor */
  82. /* Horizontal params are in units of 2 pixels */
  83. /* Except, apparently, for hres > 1024 (or == 1280?) */
  84. unsigned hperiod; /* horiz period - 2 */
  85. unsigned hsblank; /* horiz start blank */
  86. unsigned heblank; /* horiz end blank */
  87. unsigned hesync; /* horiz end sync */
  88. unsigned hssync; /* horiz start sync */
  89. unsigned heq; /* half horiz sync len */
  90. unsigned hlfln; /* half horiz period */
  91. unsigned hserr; /* horiz period - horiz sync len */
  92. };
  93. /*
  94. * Dot clock rate is
  95. * 3.9064MHz * 2**clock_params[2] * clock_params[1] / clock_params[0].
  96. */
  97. struct control_regvals {
  98. unsigned regs[16]; /* for vswin .. hserr */
  99. unsigned char mode;
  100. unsigned char radacal_ctrl;
  101. unsigned char clock_params[3];
  102. };
  103. #define CTRLFB_OFF 16 /* position of pixel 0 in frame buffer */
  104. /*
  105. * Best cmode supported by control
  106. */
  107. struct max_cmodes {
  108. int m[2]; /* 0: 2MB vram, 1: 4MB vram */
  109. };
  110. /*
  111. * Video modes supported by macmodes.c
  112. */
  113. static struct max_cmodes control_mac_modes[] = {
  114. {{-1,-1}}, /* 512x384, 60Hz interlaced (NTSC) */
  115. {{-1,-1}}, /* 512x384, 60Hz */
  116. {{-1,-1}}, /* 640x480, 50Hz interlaced (PAL) */
  117. {{-1,-1}}, /* 640x480, 60Hz interlaced (NTSC) */
  118. {{ 2, 2}}, /* 640x480, 60Hz (VGA) */
  119. {{ 2, 2}}, /* 640x480, 67Hz */
  120. {{-1,-1}}, /* 640x870, 75Hz (portrait) */
  121. {{-1,-1}}, /* 768x576, 50Hz (PAL full frame) */
  122. {{ 2, 2}}, /* 800x600, 56Hz */
  123. {{ 2, 2}}, /* 800x600, 60Hz */
  124. {{ 2, 2}}, /* 800x600, 72Hz */
  125. {{ 2, 2}}, /* 800x600, 75Hz */
  126. {{ 1, 2}}, /* 832x624, 75Hz */
  127. {{ 1, 2}}, /* 1024x768, 60Hz */
  128. {{ 1, 2}}, /* 1024x768, 70Hz (or 72Hz?) */
  129. {{ 1, 2}}, /* 1024x768, 75Hz (VESA) */
  130. {{ 1, 2}}, /* 1024x768, 75Hz */
  131. {{ 1, 2}}, /* 1152x870, 75Hz */
  132. {{ 0, 1}}, /* 1280x960, 75Hz */
  133. {{ 0, 1}}, /* 1280x1024, 75Hz */
  134. };