controlfb.h 4.4 KB

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