11da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* 21da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * valkyriefb.h: Constants of all sorts for valkyriefb 31da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * 41da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * Created 8 August 1998 by 51da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * Martin Costabel <costabel@wanadoo.fr> and Kevin Schoedel 61da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * 71da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * Vmode-switching changes and vmode 15/17 modifications created 29 August 81da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * 1998 by Barry K. Nathan <barryn@pobox.com>. 91da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * 101da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * vmode 10 changed by Steven Borley <sjb@salix.demon.co.uk>, 14 mai 2000 111da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * 121da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * Ported to 68k Macintosh by David Huggins-Daines <dhd@debian.org> 131da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * 141da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * This program is free software; you can redistribute it and/or 151da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * modify it under the terms of the GNU General Public License 161da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * as published by the Free Software Foundation; either version 171da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * 2 of the License, or (at your option) any later version. 181da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * 191da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * Based directly on: 201da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * 211da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * controlfb.h: Constants of all sorts for controlfb 221da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * Copyright (C) 1998 Daniel Jacobowitz <dan@debian.org> 231da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * 241da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * pmc-valkyrie.h: Console support for PowerMac "control" display adaptor. 251da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * Copyright (C) 1997 Paul Mackerras. 261da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * 271da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * pmc-valkyrie.c: Console support for PowerMac "control" display adaptor. 281da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * Copyright (C) 1997 Paul Mackerras. 291da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * 301da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * and indirectly from: 311da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * 321da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * pmc-control.h: Console support for PowerMac "control" display adaptor. 331da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * Copyright (C) 1997 Paul Mackerras. 341da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * 351da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * pmc-control.c: Console support for PowerMac "control" display adaptor. 361da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * Copyright (C) 1996 Paul Mackerras. 371da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * 381da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * platinumfb.c: Console support for PowerMac "platinum" display adaptor. 391da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * Copyright (C) 1998 Jon Howell 401da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds */ 411da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 421da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#ifdef CONFIG_MAC 431da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* Valkyrie registers are word-aligned on m68k */ 441da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define VALKYRIE_REG_PADSIZE 3 451da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#else 461da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define VALKYRIE_REG_PADSIZE 7 471da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#endif 481da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 491da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* 501da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * Structure of the registers for the Valkyrie colormap registers. 511da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds */ 521da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldsstruct cmap_regs { 531da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds unsigned char addr; 541da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds char pad1[VALKYRIE_REG_PADSIZE]; 551da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds unsigned char lut; 561da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds}; 571da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 581da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* 591da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * Structure of the registers for the "valkyrie" display adaptor. 601da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds */ 611da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 621da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldsstruct vpreg { /* padded register */ 631da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds unsigned char r; 641da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds char pad[VALKYRIE_REG_PADSIZE]; 651da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds}; 661da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 671da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 681da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldsstruct valkyrie_regs { 691da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds struct vpreg mode; 701da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds struct vpreg depth; 711da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds struct vpreg status; 721da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds struct vpreg reg3; 731da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds struct vpreg intr; 741da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds struct vpreg reg5; 751da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds struct vpreg intr_enb; 761da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds struct vpreg msense; 771da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds}; 781da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 791da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* 801da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * Register initialization tables for the valkyrie display. 811da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * 821da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * Dot clock rate is 831da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * 3.9064MHz * 2**clock_params[2] * clock_params[1] / clock_params[0]. 841da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds */ 851da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldsstruct valkyrie_regvals { 861da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds unsigned char mode; 871da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds unsigned char clock_params[3]; 881da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds int pitch[2]; /* bytes/line, indexed by color_mode */ 891da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds int hres; 901da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds int vres; 911da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds}; 921da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 931da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#ifndef CONFIG_MAC 941da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* Register values for 1024x768, 75Hz mode (17) */ 951da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* I'm not sure which mode this is (16 or 17), so I'm defining it as 17, 961da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * since the equivalent mode in controlfb (which I adapted this from) is 971da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * also 17. Just because MacOS can't do this on Valkyrie doesn't mean we 981da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * can't! :) 991da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * 1001da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * I was going to use 12, 31, 3, which I found by myself, but instead I'm 1011da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * using 11, 28, 3 like controlfb, for consistency's sake. 1021da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds */ 1031da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 1041da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldsstatic struct valkyrie_regvals valkyrie_reg_init_17 = { 1051da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 15, 1061da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds { 11, 28, 3 }, /* pixel clock = 79.55MHz for V=74.50Hz */ 1071da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds { 1024, 0 }, 1081da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 1024, 768 1091da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds}; 1101da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 1111da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* Register values for 1024x768, 72Hz mode (15) */ 1121da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* This used to be 12, 30, 3 for pixel clock = 78.12MHz for V=72.12Hz, but 1131da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * that didn't match MacOS in the same video mode on this chip, and it also 1141da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * caused the 15" Apple Studio Display to not work in this mode. While this 1151da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * mode still doesn't match MacOS exactly (as far as I can tell), it's a lot 1161da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * closer now, and it works with the Apple Studio Display. 1171da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * 1181da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * Yes, even though MacOS calls it "72Hz", in reality it's about 70Hz. 1191da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds */ 1201da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldsstatic struct valkyrie_regvals valkyrie_reg_init_15 = { 1211da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 15, 1221da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds { 12, 29, 3 }, /* pixel clock = 75.52MHz for V=69.71Hz? */ 1231da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds /* I interpolated the V=69.71 from the vmode 14 and old 15 1241da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * numbers. Is this result correct? 1251da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds */ 1261da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds { 1024, 0 }, 1271da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 1024, 768 1281da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds}; 1291da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 1301da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* Register values for 1024x768, 60Hz mode (14) */ 1311da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldsstatic struct valkyrie_regvals valkyrie_reg_init_14 = { 1321da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 14, 1331da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds { 15, 31, 3 }, /* pixel clock = 64.58MHz for V=59.62Hz */ 1341da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds { 1024, 0 }, 1351da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 1024, 768 1361da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds}; 13711e8faca2e501c25d2f98c1b9534776a9a9704c5Finn Thain#endif /* !defined CONFIG_MAC */ 1381da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 1391da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* Register values for 832x624, 75Hz mode (13) */ 1401da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldsstatic struct valkyrie_regvals valkyrie_reg_init_13 = { 1411da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 9, 1421da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds { 23, 42, 3 }, /* pixel clock = 57.07MHz for V=74.27Hz */ 1431da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds { 832, 0 }, 1441da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 832, 624 1451da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds}; 1461da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 14711e8faca2e501c25d2f98c1b9534776a9a9704c5Finn Thain/* Register values for 800x600, 72Hz mode (11) */ 14811e8faca2e501c25d2f98c1b9534776a9a9704c5Finn Thainstatic struct valkyrie_regvals valkyrie_reg_init_11 = { 14911e8faca2e501c25d2f98c1b9534776a9a9704c5Finn Thain 13, 15011e8faca2e501c25d2f98c1b9534776a9a9704c5Finn Thain { 17, 27, 3 }, /* pixel clock = 49.63MHz for V=71.66Hz */ 15111e8faca2e501c25d2f98c1b9534776a9a9704c5Finn Thain { 800, 0 }, 15211e8faca2e501c25d2f98c1b9534776a9a9704c5Finn Thain 800, 600 15311e8faca2e501c25d2f98c1b9534776a9a9704c5Finn Thain}; 15411e8faca2e501c25d2f98c1b9534776a9a9704c5Finn Thain 1551da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* Register values for 800x600, 60Hz mode (10) */ 1561da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldsstatic struct valkyrie_regvals valkyrie_reg_init_10 = { 1571da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 12, 1581da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds { 25, 32, 3 }, /* pixel clock = 40.0015MHz, 1591da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds used to be 20,53,2, pixel clock 41.41MHz for V=59.78Hz */ 1601da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds { 800, 1600 }, 1611da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 800, 600 1621da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds}; 1631da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 1641da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* Register values for 640x480, 67Hz mode (6) */ 1651da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldsstatic struct valkyrie_regvals valkyrie_reg_init_6 = { 1661da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 6, 1671da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds { 14, 27, 2 }, /* pixel clock = 30.13MHz for V=66.43Hz */ 1681da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds { 640, 1280 }, 1691da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 640, 480 1701da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds}; 1711da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 1721da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* Register values for 640x480, 60Hz mode (5) */ 1731da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldsstatic struct valkyrie_regvals valkyrie_reg_init_5 = { 1741da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 11, 1751da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds { 23, 37, 2 }, /* pixel clock = 25.14MHz for V=59.85Hz */ 1761da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds { 640, 1280 }, 1771da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 640, 480 1781da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds}; 1791da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds 1801da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldsstatic struct valkyrie_regvals *valkyrie_reg_init[VMODE_MAX] = { 1811da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds NULL, 1821da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds NULL, 1831da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds NULL, 1841da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds NULL, 1851da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds &valkyrie_reg_init_5, 1861da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds &valkyrie_reg_init_6, 1871da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds NULL, 1881da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds NULL, 1891da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds NULL, 1901da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds &valkyrie_reg_init_10, 1911da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds &valkyrie_reg_init_11, 1921da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds NULL, 1931da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds &valkyrie_reg_init_13, 19411e8faca2e501c25d2f98c1b9534776a9a9704c5Finn Thain#ifndef CONFIG_MAC 1951da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds &valkyrie_reg_init_14, 1961da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds &valkyrie_reg_init_15, 1971da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds NULL, 1981da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds &valkyrie_reg_init_17, 1991da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#endif 2001da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds}; 201