1 diff --git a/arch/mips/Kconfig.debug b/arch/mips/Kconfig.debug
2 index 058f8cd628fd..08fb173ef865 100644
3 --- a/arch/mips/Kconfig.debug
4 +++ b/arch/mips/Kconfig.debug
5 @@ -53,6 +53,19 @@ config EARLY_IMPACT_PRINTK
6 for debugging purposes. It is fixed at 1280x1024 resolution and
7 overwrites top-to-bottom. A solid red line indicates the last line
10 +config EARLY_ODYSSEY_PRINTK
11 + bool "Early Odyssey printk" if EXPERT
12 + depends on (SGI_IP30 || SGI_IP35) && EARLY_PRINTK
13 + select FB_ODYSSEY_EARLY
17 + This options enables utilizing the Odyssey as an early boot console
18 + for debugging purposes. It is fixed at 1280x1024 resolution and
19 + overwrites top-to-bottom. A solid red line indicates the last line
24 config USE_GENERIC_EARLY_PRINTK_8250
25 diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c
26 index d5b6c6816af5..d59bfab970a6 100644
27 --- a/arch/mips/kernel/setup.c
28 +++ b/arch/mips/kernel/setup.c
29 @@ -57,6 +57,10 @@ struct screen_info screen_info;
30 extern void setup_early_impact_printk(void);
33 +#if defined(CONFIG_EARLY_ODYSSEY_PRINTK)
34 + extern void setup_early_odyssey_printk(void);
40 @@ -1017,6 +1021,8 @@ void __init setup_arch(char **cmdline_p)
41 #ifdef CONFIG_EARLY_PRINTK
42 #if defined(CONFIG_EARLY_IMPACT_PRINTK)
43 setup_early_impact_printk();
44 +#elif defined(CONFIG_EARLY_ODYSSEY_PRINTK)
45 + setup_early_odyssey_printk();
49 diff --git a/arch/mips/sgi-common/Makefile b/arch/mips/sgi-common/Makefile
50 index ff862b0c7abd..70499ee1c2ec 100644
51 --- a/arch/mips/sgi-common/Makefile
52 +++ b/arch/mips/sgi-common/Makefile
56 obj-$(CONFIG_EARLY_IMPACT_PRINTK) += impact-earlycon.o
57 +obj-$(CONFIG_EARLY_ODYSSEY_PRINTK) += odyssey-earlycon.o
58 diff --git a/arch/mips/sgi-common/odyssey-earlycon.c b/arch/mips/sgi-common/odyssey-earlycon.c
60 index 000000000000..1267b430da97
62 +++ b/arch/mips/sgi-common/odyssey-earlycon.c
65 + * Wrapper for an early console using the using the Odyssey Graphics Card
66 + * as a debugging/early boot console.
68 + * Copyright (c) 2004-2007 Stanislaw Skowronek
69 + * Copyright (c) 2014 Joshua Kinard
71 +#include <linux/kernel.h>
72 +#include <linux/console.h>
73 +#include <linux/printk.h>
74 +#include <linux/init.h>
76 +#include <asm/setup.h>
78 +extern void odyssey_earlyinit(void);
79 +extern void odyssey_earlychar(u8 c, u32 f);
80 +extern struct console *early_console;
83 +early_odyssey_write(struct console *co, const char *s, u32 count)
85 + /* Do each character */
87 + odyssey_earlychar(*s++, 0xa0a0a0);
90 +static struct console
91 +early_odyssey_cons = {
92 + .name = "early_odyssey",
93 + .write = early_odyssey_write,
94 + .flags = CON_PRINTBUFFER | CON_BOOT,
99 +setup_early_odyssey_printk(void)
104 + odyssey_earlyinit();
105 + early_console = &early_odyssey_cons;
107 + register_console(&early_odyssey_cons);
109 diff --git a/drivers/video/fbdev/Kconfig b/drivers/video/fbdev/Kconfig
110 index 7430a82492dc..34b155053e06 100644
111 --- a/drivers/video/fbdev/Kconfig
112 +++ b/drivers/video/fbdev/Kconfig
113 @@ -731,6 +731,10 @@ config FB_IMPACT
115 SGI Impact (MardiGras/MGRAS) graphics card support.
117 +config FB_ODYSSEY_EARLY
119 + depends on (SGI_IP30 || SGI_IP35)
122 tristate "SGI Odyssey graphics support"
123 depends on FB && (SGI_IP30 || SGI_IP35)
124 diff --git a/drivers/video/fbdev/Makefile b/drivers/video/fbdev/Makefile
125 index 67fe1e90b9a3..0e09eb73b1a6 100644
126 --- a/drivers/video/fbdev/Makefile
127 +++ b/drivers/video/fbdev/Makefile
128 @@ -128,6 +128,7 @@ obj-$(CONFIG_FB_SM712) += sm712fb.o
129 obj-$(CONFIG_FB_IMPACT) += impact.o
130 obj-$(CONFIG_FB_IMPACT_EARLY) += impact_early.o
131 obj-$(CONFIG_FB_ODYSSEY) += odyssey.o
132 +obj-$(CONFIG_FB_ODYSSEY_EARLY) += odyssey_early.o
134 # Platform or fallback drivers go here
135 obj-$(CONFIG_FB_UVESA) += uvesafb.o
136 diff --git a/drivers/video/fbdev/odyssey_early.c b/drivers/video/fbdev/odyssey_early.c
138 index 000000000000..a209f2b0149a
140 +++ b/drivers/video/fbdev/odyssey_early.c
143 + * linux/drivers/video/odyssey_early.c
144 + * -- SGI Octane Odyssey (VPro) graphics
146 + * Copyright (c) 2004 by Stanislaw Skowronek
147 + * Copyright (c) 2011-14 by Joshua Kinard (Fixes, Maintenance)
149 + * Separated from linux/drivers/video/fbdev/odyssey.c
151 + * This driver provides direct access to the Odyssey hardware for
152 + * early_console support. It can typically be initialized after the
153 + * CPU(s) have been setup, but before anything else, like IRQs. Handy for
154 + * debugging core startup code on a machine as difficult as Octane.
156 + * When running, the driver will draw a solid red line across the screen
157 + * to denote the current output line. It will scroll from top to the bottom
158 + * of the screen and then begin overwriting from the top again.
161 +#include <linux/module.h>
162 +#include <linux/kernel.h>
163 +#include <linux/errno.h>
164 +#include <linux/string.h>
165 +#include <linux/font.h>
166 +#include <linux/platform_device.h>
168 +#include <video/odyssey.h>
170 +#define MMIO_FIXED 0x900000001b000000
173 +odyssey_early_ieee754_packed(int val)
180 + sign = (val & 0x80000000);
185 + if (val & 0xff000000)
189 + while (!(val & 0x00800000)) {
194 + return (sign | (exp << 23) | (val & 0x007fffff));
198 +odyssey_earlyflush(unsigned long mmio)
200 + odyssey_wait_cfifo(mmio);
201 + ODY_CFIFO_W(mmio) = 0x00010443;
202 + ODY_CFIFO_W(mmio) = 0x000000fa;
203 + ODY_CFIFO_W(mmio) = 0x00010046;
204 + ODY_CFIFO_W(mmio) = 0x00010046;
205 + ODY_CFIFO_W(mmio) = 0x00010019;
206 + ODY_CFIFO_W(mmio) = 0x00010443;
207 + ODY_CFIFO_W(mmio) = 0x00000096;
208 + ODY_CFIFO_W(mmio) = 0x00010046;
209 + ODY_CFIFO_W(mmio) = 0x00010046;
210 + ODY_CFIFO_W(mmio) = 0x00010046;
211 + ODY_CFIFO_W(mmio) = 0x00010046;
212 + ODY_CFIFO_W(mmio) = 0x00010443;
213 + ODY_CFIFO_W(mmio) = 0x000000fa;
214 + ODY_CFIFO_W(mmio) = 0x00010046;
215 + ODY_CFIFO_W(mmio) = 0x00010046;
219 +odyssey_earlysmallflush(unsigned long mmio)
221 + odyssey_wait_cfifo(mmio);
222 + ODY_CFIFO_W(mmio) = 0x00010443;
223 + ODY_CFIFO_W(mmio) = 0x000000fa;
224 + ODY_CFIFO_W(mmio) = 0x00010046;
225 + ODY_CFIFO_W(mmio) = 0x00010046;
229 +odyssey_earlyrect(int x, int y, int w, int h, u32 c)
231 + ODY_CFIFO_W(MMIO_FIXED) = 0x00014400; /* glBegin */
232 + ODY_CFIFO_W(MMIO_FIXED) = 0x00000007; /* GL_QUADS */
233 + ODY_CFIFO_W(MMIO_FIXED) = 0xc580cc08; /* glColor3ub */
234 + ODY_CFIFO_W(MMIO_FIXED) = (c & 255);
235 + ODY_CFIFO_W(MMIO_FIXED) = ((c >> 8) & 255);
236 + ODY_CFIFO_W(MMIO_FIXED) = ((c >> 16) & 255);
237 + ODY_CFIFO_W(MMIO_FIXED) = 0x8080c800; /* glVertex2i */
238 + ODY_CFIFO_W(MMIO_FIXED) = x;
239 + ODY_CFIFO_W(MMIO_FIXED) = y;
240 + ODY_CFIFO_W(MMIO_FIXED) = 0x8080c800; /* glVertex2i */
241 + ODY_CFIFO_W(MMIO_FIXED) = (x + w);
242 + ODY_CFIFO_W(MMIO_FIXED) = y;
243 + ODY_CFIFO_W(MMIO_FIXED) = 0x8080c800; /* glVertex2i */
244 + ODY_CFIFO_W(MMIO_FIXED) = (x + w);
245 + ODY_CFIFO_W(MMIO_FIXED) = (y + h);
246 + ODY_CFIFO_W(MMIO_FIXED) = 0x8080c800; /* glVertex2i */
247 + ODY_CFIFO_W(MMIO_FIXED) = x;
248 + ODY_CFIFO_W(MMIO_FIXED) = (y + h);
249 + ODY_CFIFO_W(MMIO_FIXED) = 0x00014001; /* glEnd */
250 + odyssey_earlysmallflush(MMIO_FIXED);
254 +odyssey_earlypaintchar(int x, int y, u8 *b, u32 c, u32 a)
258 + odyssey_earlysmallflush(MMIO_FIXED);
259 + ODY_CFIFO_W(MMIO_FIXED) = 0x00010405;
260 + ODY_CFIFO_W(MMIO_FIXED) = 0x00002400;
261 + ODY_CFIFO_W(MMIO_FIXED) = 0xc580cc08;
262 + ODY_CFIFO_W(MMIO_FIXED) = 0x00000000;
263 + ODY_CFIFO_W(MMIO_FIXED) = 0x00000000;
264 + ODY_CFIFO_W(MMIO_FIXED) = 0x00000000;
265 + ODY_CFIFO_W(MMIO_FIXED) = 0x00011453;
266 + ODY_CFIFO_W(MMIO_FIXED) = 0x00000002;
267 + ODY_CFIFO_W(MMIO_FIXED) = 0x00000000;
268 + ODY_CFIFO_W(MMIO_FIXED) = 0x00000000;
269 + ODY_CFIFO_W(MMIO_FIXED) = 0x00000000;
270 + ODY_CFIFO_W(MMIO_FIXED) = 0x00000000;
271 + odyssey_earlyflush(MMIO_FIXED);
272 + ODY_CFIFO_W(MMIO_FIXED) = 0x2900812f;
273 + ODY_CFIFO_W(MMIO_FIXED) = 0x00014400;
274 + ODY_CFIFO_W(MMIO_FIXED) = 0x0000000a;
275 + ODY_CFIFO_W(MMIO_FIXED) = 0xcf80a92f;
276 + ODY_CFIFO_W(MMIO_FIXED) = 0x00000000;
277 + ODY_CFIFO_W(MMIO_FIXED) = 0x00000000;
278 + ODY_CFIFO_W(MMIO_FIXED) = 0x00000000;
279 + ODY_CFIFO_W(MMIO_FIXED) = 0x00000000;
280 + ODY_CFIFO_W(MMIO_FIXED) = odyssey_early_ieee754_packed(x);
281 + ODY_CFIFO_W(MMIO_FIXED) = odyssey_early_ieee754_packed(y);
282 + ODY_CFIFO_W(MMIO_FIXED) = 0x00000000;
283 + ODY_CFIFO_W(MMIO_FIXED) = odyssey_early_ieee754_packed(x + 8);
284 + ODY_CFIFO_W(MMIO_FIXED) = odyssey_early_ieee754_packed(y + 16);
285 + ODY_CFIFO_W(MMIO_FIXED) = 0x00000000;
286 + ODY_CFIFO_W(MMIO_FIXED) = 0x8080c800;
287 + ODY_CFIFO_W(MMIO_FIXED) = 0x00000000;
288 + ODY_CFIFO_W(MMIO_FIXED) = 0x00000000;
289 + ODY_CFIFO_W(MMIO_FIXED) = 0x00004570;
290 + ODY_CFIFO_W(MMIO_FIXED) = 0x0f00104c;
291 + ODY_CFIFO_W(MMIO_FIXED) = 0x00000071;
293 + for (j = 0; j < 16; j++) {
294 + ODY_CFIFO_W(MMIO_FIXED) = 0x00004570;
295 + ODY_CFIFO_W(MMIO_FIXED) = 0x0fd1104c;
296 + ODY_CFIFO_W(MMIO_FIXED) = 0x00000071;
297 + ODY_CFIFO_W(MMIO_FIXED) = 0x00016011;
298 + for (i = 7; i >= 0; i--)
299 + if ((b[j] >> i) & 1)
300 + ODY_CFIFO_W(MMIO_FIXED) = c;
302 + ODY_CFIFO_W(MMIO_FIXED) = a;
305 + ODY_CFIFO_W(MMIO_FIXED) = 0x00014001;
306 + odyssey_earlysmallflush(MMIO_FIXED);
307 + ODY_CFIFO_W(MMIO_FIXED) = 0x290080d6;
308 + ODY_CFIFO_W(MMIO_FIXED) = 0x00011453;
309 + ODY_CFIFO_W(MMIO_FIXED) = 0x00000000;
310 + ODY_CFIFO_W(MMIO_FIXED) = 0x00000000;
311 + ODY_CFIFO_W(MMIO_FIXED) = 0x00000000;
312 + ODY_CFIFO_W(MMIO_FIXED) = 0x00000000;
313 + ODY_CFIFO_W(MMIO_FIXED) = 0x00000000;
314 + ODY_CFIFO_W(MMIO_FIXED) = 0x00010405;
315 + ODY_CFIFO_W(MMIO_FIXED) = 0x00002000;
316 + odyssey_earlyflush(MMIO_FIXED);
320 +odyssey_earlyhwinit(void)
325 + /* odyssey_initbuzzgfe */
326 + ODY_CFIFO_W(MMIO_FIXED) = 0x20008003;
327 + ODY_CFIFO_W(MMIO_FIXED) = 0x21008010;
328 + ODY_CFIFO_W(MMIO_FIXED) = 0x22008000;
329 + ODY_CFIFO_W(MMIO_FIXED) = 0x23008002;
330 + ODY_CFIFO_W(MMIO_FIXED) = 0x2400800c;
331 + ODY_CFIFO_W(MMIO_FIXED) = 0x2500800e;
332 + ODY_CFIFO_W(MMIO_FIXED) = 0x27008000;
333 + ODY_CFIFO_W(MMIO_FIXED) = 0x28008000;
334 + ODY_CFIFO_W(MMIO_FIXED) = 0x290080d6;
335 + ODY_CFIFO_W(MMIO_FIXED) = 0x2a0080e0;
336 + ODY_CFIFO_W(MMIO_FIXED) = 0x2c0080ea;
337 + ODY_CFIFO_W(MMIO_FIXED) = 0x2e008380;
338 + ODY_CFIFO_W(MMIO_FIXED) = 0x2f008000;
339 + ODY_CFIFO_W(MMIO_FIXED) = 0x30008000;
340 + ODY_CFIFO_W(MMIO_FIXED) = 0x31008000;
341 + ODY_CFIFO_W(MMIO_FIXED) = 0x32008000;
342 + ODY_CFIFO_W(MMIO_FIXED) = 0x33008000;
343 + ODY_CFIFO_W(MMIO_FIXED) = 0x34008000;
344 + ODY_CFIFO_W(MMIO_FIXED) = 0x35008000;
345 + ODY_CFIFO_W(MMIO_FIXED) = 0x310081e0;
346 + odyssey_earlyflush(MMIO_FIXED);
348 + /* odyssey_initbuzzxform */
349 + ODY_CFIFO_W(MMIO_FIXED) = 0x9080bda2;
350 + ODY_CFIFO_W(MMIO_FIXED) = 0x3f800000;
351 + ODY_CFIFO_W(MMIO_FIXED) = 0x3f000000;
352 + ODY_CFIFO_W(MMIO_FIXED) = 0xbf800000;
353 + ODY_CFIFO_W(MMIO_FIXED) = 0x00000000;
354 + ODY_CFIFO_W(MMIO_FIXED) = 0x4e000000;
355 + ODY_CFIFO_W(MMIO_FIXED) = 0x40400000;
356 + ODY_CFIFO_W(MMIO_FIXED) = 0x4e000000;
357 + ODY_CFIFO_W(MMIO_FIXED) = 0x4d000000;
358 + ODY_CFIFO_W(MMIO_FIXED) = 0x00000000;
359 + ODY_CFIFO_W(MMIO_FIXED) = 0x00000000;
360 + ODY_CFIFO_W(MMIO_FIXED) = 0x00000000;
361 + ODY_CFIFO_W(MMIO_FIXED) = 0x00000000;
362 + ODY_CFIFO_W(MMIO_FIXED) = 0x00000000;
363 + ODY_CFIFO_W(MMIO_FIXED) = 0x00000000;
364 + ODY_CFIFO_W(MMIO_FIXED) = 0x00000000;
365 + ODY_CFIFO_W(MMIO_FIXED) = 0x00000000;
366 + ODY_CFIFO_W(MMIO_FIXED) = 0x34008000;
367 + ODY_CFIFO_W(MMIO_FIXED) = 0x9080bdc8;
368 + ODY_CFIFO_W(MMIO_FIXED) = 0x3f800000;
369 + ODY_CFIFO_W(MMIO_FIXED) = 0x00000000;
370 + ODY_CFIFO_W(MMIO_FIXED) = 0x00000000;
371 + ODY_CFIFO_W(MMIO_FIXED) = 0x3f000000;
372 + ODY_CFIFO_W(MMIO_FIXED) = 0x00000000;
373 + ODY_CFIFO_W(MMIO_FIXED) = 0x3f800000;
374 + ODY_CFIFO_W(MMIO_FIXED) = 0x00000000;
375 + ODY_CFIFO_W(MMIO_FIXED) = 0x3f000000;
376 + ODY_CFIFO_W(MMIO_FIXED) = 0x00000000;
377 + ODY_CFIFO_W(MMIO_FIXED) = 0x00000000;
378 + ODY_CFIFO_W(MMIO_FIXED) = 0x3f800000;
379 + ODY_CFIFO_W(MMIO_FIXED) = 0x00000000;
380 + ODY_CFIFO_W(MMIO_FIXED) = 0x00000000;
381 + ODY_CFIFO_W(MMIO_FIXED) = 0x00000000;
382 + ODY_CFIFO_W(MMIO_FIXED) = 0x00000000;
383 + ODY_CFIFO_W(MMIO_FIXED) = 0x3f800000;
384 + ODY_CFIFO_W(MMIO_FIXED) = 0x34008010;
385 + ODY_CFIFO_W(MMIO_FIXED) = 0x908091df;
386 + ODY_CFIFO_W(MMIO_FIXED) = 0x00000000;
387 + ODY_CFIFO_W(MMIO_FIXED) = 0x00000000;
388 + ODY_CFIFO_W(MMIO_FIXED) = 0x00000000;
389 + ODY_CFIFO_W(MMIO_FIXED) = 0x3f800000;
390 + ODY_CFIFO_W(MMIO_FIXED) = 0x34008000;
391 + odyssey_earlyflush(MMIO_FIXED);
393 + /* odyssey_initbuzzrast */
394 + ODY_CFIFO_W(MMIO_FIXED) = 0x0001203b;
395 + ODY_CFIFO_W(MMIO_FIXED) = 0x00001000;
396 + ODY_CFIFO_W(MMIO_FIXED) = 0x00000000;
397 + ODY_CFIFO_W(MMIO_FIXED) = 0x00001000;
398 + ODY_CFIFO_W(MMIO_FIXED) = 0x00000000;
399 + ODY_CFIFO_W(MMIO_FIXED) = 0x00001000;
400 + ODY_CFIFO_W(MMIO_FIXED) = 0x00000000;
401 + ODY_CFIFO_W(MMIO_FIXED) = 0x00001000;
402 + ODY_CFIFO_W(MMIO_FIXED) = 0x00000000;
403 + ODY_CFIFO_W(MMIO_FIXED) = 0x0001084a;
404 + ODY_CFIFO_W(MMIO_FIXED) = 0x00000080;
405 + ODY_CFIFO_W(MMIO_FIXED) = 0x00000080;
406 + ODY_CFIFO_W(MMIO_FIXED) = 0x00010845;
407 + ODY_CFIFO_W(MMIO_FIXED) = 0x000000ff;
408 + ODY_CFIFO_W(MMIO_FIXED) = 0x000076ff;
409 + ODY_CFIFO_W(MMIO_FIXED) = 0x0001141b;
410 + ODY_CFIFO_W(MMIO_FIXED) = 0x00000001;
411 + ODY_CFIFO_W(MMIO_FIXED) = 0x00000000;
412 + ODY_CFIFO_W(MMIO_FIXED) = 0x00000000;
413 + ODY_CFIFO_W(MMIO_FIXED) = 0x00000000;
414 + ODY_CFIFO_W(MMIO_FIXED) = 0x00000000;
415 + ODY_CFIFO_W(MMIO_FIXED) = 0x00011c16;
416 + ODY_CFIFO_W(MMIO_FIXED) = 0x00000000;
417 + ODY_CFIFO_W(MMIO_FIXED) = 0x00000000;
418 + ODY_CFIFO_W(MMIO_FIXED) = 0x00000000;
419 + ODY_CFIFO_W(MMIO_FIXED) = 0x00000000;
420 + ODY_CFIFO_W(MMIO_FIXED) = 0x03000000;
421 + ODY_CFIFO_W(MMIO_FIXED) = 0x00000000;
422 + ODY_CFIFO_W(MMIO_FIXED) = 0x00000000;
423 + ODY_CFIFO_W(MMIO_FIXED) = 0x00010404;
424 + ODY_CFIFO_W(MMIO_FIXED) = 0x00000000;
425 + ODY_CFIFO_W(MMIO_FIXED) = 0x00011023;
426 + ODY_CFIFO_W(MMIO_FIXED) = 0x00ff0ff0;
427 + ODY_CFIFO_W(MMIO_FIXED) = 0x00ff0ff0;
428 + ODY_CFIFO_W(MMIO_FIXED) = 0x00000000;
429 + ODY_CFIFO_W(MMIO_FIXED) = 0x000000ff;
430 + ODY_CFIFO_W(MMIO_FIXED) = 0x00011017;
431 + ODY_CFIFO_W(MMIO_FIXED) = 0x00002000;
432 + ODY_CFIFO_W(MMIO_FIXED) = 0x00000050;
433 + ODY_CFIFO_W(MMIO_FIXED) = 0x20004950;
434 + ODY_CFIFO_W(MMIO_FIXED) = 0x00000000;
435 + ODY_CFIFO_W(MMIO_FIXED) = 0x0001204b;
436 + ODY_CFIFO_W(MMIO_FIXED) = 0x00000000;
437 + ODY_CFIFO_W(MMIO_FIXED) = 0x004ff3ff;
438 + ODY_CFIFO_W(MMIO_FIXED) = 0x00ffffff;
439 + ODY_CFIFO_W(MMIO_FIXED) = 0x00000000;
440 + ODY_CFIFO_W(MMIO_FIXED) = 0x00ffffff;
441 + ODY_CFIFO_W(MMIO_FIXED) = 0x00000000;
442 + ODY_CFIFO_W(MMIO_FIXED) = 0x00ffffff;
443 + ODY_CFIFO_W(MMIO_FIXED) = 0x00000000;
444 + odyssey_earlyflush(MMIO_FIXED);
446 + /* odyssey_initpbjvc */
447 + odyssey_wait_dfifo(MMIO_FIXED, 0);
448 + for (x = 0; x < 16; x++)
449 + odyssey_dfifo_write(MMIO_FIXED, (0x2900 | x), 0x905215a6);
451 + odyssey_wait_dfifo(MMIO_FIXED, 0);
452 + for (x = 16; x < 32; x++)
453 + odyssey_dfifo_write(MMIO_FIXED, (0x2900 | x), 0x905215a6);
455 + odyssey_wait_dfifo(MMIO_FIXED, 0);
456 + odyssey_dfifo_write(MMIO_FIXED, 0x2581, 0x00000000);
459 + /* odyssey_initpbjgamma */
460 + for (i = 0; i < 0x200; i++) {
462 + odyssey_wait_dfifo(MMIO_FIXED, 0);
464 + v = ((v << 20) | (v << 10) | v);
465 + odyssey_dfifo_write(MMIO_FIXED, (i + 0x1a00), v);
468 + for (i = 0x200; i < 0x300; i++) {
470 + odyssey_wait_dfifo(MMIO_FIXED, 0);
471 + v = (((i - 0x200) >> 1) + 0x80);
472 + v = ((v << 20) | (v << 10) | v);
473 + odyssey_dfifo_write(MMIO_FIXED, (i + 0x1a00), v);
476 + for (i = 0x300; i < 0x600; i++) {
478 + odyssey_wait_dfifo(MMIO_FIXED, 0);
479 + v = ((i - 0x300) + 0x100);
480 + v = ((v << 20) | (v << 10) | v);
481 + odyssey_dfifo_write(MMIO_FIXED, (i + 0x1a00), v);
485 +static int posx = -1, posy;
486 +DEFINE_SPINLOCK(odyssey_earlylock);
488 +odyssey_earlychar(u8 c, u32 f)
490 + unsigned long flags;
492 + spin_lock_irqsave(&odyssey_earlylock, flags);
504 + odyssey_earlyrect(0, posy, 1280, 16, 0x000000);
505 + if ((posy + 16) < 1024)
506 + odyssey_earlyrect(0, (posy + 16),
507 + 1280, 2, 0x0000ff);
510 + odyssey_earlypaintchar(posx, posy,
511 + (u8 *)font_vga_8x16.data +
515 + if (posx >= 1280) {
525 + spin_unlock_irqrestore(&odyssey_earlylock, flags);
529 +odyssey_earlystring(char *s, u32 f)
532 + odyssey_earlychar(*(s++), f);
536 +odyssey_earlyinit(void)
538 + odyssey_earlyhwinit();
539 + odyssey_earlyrect(0, 0, 1280, 1024, 0);
542 + odyssey_earlystring("Odyssey early console ready.\n", 0xffffff);
545 +MODULE_AUTHOR("Stanislaw Skowronek <skylark@unaligned.org>");
546 +MODULE_AUTHOR("Joshua Kinard <kumba@gentoo.org>");
547 +MODULE_DESCRIPTION("SGI Odyssey (Buzz) Early Printk Driver");
548 +MODULE_LICENSE("GPL");
549 +MODULE_VERSION("0.42.1");
550 +MODULE_ALIAS("platform:odyssey_early");