1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 * controlfb_hw.h: Constants of all sorts for controlfb
5 * Copyright (C) 1998 Daniel Jacobowitz <dan@debian.org>
7 * Based on an awful lot of code, including:
9 * control.c: Console support for PowerMac "control" display adaptor.
10 * Copyright (C) 1996 Paul Mackerras.
12 * The so far unpublished platinumfb.c
13 * Copyright (C) 1998 Jon Howell
17 * Structure of the registers for the RADACAL colormap device.
20 unsigned char addr
; /* index for both cmap and misc registers */
22 unsigned char crsr
; /* cursor palette */
24 unsigned char dat
; /* RADACAL misc register data */
26 unsigned char lut
; /* cmap data */
31 * Structure of the registers for the "control" display adaptor.
33 #define PAD(x) char x[12]
35 struct preg
{ /* padded register */
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 */
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 */
67 struct preg rfrcnt
; /* refresh count */
68 struct preg intr_ena
; /* interrupt enable */
69 struct preg intr_stat
; /* interrupt status */
73 struct control_regints
{
74 /* Vertical parameters are in units of 1/2 scan line */
75 unsigned vswin
; /* between vsblank and vssync */
76 unsigned vsblank
; /* vert start blank */
77 unsigned veblank
; /* vert end blank (display start) */
78 unsigned vewin
; /* between vesync and veblank */
79 unsigned vesync
; /* vert end sync */
80 unsigned vssync
; /* vert start sync */
81 unsigned vperiod
; /* vert period */
82 unsigned piped
; /* pipe delay hardware cursor */
83 /* Horizontal params are in units of 2 pixels */
84 /* Except, apparently, for hres > 1024 (or == 1280?) */
85 unsigned hperiod
; /* horiz period - 2 */
86 unsigned hsblank
; /* horiz start blank */
87 unsigned heblank
; /* horiz end blank */
88 unsigned hesync
; /* horiz end sync */
89 unsigned hssync
; /* horiz start sync */
90 unsigned heq
; /* half horiz sync len */
91 unsigned hlfln
; /* half horiz period */
92 unsigned hserr
; /* horiz period - horiz sync len */
97 * 3.9064MHz * 2**clock_params[2] * clock_params[1] / clock_params[0].
99 struct control_regvals
{
100 unsigned regs
[16]; /* for vswin .. hserr */
102 unsigned char radacal_ctrl
;
103 unsigned char clock_params
[3];
106 #define CTRLFB_OFF 16 /* position of pixel 0 in frame buffer */
110 * Best cmode supported by control
113 int m
[2]; /* 0: 2MB vram, 1: 4MB vram */
117 * Video modes supported by macmodes.c
119 static struct max_cmodes control_mac_modes
[] = {
120 {{-1,-1}}, /* 512x384, 60Hz interlaced (NTSC) */
121 {{-1,-1}}, /* 512x384, 60Hz */
122 {{-1,-1}}, /* 640x480, 50Hz interlaced (PAL) */
123 {{-1,-1}}, /* 640x480, 60Hz interlaced (NTSC) */
124 {{ 2, 2}}, /* 640x480, 60Hz (VGA) */
125 {{ 2, 2}}, /* 640x480, 67Hz */
126 {{-1,-1}}, /* 640x870, 75Hz (portrait) */
127 {{-1,-1}}, /* 768x576, 50Hz (PAL full frame) */
128 {{ 2, 2}}, /* 800x600, 56Hz */
129 {{ 2, 2}}, /* 800x600, 60Hz */
130 {{ 2, 2}}, /* 800x600, 72Hz */
131 {{ 2, 2}}, /* 800x600, 75Hz */
132 {{ 1, 2}}, /* 832x624, 75Hz */
133 {{ 1, 2}}, /* 1024x768, 60Hz */
134 {{ 1, 2}}, /* 1024x768, 70Hz (or 72Hz?) */
135 {{ 1, 2}}, /* 1024x768, 75Hz (VESA) */
136 {{ 1, 2}}, /* 1024x768, 75Hz */
137 {{ 1, 2}}, /* 1152x870, 75Hz */
138 {{ 0, 1}}, /* 1280x960, 75Hz */
139 {{ 0, 1}}, /* 1280x1024, 75Hz */
140 {{ 1, 2}}, /* 1152x768, 60Hz */
141 {{ 0, 1}}, /* 1600x1024, 60Hz */