1*e3adcf8fSFrançois Tigeot /* 2*e3adcf8fSFrançois Tigeot * Copyright © 2006 Intel Corporation 3*e3adcf8fSFrançois Tigeot * 4*e3adcf8fSFrançois Tigeot * Permission is hereby granted, free of charge, to any person obtaining a 5*e3adcf8fSFrançois Tigeot * copy of this software and associated documentation files (the "Software"), 6*e3adcf8fSFrançois Tigeot * to deal in the Software without restriction, including without limitation 7*e3adcf8fSFrançois Tigeot * the rights to use, copy, modify, merge, publish, distribute, sublicense, 8*e3adcf8fSFrançois Tigeot * and/or sell copies of the Software, and to permit persons to whom the 9*e3adcf8fSFrançois Tigeot * Software is furnished to do so, subject to the following conditions: 10*e3adcf8fSFrançois Tigeot * 11*e3adcf8fSFrançois Tigeot * The above copyright notice and this permission notice (including the next 12*e3adcf8fSFrançois Tigeot * paragraph) shall be included in all copies or substantial portions of the 13*e3adcf8fSFrançois Tigeot * Software. 14*e3adcf8fSFrançois Tigeot * 15*e3adcf8fSFrançois Tigeot * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16*e3adcf8fSFrançois Tigeot * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17*e3adcf8fSFrançois Tigeot * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18*e3adcf8fSFrançois Tigeot * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19*e3adcf8fSFrançois Tigeot * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20*e3adcf8fSFrançois Tigeot * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21*e3adcf8fSFrançois Tigeot * SOFTWARE. 22*e3adcf8fSFrançois Tigeot * 23*e3adcf8fSFrançois Tigeot * Authors: 24*e3adcf8fSFrançois Tigeot * Eric Anholt <eric@anholt.net> 25*e3adcf8fSFrançois Tigeot * 26*e3adcf8fSFrançois Tigeot * $FreeBSD: src/sys/dev/drm2/i915/intel_bios.h,v 1.1 2012/05/22 11:07:44 kib Exp $ 27*e3adcf8fSFrançois Tigeot */ 28*e3adcf8fSFrançois Tigeot 29*e3adcf8fSFrançois Tigeot #ifndef _I830_BIOS_H_ 30*e3adcf8fSFrançois Tigeot #define _I830_BIOS_H_ 31*e3adcf8fSFrançois Tigeot 32*e3adcf8fSFrançois Tigeot #include <dev/drm/drmP.h> 33*e3adcf8fSFrançois Tigeot 34*e3adcf8fSFrançois Tigeot struct vbt_header { 35*e3adcf8fSFrançois Tigeot u8 signature[20]; /**< Always starts with 'VBT$' */ 36*e3adcf8fSFrançois Tigeot u16 version; /**< decimal */ 37*e3adcf8fSFrançois Tigeot u16 header_size; /**< in bytes */ 38*e3adcf8fSFrançois Tigeot u16 vbt_size; /**< in bytes */ 39*e3adcf8fSFrançois Tigeot u8 vbt_checksum; 40*e3adcf8fSFrançois Tigeot u8 reserved0; 41*e3adcf8fSFrançois Tigeot u32 bdb_offset; /**< from beginning of VBT */ 42*e3adcf8fSFrançois Tigeot u32 aim_offset[4]; /**< from beginning of VBT */ 43*e3adcf8fSFrançois Tigeot } __attribute__((packed)); 44*e3adcf8fSFrançois Tigeot 45*e3adcf8fSFrançois Tigeot struct bdb_header { 46*e3adcf8fSFrançois Tigeot u8 signature[16]; /**< Always 'BIOS_DATA_BLOCK' */ 47*e3adcf8fSFrançois Tigeot u16 version; /**< decimal */ 48*e3adcf8fSFrançois Tigeot u16 header_size; /**< in bytes */ 49*e3adcf8fSFrançois Tigeot u16 bdb_size; /**< in bytes */ 50*e3adcf8fSFrançois Tigeot }; 51*e3adcf8fSFrançois Tigeot 52*e3adcf8fSFrançois Tigeot /* strictly speaking, this is a "skip" block, but it has interesting info */ 53*e3adcf8fSFrançois Tigeot struct vbios_data { 54*e3adcf8fSFrançois Tigeot u8 type; /* 0 == desktop, 1 == mobile */ 55*e3adcf8fSFrançois Tigeot u8 relstage; 56*e3adcf8fSFrançois Tigeot u8 chipset; 57*e3adcf8fSFrançois Tigeot u8 lvds_present:1; 58*e3adcf8fSFrançois Tigeot u8 tv_present:1; 59*e3adcf8fSFrançois Tigeot u8 rsvd2:6; /* finish byte */ 60*e3adcf8fSFrançois Tigeot u8 rsvd3[4]; 61*e3adcf8fSFrançois Tigeot u8 signon[155]; 62*e3adcf8fSFrançois Tigeot u8 copyright[61]; 63*e3adcf8fSFrançois Tigeot u16 code_segment; 64*e3adcf8fSFrançois Tigeot u8 dos_boot_mode; 65*e3adcf8fSFrançois Tigeot u8 bandwidth_percent; 66*e3adcf8fSFrançois Tigeot u8 rsvd4; /* popup memory size */ 67*e3adcf8fSFrançois Tigeot u8 resize_pci_bios; 68*e3adcf8fSFrançois Tigeot u8 rsvd5; /* is crt already on ddc2 */ 69*e3adcf8fSFrançois Tigeot } __attribute__((packed)); 70*e3adcf8fSFrançois Tigeot 71*e3adcf8fSFrançois Tigeot /* 72*e3adcf8fSFrançois Tigeot * There are several types of BIOS data blocks (BDBs), each block has 73*e3adcf8fSFrançois Tigeot * an ID and size in the first 3 bytes (ID in first, size in next 2). 74*e3adcf8fSFrançois Tigeot * Known types are listed below. 75*e3adcf8fSFrançois Tigeot */ 76*e3adcf8fSFrançois Tigeot #define BDB_GENERAL_FEATURES 1 77*e3adcf8fSFrançois Tigeot #define BDB_GENERAL_DEFINITIONS 2 78*e3adcf8fSFrançois Tigeot #define BDB_OLD_TOGGLE_LIST 3 79*e3adcf8fSFrançois Tigeot #define BDB_MODE_SUPPORT_LIST 4 80*e3adcf8fSFrançois Tigeot #define BDB_GENERIC_MODE_TABLE 5 81*e3adcf8fSFrançois Tigeot #define BDB_EXT_MMIO_REGS 6 82*e3adcf8fSFrançois Tigeot #define BDB_SWF_IO 7 83*e3adcf8fSFrançois Tigeot #define BDB_SWF_MMIO 8 84*e3adcf8fSFrançois Tigeot #define BDB_DOT_CLOCK_TABLE 9 85*e3adcf8fSFrançois Tigeot #define BDB_MODE_REMOVAL_TABLE 10 86*e3adcf8fSFrançois Tigeot #define BDB_CHILD_DEVICE_TABLE 11 87*e3adcf8fSFrançois Tigeot #define BDB_DRIVER_FEATURES 12 88*e3adcf8fSFrançois Tigeot #define BDB_DRIVER_PERSISTENCE 13 89*e3adcf8fSFrançois Tigeot #define BDB_EXT_TABLE_PTRS 14 90*e3adcf8fSFrançois Tigeot #define BDB_DOT_CLOCK_OVERRIDE 15 91*e3adcf8fSFrançois Tigeot #define BDB_DISPLAY_SELECT 16 92*e3adcf8fSFrançois Tigeot /* 17 rsvd */ 93*e3adcf8fSFrançois Tigeot #define BDB_DRIVER_ROTATION 18 94*e3adcf8fSFrançois Tigeot #define BDB_DISPLAY_REMOVE 19 95*e3adcf8fSFrançois Tigeot #define BDB_OEM_CUSTOM 20 96*e3adcf8fSFrançois Tigeot #define BDB_EFP_LIST 21 /* workarounds for VGA hsync/vsync */ 97*e3adcf8fSFrançois Tigeot #define BDB_SDVO_LVDS_OPTIONS 22 98*e3adcf8fSFrançois Tigeot #define BDB_SDVO_PANEL_DTDS 23 99*e3adcf8fSFrançois Tigeot #define BDB_SDVO_LVDS_PNP_IDS 24 100*e3adcf8fSFrançois Tigeot #define BDB_SDVO_LVDS_POWER_SEQ 25 101*e3adcf8fSFrançois Tigeot #define BDB_TV_OPTIONS 26 102*e3adcf8fSFrançois Tigeot #define BDB_EDP 27 103*e3adcf8fSFrançois Tigeot #define BDB_LVDS_OPTIONS 40 104*e3adcf8fSFrançois Tigeot #define BDB_LVDS_LFP_DATA_PTRS 41 105*e3adcf8fSFrançois Tigeot #define BDB_LVDS_LFP_DATA 42 106*e3adcf8fSFrançois Tigeot #define BDB_LVDS_BACKLIGHT 43 107*e3adcf8fSFrançois Tigeot #define BDB_LVDS_POWER 44 108*e3adcf8fSFrançois Tigeot #define BDB_SKIP 254 /* VBIOS private block, ignore */ 109*e3adcf8fSFrançois Tigeot 110*e3adcf8fSFrançois Tigeot struct bdb_general_features { 111*e3adcf8fSFrançois Tigeot /* bits 1 */ 112*e3adcf8fSFrançois Tigeot u8 panel_fitting:2; 113*e3adcf8fSFrançois Tigeot u8 flexaim:1; 114*e3adcf8fSFrançois Tigeot u8 msg_enable:1; 115*e3adcf8fSFrançois Tigeot u8 clear_screen:3; 116*e3adcf8fSFrançois Tigeot u8 color_flip:1; 117*e3adcf8fSFrançois Tigeot 118*e3adcf8fSFrançois Tigeot /* bits 2 */ 119*e3adcf8fSFrançois Tigeot u8 download_ext_vbt:1; 120*e3adcf8fSFrançois Tigeot u8 enable_ssc:1; 121*e3adcf8fSFrançois Tigeot u8 ssc_freq:1; 122*e3adcf8fSFrançois Tigeot u8 enable_lfp_on_override:1; 123*e3adcf8fSFrançois Tigeot u8 disable_ssc_ddt:1; 124*e3adcf8fSFrançois Tigeot u8 rsvd7:1; 125*e3adcf8fSFrançois Tigeot u8 display_clock_mode:1; 126*e3adcf8fSFrançois Tigeot u8 rsvd8:1; /* finish byte */ 127*e3adcf8fSFrançois Tigeot 128*e3adcf8fSFrançois Tigeot /* bits 3 */ 129*e3adcf8fSFrançois Tigeot u8 disable_smooth_vision:1; 130*e3adcf8fSFrançois Tigeot u8 single_dvi:1; 131*e3adcf8fSFrançois Tigeot u8 rsvd9:6; /* finish byte */ 132*e3adcf8fSFrançois Tigeot 133*e3adcf8fSFrançois Tigeot /* bits 4 */ 134*e3adcf8fSFrançois Tigeot u8 legacy_monitor_detect; 135*e3adcf8fSFrançois Tigeot 136*e3adcf8fSFrançois Tigeot /* bits 5 */ 137*e3adcf8fSFrançois Tigeot u8 int_crt_support:1; 138*e3adcf8fSFrançois Tigeot u8 int_tv_support:1; 139*e3adcf8fSFrançois Tigeot u8 int_efp_support:1; 140*e3adcf8fSFrançois Tigeot u8 dp_ssc_enb:1; /* PCH attached eDP supports SSC */ 141*e3adcf8fSFrançois Tigeot u8 dp_ssc_freq:1; /* SSC freq for PCH attached eDP */ 142*e3adcf8fSFrançois Tigeot u8 rsvd11:3; /* finish byte */ 143*e3adcf8fSFrançois Tigeot } __attribute__((packed)); 144*e3adcf8fSFrançois Tigeot 145*e3adcf8fSFrançois Tigeot /* pre-915 */ 146*e3adcf8fSFrançois Tigeot #define GPIO_PIN_DVI_LVDS 0x03 /* "DVI/LVDS DDC GPIO pins" */ 147*e3adcf8fSFrançois Tigeot #define GPIO_PIN_ADD_I2C 0x05 /* "ADDCARD I2C GPIO pins" */ 148*e3adcf8fSFrançois Tigeot #define GPIO_PIN_ADD_DDC 0x04 /* "ADDCARD DDC GPIO pins" */ 149*e3adcf8fSFrançois Tigeot #define GPIO_PIN_ADD_DDC_I2C 0x06 /* "ADDCARD DDC/I2C GPIO pins" */ 150*e3adcf8fSFrançois Tigeot 151*e3adcf8fSFrançois Tigeot /* Pre 915 */ 152*e3adcf8fSFrançois Tigeot #define DEVICE_TYPE_NONE 0x00 153*e3adcf8fSFrançois Tigeot #define DEVICE_TYPE_CRT 0x01 154*e3adcf8fSFrançois Tigeot #define DEVICE_TYPE_TV 0x09 155*e3adcf8fSFrançois Tigeot #define DEVICE_TYPE_EFP 0x12 156*e3adcf8fSFrançois Tigeot #define DEVICE_TYPE_LFP 0x22 157*e3adcf8fSFrançois Tigeot /* On 915+ */ 158*e3adcf8fSFrançois Tigeot #define DEVICE_TYPE_CRT_DPMS 0x6001 159*e3adcf8fSFrançois Tigeot #define DEVICE_TYPE_CRT_DPMS_HOTPLUG 0x4001 160*e3adcf8fSFrançois Tigeot #define DEVICE_TYPE_TV_COMPOSITE 0x0209 161*e3adcf8fSFrançois Tigeot #define DEVICE_TYPE_TV_MACROVISION 0x0289 162*e3adcf8fSFrançois Tigeot #define DEVICE_TYPE_TV_RF_COMPOSITE 0x020c 163*e3adcf8fSFrançois Tigeot #define DEVICE_TYPE_TV_SVIDEO_COMPOSITE 0x0609 164*e3adcf8fSFrançois Tigeot #define DEVICE_TYPE_TV_SCART 0x0209 165*e3adcf8fSFrançois Tigeot #define DEVICE_TYPE_TV_CODEC_HOTPLUG_PWR 0x6009 166*e3adcf8fSFrançois Tigeot #define DEVICE_TYPE_EFP_HOTPLUG_PWR 0x6012 167*e3adcf8fSFrançois Tigeot #define DEVICE_TYPE_EFP_DVI_HOTPLUG_PWR 0x6052 168*e3adcf8fSFrançois Tigeot #define DEVICE_TYPE_EFP_DVI_I 0x6053 169*e3adcf8fSFrançois Tigeot #define DEVICE_TYPE_EFP_DVI_D_DUAL 0x6152 170*e3adcf8fSFrançois Tigeot #define DEVICE_TYPE_EFP_DVI_D_HDCP 0x60d2 171*e3adcf8fSFrançois Tigeot #define DEVICE_TYPE_OPENLDI_HOTPLUG_PWR 0x6062 172*e3adcf8fSFrançois Tigeot #define DEVICE_TYPE_OPENLDI_DUALPIX 0x6162 173*e3adcf8fSFrançois Tigeot #define DEVICE_TYPE_LFP_PANELLINK 0x5012 174*e3adcf8fSFrançois Tigeot #define DEVICE_TYPE_LFP_CMOS_PWR 0x5042 175*e3adcf8fSFrançois Tigeot #define DEVICE_TYPE_LFP_LVDS_PWR 0x5062 176*e3adcf8fSFrançois Tigeot #define DEVICE_TYPE_LFP_LVDS_DUAL 0x5162 177*e3adcf8fSFrançois Tigeot #define DEVICE_TYPE_LFP_LVDS_DUAL_HDCP 0x51e2 178*e3adcf8fSFrançois Tigeot 179*e3adcf8fSFrançois Tigeot #define DEVICE_CFG_NONE 0x00 180*e3adcf8fSFrançois Tigeot #define DEVICE_CFG_12BIT_DVOB 0x01 181*e3adcf8fSFrançois Tigeot #define DEVICE_CFG_12BIT_DVOC 0x02 182*e3adcf8fSFrançois Tigeot #define DEVICE_CFG_24BIT_DVOBC 0x09 183*e3adcf8fSFrançois Tigeot #define DEVICE_CFG_24BIT_DVOCB 0x0a 184*e3adcf8fSFrançois Tigeot #define DEVICE_CFG_DUAL_DVOB 0x11 185*e3adcf8fSFrançois Tigeot #define DEVICE_CFG_DUAL_DVOC 0x12 186*e3adcf8fSFrançois Tigeot #define DEVICE_CFG_DUAL_DVOBC 0x13 187*e3adcf8fSFrançois Tigeot #define DEVICE_CFG_DUAL_LINK_DVOBC 0x19 188*e3adcf8fSFrançois Tigeot #define DEVICE_CFG_DUAL_LINK_DVOCB 0x1a 189*e3adcf8fSFrançois Tigeot 190*e3adcf8fSFrançois Tigeot #define DEVICE_WIRE_NONE 0x00 191*e3adcf8fSFrançois Tigeot #define DEVICE_WIRE_DVOB 0x01 192*e3adcf8fSFrançois Tigeot #define DEVICE_WIRE_DVOC 0x02 193*e3adcf8fSFrançois Tigeot #define DEVICE_WIRE_DVOBC 0x03 194*e3adcf8fSFrançois Tigeot #define DEVICE_WIRE_DVOBB 0x05 195*e3adcf8fSFrançois Tigeot #define DEVICE_WIRE_DVOCC 0x06 196*e3adcf8fSFrançois Tigeot #define DEVICE_WIRE_DVOB_MASTER 0x0d 197*e3adcf8fSFrançois Tigeot #define DEVICE_WIRE_DVOC_MASTER 0x0e 198*e3adcf8fSFrançois Tigeot 199*e3adcf8fSFrançois Tigeot #define DEVICE_PORT_DVOA 0x00 /* none on 845+ */ 200*e3adcf8fSFrançois Tigeot #define DEVICE_PORT_DVOB 0x01 201*e3adcf8fSFrançois Tigeot #define DEVICE_PORT_DVOC 0x02 202*e3adcf8fSFrançois Tigeot 203*e3adcf8fSFrançois Tigeot struct child_device_config { 204*e3adcf8fSFrançois Tigeot u16 handle; 205*e3adcf8fSFrançois Tigeot u16 device_type; 206*e3adcf8fSFrançois Tigeot u8 device_id[10]; /* ascii string */ 207*e3adcf8fSFrançois Tigeot u16 addin_offset; 208*e3adcf8fSFrançois Tigeot u8 dvo_port; /* See Device_PORT_* above */ 209*e3adcf8fSFrançois Tigeot u8 i2c_pin; 210*e3adcf8fSFrançois Tigeot u8 slave_addr; 211*e3adcf8fSFrançois Tigeot u8 ddc_pin; 212*e3adcf8fSFrançois Tigeot u16 edid_ptr; 213*e3adcf8fSFrançois Tigeot u8 dvo_cfg; /* See DEVICE_CFG_* above */ 214*e3adcf8fSFrançois Tigeot u8 dvo2_port; 215*e3adcf8fSFrançois Tigeot u8 i2c2_pin; 216*e3adcf8fSFrançois Tigeot u8 slave2_addr; 217*e3adcf8fSFrançois Tigeot u8 ddc2_pin; 218*e3adcf8fSFrançois Tigeot u8 capabilities; 219*e3adcf8fSFrançois Tigeot u8 dvo_wiring;/* See DEVICE_WIRE_* above */ 220*e3adcf8fSFrançois Tigeot u8 dvo2_wiring; 221*e3adcf8fSFrançois Tigeot u16 extended_type; 222*e3adcf8fSFrançois Tigeot u8 dvo_function; 223*e3adcf8fSFrançois Tigeot } __attribute__((packed)); 224*e3adcf8fSFrançois Tigeot 225*e3adcf8fSFrançois Tigeot struct bdb_general_definitions { 226*e3adcf8fSFrançois Tigeot /* DDC GPIO */ 227*e3adcf8fSFrançois Tigeot u8 crt_ddc_gmbus_pin; 228*e3adcf8fSFrançois Tigeot 229*e3adcf8fSFrançois Tigeot /* DPMS bits */ 230*e3adcf8fSFrançois Tigeot u8 dpms_acpi:1; 231*e3adcf8fSFrançois Tigeot u8 skip_boot_crt_detect:1; 232*e3adcf8fSFrançois Tigeot u8 dpms_aim:1; 233*e3adcf8fSFrançois Tigeot u8 rsvd1:5; /* finish byte */ 234*e3adcf8fSFrançois Tigeot 235*e3adcf8fSFrançois Tigeot /* boot device bits */ 236*e3adcf8fSFrançois Tigeot u8 boot_display[2]; 237*e3adcf8fSFrançois Tigeot u8 child_dev_size; 238*e3adcf8fSFrançois Tigeot 239*e3adcf8fSFrançois Tigeot /* 240*e3adcf8fSFrançois Tigeot * Device info: 241*e3adcf8fSFrançois Tigeot * If TV is present, it'll be at devices[0]. 242*e3adcf8fSFrançois Tigeot * LVDS will be next, either devices[0] or [1], if present. 243*e3adcf8fSFrançois Tigeot * On some platforms the number of device is 6. But could be as few as 244*e3adcf8fSFrançois Tigeot * 4 if both TV and LVDS are missing. 245*e3adcf8fSFrançois Tigeot * And the device num is related with the size of general definition 246*e3adcf8fSFrançois Tigeot * block. It is obtained by using the following formula: 247*e3adcf8fSFrançois Tigeot * number = (block_size - sizeof(bdb_general_definitions))/ 248*e3adcf8fSFrançois Tigeot * sizeof(child_device_config); 249*e3adcf8fSFrançois Tigeot */ 250*e3adcf8fSFrançois Tigeot struct child_device_config devices[0]; 251*e3adcf8fSFrançois Tigeot } __attribute__((packed)); 252*e3adcf8fSFrançois Tigeot 253*e3adcf8fSFrançois Tigeot struct bdb_lvds_options { 254*e3adcf8fSFrançois Tigeot u8 panel_type; 255*e3adcf8fSFrançois Tigeot u8 rsvd1; 256*e3adcf8fSFrançois Tigeot /* LVDS capabilities, stored in a dword */ 257*e3adcf8fSFrançois Tigeot u8 pfit_mode:2; 258*e3adcf8fSFrançois Tigeot u8 pfit_text_mode_enhanced:1; 259*e3adcf8fSFrançois Tigeot u8 pfit_gfx_mode_enhanced:1; 260*e3adcf8fSFrançois Tigeot u8 pfit_ratio_auto:1; 261*e3adcf8fSFrançois Tigeot u8 pixel_dither:1; 262*e3adcf8fSFrançois Tigeot u8 lvds_edid:1; 263*e3adcf8fSFrançois Tigeot u8 rsvd2:1; 264*e3adcf8fSFrançois Tigeot u8 rsvd4; 265*e3adcf8fSFrançois Tigeot } __attribute__((packed)); 266*e3adcf8fSFrançois Tigeot 267*e3adcf8fSFrançois Tigeot /* LFP pointer table contains entries to the struct below */ 268*e3adcf8fSFrançois Tigeot struct bdb_lvds_lfp_data_ptr { 269*e3adcf8fSFrançois Tigeot u16 fp_timing_offset; /* offsets are from start of bdb */ 270*e3adcf8fSFrançois Tigeot u8 fp_table_size; 271*e3adcf8fSFrançois Tigeot u16 dvo_timing_offset; 272*e3adcf8fSFrançois Tigeot u8 dvo_table_size; 273*e3adcf8fSFrançois Tigeot u16 panel_pnp_id_offset; 274*e3adcf8fSFrançois Tigeot u8 pnp_table_size; 275*e3adcf8fSFrançois Tigeot } __attribute__((packed)); 276*e3adcf8fSFrançois Tigeot 277*e3adcf8fSFrançois Tigeot struct bdb_lvds_lfp_data_ptrs { 278*e3adcf8fSFrançois Tigeot u8 lvds_entries; /* followed by one or more lvds_data_ptr structs */ 279*e3adcf8fSFrançois Tigeot struct bdb_lvds_lfp_data_ptr ptr[16]; 280*e3adcf8fSFrançois Tigeot } __attribute__((packed)); 281*e3adcf8fSFrançois Tigeot 282*e3adcf8fSFrançois Tigeot /* LFP data has 3 blocks per entry */ 283*e3adcf8fSFrançois Tigeot struct lvds_fp_timing { 284*e3adcf8fSFrançois Tigeot u16 x_res; 285*e3adcf8fSFrançois Tigeot u16 y_res; 286*e3adcf8fSFrançois Tigeot u32 lvds_reg; 287*e3adcf8fSFrançois Tigeot u32 lvds_reg_val; 288*e3adcf8fSFrançois Tigeot u32 pp_on_reg; 289*e3adcf8fSFrançois Tigeot u32 pp_on_reg_val; 290*e3adcf8fSFrançois Tigeot u32 pp_off_reg; 291*e3adcf8fSFrançois Tigeot u32 pp_off_reg_val; 292*e3adcf8fSFrançois Tigeot u32 pp_cycle_reg; 293*e3adcf8fSFrançois Tigeot u32 pp_cycle_reg_val; 294*e3adcf8fSFrançois Tigeot u32 pfit_reg; 295*e3adcf8fSFrançois Tigeot u32 pfit_reg_val; 296*e3adcf8fSFrançois Tigeot u16 terminator; 297*e3adcf8fSFrançois Tigeot } __attribute__((packed)); 298*e3adcf8fSFrançois Tigeot 299*e3adcf8fSFrançois Tigeot struct lvds_dvo_timing { 300*e3adcf8fSFrançois Tigeot u16 clock; /**< In 10khz */ 301*e3adcf8fSFrançois Tigeot u8 hactive_lo; 302*e3adcf8fSFrançois Tigeot u8 hblank_lo; 303*e3adcf8fSFrançois Tigeot u8 hblank_hi:4; 304*e3adcf8fSFrançois Tigeot u8 hactive_hi:4; 305*e3adcf8fSFrançois Tigeot u8 vactive_lo; 306*e3adcf8fSFrançois Tigeot u8 vblank_lo; 307*e3adcf8fSFrançois Tigeot u8 vblank_hi:4; 308*e3adcf8fSFrançois Tigeot u8 vactive_hi:4; 309*e3adcf8fSFrançois Tigeot u8 hsync_off_lo; 310*e3adcf8fSFrançois Tigeot u8 hsync_pulse_width; 311*e3adcf8fSFrançois Tigeot u8 vsync_pulse_width:4; 312*e3adcf8fSFrançois Tigeot u8 vsync_off:4; 313*e3adcf8fSFrançois Tigeot u8 rsvd0:6; 314*e3adcf8fSFrançois Tigeot u8 hsync_off_hi:2; 315*e3adcf8fSFrançois Tigeot u8 h_image; 316*e3adcf8fSFrançois Tigeot u8 v_image; 317*e3adcf8fSFrançois Tigeot u8 max_hv; 318*e3adcf8fSFrançois Tigeot u8 h_border; 319*e3adcf8fSFrançois Tigeot u8 v_border; 320*e3adcf8fSFrançois Tigeot u8 rsvd1:3; 321*e3adcf8fSFrançois Tigeot u8 digital:2; 322*e3adcf8fSFrançois Tigeot u8 vsync_positive:1; 323*e3adcf8fSFrançois Tigeot u8 hsync_positive:1; 324*e3adcf8fSFrançois Tigeot u8 rsvd2:1; 325*e3adcf8fSFrançois Tigeot } __attribute__((packed)); 326*e3adcf8fSFrançois Tigeot 327*e3adcf8fSFrançois Tigeot struct lvds_pnp_id { 328*e3adcf8fSFrançois Tigeot u16 mfg_name; 329*e3adcf8fSFrançois Tigeot u16 product_code; 330*e3adcf8fSFrançois Tigeot u32 serial; 331*e3adcf8fSFrançois Tigeot u8 mfg_week; 332*e3adcf8fSFrançois Tigeot u8 mfg_year; 333*e3adcf8fSFrançois Tigeot } __attribute__((packed)); 334*e3adcf8fSFrançois Tigeot 335*e3adcf8fSFrançois Tigeot struct bdb_lvds_lfp_data_entry { 336*e3adcf8fSFrançois Tigeot struct lvds_fp_timing fp_timing; 337*e3adcf8fSFrançois Tigeot struct lvds_dvo_timing dvo_timing; 338*e3adcf8fSFrançois Tigeot struct lvds_pnp_id pnp_id; 339*e3adcf8fSFrançois Tigeot } __attribute__((packed)); 340*e3adcf8fSFrançois Tigeot 341*e3adcf8fSFrançois Tigeot struct bdb_lvds_lfp_data { 342*e3adcf8fSFrançois Tigeot struct bdb_lvds_lfp_data_entry data[16]; 343*e3adcf8fSFrançois Tigeot } __attribute__((packed)); 344*e3adcf8fSFrançois Tigeot 345*e3adcf8fSFrançois Tigeot struct aimdb_header { 346*e3adcf8fSFrançois Tigeot char signature[16]; 347*e3adcf8fSFrançois Tigeot char oem_device[20]; 348*e3adcf8fSFrançois Tigeot u16 aimdb_version; 349*e3adcf8fSFrançois Tigeot u16 aimdb_header_size; 350*e3adcf8fSFrançois Tigeot u16 aimdb_size; 351*e3adcf8fSFrançois Tigeot } __attribute__((packed)); 352*e3adcf8fSFrançois Tigeot 353*e3adcf8fSFrançois Tigeot struct aimdb_block { 354*e3adcf8fSFrançois Tigeot u8 aimdb_id; 355*e3adcf8fSFrançois Tigeot u16 aimdb_size; 356*e3adcf8fSFrançois Tigeot } __attribute__((packed)); 357*e3adcf8fSFrançois Tigeot 358*e3adcf8fSFrançois Tigeot struct vch_panel_data { 359*e3adcf8fSFrançois Tigeot u16 fp_timing_offset; 360*e3adcf8fSFrançois Tigeot u8 fp_timing_size; 361*e3adcf8fSFrançois Tigeot u16 dvo_timing_offset; 362*e3adcf8fSFrançois Tigeot u8 dvo_timing_size; 363*e3adcf8fSFrançois Tigeot u16 text_fitting_offset; 364*e3adcf8fSFrançois Tigeot u8 text_fitting_size; 365*e3adcf8fSFrançois Tigeot u16 graphics_fitting_offset; 366*e3adcf8fSFrançois Tigeot u8 graphics_fitting_size; 367*e3adcf8fSFrançois Tigeot } __attribute__((packed)); 368*e3adcf8fSFrançois Tigeot 369*e3adcf8fSFrançois Tigeot struct vch_bdb_22 { 370*e3adcf8fSFrançois Tigeot struct aimdb_block aimdb_block; 371*e3adcf8fSFrançois Tigeot struct vch_panel_data panels[16]; 372*e3adcf8fSFrançois Tigeot } __attribute__((packed)); 373*e3adcf8fSFrançois Tigeot 374*e3adcf8fSFrançois Tigeot struct bdb_sdvo_lvds_options { 375*e3adcf8fSFrançois Tigeot u8 panel_backlight; 376*e3adcf8fSFrançois Tigeot u8 h40_set_panel_type; 377*e3adcf8fSFrançois Tigeot u8 panel_type; 378*e3adcf8fSFrançois Tigeot u8 ssc_clk_freq; 379*e3adcf8fSFrançois Tigeot u16 als_low_trip; 380*e3adcf8fSFrançois Tigeot u16 als_high_trip; 381*e3adcf8fSFrançois Tigeot u8 sclalarcoeff_tab_row_num; 382*e3adcf8fSFrançois Tigeot u8 sclalarcoeff_tab_row_size; 383*e3adcf8fSFrançois Tigeot u8 coefficient[8]; 384*e3adcf8fSFrançois Tigeot u8 panel_misc_bits_1; 385*e3adcf8fSFrançois Tigeot u8 panel_misc_bits_2; 386*e3adcf8fSFrançois Tigeot u8 panel_misc_bits_3; 387*e3adcf8fSFrançois Tigeot u8 panel_misc_bits_4; 388*e3adcf8fSFrançois Tigeot } __attribute__((packed)); 389*e3adcf8fSFrançois Tigeot 390*e3adcf8fSFrançois Tigeot 391*e3adcf8fSFrançois Tigeot #define BDB_DRIVER_FEATURE_NO_LVDS 0 392*e3adcf8fSFrançois Tigeot #define BDB_DRIVER_FEATURE_INT_LVDS 1 393*e3adcf8fSFrançois Tigeot #define BDB_DRIVER_FEATURE_SDVO_LVDS 2 394*e3adcf8fSFrançois Tigeot #define BDB_DRIVER_FEATURE_EDP 3 395*e3adcf8fSFrançois Tigeot 396*e3adcf8fSFrançois Tigeot struct bdb_driver_features { 397*e3adcf8fSFrançois Tigeot u8 boot_dev_algorithm:1; 398*e3adcf8fSFrançois Tigeot u8 block_display_switch:1; 399*e3adcf8fSFrançois Tigeot u8 allow_display_switch:1; 400*e3adcf8fSFrançois Tigeot u8 hotplug_dvo:1; 401*e3adcf8fSFrançois Tigeot u8 dual_view_zoom:1; 402*e3adcf8fSFrançois Tigeot u8 int15h_hook:1; 403*e3adcf8fSFrançois Tigeot u8 sprite_in_clone:1; 404*e3adcf8fSFrançois Tigeot u8 primary_lfp_id:1; 405*e3adcf8fSFrançois Tigeot 406*e3adcf8fSFrançois Tigeot u16 boot_mode_x; 407*e3adcf8fSFrançois Tigeot u16 boot_mode_y; 408*e3adcf8fSFrançois Tigeot u8 boot_mode_bpp; 409*e3adcf8fSFrançois Tigeot u8 boot_mode_refresh; 410*e3adcf8fSFrançois Tigeot 411*e3adcf8fSFrançois Tigeot u16 enable_lfp_primary:1; 412*e3adcf8fSFrançois Tigeot u16 selective_mode_pruning:1; 413*e3adcf8fSFrançois Tigeot u16 dual_frequency:1; 414*e3adcf8fSFrançois Tigeot u16 render_clock_freq:1; /* 0: high freq; 1: low freq */ 415*e3adcf8fSFrançois Tigeot u16 nt_clone_support:1; 416*e3adcf8fSFrançois Tigeot u16 power_scheme_ui:1; /* 0: CUI; 1: 3rd party */ 417*e3adcf8fSFrançois Tigeot u16 sprite_display_assign:1; /* 0: secondary; 1: primary */ 418*e3adcf8fSFrançois Tigeot u16 cui_aspect_scaling:1; 419*e3adcf8fSFrançois Tigeot u16 preserve_aspect_ratio:1; 420*e3adcf8fSFrançois Tigeot u16 sdvo_device_power_down:1; 421*e3adcf8fSFrançois Tigeot u16 crt_hotplug:1; 422*e3adcf8fSFrançois Tigeot u16 lvds_config:2; 423*e3adcf8fSFrançois Tigeot u16 tv_hotplug:1; 424*e3adcf8fSFrançois Tigeot u16 hdmi_config:2; 425*e3adcf8fSFrançois Tigeot 426*e3adcf8fSFrançois Tigeot u8 static_display:1; 427*e3adcf8fSFrançois Tigeot u8 reserved2:7; 428*e3adcf8fSFrançois Tigeot u16 legacy_crt_max_x; 429*e3adcf8fSFrançois Tigeot u16 legacy_crt_max_y; 430*e3adcf8fSFrançois Tigeot u8 legacy_crt_max_refresh; 431*e3adcf8fSFrançois Tigeot 432*e3adcf8fSFrançois Tigeot u8 hdmi_termination; 433*e3adcf8fSFrançois Tigeot u8 custom_vbt_version; 434*e3adcf8fSFrançois Tigeot } __attribute__((packed)); 435*e3adcf8fSFrançois Tigeot 436*e3adcf8fSFrançois Tigeot #define EDP_18BPP 0 437*e3adcf8fSFrançois Tigeot #define EDP_24BPP 1 438*e3adcf8fSFrançois Tigeot #define EDP_30BPP 2 439*e3adcf8fSFrançois Tigeot #define EDP_RATE_1_62 0 440*e3adcf8fSFrançois Tigeot #define EDP_RATE_2_7 1 441*e3adcf8fSFrançois Tigeot #define EDP_LANE_1 0 442*e3adcf8fSFrançois Tigeot #define EDP_LANE_2 1 443*e3adcf8fSFrançois Tigeot #define EDP_LANE_4 3 444*e3adcf8fSFrançois Tigeot #define EDP_PREEMPHASIS_NONE 0 445*e3adcf8fSFrançois Tigeot #define EDP_PREEMPHASIS_3_5dB 1 446*e3adcf8fSFrançois Tigeot #define EDP_PREEMPHASIS_6dB 2 447*e3adcf8fSFrançois Tigeot #define EDP_PREEMPHASIS_9_5dB 3 448*e3adcf8fSFrançois Tigeot #define EDP_VSWING_0_4V 0 449*e3adcf8fSFrançois Tigeot #define EDP_VSWING_0_6V 1 450*e3adcf8fSFrançois Tigeot #define EDP_VSWING_0_8V 2 451*e3adcf8fSFrançois Tigeot #define EDP_VSWING_1_2V 3 452*e3adcf8fSFrançois Tigeot 453*e3adcf8fSFrançois Tigeot struct edp_power_seq { 454*e3adcf8fSFrançois Tigeot u16 t1_t3; 455*e3adcf8fSFrançois Tigeot u16 t8; 456*e3adcf8fSFrançois Tigeot u16 t9; 457*e3adcf8fSFrançois Tigeot u16 t10; 458*e3adcf8fSFrançois Tigeot u16 t11_t12; 459*e3adcf8fSFrançois Tigeot } __attribute__ ((packed)); 460*e3adcf8fSFrançois Tigeot 461*e3adcf8fSFrançois Tigeot struct edp_link_params { 462*e3adcf8fSFrançois Tigeot u8 rate:4; 463*e3adcf8fSFrançois Tigeot u8 lanes:4; 464*e3adcf8fSFrançois Tigeot u8 preemphasis:4; 465*e3adcf8fSFrançois Tigeot u8 vswing:4; 466*e3adcf8fSFrançois Tigeot } __attribute__ ((packed)); 467*e3adcf8fSFrançois Tigeot 468*e3adcf8fSFrançois Tigeot struct bdb_edp { 469*e3adcf8fSFrançois Tigeot struct edp_power_seq power_seqs[16]; 470*e3adcf8fSFrançois Tigeot u32 color_depth; 471*e3adcf8fSFrançois Tigeot struct edp_link_params link_params[16]; 472*e3adcf8fSFrançois Tigeot u32 sdrrs_msa_timing_delay; 473*e3adcf8fSFrançois Tigeot 474*e3adcf8fSFrançois Tigeot /* ith bit indicates enabled/disabled for (i+1)th panel */ 475*e3adcf8fSFrançois Tigeot u16 edp_s3d_feature; 476*e3adcf8fSFrançois Tigeot u16 edp_t3_optimization; 477*e3adcf8fSFrançois Tigeot } __attribute__ ((packed)); 478*e3adcf8fSFrançois Tigeot 479*e3adcf8fSFrançois Tigeot void intel_setup_bios(struct drm_device *dev); 480*e3adcf8fSFrançois Tigeot bool intel_parse_bios(struct drm_device *dev); 481*e3adcf8fSFrançois Tigeot 482*e3adcf8fSFrançois Tigeot /* 483*e3adcf8fSFrançois Tigeot * Driver<->VBIOS interaction occurs through scratch bits in 484*e3adcf8fSFrançois Tigeot * GR18 & SWF*. 485*e3adcf8fSFrançois Tigeot */ 486*e3adcf8fSFrançois Tigeot 487*e3adcf8fSFrançois Tigeot /* GR18 bits are set on display switch and hotkey events */ 488*e3adcf8fSFrançois Tigeot #define GR18_DRIVER_SWITCH_EN (1<<7) /* 0: VBIOS control, 1: driver control */ 489*e3adcf8fSFrançois Tigeot #define GR18_HOTKEY_MASK 0x78 /* See also SWF4 15:0 */ 490*e3adcf8fSFrançois Tigeot #define GR18_HK_NONE (0x0<<3) 491*e3adcf8fSFrançois Tigeot #define GR18_HK_LFP_STRETCH (0x1<<3) 492*e3adcf8fSFrançois Tigeot #define GR18_HK_TOGGLE_DISP (0x2<<3) 493*e3adcf8fSFrançois Tigeot #define GR18_HK_DISP_SWITCH (0x4<<3) /* see SWF14 15:0 for what to enable */ 494*e3adcf8fSFrançois Tigeot #define GR18_HK_POPUP_DISABLED (0x6<<3) 495*e3adcf8fSFrançois Tigeot #define GR18_HK_POPUP_ENABLED (0x7<<3) 496*e3adcf8fSFrançois Tigeot #define GR18_HK_PFIT (0x8<<3) 497*e3adcf8fSFrançois Tigeot #define GR18_HK_APM_CHANGE (0xa<<3) 498*e3adcf8fSFrançois Tigeot #define GR18_HK_MULTIPLE (0xc<<3) 499*e3adcf8fSFrançois Tigeot #define GR18_USER_INT_EN (1<<2) 500*e3adcf8fSFrançois Tigeot #define GR18_A0000_FLUSH_EN (1<<1) 501*e3adcf8fSFrançois Tigeot #define GR18_SMM_EN (1<<0) 502*e3adcf8fSFrançois Tigeot 503*e3adcf8fSFrançois Tigeot /* Set by driver, cleared by VBIOS */ 504*e3adcf8fSFrançois Tigeot #define SWF00_YRES_SHIFT 16 505*e3adcf8fSFrançois Tigeot #define SWF00_XRES_SHIFT 0 506*e3adcf8fSFrançois Tigeot #define SWF00_RES_MASK 0xffff 507*e3adcf8fSFrançois Tigeot 508*e3adcf8fSFrançois Tigeot /* Set by VBIOS at boot time and driver at runtime */ 509*e3adcf8fSFrançois Tigeot #define SWF01_TV2_FORMAT_SHIFT 8 510*e3adcf8fSFrançois Tigeot #define SWF01_TV1_FORMAT_SHIFT 0 511*e3adcf8fSFrançois Tigeot #define SWF01_TV_FORMAT_MASK 0xffff 512*e3adcf8fSFrançois Tigeot 513*e3adcf8fSFrançois Tigeot #define SWF10_VBIOS_BLC_I2C_EN (1<<29) 514*e3adcf8fSFrançois Tigeot #define SWF10_GTT_OVERRIDE_EN (1<<28) 515*e3adcf8fSFrançois Tigeot #define SWF10_LFP_DPMS_OVR (1<<27) /* override DPMS on display switch */ 516*e3adcf8fSFrançois Tigeot #define SWF10_ACTIVE_TOGGLE_LIST_MASK (7<<24) 517*e3adcf8fSFrançois Tigeot #define SWF10_OLD_TOGGLE 0x0 518*e3adcf8fSFrançois Tigeot #define SWF10_TOGGLE_LIST_1 0x1 519*e3adcf8fSFrançois Tigeot #define SWF10_TOGGLE_LIST_2 0x2 520*e3adcf8fSFrançois Tigeot #define SWF10_TOGGLE_LIST_3 0x3 521*e3adcf8fSFrançois Tigeot #define SWF10_TOGGLE_LIST_4 0x4 522*e3adcf8fSFrançois Tigeot #define SWF10_PANNING_EN (1<<23) 523*e3adcf8fSFrançois Tigeot #define SWF10_DRIVER_LOADED (1<<22) 524*e3adcf8fSFrançois Tigeot #define SWF10_EXTENDED_DESKTOP (1<<21) 525*e3adcf8fSFrançois Tigeot #define SWF10_EXCLUSIVE_MODE (1<<20) 526*e3adcf8fSFrançois Tigeot #define SWF10_OVERLAY_EN (1<<19) 527*e3adcf8fSFrançois Tigeot #define SWF10_PLANEB_HOLDOFF (1<<18) 528*e3adcf8fSFrançois Tigeot #define SWF10_PLANEA_HOLDOFF (1<<17) 529*e3adcf8fSFrançois Tigeot #define SWF10_VGA_HOLDOFF (1<<16) 530*e3adcf8fSFrançois Tigeot #define SWF10_ACTIVE_DISP_MASK 0xffff 531*e3adcf8fSFrançois Tigeot #define SWF10_PIPEB_LFP2 (1<<15) 532*e3adcf8fSFrançois Tigeot #define SWF10_PIPEB_EFP2 (1<<14) 533*e3adcf8fSFrançois Tigeot #define SWF10_PIPEB_TV2 (1<<13) 534*e3adcf8fSFrançois Tigeot #define SWF10_PIPEB_CRT2 (1<<12) 535*e3adcf8fSFrançois Tigeot #define SWF10_PIPEB_LFP (1<<11) 536*e3adcf8fSFrançois Tigeot #define SWF10_PIPEB_EFP (1<<10) 537*e3adcf8fSFrançois Tigeot #define SWF10_PIPEB_TV (1<<9) 538*e3adcf8fSFrançois Tigeot #define SWF10_PIPEB_CRT (1<<8) 539*e3adcf8fSFrançois Tigeot #define SWF10_PIPEA_LFP2 (1<<7) 540*e3adcf8fSFrançois Tigeot #define SWF10_PIPEA_EFP2 (1<<6) 541*e3adcf8fSFrançois Tigeot #define SWF10_PIPEA_TV2 (1<<5) 542*e3adcf8fSFrançois Tigeot #define SWF10_PIPEA_CRT2 (1<<4) 543*e3adcf8fSFrançois Tigeot #define SWF10_PIPEA_LFP (1<<3) 544*e3adcf8fSFrançois Tigeot #define SWF10_PIPEA_EFP (1<<2) 545*e3adcf8fSFrançois Tigeot #define SWF10_PIPEA_TV (1<<1) 546*e3adcf8fSFrançois Tigeot #define SWF10_PIPEA_CRT (1<<0) 547*e3adcf8fSFrançois Tigeot 548*e3adcf8fSFrançois Tigeot #define SWF11_MEMORY_SIZE_SHIFT 16 549*e3adcf8fSFrançois Tigeot #define SWF11_SV_TEST_EN (1<<15) 550*e3adcf8fSFrançois Tigeot #define SWF11_IS_AGP (1<<14) 551*e3adcf8fSFrançois Tigeot #define SWF11_DISPLAY_HOLDOFF (1<<13) 552*e3adcf8fSFrançois Tigeot #define SWF11_DPMS_REDUCED (1<<12) 553*e3adcf8fSFrançois Tigeot #define SWF11_IS_VBE_MODE (1<<11) 554*e3adcf8fSFrançois Tigeot #define SWF11_PIPEB_ACCESS (1<<10) /* 0 here means pipe a */ 555*e3adcf8fSFrançois Tigeot #define SWF11_DPMS_MASK 0x07 556*e3adcf8fSFrançois Tigeot #define SWF11_DPMS_OFF (1<<2) 557*e3adcf8fSFrançois Tigeot #define SWF11_DPMS_SUSPEND (1<<1) 558*e3adcf8fSFrançois Tigeot #define SWF11_DPMS_STANDBY (1<<0) 559*e3adcf8fSFrançois Tigeot #define SWF11_DPMS_ON 0 560*e3adcf8fSFrançois Tigeot 561*e3adcf8fSFrançois Tigeot #define SWF14_GFX_PFIT_EN (1<<31) 562*e3adcf8fSFrançois Tigeot #define SWF14_TEXT_PFIT_EN (1<<30) 563*e3adcf8fSFrançois Tigeot #define SWF14_LID_STATUS_CLOSED (1<<29) /* 0 here means open */ 564*e3adcf8fSFrançois Tigeot #define SWF14_POPUP_EN (1<<28) 565*e3adcf8fSFrançois Tigeot #define SWF14_DISPLAY_HOLDOFF (1<<27) 566*e3adcf8fSFrançois Tigeot #define SWF14_DISP_DETECT_EN (1<<26) 567*e3adcf8fSFrançois Tigeot #define SWF14_DOCKING_STATUS_DOCKED (1<<25) /* 0 here means undocked */ 568*e3adcf8fSFrançois Tigeot #define SWF14_DRIVER_STATUS (1<<24) 569*e3adcf8fSFrançois Tigeot #define SWF14_OS_TYPE_WIN9X (1<<23) 570*e3adcf8fSFrançois Tigeot #define SWF14_OS_TYPE_WINNT (1<<22) 571*e3adcf8fSFrançois Tigeot /* 21:19 rsvd */ 572*e3adcf8fSFrançois Tigeot #define SWF14_PM_TYPE_MASK 0x00070000 573*e3adcf8fSFrançois Tigeot #define SWF14_PM_ACPI_VIDEO (0x4 << 16) 574*e3adcf8fSFrançois Tigeot #define SWF14_PM_ACPI (0x3 << 16) 575*e3adcf8fSFrançois Tigeot #define SWF14_PM_APM_12 (0x2 << 16) 576*e3adcf8fSFrançois Tigeot #define SWF14_PM_APM_11 (0x1 << 16) 577*e3adcf8fSFrançois Tigeot #define SWF14_HK_REQUEST_MASK 0x0000ffff /* see GR18 6:3 for event type */ 578*e3adcf8fSFrançois Tigeot /* if GR18 indicates a display switch */ 579*e3adcf8fSFrançois Tigeot #define SWF14_DS_PIPEB_LFP2_EN (1<<15) 580*e3adcf8fSFrançois Tigeot #define SWF14_DS_PIPEB_EFP2_EN (1<<14) 581*e3adcf8fSFrançois Tigeot #define SWF14_DS_PIPEB_TV2_EN (1<<13) 582*e3adcf8fSFrançois Tigeot #define SWF14_DS_PIPEB_CRT2_EN (1<<12) 583*e3adcf8fSFrançois Tigeot #define SWF14_DS_PIPEB_LFP_EN (1<<11) 584*e3adcf8fSFrançois Tigeot #define SWF14_DS_PIPEB_EFP_EN (1<<10) 585*e3adcf8fSFrançois Tigeot #define SWF14_DS_PIPEB_TV_EN (1<<9) 586*e3adcf8fSFrançois Tigeot #define SWF14_DS_PIPEB_CRT_EN (1<<8) 587*e3adcf8fSFrançois Tigeot #define SWF14_DS_PIPEA_LFP2_EN (1<<7) 588*e3adcf8fSFrançois Tigeot #define SWF14_DS_PIPEA_EFP2_EN (1<<6) 589*e3adcf8fSFrançois Tigeot #define SWF14_DS_PIPEA_TV2_EN (1<<5) 590*e3adcf8fSFrançois Tigeot #define SWF14_DS_PIPEA_CRT2_EN (1<<4) 591*e3adcf8fSFrançois Tigeot #define SWF14_DS_PIPEA_LFP_EN (1<<3) 592*e3adcf8fSFrançois Tigeot #define SWF14_DS_PIPEA_EFP_EN (1<<2) 593*e3adcf8fSFrançois Tigeot #define SWF14_DS_PIPEA_TV_EN (1<<1) 594*e3adcf8fSFrançois Tigeot #define SWF14_DS_PIPEA_CRT_EN (1<<0) 595*e3adcf8fSFrançois Tigeot /* if GR18 indicates a panel fitting request */ 596*e3adcf8fSFrançois Tigeot #define SWF14_PFIT_EN (1<<0) /* 0 means disable */ 597*e3adcf8fSFrançois Tigeot /* if GR18 indicates an APM change request */ 598*e3adcf8fSFrançois Tigeot #define SWF14_APM_HIBERNATE 0x4 599*e3adcf8fSFrançois Tigeot #define SWF14_APM_SUSPEND 0x3 600*e3adcf8fSFrançois Tigeot #define SWF14_APM_STANDBY 0x1 601*e3adcf8fSFrançois Tigeot #define SWF14_APM_RESTORE 0x0 602*e3adcf8fSFrançois Tigeot 603*e3adcf8fSFrançois Tigeot /* Add the device class for LFP, TV, HDMI */ 604*e3adcf8fSFrançois Tigeot #define DEVICE_TYPE_INT_LFP 0x1022 605*e3adcf8fSFrançois Tigeot #define DEVICE_TYPE_INT_TV 0x1009 606*e3adcf8fSFrançois Tigeot #define DEVICE_TYPE_HDMI 0x60D2 607*e3adcf8fSFrançois Tigeot #define DEVICE_TYPE_DP 0x68C6 608*e3adcf8fSFrançois Tigeot #define DEVICE_TYPE_eDP 0x78C6 609*e3adcf8fSFrançois Tigeot 610*e3adcf8fSFrançois Tigeot /* define the DVO port for HDMI output type */ 611*e3adcf8fSFrançois Tigeot #define DVO_B 1 612*e3adcf8fSFrançois Tigeot #define DVO_C 2 613*e3adcf8fSFrançois Tigeot #define DVO_D 3 614*e3adcf8fSFrançois Tigeot 615*e3adcf8fSFrançois Tigeot /* define the PORT for DP output type */ 616*e3adcf8fSFrançois Tigeot #define PORT_IDPB 7 617*e3adcf8fSFrançois Tigeot #define PORT_IDPC 8 618*e3adcf8fSFrançois Tigeot #define PORT_IDPD 9 619*e3adcf8fSFrançois Tigeot 620*e3adcf8fSFrançois Tigeot #endif /* _I830_BIOS_H_ */ 621