summaryrefslogtreecommitdiff
path: root/ChvRefCodePkg/AcpiTablesPCAT/SystemAgent
diff options
context:
space:
mode:
Diffstat (limited to 'ChvRefCodePkg/AcpiTablesPCAT/SystemAgent')
-rw-r--r--ChvRefCodePkg/AcpiTablesPCAT/SystemAgent/Als.asl60
-rw-r--r--ChvRefCodePkg/AcpiTablesPCAT/SystemAgent/Chv.asl56
-rw-r--r--ChvRefCodePkg/AcpiTablesPCAT/SystemAgent/HostBus.asl412
-rw-r--r--ChvRefCodePkg/AcpiTablesPCAT/SystemAgent/IgdOpGbda.asl153
-rw-r--r--ChvRefCodePkg/AcpiTablesPCAT/SystemAgent/IgdOpMobf.asl483
-rw-r--r--ChvRefCodePkg/AcpiTablesPCAT/SystemAgent/IgdOpRn.ASL298
-rw-r--r--ChvRefCodePkg/AcpiTablesPCAT/SystemAgent/IgdOpSbcb.asl287
-rw-r--r--ChvRefCodePkg/AcpiTablesPCAT/SystemAgent/IntelGraphics.asl1009
-rw-r--r--ChvRefCodePkg/AcpiTablesPCAT/SystemAgent/IntelIspDev2.asl66
-rw-r--r--ChvRefCodePkg/AcpiTablesPCAT/SystemAgent/Video.asl32
10 files changed, 2856 insertions, 0 deletions
diff --git a/ChvRefCodePkg/AcpiTablesPCAT/SystemAgent/Als.asl b/ChvRefCodePkg/AcpiTablesPCAT/SystemAgent/Als.asl
new file mode 100644
index 0000000000..7ae83984b1
--- /dev/null
+++ b/ChvRefCodePkg/AcpiTablesPCAT/SystemAgent/Als.asl
@@ -0,0 +1,60 @@
+/** @file
+ ACPI DSDT table
+
+ Copyright (c) 1999 - 2015, Intel Corporation. All rights reserved.<BR>
+
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php.
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+Device(ALSD)
+{
+ Name(_HID,"ACPI0008")
+ Name(_CID,EISAID("PNP0C01"))
+
+ Method(_STA,0)
+ {
+ If(LEqual(ALSE,2))
+ {
+ Return(0x000F) // ALS Enabled. Show it.
+ }
+
+ Return(0x0000) // ALS Disabled. Hide it.
+ }
+
+ Method(_ALI)
+ {
+ Return (Or(ShiftLeft(LHIH,8),LLOW))
+ }
+
+// TODO
+// Method(_ALT)
+// {
+// Return(3000)
+// }
+
+// TODO - These are "best guess" values.
+
+ Name(_ALR, Package()
+ {
+ Package() {70, 0},
+ Package() {73, 10},
+ Package() {85, 80},
+ Package() {100, 300},
+ Package() {150, 1000}
+ })
+
+// TODO - CRB designs don't require this as the KSC performas the polling
+// and notifies ASL via Q70 when a change occurs.
+//
+// Method(_ALP)
+// {
+// }
+
+}
diff --git a/ChvRefCodePkg/AcpiTablesPCAT/SystemAgent/Chv.asl b/ChvRefCodePkg/AcpiTablesPCAT/SystemAgent/Chv.asl
new file mode 100644
index 0000000000..3ce50c62c1
--- /dev/null
+++ b/ChvRefCodePkg/AcpiTablesPCAT/SystemAgent/Chv.asl
@@ -0,0 +1,56 @@
+/** @file
+ ACPI DSDT table
+
+ Copyright (c) 1999 - 2015, Intel Corporation. All rights reserved.<BR>
+
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php.
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+Scope (\_SB.PCI0) {
+ //
+ // IUNIT - Device 3, Function 0
+ //
+ Device (ISP3)
+ {
+ Name (_ADR, 0x00030000)
+ Method (_PR3, 0, NotSerialized)
+ {
+ Return (Package (0x01)
+ {
+ ID3C
+ })
+ }
+
+ PowerResource (ID3C, 0x00, 0x0000)
+ {
+ Method (_STA, 0, NotSerialized)
+ {
+ If(LEqual(ISPD,2)) {
+ Return (0x0F)
+ } Else {
+ Return (0x0)
+ }
+ }
+ Method (_ON, 0, NotSerialized)
+ {
+ }
+ Method (_OFF, 0, NotSerialized)
+ {
+ }
+ }
+ }
+
+ Device(GFX0) { // Mobile I.G.D
+ Name(_ADR, 0x00020000)
+ Name (_S0W, 3)
+ include("SystemAgent/IntelGraphics.asl")
+ include("SystemAgent/IntelIspDev2.asl")
+ } // end "Mobile I.G.D"
+}//end scope
diff --git a/ChvRefCodePkg/AcpiTablesPCAT/SystemAgent/HostBus.asl b/ChvRefCodePkg/AcpiTablesPCAT/SystemAgent/HostBus.asl
new file mode 100644
index 0000000000..0d90934b47
--- /dev/null
+++ b/ChvRefCodePkg/AcpiTablesPCAT/SystemAgent/HostBus.asl
@@ -0,0 +1,412 @@
+/** @file
+ ACPI DSDT table
+
+ Copyright (c) 1999 - 2015, Intel Corporation. All rights reserved.<BR>
+
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php.
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+Device(CHVC)
+{
+ Name(_ADR, 0x00000000) // Device 0, Function 0
+ //
+ // Define various MCH Controller PCI Configuration Space
+ // registers which will be used to dynamically produce all
+ // resources in the Host Bus _CRS.
+ //
+ OperationRegion(HBUS, PCI_Config, 0x00, 0xFF)
+ Field(HBUS, DWordAcc, NoLock, Preserve)
+ {
+ Offset(0xD0),
+ SMCR, 32, // Message Control Register (0xD0)
+ Offset(0xD4),
+ SMDR, 32, // Message Data Register (0xD4)
+ Offset(0xD8),
+ MCRX, 32, // Message Control Register Extension (0xD8)
+ Offset(0xDC),
+ MCXX, 32, // Message Control Register Double Extension (0xDC)
+ }
+ //
+ // Define a method to read a 32-bit register on the Message bus.
+ // Arg0 = Port
+ // Arg1 = Register
+ //
+ // Returns 32-bit register value
+ //
+ Method(RMBR, 2, Serialized)
+ {
+ //
+ // Initiate regsiter read message on Message Bus MCR
+ //
+ Or(ShiftLeft(Arg0, 16), ShiftLeft(Arg1, 8), Local0)
+ Or(0x100000F0, Local0, SMCR)
+ //
+ // Read register value from Message Data Register
+ //
+ Return(SMDR)
+ }
+
+ //
+ // Define a method to write a 32-bit register on the Message bus MDR.
+ // Arg0 = Port
+ // Arg1 = Register
+ // Arg2 = 32-bit value
+ //
+ Method(WMBR, 3, Serialized)
+ {
+ //
+ // Write register value to Message Data Register
+ //
+ Store(Arg2, SMDR)
+ //
+ // Initiate register write message on Message Bus
+ //
+ Or(ShiftLeft(Arg0, 16), ShiftLeft(Arg1, 8), Local0)
+ Or(0x110000F0, Local0, SMCR)
+ }
+ //
+ // Define an extended IOSF-SB access method to read a 32-bit message bus register.
+ // Arg0 = Port
+ // Arg1 = Register
+ // Arg2 = ReadOpcode
+ // Arg3 = Bar
+ // Arg4 = Device
+ // Arg5 = Function
+ //
+ // Returns 32-bit register value
+ //
+ Method(RMBX, 6, Serialized)
+ {
+ //
+ // Initiate regsiter read message on Message Bus MCR
+ // (((Bar & 0x07) << 8) | (((Device << 3) | (Function)) & 0xFF))
+ //
+ And(Arg3, 0x07, Local4) // (Bar & 0x07)
+ Store(ShiftLeft(Local4, 8), Local4) // ((Bar & 0x07) << 8)
+ Or(ShiftLeft(Arg4, 3), Arg5, Local5) // ((Device << 3) | (Function))
+ And(Local5, 0xFF, Local5) // (((Device << 3) | (Function)) & 0xFF)
+ Or(Local4, Local5, MCXX)
+ And(Arg1, 0xFFFFFF00, Local3)
+ Store(Local3, MCRX)
+ //
+ // Perform the Operation:
+ // (ReadOpCode << 24) | (PortId << 16) | ((Register & 0x000000FF) << 8) | 0xF0
+ //
+ And(Arg1, 0x000000FF, Local0)
+ Or(ShiftLeft(Arg2, 24), ShiftLeft(Arg0, 16), Local1)
+ And(Local1, 0xFFFF0000, Local1)
+ Or(ShiftLeft(Local0, 8), 0xf0, Local2)
+ And(Local2, 0x0000FFFF, Local2)
+ Or(Local1, Local2, SMCR)
+ //
+ // Read register value from Message Data Register
+ //
+ Return(SMDR)
+ }
+
+ //
+ // Define an extended IOSF-SB access method to write a 32-bit message bus register.
+ // Arg0 = Port
+ // Arg1 = Register
+ // Arg2 = 32-bit value
+ // Arg3 = WriteOpcode
+ // Arg4 = Bar
+ // Arg5 = Device
+ // Arg6 = Function
+ //
+ Method(WMBX, 7, Serialized)
+ {
+ //
+ // Write register value to Message Data Register
+ // (((Bar & 0x07) << 8) | (((Device << 3) | (Function)) & 0xFF))
+ //
+ And(Arg4, 0x07, Local4) // (Bar & 0x07)
+ Store(ShiftLeft(Local4, 8), Local4) // ((Bar & 0x07) << 8)
+ Or(ShiftLeft(Arg5, 3), Arg6, Local5) // ((Device << 3) | (Function))
+ And(Local5, 0xFF, Local5) // (((Device << 3) | (Function)) & 0xFF)
+ Or(Local4, Local5, MCXX)
+ And(Arg1,0xFFFFFF00, Local3)
+ Store(Local3, MCRX)
+ Store(Arg2, SMDR)
+ //
+ // Initiate register write message on Message Bus
+ // (WriteOpCode << 24) | (PortId << 16) | ((Register & 0x000000FF) << 8) | 0xF0
+ //
+ And(Arg1,0x000000FF, Local0)
+ Or(ShiftLeft(Arg3, 24), ShiftLeft(Arg0, 16), Local1)
+ And(Local1,0xFFFF0000, Local1)
+ Or(ShiftLeft(Local0, 8), 0xf0, Local2)
+ And(Local2, 0x0000FFFF, Local2)
+ Or(Local1, Local2, SMCR)
+ }
+}
+
+//
+// BUS, I/O, and MMIO resources
+//
+Method(_CRS,0,Serialized) {
+
+ Name(FTSZ,0x100000) // FTPM size
+
+ //
+ // Update LPEA reserved memory
+ //
+ CreateDwordField(RES0, ^LPA0._MIN,LPMN)
+ CreateDwordField(RES0, ^LPA0._MAX,LPMX)
+ CreateDwordField(RES0, ^LPA0._LEN,LPLN)
+ If (LAnd(LNotEqual(LPE2, 0), LEqual(LPED, 0))) {
+ Store (LPE2, LPMN)
+ Add (LPMN, LPLN, LPMX)
+ Subtract(LPMX, 1, LPMX)
+ } Else {
+ Store (0, LPMN)
+ Store (0, LPMX)
+ Store (0, LPLN)
+ }
+
+ //Update ISP0 reserved memory
+ CreateDwordField(RES0, ^ISP0._MIN,ISMN)
+ CreateDwordField(RES0, ^ISP0._MAX,ISMX)
+ CreateDwordField(RES0, ^ISP0._LEN,ISLN)
+ If (LEqual(ISPD,1)){
+ Store (ISPA, ISMN)
+ Add (ISMN, ISLN, ISMX)
+ Subtract(ISMX, 1, ISMX)
+ } Else {
+ Store (0, ISMN)
+ Store (0, ISMX)
+ Store (0, ISLN)
+ }
+
+ ////PCI MMIO SPACE
+ CreateDwordField(RES0, ^PM01._MIN,M1MN)
+ CreateDwordField(RES0, ^PM01._MAX,M1MX)
+ CreateDwordField(RES0, ^PM01._LEN,M1LN)
+
+ ///Get dBMBOUND Base
+ And(BMBD, 0xFF000000, M1MN)
+
+ // Calculate Length
+ Add(Subtract(M1MX, M1MN), 1, M1LN)
+
+
+ Return(RES0)
+}
+
+Name( RES0,ResourceTemplate() {
+ WORDBusNumber ( // Bus number resource (0); the bridge produces bus numbers for its subsequent buses
+ ResourceProducer, // bit 0 of general flags is 1
+ MinFixed, // Range is fixed
+ MaxFixed, // Range is fixed
+ PosDecode, // PosDecode
+ 0x0000, // Granularity
+ 0x0000, // Min
+ 0x00FF, // Max
+ 0x0000, // Translation
+ 0x0100 // Range Length = Max-Min+1
+ )
+
+ IO (Decode16, 0x70, 0x77, 0x01, 0x08) //Consumed resource (0xCF8-0xCFF)
+ IO (Decode16, 0xCF8, 0xCF8, 0x01, 0x08) //Consumed resource (0xCF8-0xCFF)
+
+ WORDIO ( // Consumed-and-produced resource (all I/O below CF8)
+ ResourceProducer, // bit 0 of general flags is 0
+ MinFixed, // Range is fixed
+ MaxFixed, // Range is fixed
+ PosDecode,
+ EntireRange,
+ 0x0000, // Granularity
+ 0x0000, // Min
+ 0x006F, // Max
+ 0x0000, // Translation
+ 0x0070 // Range Length
+ )
+
+ WORDIO ( // Consumed-and-produced resource
+ ResourceProducer, // bit 0 of general flags is 0
+ MinFixed, // Range is fixed
+ MaxFixed, // Range is fixed
+ PosDecode,
+ EntireRange,
+ 0x0000, // Granularity
+ 0x0078, // Min
+ 0x0CF7, // Max
+ 0x0000, // Translation
+ 0x0C80 // Range Length
+ )
+
+ WORDIO ( // Consumed-and-produced resource (all I/O above CFF)
+ ResourceProducer, // bit 0 of general flags is 0
+ MinFixed, // Range is fixed
+ MaxFixed, // Range is fixed
+ PosDecode,
+ EntireRange,
+ 0x0000, // Granularity
+ 0x0D00, // Min
+ 0xFFFF, // Max
+ 0x0000, // Translation
+ 0xF300 // Range Length
+ )
+
+ DWORDMEMORY ( // Descriptor for legacy VGA video RAM
+ ResourceProducer, // bit 0 of general flags is 0
+ PosDecode,
+ MinFixed, // Range is fixed
+ MaxFixed, // Range is fixed
+ Cacheable,
+ ReadWrite,
+ 0x00000000, // Granularity
+ 0x000A0000, // Min
+ 0x000BFFFF, // Max
+ 0x00000000, // Translation
+ 0x00020000 // Range Length
+ )
+
+ DWORDMEMORY ( // Descriptor for legacy OptionRom
+ ResourceProducer, // bit 0 of general flags is 0
+ PosDecode,
+ MinFixed, // Range is fixed
+ MaxFixed, // Range is fixed
+ Cacheable,
+ ReadWrite,
+ 0x00000000, // Granularity
+ 0x000C0000, // Min
+ 0x000DFFFF, // Max
+ 0x00000000, // Translation
+ 0x00020000 // Range Length
+ )
+
+ DWORDMEMORY ( // Descriptor for BIOS Area
+ ResourceProducer, // bit 0 of general flags is 0
+ PosDecode,
+ MinFixed, // Range is fixed
+ MaxFixed, // Range is fixed
+ Cacheable,
+ ReadWrite,
+ 0x00000000, // Granularity
+ 0x000E0000, // Min
+ 0x000FFFFF, // Max
+ 0x00000000, // Translation
+ 0x00020000 // Range Length
+ )
+
+ DWORDMEMORY ( // Descriptor for LPEA Area
+ ResourceProducer, // bit 0 of general flags is 0
+ PosDecode,
+ MinFixed, // Range is fixed
+ MaxFixed, // Range is fixed
+ Cacheable,
+ ReadWrite,
+ 0x00000000, // Granularity
+ 0x20000000, // Min
+ 0x201FFFFF, // Max
+ 0x00000000, // Translation
+ 0x00200000 // Range Length
+ ,,,
+ LPA0
+ )
+
+ DWORDMEMORY ( // Descriptor for ISP0 reserved Mem
+ ResourceProducer, // bit 0 of general flags is 0
+ PosDecode,
+ MinFixed, // Range is fixed
+ MaxFixed, // Range is fixed
+ Cacheable,
+ ReadWrite,
+ 0x00000000, // Granularity
+ 0x7A000000, // Min
+ 0x7A3FFFFF, // Max
+ 0x00000000, // Translation
+ 0x00400000 // Range Length
+ ,,,
+ ISP0
+ )
+
+ DWORDMEMORY ( // Descriptor for PCI MMIO
+ ResourceProducer, // bit 0 of general flags is 0
+ PosDecode,
+ MinFixed, // Range is fixed
+ MaxFixed, // Range is fixed
+ Cacheable,
+ ReadWrite,
+ 0x00000000, // Granularity
+ 0x80000000, // Min
+ 0xDFFFFFFF, // Max
+ 0x00000000, // Translation
+ 0x60000000 // Range Length
+ ,,,
+ PM01
+ )
+
+})
+
+//Name(GUID,UUID("33DB4D5B-1FF7-401C-9657-7441C03DD766"))
+Name(GUID,Buffer(){0x5b, 0x4d, 0xdb, 0x33,
+ 0xf7, 0x1f,
+ 0x1c, 0x40,
+ 0x96, 0x57,
+ 0x74, 0x41, 0xc0, 0x3d, 0xd7, 0x66})
+
+
+Name(SUPP,0) // PCI _OSC Support Field value
+Name(CTRL,0) // PCI _OSC Control Field value
+
+Method(_OSC,4,Serialized)
+{ // Check for proper UUID
+ // Save the capabilities buffer
+ Store(Arg3,Local0)
+
+ // Create DWord-adressable fields from the Capabilties Buffer
+ CreateDWordField(Local0,0,CDW1)
+ CreateDWordField(Local0,4,CDW2)
+ CreateDWordField(Local0,8,CDW3)
+
+ // Check for proper UUID
+ If(LAnd(LEqual(Arg0,GUID),NEXP))
+ {
+ // Save Capabilities DWord2 & 3
+ Store(CDW2,SUPP)
+ Store(CDW3,CTRL)
+
+ // You can clear bits in CTRL here if you don't want OS to take
+ // control
+
+// And(CTRL, 0xFFFFFFF8, CTRL) // disable Native hot plug, PME
+
+ If(Not(And(CDW1,1))) // Query flag clear?
+ { // Disable GPEs for features granted native control.
+ If(And(CTRL,0x02))
+ {
+ NHPG()
+ }
+ If(And(CTRL,0x04)) // PME control granted?
+ {
+ NPME()
+ }
+ }
+
+ If(LNotEqual(Arg1,One))
+ { // Unknown revision
+ Or(CDW1,0x08,CDW1)
+ }
+
+ If(LNotEqual(CDW3,CTRL))
+ { // Capabilities bits were masked
+ Or(CDW1,0x10,CDW1)
+ }
+ // Update DWORD3 in the buffer
+ Store(CTRL,CDW3)
+ Store(CTRL,OSCC)
+ Return(Local0)
+ } Else {
+ Or(CDW1,4,CDW1) // Unrecognized UUID
+ Return(Local0)
+ }
+} // End _OSC
diff --git a/ChvRefCodePkg/AcpiTablesPCAT/SystemAgent/IgdOpGbda.asl b/ChvRefCodePkg/AcpiTablesPCAT/SystemAgent/IgdOpGbda.asl
new file mode 100644
index 0000000000..2aebdd1009
--- /dev/null
+++ b/ChvRefCodePkg/AcpiTablesPCAT/SystemAgent/IgdOpGbda.asl
@@ -0,0 +1,153 @@
+/** @file
+ ACPI DSDT table
+ IGD OpRegion/Software SCI Reference Code for the CherryView Family.
+ This file contains Get BIOS Data Area funciton support for the
+ Integrated Graphics Device (IGD) OpRegion/Software SCI mechanism.
+
+ Copyright (c) 1999 - 2015, Intel Corporation. All rights reserved.<BR>
+
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php.
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+
+Method (GBDA, 0, Serialized)
+{
+
+ // Supported calls: Sub-function 0
+
+ If (LEqual(GESF, 0))
+ {
+ //<TODO> Update implementation specific supported calls. Reference
+ // code is set to Intel's validated implementation.
+
+ Store(0x0000279, PARM)
+
+ Store(Zero, GESF) // Clear the exit parameter
+ Return(SUCC) // Success
+ }
+
+ // Requested callbacks: Sub-function 1
+
+ If (LEqual(GESF, 1))
+ {
+
+ //<TODO> Update implementation specific system BIOS requested call
+ // back functions. Call back functions are where the driver calls the
+ // system BIOS at function indicated event.
+
+ Store(0x00000240, PARM)
+
+ Store(Zero, GESF) // Clear the exit parameter
+ Return(SUCC) // Success
+ }
+
+ // Get Boot display Preferences: Sub-function 4
+
+ If (LEqual(GESF, 4))
+ {
+
+ //<TODO> Update the implementation specific Get Boot Display
+ // Preferences function.
+
+ And(PARM, 0xEFFF0000, PARM) // PARM[30:16] = Boot device ports
+ And(PARM, ShiftLeft(DeRefOf(Index(DBTB, IBTT)), 16), PARM)
+ Or(IBTT, PARM, PARM) // PARM[7:0] = Boot device type
+
+ Store(Zero, GESF) // Clear the exit parameter
+ Return(SUCC) // Success
+ }
+
+ // Panel details: Sub-function 5
+
+ If (LEqual(GESF, 5))
+ {
+
+ //<TODO> Update the implementation specific Get Panel Details
+ // function.
+
+ Store(IPSC, PARM) // Report the scaling setting
+ Or(PARM, ShiftLeft(IPAT, 8), PARM)
+ Add(PARM, 0x100, PARM) // Adjust panel type, 0 = VBT default
+ Or(PARM, ShiftLeft(LIDS, 16), PARM) // Report the lid state
+ Add(PARM, 0x10000, PARM) // Adjust the lid state, 0 = Unknown
+ Or(PARM, ShiftLeft(IBLC, 18), PARM) // Report the BLC setting
+ Or(PARM, ShiftLeft(IBIA, 20), PARM) // Report the BIA setting
+ Store(Zero, GESF)
+ Return(SUCC)
+ }
+
+ // TV-standard/Video-connector: Sub-function 6
+
+ If (LEqual(GESF, 6))
+ {
+
+ //<TODO> Update the implementation specific Get
+ // TV-standard/Video-connectorPanel function.
+
+ Store(ITVF, PARM)
+ Or(PARM, ShiftLeft(ITVM, 4), PARM)
+ Store(Zero, GESF)
+ Return(SUCC)
+ }
+
+ // Internal graphics: Sub-function 7
+
+ If (LEqual(GESF, 7))
+ {
+ Store(GIVD, PARM) // PARM[0] - VGA mode(1=VGA)
+ Xor(PARM, 1, PARM) // Invert the VGA mode polarity
+ Or(PARM, ShiftLeft(GMFN, 1), PARM) // PARM[1] - # IGD PCI functions-1
+ // PARM[3:2] - Reserved
+ // PARM[4] - IGD D3 support(0=cold)
+ // PARM[10:5] - Reserved
+ Or(PARM, ShiftLeft(3, 11), PARM) // PARM[12:11] - DVMT mode(11b = 5.0)
+
+ //
+ // Report DVMT 5.0 Total Graphics memory size.
+ //
+ Or(PARM, ShiftLeft(IDMS, 17), PARM) // Bits 20:17 are for Gfx total memory size
+
+ // If the "Set Internal Graphics" call is supported, the modified
+ // settings flag must be programmed per the specification. This means
+ // that the flag must be set to indicate that system BIOS requests
+ // these settings. Once "Set Internal Graphics" is called, the
+ // modified settings flag must be cleared on all subsequent calls to
+ // this function.
+
+ // Report the graphics frequency based on DISPLAY_CLOCK_FREQUENCY_ENCODING [MMADR+0x20C8]
+
+ Or(ShiftLeft(Derefof(Index(CDCT, DCFE)), 21),PARM, PARM)
+
+ Store(1, GESF) // Set the modified settings flag
+ Return(SUCC)
+ }
+
+ // Spread spectrum clocks: Sub-function 10
+
+ If (LEqual(GESF, 10))
+ {
+
+ Store(0, PARM) // Assume SSC is disabled
+
+ If(ISSC)
+ {
+ Or(PARM, 3, PARM) // If SSC enabled, return SSC1+Enabled
+ }
+
+ Store(0, GESF) // Set the modified settings flag
+ Return(SUCC) // Success
+ }
+
+
+ // A call to a reserved "Get BIOS data" function was received.
+
+ Store(Zero, GESF) // Clear the exit parameter
+ Return(CRIT) // Reserved, "Critical failure"
+}
diff --git a/ChvRefCodePkg/AcpiTablesPCAT/SystemAgent/IgdOpMobf.asl b/ChvRefCodePkg/AcpiTablesPCAT/SystemAgent/IgdOpMobf.asl
new file mode 100644
index 0000000000..bd52b4d91e
--- /dev/null
+++ b/ChvRefCodePkg/AcpiTablesPCAT/SystemAgent/IgdOpMobf.asl
@@ -0,0 +1,483 @@
+/** @file
+ ACPI DSDT table
+ IGD OpRegion/Software SCI Reference Code for the CherryView Family.
+ This file contains ASL code with the purpose of handling events
+ i.e. hotkeys and other system interrupts.
+
+ Copyright (c) 1999 - 2015, Intel Corporation. All rights reserved.<BR>
+
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php.
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+
+// Notes:
+// 1. The following routines are to be called from the appropriate event
+// handlers.
+// 2. This code cannot comprehend the exact implementation in the OEM's BIOS.
+// Therefore, an OEM must call these methods from the existing event
+// handler infrastructure. Details on when/why to call each method is
+// included in the method header under the "usage" section.
+
+
+/************************************************************************;
+;* ACPI Notification Methods
+;************************************************************************/
+
+
+/************************************************************************;
+;*
+;* Name: PDRD
+;*
+;* Description: Check if the graphics driver is ready to process
+;* notifications and video extensions.
+;*
+;* Usage: This method is to be called prior to performing any
+;* notifications or handling video extensions.
+;* Ex: If (PDRD()) {Return (FAIL)}
+;*
+;* Input: None
+;*
+;* Output: None
+;*
+;* References: DRDY (Driver ready status), ASLP (Driver recommended
+;* sleep timeout value).
+;*
+;************************************************************************/
+
+Method(PDRD)
+{
+ If(LNot(DRDY))
+ {
+
+ // Sleep for ASLP milliseconds if the driver is not ready.
+
+ Sleep(ASLP)
+ }
+
+ // If DRDY is clear, the driver is not ready. If the return value is
+ // !=0, do not perform any notifications or video extension handling.
+
+ Return(LNot(DRDY))
+}
+
+
+/************************************************************************;
+;*
+;* Name: PSTS
+;*
+;* Description: Check if the graphics driver has completed the previous
+;* "notify" command.
+;*
+;* Usage: This method is called before every "notify" command. A
+;* "notify" should only be set if the driver has completed the
+;* previous command. Else, ignore the event and exit the parent
+;* method.
+;* Ex: If (PSTS()) {Return (FAIL)}
+;*
+;* Input: None
+;*
+;* Output: None
+;*
+;* References: CSTS (Notification status), ASLP (Driver recommended sleep
+;* timeout value).
+;*
+;************************************************************************/
+
+Method(PSTS)
+{
+ If(LGreater(CSTS, 2))
+ {
+ // Sleep for ASLP milliseconds if the status is not "success,
+ // failure, or pending"
+ //
+ Sleep(ASLP)
+ }
+
+ Return(LEqual(CSTS, 3)) // Return True if still Dispatched
+}
+
+
+/************************************************************************;
+;*
+;* Name: GNOT
+;*
+;* Description: Call the appropriate methods to query the graphics driver
+;* status. If all methods return success, do a notification of
+;* the graphics device.
+;*
+;* Usage: This method is to be called when a graphics device
+;* notification is required (display switch hotkey, etc).
+;*
+;* Input: Arg0 = Current event type:
+;* 1 = display switch
+;* 2 = lid
+;* 3 = dock
+;* Arg1 = Notification type:
+;* 0 = Re-enumeration
+;* 0x80 = Display switch
+;*
+;* Output: Returns 0 = success, 1 = failure
+;*
+;* References: PDRD and PSTS methods. OSYS (OS version)
+;*
+;************************************************************************/
+
+Method(GNOT, 2)
+{
+ // Check for 1. Driver loaded, 2. Driver ready.
+ // If any of these cases is not met, skip this event and return failure.
+ //
+ If(PDRD())
+ {
+ Return(0x1) // Return failure if driver not loaded.
+ }
+
+ Store(Arg0, CEVT) // Set up the current event value
+ Store(3, CSTS) // CSTS=BIOS dispatched an event
+
+ If(LAnd(LEqual(CHPD, 0), LEqual(Arg1, 0))) // Do not re-enum if driver supports hotplug
+ {
+ If(LOr(LGreater(OSYS, 2000), LLess(OSYS, 2006)))
+ {
+ //
+ // WINXP requires that the entire PCI Bridge be re-enumerated.
+ //
+ Notify(\_SB.PCI0, Arg1)
+ }
+ Else
+ {
+ //
+ // Re-enumerate the Graphics Device for non-XP operating systems.
+ //
+ Notify(\_SB.PCI0.GFX0, Arg1)
+ }
+ }
+
+ Notify(\_SB.PCI0.GFX0,0x80)
+
+
+ Return(0x0) // Return success
+}
+
+
+/************************************************************************;
+;*
+;* Name: GHDS
+;*
+;* Description: Handle a hotkey display switching event (performs a
+;* Notify(GFX0, 0).
+;*
+;* Usage: This method must be called when a hotkey event occurs and the
+;* purpose of that hotkey is to do a display switch.
+;*
+;* Input: Arg0 = Toggle table number.
+;*
+;* Output: Returns 0 = success, 1 = failure.
+;* CEVT and TIDX are indirect outputs.
+;*
+;* References: TIDX, GNOT
+;*
+;************************************************************************/
+
+Method(GHDS, 1)
+{
+ Store(Arg0, TIDX) // Store the table number
+
+ // Call GNOT for CEVT = 1 = hotkey, notify value = 0
+
+ Return(GNOT(1, 0)) // Return stats from GNOT
+}
+
+
+/************************************************************************;
+;*
+;* Name: GLID
+;*
+;* Description: Handle a lid event (performs the Notify(GFX0, 0), but not the
+;* lid notify).
+;*
+;* Usage: This method must be called when a lid event occurs. A
+;* Notify(LID0, 0x80) must follow the call to this method.
+;*
+;* Input: Arg0 = Lid state:
+;* 0 = All closed
+;* 1 = internal LFP lid open
+;* 2 = external lid open
+;* 3 = both external and internal open
+;*
+;* Output: Returns 0=success, 1=failure.
+;* CLID and CEVT are indirect outputs.
+;*
+;* References: CLID, GNOT
+;*
+;************************************************************************/
+
+Method(GLID, 1)
+{
+ Store(Arg0, CLID) // Store the current lid state
+
+ // Call GNOT for CEVT=2=Lid, notify value = 0
+
+ Return(GNOT(2, 0)) // Return stats from GNOT
+}
+
+
+/************************************************************************;
+;*
+;* Name: GDCK
+;*
+;* Description: Handle a docking event by updating the current docking status
+;* and doing a notification.
+;*
+;* Usage: This method must be called when a docking event occurs.
+;*
+;* Input: Arg0 = Docking state:
+;* 0 = Undocked
+;* 1 = Docked
+;*
+;* Output: Returns 0=success, 1=failure.
+;* CDCK and CEVT are indirect outputs.
+;*
+;* References: CDCK, GNOT
+;*
+;************************************************************************/
+
+Method(GDCK, 1)
+{
+ Store(Arg0, CDCK) // Store the current dock state
+
+ // Call GNOT for CEVT=4=Dock, notify value = 0
+
+ Return(GNOT(4, 0)) // Return stats from GNOT
+}
+
+
+/************************************************************************;
+;* ASLE Interrupt Methods
+;************************************************************************/
+
+
+/************************************************************************;
+;*
+;* Name: PARD
+;*
+;* Description: Check if the driver is ready to handle ASLE interrupts
+;* generate by the system BIOS.
+;*
+;* Usage: This method must be called before generating each ASLE
+;* interrupt.
+;*
+;* Input: None
+;*
+;* Output: Returns 0 = success, 1 = failure.
+;*
+;* References: ARDY (Driver readiness), ASLP (Driver recommended sleep
+;* timeout value)
+;*
+;************************************************************************/
+
+Method(PARD)
+{
+ If(LNot(ARDY))
+ {
+
+ // Sleep for ASLP milliseconds if the driver is not ready.
+
+ Sleep(ASLP)
+ }
+
+ // If ARDY is clear, the driver is not ready. If the return value is
+ // !=0, do not generate the ASLE interrupt.
+
+ Return(LNot(ARDY))
+}
+
+
+/************************************************************************;
+;*
+;* Name: AINT
+;*
+;* Description: Call the appropriate methods to generate an ASLE interrupt.
+;* This process includes ensuring the graphics driver is ready
+;* to process the interrupt, ensuring the driver supports the
+;* interrupt of interest, and passing information about the event
+;* to the graphics driver.
+;*
+;* Usage: This method must called to generate an ASLE interrupt.
+;*
+;* Input: Arg0 = ASLE command function code:
+;* 0 = Set ALS illuminance
+;* 1 = Set backlight brightness
+;* 2 = Do Panel Fitting
+;* Arg1 = If Arg0 = 0, current ALS reading:
+;* 0 = Reading below sensor range
+;* 1-0xFFFE = Current sensor reading
+;* 0xFFFF = Reading above sensor range
+;* Arg1 = If Arg0 = 1, requested backlight percentage
+;*
+;* Output: Returns 0 = success, 1 = failure
+;*
+;* References: PARD method.
+;*
+;************************************************************************/
+
+Method(AINT, 2)
+{
+
+ // Return failure if the requested feature is not supported by the
+ // driver.
+
+ If(LNot(And(TCHE, ShiftLeft(1, Arg0))))
+ {
+ Return(0x1)
+ }
+
+ // Return failure if the driver is not ready to handle an ASLE
+ // interrupt.
+
+ If(PARD())
+ {
+ Return(0x1)
+ }
+
+ // Evaluate the first argument (Panel fitting, backlight brightness, or ALS).
+
+ If(LEqual(Arg0, 2)) // Arg0 = 2, so request a panel fitting mode change.
+ {
+ If(CPFM) // If current mode field is non-zero use it.
+ {
+ And(CPFM, 0x0F, Local0) // Create variables without reserved
+ And(EPFM, 0x0F, Local1) // or valid bits.
+
+ If(LEqual(Local0, 1)) // If current mode is centered,
+ {
+ If(And(Local1, 6)) // and if stretched is enabled,
+ {
+ Store(6, PFIT) // request stretched.
+ }
+ Else // Otherwise,
+ {
+ If(And(Local1, 8)) // if aspect ratio is enabled,
+ {
+ Store(8, PFIT) // request aspect ratio.
+ }
+ Else // Only centered mode is enabled
+ {
+ Store(1, PFIT) // so request centered. (No change.)
+ }
+ }
+ }
+ If(LEqual(Local0, 6)) // If current mode is stretched,
+ {
+ If(And(Local1, 8)) // and if aspect ratio is enabled,
+ {
+ Store(8, PFIT) // request aspect ratio.
+ }
+ Else // Otherwise,
+ {
+ If(And(Local1, 1)) // if centered is enabled,
+ {
+ Store(1, PFIT) // request centered.
+ }
+ Else // Only stretched mode is enabled
+ {
+ Store(6, PFIT) // so request stretched. (No change.)
+ }
+ }
+ }
+ If(LEqual(Local0, 8)) // If current mode is aspect ratio,
+ {
+ If(And(Local1, 1)) // and if centered is enabled,
+ {
+ Store(1, PFIT) // request centered.
+ }
+ Else // Otherwise,
+ {
+ If(And(Local1, 6)) // if stretched is enabled,
+ {
+ Store(6, PFIT) // request stretched.
+ }
+ Else // Only aspect ratio mode is enabled
+ {
+ Store(8, PFIT) // so request aspect ratio. (No change.)
+ }
+ }
+ }
+ }
+
+ // The following code for panel fitting (within the Else condition) is retained for backward compatiblity.
+
+ Else // If CFPM field is zero use PFIT and toggle the
+ {
+ Xor(PFIT,7,PFIT) // mode setting between stretched and centered only.
+ }
+
+ Or(PFIT,0x80000000,PFIT) // Set the valid bit for all cases.
+
+ Store(4, ASLC) // Store "Panel fitting event" to ASLC[31:1]
+ }
+ Else
+ {
+ If(LEqual(Arg0, 1)) // Arg0=1, so set the backlight brightness.
+ {
+ Store(Divide(Multiply(Arg1, 255), 100), BCLP) // Convert from percent to 0-255.
+
+ Or(BCLP, 0x80000000, BCLP) // Set the valid bit.
+
+ Store(2, ASLC) // Store "Backlight control event" to ASLC[31:1]
+ }
+ Else
+ {
+ If(LEqual(Arg0, 0)) // Arg0=0, so set the ALS illuminace
+ {
+ Store(Arg1, ALSI)
+
+ Store(1, ASLC) // Store "ALS event" to ASLC[31:1]
+ }
+ Else
+ {
+ Return(0x1) // Unsupported function
+ }
+ }
+ }
+
+ Store(0x01, ASLE) // Generate ASLE interrupt
+ Return(0x0) // Return success
+}
+
+
+/************************************************************************;
+;*
+;* Name: SCIP
+;*
+;* Description: Checks the presence of the OpRegion and SCI
+;*
+;* Usage: This method is called before other OpRegion methods. The
+;* former "GSMI True/False is not always valid. This method
+;* checks if the OpRegion Version is non-zero and if non-zero,
+;* (present and readable) then checks the GSMI flag.
+;*
+;* Input: None
+;*
+;* Output: Boolean True = SCI present.
+;*
+;* References: None
+;*
+;************************************************************************/
+
+Method(SCIP)
+{
+ If(LNotEqual(OVER,0)) // If OpRegion Version not 0.
+ {
+ Return(LNot(GSMI)) // Return True if SCI.
+ }
+
+ Return(0) // Else Return False.
+}
diff --git a/ChvRefCodePkg/AcpiTablesPCAT/SystemAgent/IgdOpRn.ASL b/ChvRefCodePkg/AcpiTablesPCAT/SystemAgent/IgdOpRn.ASL
new file mode 100644
index 0000000000..528e1653f4
--- /dev/null
+++ b/ChvRefCodePkg/AcpiTablesPCAT/SystemAgent/IgdOpRn.ASL
@@ -0,0 +1,298 @@
+/** @file
+ ACPI DSDT table
+ IGD OpRegion/Software SCI Reference Code for the CherryView Family.
+ This file contains the interrupt handler code for the Integrated
+ Graphics Device (IGD) OpRegion/Software SCI mechanism.
+
+ Copyright (c) 1999 - 2015, Intel Corporation. All rights reserved.<BR>
+
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php.
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+
+//NOTES:
+//
+// (1) The code contained in this file inherits the scope in which it
+// was included. So BIOS developers must be sure to include this
+// file in the scope associated with the graphics device
+// (ex. \_SB.PCI0.GFX0).
+// (2) Create a _L06 method under the GPE scope to handle the event
+// generated by the graphics driver. The _L06 method must call
+// the GSCI method in this file.
+// (3) The MCHP operation region assumes that _ADR and _BBN names
+// corresponding to bus 0, device0, function 0 have been declared
+// under the PCI0 scope.
+// (4) Before the first execution of the GSCI method, the base address
+// of the GMCH SCI OpRegion must be programmed where the driver can
+// access it. A 32bit scratch register at 0xFC in the IGD PCI
+// configuration space (B0/D2/F0/R0FCh) is used for this purpose.
+
+// Define an OperationRegion to cover the GMCH PCI configuration space as
+// described in the IGD OpRegion specificiation.
+
+// Define an OperationRegion to cover the IGD PCI configuration space as
+// described in the IGD OpRegion specificiation.
+
+OperationRegion(IGDP, PCI_Config,0x00,0x100)
+Field(IGDP, AnyAcc, NoLock, Preserve)
+{
+ Offset(0x00), // Device and Vendor ID
+ GVID, 32,
+ Offset(0x10), // GTTMMADR
+ MADR, 32,
+ Offset(0x50), // GMCH Graphics Control Register
+ , 1,
+ GIVD, 1, // IGD VGA disable bit
+ , 1,
+ GUMA, 5, // Stolen memory size
+ , 8,
+ Offset(0x54),
+ , 4,
+ GMFN, 1, // Gfx function 1 enable
+ , 27,
+ Offset(0x5C), // Stolen Memory Base Address
+ GSTM, 32,
+ Offset(0xE0), // Reg 0xE8, SWSCI control register
+ GSSE, 1, // Graphics SCI event (1=event pending)
+ GSSB, 14, // Graphics SCI scratchpad bits
+ GSES, 1, // Graphics event select (1=SCI)
+ Offset(0xE4),
+ ASLE, 8, // Reg 0xE4, ASLE interrupt register
+ , 24, // Only use first byte of ASLE reg
+ Offset(0xFC),
+ ASLS, 32, // Reg 0xFC, Address of the IGD OpRegion
+}
+
+Method (GTTM, 0, Serialized)
+{
+ If (LEqual (GVID, 0xFFFFFFFF)) {
+ Return (ABTR)
+ } Else {
+ Return (MADR)
+ }
+}
+
+OperationRegion(IGMM, SystemMemory, GTTM(), 0x3000)
+Field(IGMM,AnyAcc, NoLock, Preserve)
+{
+ Offset(0X20C8),
+ , 4,
+ DCFE, 4, // DISPLAY_CLOCK_FREQUENCY_ENCODING
+}
+
+// Define an OperationRegion to cover the IGD OpRegion layout.
+
+OperationRegion(IGDM, SystemMemory, ASLB, 0x2000)
+Field(IGDM, AnyAcc, NoLock, Preserve)
+{
+
+ // OpRegion Header
+
+ SIGN, 128, // Signature-"IntelGraphicsMem"
+ SIZE, 32, // OpRegion Size
+ OVER, 32, // OpRegion Version
+ SVER, 256, // System BIOS Version
+ VVER, 128, // VBIOS Version
+ GVER, 128, // Driver version
+ MBOX, 32, // Mailboxes supported
+ DMOD, 32, // Driver Model
+
+ // OpRegion Mailbox 1 (Public ACPI Methods)
+ // Note: Mailbox 1 is normally reserved for desktop platforms.
+
+ Offset(0x100),
+ DRDY, 32, // Driver readiness (ACPI notification)
+ CSTS, 32, // Notification status
+ CEVT, 32, // Current event
+ Offset(0x120),
+ DIDL, 32, // Supported display device ID list
+ DDL2, 32, // Allows for 8 devices
+ DDL3, 32,
+ DDL4, 32,
+ DDL5, 32,
+ DDL6, 32,
+ DDL7, 32,
+ DDL8, 32,
+ CPDL, 32, // Currently present display list
+ CPL2, 32, // Allows for 8 devices
+ CPL3, 32,
+ CPL4, 32,
+ CPL5, 32,
+ CPL6, 32,
+ CPL7, 32,
+ CPL8, 32,
+ CAD1, 32, // Currently active display list
+ CAL2, 32, // Allows for 8 devices
+ CAL3, 32,
+ CAL4, 32,
+ CAL5, 32,
+ CAL6, 32,
+ CAL7, 32,
+ CAL8, 32,
+ NADL, 32, // Next active display list
+ NDL2, 32, // Allows for 8 devices
+ NDL3, 32,
+ NDL4, 32,
+ NDL5, 32,
+ NDL6, 32,
+ NDL7, 32,
+ NDL8, 32,
+ ASLP, 32, // ASL sleep timeout
+ TIDX, 32, // Toggle table index
+ CHPD, 32, // Current hot plug enable indicator
+ CLID, 32, // Current lid state indicator
+ CDCK, 32, // Current docking state indicator
+ SXSW, 32, // Display switch notify on resume
+ EVTS, 32, // Events supported by ASL (diag only)
+ CNOT, 32, // Current OS notifications (diag only)
+ NRDY, 32,
+
+ // OpRegion Mailbox 2 (Software SCI Interface)
+
+ Offset(0x200), // SCIC
+ SCIE, 1, // SCI entry bit (1=call unserviced)
+ GEFC, 4, // Entry function code
+ GXFC, 3, // Exit result
+ GESF, 8, // Entry/exit sub-function/parameter
+ , 16, // SCIC[31:16] reserved
+ Offset(0x204), // PARM
+ PARM, 32, // PARM register (extra parameters)
+ DSLP, 32, // Driver sleep time out
+
+ // OpRegion Mailbox 3 (BIOS to Driver Notification)
+ // Note: Mailbox 3 is normally reserved for desktop platforms.
+
+ Offset(0x300),
+ ARDY, 32, // Driver readiness (power conservation)
+ ASLC, 32, // ASLE interrupt command/status
+ TCHE, 32, // Technology enabled indicator
+ ALSI, 32, // Current ALS illuminance reading
+ BCLP, 32, // Backlight brightness
+ PFIT, 32, // Panel fitting state or request
+ CBLV, 32, // Current brightness level
+ BCLM, 320, // Backlight brightness level duty cycle mapping table
+ CPFM, 32, // Current panel fitting mode
+ EPFM, 32, // Enabled panel fitting modes
+ PLUT, 592, // Optional. 74-byte Panel LUT Table
+ PFMB, 32, // Optional. PWM Frequency and Minimum Brightness
+ CCDV, 32, // Optional. Gamma, Brightness, Contrast values.
+ PCFT, 32, // Optional. Power Conservation Features
+
+ // OpRegion Mailbox 4 (VBT)
+
+ Offset(0x400),
+ GVD1, 0xC000, // 6K bytes maximum VBT image
+
+ // OpRegion Mailbox 5 (BIOS to Driver Notification Extension)
+
+ Offset(0x1C00),
+ PHED, 32, // Panel Header
+ BDDC, 2048, // Panel EDID (Max 256 bytes)
+
+}
+
+
+
+// Convert boot display type into a port mask.
+
+Name (DBTB, Package()
+{
+ 0x0000, // Automatic
+ 0x0007, // Port-0 : Integrated CRT
+ 0x0038, // Port-1 : DVO-A, or Integrated LVDS
+ 0x01C0, // Port-2 : SDVO-B, or SDVO-B/C
+ 0x0E00, // Port-3 : SDVO-C
+ 0x003F, // [CRT + DVO-A / Integrated LVDS]
+ 0x01C7, // [CRT + SDVO-B] or [CRT + SDVO-B/C]
+ 0x0E07, // [CRT + SDVO-C]
+ 0x01F8, // [DVO-A / Integrated LVDS + SDVO-B]
+ 0x0E38, // [DVO-A / Integrated LVDS + SDVO-C]
+ 0x0FC0, // [SDVO-B + SDVO-C]
+ 0x0000, // Reserved
+ 0x0000, // Reserved
+ 0x0000, // Reserved
+ 0x0000, // Reserved
+ 0x0000, // Reserved
+ 0x7000, // Port-4: Integrated TV
+ 0x7007, // [Integrated TV + CRT]
+ 0x7038, // [Integrated TV + LVDS]
+ 0x71C0, // [Integrated TV + DVOB]
+ 0x7E00 // [Integrated TV + DVOC]
+})
+
+// Core display clock value table.
+
+Name (CDCT, Package()
+{
+ Package() {160},
+ Package() {200},
+ Package() {267},
+ Package() {320},
+ Package() {356},
+ Package() {400},
+})
+
+// Defined exit result values:
+
+Name (SUCC, 1) // Exit result: Success
+Name (NVLD, 2) // Exit result: Invalid parameter
+Name (CRIT, 4) // Exit result: Critical failure
+Name (NCRT, 6) // Exit result: Non-critical failure
+
+
+/************************************************************************;
+;*
+;* Name: GSCI
+;*
+;* Description: Handles an SCI generated by the graphics driver. The
+;* PARM and SCIC input fields are parsed to determine the
+;* functionality requested by the driver. GBDA or SBCB
+;* is called based on the input data in SCIC.
+;*
+;* Usage: The method must be called in response to a GPE 06 event
+;* which will be generated by the graphics driver.
+;* Ex: Method(\_GPE._L06) {Return(\_SB.PCI0.GFX0.GSCI())}
+;*
+;* Input: PARM and SCIC are indirect inputs
+;*
+;* Output: PARM and SIC are indirect outputs
+;*
+;* References: GBDA (Get BIOS Data method), SBCB (System BIOS Callback
+;* method)
+;*
+;************************************************************************/
+
+Method (GSCI, 0, Serialized)
+{
+ Include("SystemAgent/IgdOpGbda.asl") // "Get BIOS Data" Functions
+ Include("SystemAgent/IgdOpSbcb.asl") // "System BIOS CallBacks"
+
+ If (LNotEqual(GVID, 0xFFFFFFFF)) {
+ If (LEqual(GEFC, 4))
+ {
+ Store(GBDA(), GXFC) // Process Get BIOS Data functions
+ }
+
+ If (LEqual(GEFC, 6))
+ {
+ Store(SBCB(), GXFC) // Process BIOS Callback functions
+ }
+
+ Store(0, GEFC) // Wipe out the entry function code
+ Store(0, GSSE) // Clear the SCI generation bit in PCI space.
+ Store(0, SCIE) // Clr SCI serviced bit to signal completion
+ }
+ Store(1, SCIS) // Clear the GUNIT SCI status bit in PCH ACPI I/O space.
+
+ Return(Zero)
+}
+
+// Include MOBLFEAT.ASL for mobile systems only. Remove for desktop.
+Include("SystemAgent/IgdOpMobf.asl") // IGD SCI mobile features
diff --git a/ChvRefCodePkg/AcpiTablesPCAT/SystemAgent/IgdOpSbcb.asl b/ChvRefCodePkg/AcpiTablesPCAT/SystemAgent/IgdOpSbcb.asl
new file mode 100644
index 0000000000..72ee150898
--- /dev/null
+++ b/ChvRefCodePkg/AcpiTablesPCAT/SystemAgent/IgdOpSbcb.asl
@@ -0,0 +1,287 @@
+/** @file
+ ACPI DSDT table
+ IGD OpRegion/Software SCI Reference Code for the CherryView Family.
+ This file contains the system BIOS call back functionality for the
+ OpRegion/Software SCI mechanism.
+
+ Copyright (c) 1999 - 2015, Intel Corporation. All rights reserved.<BR>
+
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php.
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+
+Method (SBCB, 0, Serialized)
+{
+
+ // Supported Callbacks: Sub-function 0
+
+ If (LEqual(GESF, 0x0))
+ {
+
+ //<TODO> An OEM may support the driver->SBIOS status callbacks, but
+ // the supported callbacks value must be modified. The code that is
+ // executed upon reception of the callbacks must be also be updated
+ // to perform the desired functionality.
+
+ Store(0x00000000, PARM) // No callbacks supported
+ //Store(0x000787FD, PARM) // Used for Intel test implementaion
+
+ // <NOTSAMPLECODE>
+
+ If(LEqual(PFLV,FMBL))
+ {
+ Store(0x000F87FD, PARM) // Mobile
+ }
+ If(LEqual(PFLV,FDTP))
+ {
+ Store(0x000F87BD, PARM) // Desktop
+ }
+
+ // </NOTSAMPLECODE>
+
+ Store(Zero, GESF) // Clear the exit parameter
+ Return(SUCC) // "Success"
+ }
+
+ // BIOS POST Completion: Sub-function 1
+
+ If (LEqual(GESF, 1))
+ {
+ Store(Zero, GESF) // Clear the exit parameter
+ Store(Zero, PARM)
+ Return(SUCC) // Not supported, but no failure
+ }
+
+ // Pre-Hires Set Mode: Sub-function 3
+
+ If (LEqual(GESF, 3))
+ {
+ Store(Zero, GESF) // Clear the exit parameter
+ Store(Zero, PARM)
+ Return(SUCC) // Not supported, but no failure
+ }
+
+ // Post-Hires Set Mode: Sub-function 4
+
+ If (LEqual(GESF, 4))
+ {
+ Store(Zero, GESF) // Clear the exit parameter
+ Store(Zero, PARM)
+ Return(SUCC) // Not supported, but no failure
+ }
+
+ // Display Switch: Sub-function 5
+
+ If (LEqual(GESF, 5))
+ {
+ Store(Zero, GESF) // Clear the exit parameter
+ Store(Zero, PARM)
+ Return(SUCC) // Not supported, but no failure
+ }
+
+ // Set TV format: Sub-function 6
+
+ If (LEqual(GESF, 6))
+ {
+
+ //<TODO> If implemented, the input values must be saved into
+ // non-volatile storage for parsing during the next boot. The
+ // following Sample code is Intel validated implementation.
+
+ Store(And(PARM, 0x0F), ITVF)
+ Store(ShiftRight(And(PARM, 0xF0), 4), ITVM)
+ Store(Zero, GESF) // Clear the exit parameter
+ Store(Zero, PARM)
+ Return(SUCC)
+ }
+
+ // Adapter Power State: Sub-function 7
+
+ If (LEqual(GESF, 7))
+ {
+
+ // Upon notification from driver that the Adapter Power State = D0,
+ // check if previous lid event failed. If it did, retry the lid
+ // event here.
+ If(LEqual(PARM, 0))
+ {
+ Store(CLID, Local0)
+ If(And(0x80000000,Local0))
+ {
+ And(CLID, 0x0000000F, CLID)
+ GLID(CLID)
+ }
+ }
+ Store(Zero, GESF) // Clear the exit parameter
+ Store(Zero, PARM)
+ Return(SUCC) // Not supported, but no failure
+ }
+
+ // Display Power State: Sub-function 8
+
+ If (LEqual(GESF, 8))
+ {
+ Store(Zero, GESF) // Clear the exit parameter
+ Store(Zero, PARM)
+ Return(SUCC) // Not supported, but no failure
+ }
+
+ // Set Boot Display: Sub-function 9
+
+ If (LEqual(GESF, 9))
+ {
+
+ //<TODO> An OEM may elect to implement this method. In that case,
+ // the input values must be saved into non-volatile storage for
+ // parsing during the next boot. The following Sample code is Intel
+ // validated implementation.
+
+ And(PARM, 0xFF, IBTT) // Save the boot display to NVS
+ Store(Zero, GESF) // Clear the exit parameter
+ Store(Zero, PARM)
+ Return(SUCC) // Reserved, "Critical failure"
+ }
+
+ // Set Panel Details: Sub-function 10 (0Ah)
+
+ If (LEqual(GESF, 10))
+ {
+
+ //<TODO> An OEM may elect to implement this method. In that case,
+ // the input values must be saved into non-volatile storage for
+ // parsing during the next boot. The following Sample code is Intel
+ // validated implementation.
+
+ // Set the panel-related NVRAM variables based the input from the driver.
+
+ And(PARM, 0xFF, IPSC)
+
+ // Change panel type if a change is requested by the driver (Change if
+ // panel type input is non-zero). Zero=No change requested.
+
+ If(And(ShiftRight(PARM, 8), 0xFF))
+ {
+ And(ShiftRight(PARM, 8), 0xFF, IPAT)
+ Decrement(IPAT) // 0 = no change, so fit to CMOS map
+ }
+ And(ShiftRight(PARM, 18), 0x3, IBLC)
+ And(ShiftRight(PARM, 20), 0x7, IBIA)
+ Store(Zero, GESF) // Clear the exit parameter
+ Store(Zero, PARM)
+ Return(SUCC) // Success
+ }
+
+ // Set Internal Graphics: Sub-function 11 (0Bh)
+
+ If (LEqual(GESF, 11))
+ {
+
+ //<TODO> An OEM may elect to implement this method. In that case,
+ // the input values must be saved into non-volatile storage for
+ // parsing during the next boot. The following Sample code is Intel
+ // validated implementation.
+
+ And(ShiftRight(PARM, 1), 1, IF1E) // Program the function 1 option
+
+ //If(And(PARM, ShiftLeft(0xF, 13))) // Use fixed memory if fixed size != 0
+ //{
+
+ // Fixed memory
+
+ //And(ShiftRight(PARM, 13), 0xF, IDMS) // Program fixed memory size
+ //}
+ //Else
+ //{
+
+ // Fixed memory/DVMT memory
+
+ And(ShiftRight(PARM, 17), 0xF, IDMS) // Program DVMT/fixed memory size
+ //}
+ Store(Zero, GESF) // Clear the exit parameter
+ Store(Zero, PARM)
+ Return(SUCC) // Success
+ }
+
+ // Post-Hires to DOS FS: Sub-function 16 (10h)
+
+ If (LEqual(GESF, 16))
+ {
+ Store(Zero, GESF) // Clear the exit parameter
+ Store(Zero, PARM)
+ Return(SUCC) // Not supported, but no failure
+ }
+
+ // APM Complete: Sub-function 17 (11h)
+
+ If (LEqual(GESF, 17))
+ {
+
+ Store(ShiftLeft(LIDS, 8), PARM) // Report the lid state
+ Add(PARM, 0x100, PARM) // Adjust the lid state, 0 = Unknown
+
+ Store(Zero, GESF) // Clear the exit parameter
+ Return(SUCC) // Not supported, but no failure
+ }
+
+ // Set Spread Spectrum Clocks: Sub-function 18 (12h)
+
+ If (LEqual(GESF, 18))
+ {
+
+ //<TODO> An OEM may elect to implement this method. In that case,
+ // the input values must be saved into non-volatile storage for
+ // parsing during the next boot. The following Sample code is Intel
+ // validated implementation.
+
+ If(And(PARM, 1))
+ {
+ If(LEqual(ShiftRight(PARM, 1), 1))
+ {
+ Store(1, ISSC) // Enable HW SSC, only for clock 1
+ }
+ Else
+ {
+ Store(Zero, GESF)
+ Return(CRIT) // Failure, as the SSC clock must be 1
+ }
+ }
+ Else
+ {
+ Store(0, ISSC) // Disable SSC
+ }
+ Store(Zero, GESF) // Clear the exit parameter
+ Store(Zero, PARM)
+ Return(SUCC) // Success
+ }
+
+ // Post VBE/PM Callback: Sub-function 19 (13h)
+
+ If (LEqual(GESF, 19))
+ {
+ Store(Zero, GESF) // Clear the exit parameter
+ Store(Zero, PARM)
+ Return(SUCC) // Not supported, but no failure
+ }
+
+ // Set PAVP Data: Sub-function 20 (14h)
+
+ If (LEqual(GESF, 20))
+ {
+ And(PARM, 0xF, PAVP) // Store PAVP info
+ Store(Zero, GESF) // Clear the exit parameter
+ Store(Zero, PARM)
+ Return(SUCC) // Success
+ }
+
+ // A call to a reserved "System BIOS callbacks" function was received
+
+ Store(Zero, GESF) // Clear the exit parameter
+ Return(SUCC) // Reserved, "Critical failure"
+}
diff --git a/ChvRefCodePkg/AcpiTablesPCAT/SystemAgent/IntelGraphics.asl b/ChvRefCodePkg/AcpiTablesPCAT/SystemAgent/IntelGraphics.asl
new file mode 100644
index 0000000000..d7e45fd7b2
--- /dev/null
+++ b/ChvRefCodePkg/AcpiTablesPCAT/SystemAgent/IntelGraphics.asl
@@ -0,0 +1,1009 @@
+/** @file
+ ACPI DSDT table
+ IGD OpRegion/Software ACPI Reference Code for the CherryView Family.
+
+ Copyright (c) 1999 - 2015, Intel Corporation. All rights reserved.<BR>
+
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php.
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+//Device(GFX0)
+//{
+// Name(_ADR, 0x00020000)
+
+ // Enable/Disable Output Switching. In WIN2K/WINXP, _DOS = 0 will
+ // get called during initialization to prepare for an ACPI Display
+ // Switch Event. During an ACPI Display Switch, the OS will call
+ // _DOS = 2 immediately after a Notify=0x80 to temporarily disable
+ // all Display Switching. After ACPI Display Switching is complete,
+ // the OS will call _DOS = 0 to re-enable ACPI Display Switching.
+
+ Method(_DOS,1)
+ {
+ // Store Display Switching and LCD brightness BIOS control bit
+ Store(And(Arg0,7),DSEN)
+ }
+
+ // Enumerate the Display Environment. This method will return
+ // valid addresses for all display device encoders present in the
+ // system. The Miniport Driver will reject the addresses for every
+ // encoder that does not have an attached display device. After
+ // enumeration is complete, the OS will call the _DGS methods
+ // during a display switch only for the addresses accepted by the
+ // Miniport Driver. For hot-insertion and removal of display
+ // devices, a re-enumeration notification will be required so the
+ // address of the newly present display device will be accepted by
+ // the Miniport Driver.
+
+ Method(_DOD,0)
+ {
+ If (LEqual(ISPE,1)) {
+ //
+ // Increment number of devices if ISP is enabled
+ //
+ Store(1, NDID)
+ } Else {
+ Store(0, NDID)
+ }
+ If(LNotEqual(DIDL, Zero))
+ {
+ Store(SDDL(DIDL),DID1)
+ }
+ If(LNotEqual(DDL2, Zero))
+ {
+ Store(SDDL(DDL2),DID2)
+ }
+ If(LNotEqual(DDL3, Zero))
+ {
+ Store(SDDL(DDL3),DID3)
+ }
+ If(LNotEqual(DDL4, Zero))
+ {
+ Store(SDDL(DDL4),DID4)
+ }
+ If(LNotEqual(DDL5, Zero))
+ {
+ Store(SDDL(DDL5),DID5)
+ }
+ If(LNotEqual(DDL6, Zero))
+ {
+ Store(SDDL(DDL6),DID6)
+ }
+ If(LNotEqual(DDL7, Zero))
+ {
+ Store(SDDL(DDL7),DID7)
+ }
+ If(LNotEqual(DDL8, Zero))
+ {
+ Store(SDDL(DDL8),DID8)
+ }
+
+ // TODO - This level of flexibility is not needed for a true
+ // OEM design. Simply determine the greatest number of
+ // encoders the platform will suppport then remove all
+ // return packages beyond that value. Note that for
+ // current silicon, the maximum number of encoders
+ // possible is 8.
+
+ If(LEqual(NDID,1))
+ {
+ Name(TMP1,Package() {
+ 0xFFFFFFFF})
+ If (LEqual(ISPE,1)) {
+ //
+ // IGFX need report ISP Device as GFX0 child
+ //
+ Store(0x000222B8,Index(TMP1,0))
+ } Else {
+ Store(Or(0x10000,DID1),Index(TMP1,0))
+ }
+ Return(TMP1)
+ }
+
+ If(LEqual(NDID,2))
+ {
+ Name(TMP2,Package() {
+ 0xFFFFFFFF,
+ 0xFFFFFFFF})
+ If (LEqual(ISPE,1)) {
+ //
+ // IGFX need report ISP Device as GFX0 child
+ //
+ Store(Or(0x10000,DID1),Index(TMP2,0))
+ Store(0x000222B8,Index(TMP2,1))
+ } Else {
+ Store(Or(0x10000,DID1),Index(TMP2,0))
+ Store(Or(0x10000,DID2),Index(TMP2,1))
+ }
+ Return(TMP2)
+ }
+
+ If(LEqual(NDID,3))
+ {
+ Name(TMP3,Package() {
+ 0xFFFFFFFF,
+ 0xFFFFFFFF,
+ 0xFFFFFFFF})
+ If (LEqual(ISPE,1)) {
+ //
+ // IGFX need report ISP Device as GFX0 child
+ //
+ Store(Or(0x10000,DID1),Index(TMP3,0))
+ Store(Or(0x10000,DID2),Index(TMP3,1))
+ Store(0x000222B8,Index(TMP3,2))
+ } Else {
+ Store(Or(0x10000,DID1),Index(TMP3,0))
+ Store(Or(0x10000,DID2),Index(TMP3,1))
+ Store(Or(0x10000,DID3),Index(TMP3,2))
+ }
+ Return(TMP3)
+ }
+
+ If(LEqual(NDID,4))
+ {
+ Name(TMP4,Package() {
+ 0xFFFFFFFF,
+ 0xFFFFFFFF,
+ 0xFFFFFFFF,
+ 0xFFFFFFFF})
+ If (LEqual(ISPE,1)) {
+ //
+ // IGFX need report ISP Device as GFX0 child
+ //
+ Store(Or(0x10000,DID1),Index(TMP4,0))
+ Store(Or(0x10000,DID2),Index(TMP4,1))
+ Store(Or(0x10000,DID3),Index(TMP4,2))
+ Store(0x000222B8,Index(TMP4,3))
+ } Else {
+ Store(Or(0x10000,DID1),Index(TMP4,0))
+ Store(Or(0x10000,DID2),Index(TMP4,1))
+ Store(Or(0x10000,DID3),Index(TMP4,2))
+ Store(Or(0x10000,DID4),Index(TMP4,3))
+ }
+ Return(TMP4)
+ }
+
+ If(LEqual(NDID,5))
+ {
+ Name(TMP5,Package() {
+ 0xFFFFFFFF,
+ 0xFFFFFFFF,
+ 0xFFFFFFFF,
+ 0xFFFFFFFF,
+ 0xFFFFFFFF})
+ If (LEqual(ISPE,1)) {
+ //
+ // IGFX need report ISP Device as GFX0 child
+ //
+ Store(Or(0x10000,DID1),Index(TMP5,0))
+ Store(Or(0x10000,DID2),Index(TMP5,1))
+ Store(Or(0x10000,DID3),Index(TMP5,2))
+ Store(Or(0x10000,DID4),Index(TMP5,3))
+ Store(0x000222B8,Index(TMP5,4))
+ } Else {
+ Store(Or(0x10000,DID1),Index(TMP5,0))
+ Store(Or(0x10000,DID2),Index(TMP5,1))
+ Store(Or(0x10000,DID3),Index(TMP5,2))
+ Store(Or(0x10000,DID4),Index(TMP5,3))
+ Store(Or(0x10000,DID5),Index(TMP5,4))
+ }
+ Return(TMP5)
+ }
+
+ If(LEqual(NDID,6))
+ {
+ Name(TMP6,Package() {
+ 0xFFFFFFFF,
+ 0xFFFFFFFF,
+ 0xFFFFFFFF,
+ 0xFFFFFFFF,
+ 0xFFFFFFFF,
+ 0xFFFFFFFF})
+ If (LEqual(ISPE,1)) {
+ //
+ // IGFX need report ISP Device as GFX0 child
+ //
+ Store(Or(0x10000,DID1),Index(TMP6,0))
+ Store(Or(0x10000,DID2),Index(TMP6,1))
+ Store(Or(0x10000,DID3),Index(TMP6,2))
+ Store(Or(0x10000,DID4),Index(TMP6,3))
+ Store(Or(0x10000,DID5),Index(TMP6,4))
+ Store(0x000222B8,Index(TMP6,5))
+ } Else {
+ Store(Or(0x10000,DID1),Index(TMP6,0))
+ Store(Or(0x10000,DID2),Index(TMP6,1))
+ Store(Or(0x10000,DID3),Index(TMP6,2))
+ Store(Or(0x10000,DID4),Index(TMP6,3))
+ Store(Or(0x10000,DID5),Index(TMP6,4))
+ Store(Or(0x10000,DID6),Index(TMP6,5))
+ }
+ Return(TMP6)
+ }
+
+ If(LEqual(NDID,7))
+ {
+ Name(TMP7,Package() {
+ 0xFFFFFFFF,
+ 0xFFFFFFFF,
+ 0xFFFFFFFF,
+ 0xFFFFFFFF,
+ 0xFFFFFFFF,
+ 0xFFFFFFFF,
+ 0xFFFFFFFF})
+ If (LEqual(ISPE,1)) {
+ //
+ // IGFX need report ISP Device as GFX0 child
+ //
+ Store(Or(0x10000,DID1),Index(TMP7,0))
+ Store(Or(0x10000,DID2),Index(TMP7,1))
+ Store(Or(0x10000,DID3),Index(TMP7,2))
+ Store(Or(0x10000,DID4),Index(TMP7,3))
+ Store(Or(0x10000,DID5),Index(TMP7,4))
+ Store(Or(0x10000,DID6),Index(TMP7,5))
+ Store(0x000222B8,Index(TMP7,6))
+ } Else {
+ Store(Or(0x10000,DID1),Index(TMP7,0))
+ Store(Or(0x10000,DID2),Index(TMP7,1))
+ Store(Or(0x10000,DID3),Index(TMP7,2))
+ Store(Or(0x10000,DID4),Index(TMP7,3))
+ Store(Or(0x10000,DID5),Index(TMP7,4))
+ Store(Or(0x10000,DID6),Index(TMP7,5))
+ Store(Or(0x10000,DID7),Index(TMP7,6))
+ }
+ Return(TMP7)
+ }
+
+ If(LGreater(NDID,7))
+ {
+ Name(TMP8,Package() {
+ 0xFFFFFFFF,
+ 0xFFFFFFFF,
+ 0xFFFFFFFF,
+ 0xFFFFFFFF,
+ 0xFFFFFFFF,
+ 0xFFFFFFFF,
+ 0xFFFFFFFF,
+ 0xFFFFFFFF})
+ If (LEqual(ISPE,1)) {
+ //
+ // IGFX need report ISP Device as GFX0 child
+ //
+ Store(Or(0x10000,DID1),Index(TMP8,0))
+ Store(Or(0x10000,DID2),Index(TMP8,1))
+ Store(Or(0x10000,DID3),Index(TMP8,2))
+ Store(Or(0x10000,DID4),Index(TMP8,3))
+ Store(Or(0x10000,DID5),Index(TMP8,4))
+ Store(Or(0x10000,DID6),Index(TMP8,5))
+ Store(Or(0x10000,DID7),Index(TMP8,6))
+ Store(0x000222B8,Index(TMP8,7))
+ } Else {
+ Store(Or(0x10000,DID1),Index(TMP8,0))
+ Store(Or(0x10000,DID2),Index(TMP8,1))
+ Store(Or(0x10000,DID3),Index(TMP8,2))
+ Store(Or(0x10000,DID4),Index(TMP8,3))
+ Store(Or(0x10000,DID5),Index(TMP8,4))
+ Store(Or(0x10000,DID6),Index(TMP8,5))
+ Store(Or(0x10000,DID7),Index(TMP8,6))
+ Store(Or(0x10000,DID8),Index(TMP8,7))
+ }
+ Return(TMP8)
+ }
+
+ // If nothing else, return Unknown LFP.
+ // (Prevents compiler warning.)
+
+ //Add ISP device to GFX0
+ Return(Package() {0x00000400,
+ 0x000222B8})
+ }
+
+Device(DD01)
+{
+ //
+ // Return Unique ID.
+ //
+ Method(_ADR,0,Serialized)
+ {
+ If(LEqual(And(0x0F00,DID1),0x400))
+ {
+ Store(0x1, EDPV)
+ Store(DID1, DIDX)
+ Return(1)
+ }
+ If(LEqual(DID1,0))
+ {
+ Return(1)
+ }
+ Else
+ {
+ Return(And(0xFFFF,DID1))
+ }
+ }
+
+ // Return the Current Status.
+
+ Method(_DCS,0)
+ {
+ Return(CDDS(DID1))
+ }
+
+ // Query Graphics State (active or inactive).
+
+ Method(_DGS,0)
+ {
+ Return(NDDS(DID1))
+ }
+
+ // Device Set State.
+
+ // _DSS Table:
+ //
+ // BIT31 BIT30 Execution
+ // 0 0 Don't implement.
+ // 0 1 Cache change. Nothing to Implement.
+ // 1 0 Don't Implement.
+ // 1 1 Display Switch Complete. Implement.
+
+ Method(_DSS,1)
+ {
+ If(LEqual(And(Arg0,0xC0000000),0xC0000000))
+ {
+
+ // State change was performed by the
+ // Video Drivers. Simply update the
+ // New State.
+
+ Store(NSTE,CSTE)
+ }
+ }
+ }
+
+Device(DD02)
+{
+ //
+ // Return Unique ID.
+ //
+ Method(_ADR,0,Serialized)
+ {
+ If(LEqual(And(0x0F00,DID2),0x400))
+ {
+ Store(0x2, EDPV)
+ Store(DID2, DIDX)
+ Return(2)
+ }
+ If(LEqual(DID2,0))
+ {
+ Return(2)
+ }
+ Else
+ {
+ Return(And(0xFFFF,DID2))
+ }
+ }
+
+ // Return the Current Status.
+
+ Method(_DCS,0)
+ {
+ Return(CDDS(DID2))
+ }
+
+ // Query Graphics State (active or inactive).
+
+ Method(_DGS,0)
+ {
+ // Return the Next State.
+ Return(NDDS(DID2))
+ }
+
+ // Device Set State. (See table above.)
+
+ Method(_DSS,1)
+ {
+ If(LEqual(And(Arg0,0xC0000000),0xC0000000))
+ {
+
+ // State change was performed by the
+ // Video Drivers. Simply update the
+ // New State.
+
+ Store(NSTE,CSTE)
+ }
+ }
+ }
+
+Device(DD03)
+{
+ //
+ // Return Unique ID.
+ //
+ Method(_ADR,0,Serialized)
+ {
+ If(LEqual(And(0x0F00,DID3),0x400))
+ {
+ Store(0x3, EDPV)
+ Store(DID3, DIDX)
+ Return(3)
+ }
+ If(LEqual(DID3,0))
+ {
+ Return(3)
+ }
+ Else
+ {
+ Return(And(0xFFFF,DID3))
+ }
+ }
+
+ // Return the Current Status.
+
+ Method(_DCS,0)
+ {
+ If(LEqual(DID3,0))
+ {
+ Return(0x0B)
+ }
+ Else
+ {
+ Return(CDDS(DID3))
+ }
+ }
+
+ // Query Graphics State (active or inactive).
+
+ Method(_DGS,0)
+ {
+ Return(NDDS(DID3))
+ }
+
+ // Device Set State. (See table above.)
+
+ Method(_DSS,1)
+ {
+ If(LEqual(And(Arg0,0xC0000000),0xC0000000))
+ {
+ // State change was performed by the
+ // Video Drivers. Simply update the
+ // New State.
+
+ Store(NSTE,CSTE)
+ }
+ }
+
+ }
+
+Device(DD04)
+{
+ //
+ // Return Unique ID.
+ //
+ Method(_ADR,0,Serialized)
+ {
+ If(LEqual(And(0x0F00,DID4),0x400))
+ {
+ Store(0x4, EDPV)
+ Store(DID4, DIDX)
+ Return(4)
+ }
+ If(LEqual(DID4,0))
+ {
+ Return(4)
+ }
+ Else
+ {
+ Return(And(0xFFFF,DID4))
+ }
+ }
+
+ // Return the Current Status.
+
+ Method(_DCS,0)
+ {
+ If(LEqual(DID4,0))
+ {
+ Return(0x0B)
+ }
+ Else
+ {
+ Return(CDDS(DID4))
+ }
+ }
+
+ // Query Graphics State (active or inactive).
+
+ Method(_DGS,0)
+ {
+ Return(NDDS(DID4))
+ }
+
+ // Device Set State. (See table above.)
+
+ Method(_DSS,1)
+ {
+ If(LEqual(And(Arg0,0xC0000000),0xC0000000))
+ {
+
+ // State change was performed by the
+ // Video Drivers. Simply update the
+ // New State.
+
+ Store(NSTE,CSTE)
+ }
+ }
+ }
+
+Device(DD05)
+{
+ //
+ // Return Unique ID.
+ //
+ Method(_ADR,0,Serialized)
+ {
+ If(LEqual(And(0x0F00,DID5),0x400))
+ {
+ Store(0x5, EDPV)
+ Store(DID5, DIDX)
+ Return(5)
+ }
+ If(LEqual(DID5,0))
+ {
+ Return(5)
+ }
+ Else
+ {
+ Return(And(0xFFFF,DID5))
+ }
+ }
+
+ // Return the Current Status.
+
+ Method(_DCS,0)
+ {
+ If(LEqual(DID5,0))
+ {
+ Return(0x0B)
+ }
+ Else
+ {
+ Return(CDDS(DID5))
+ }
+ }
+
+ // Query Graphics State (active or inactive).
+
+ Method(_DGS,0)
+ {
+ Return(NDDS(DID5))
+ }
+
+ // Device Set State. (See table above.)
+
+ Method(_DSS,1)
+ {
+ If(LEqual(And(Arg0,0xC0000000),0xC0000000))
+ {
+ // State change was performed by the
+ // Video Drivers. Simply update the
+ // New State.
+
+ Store(NSTE,CSTE)
+ }
+ }
+ }
+
+Device(DD06)
+{
+ //
+ // Return Unique ID.
+ //
+ Method(_ADR,0,Serialized)
+ {
+ If(LEqual(And(0x0F00,DID6),0x400))
+ {
+ Store(0x6, EDPV)
+ Store(DID6, DIDX)
+ Return(6)
+ }
+ If(LEqual(DID6,0))
+ {
+ Return(6)
+ }
+ Else
+ {
+ Return(And(0xFFFF,DID6))
+ }
+ }
+
+ // Return the Current Status.
+
+ Method(_DCS,0)
+ {
+ If(LEqual(DID6,0))
+ {
+ Return(0x0B)
+ }
+ Else
+ {
+ Return(CDDS(DID6))
+ }
+ }
+
+ // Query Graphics State (active or inactive).
+
+ Method(_DGS,0)
+ {
+ Return(NDDS(DID6))
+ }
+
+ // Device Set State. (See table above.)
+
+ Method(_DSS,1)
+ {
+ If(LEqual(And(Arg0,0xC0000000),0xC0000000))
+ {
+ // State change was performed by the
+ // Video Drivers. Simply update the
+ // New State.
+
+ Store(NSTE,CSTE)
+ }
+ }
+
+ }
+
+
+ Device(DD07)
+ {
+
+ // Return Unique ID.
+
+ Method(_ADR,0,Serialized)
+ {
+ If(LEqual(And(0x0F00,DID7),0x400))
+ {
+ Store(0x7, EDPV)
+ Store(DID7, DIDX)
+ Return(7)
+ }
+ If(LEqual(DID7,0))
+ {
+ Return(7)
+ }
+ Else
+ {
+ Return(And(0xFFFF,DID7))
+ }
+ }
+
+
+ // Return the Current Status.
+
+ Method(_DCS,0)
+ {
+ If(LEqual(DID7,0))
+ {
+ Return(0x0B)
+ }
+ Else
+ {
+ Return(CDDS(DID7))
+ }
+ }
+
+ // Query Graphics State (active or inactive).
+
+ Method(_DGS,0)
+ {
+ Return(NDDS(DID7))
+ }
+
+ // Device Set State. (See table above.)
+
+ Method(_DSS,1)
+ {
+ If(LEqual(And(Arg0,0xC0000000),0xC0000000))
+ {
+ // State change was performed by the
+ // Video Drivers. Simply update the
+ // New State.
+
+ Store(NSTE,CSTE)
+ }
+ }
+ }
+
+ Device(DD08)
+ {
+ //
+ // Return Unique ID.
+ //
+ Method(_ADR,0,Serialized)
+ {
+ If(LEqual(And(0x0F00,DID8),0x400))
+ {
+ Store(0x8, EDPV)
+ Store(DID8, DIDX)
+ Return(8)
+ }
+ If(LEqual(DID8,0))
+ {
+ Return(8)
+ }
+ Else
+ {
+ Return(And(0xFFFF,DID8))
+ }
+ }
+
+ // Return the Current Status.
+
+ Method(_DCS,0)
+ {
+ If(LEqual(DID8,0))
+ {
+ Return(0x0B)
+ }
+ Else
+ {
+ Return(CDDS(DID8))
+ }
+ }
+
+ // Query Graphics State (active or inactive).
+
+ Method(_DGS,0)
+ {
+ Return(NDDS(DID8))
+ }
+
+ // Device Set State. (See table above.)
+
+ Method(_DSS,1)
+ {
+ If(LEqual(And(Arg0,0xC0000000),0xC0000000))
+ {
+ // State change was performed by the
+ // Video Drivers. Simply update the
+ // New State.
+
+ Store(NSTE,CSTE)
+ }
+ }
+
+ }
+
+
+//
+//Device for eDP
+//
+Device(DD1F)
+{
+ //
+ // Return Unique ID.
+ //
+ Method(_ADR,0,Serialized)
+ {
+ If(LEqual(EDPV, 0x0))
+ {
+ Return(0x1F)
+ }
+ Else
+ {
+ Return(And(0xFFFF,DIDX))
+ }
+ }
+
+ // Return the Current Status.
+
+ //
+ // Return the Current Status.
+ //
+ Method(_DCS,0)
+ {
+ If(LEqual(EDPV, 0x0))
+ {
+ Return(0x00)
+ }
+ Else
+ {
+ Return(CDDS(DIDX))
+ }
+ }
+
+ // Query Graphics State (active or inactive).
+
+ Method(_DGS,0)
+ {
+ Return(NDDS(DIDX))
+ }
+
+ // Device Set State. (See table above.)
+
+ Method(_DSS,1)
+ {
+ If(LEqual(And(Arg0,0xC0000000),0xC0000000))
+ {
+ // State change was performed by the
+ // Video Drivers. Simply update the
+ // New State.
+
+ Store(NSTE,CSTE)
+ }
+ }
+
+
+ //
+ // Query List of Brightness Control Levels Supported.
+ //
+ Method(_BCL,0)
+ {
+ //
+ // List of supported brightness levels in the following sequence.
+ // Level when machine has full power.
+ // Level when machine is on batteries.
+ // Other supported levels.
+ //
+ Return(Package(){80, 50, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100})
+ }
+
+ //
+ // Set the Brightness Level.
+ //
+ Method (_BCM,1)
+ {
+ //
+ // Set the requested level if it is between 0 and 100%.
+ //
+ If(LAnd(LGreaterEqual(Arg0,0),LLessEqual(Arg0,100)))
+ {
+ \_SB.PCI0.GFX0.AINT(1, Arg0)
+ Store(Arg0,BRTL) // Store Brightness Level.
+ }
+ }
+
+ //
+ // Brightness Query Current level.
+ //
+ Method (_BQC,0)
+ {
+ Return(BRTL)
+ }
+}
+
+ Method(SDDL,1)
+ {
+ Increment(NDID)
+ Store(And(Arg0,0xF0F),Local0)
+ Or(0x80000000,Local0, Local1)
+ If(LEqual(DIDL,Local0))
+ {
+ Return(Local1)
+ }
+ If(LEqual(DDL2,Local0))
+ {
+ Return(Local1)
+ }
+ If(LEqual(DDL3,Local0))
+ {
+ Return(Local1)
+ }
+ If(LEqual(DDL4,Local0))
+ {
+ Return(Local1)
+ }
+ If(LEqual(DDL5,Local0))
+ {
+ Return(Local1)
+ }
+ If(LEqual(DDL6,Local0))
+ {
+ Return(Local1)
+ }
+ If(LEqual(DDL7,Local0))
+ {
+ Return(Local1)
+ }
+ If(LEqual(DDL8,Local0))
+ {
+ Return(Local1)
+ }
+ Return(0)
+ }
+
+ Method(CDDS,1)
+ {
+ Store(And(Arg0,0xF0F),Local0)
+
+ If(LEqual(0, Local0))
+ {
+ Return(0x1D)
+ }
+ If(LEqual(CADL, Local0))
+ {
+ Return(0x1F)
+ }
+ If(LEqual(CAL2, Local0))
+ {
+ Return(0x1F)
+ }
+ If(LEqual(CAL3, Local0))
+ {
+ Return(0x1F)
+ }
+ If(LEqual(CAL4, Local0))
+ {
+ Return(0x1F)
+ }
+ If(LEqual(CAL5, Local0))
+ {
+ Return(0x1F)
+ }
+ If(LEqual(CAL6, Local0))
+ {
+ Return(0x1F)
+ }
+ If(LEqual(CAL7, Local0))
+ {
+ Return(0x1F)
+ }
+ If(LEqual(CAL8, Local0))
+ {
+ Return(0x1F)
+ }
+ Return(0x1D)
+ }
+
+ Method(NDDS,1)
+ {
+ Store(And(Arg0,0xF0F),Local0)
+
+ If(LEqual(0, Local0))
+ {
+ Return(0)
+ }
+ If(LEqual(NADL, Local0))
+ {
+ Return(1)
+ }
+ If(LEqual(NDL2, Local0))
+ {
+ Return(1)
+ }
+ If(LEqual(NDL3, Local0))
+ {
+ Return(1)
+ }
+ If(LEqual(NDL4, Local0))
+ {
+ Return(1)
+ }
+ If(LEqual(NDL5, Local0))
+ {
+ Return(1)
+ }
+ If(LEqual(NDL6, Local0))
+ {
+ Return(1)
+ }
+ If(LEqual(NDL7, Local0))
+ {
+ Return(1)
+ }
+ If(LEqual(NDL8, Local0))
+ {
+ Return(1)
+ }
+ Return(0)
+ }
+
+ // Include IGD OpRegion/Software SCI interrupt handler which is use by
+ // the graphics drivers to request data from system BIOS.
+ //
+ include("SystemAgent/IgdOpRn.ASL")
diff --git a/ChvRefCodePkg/AcpiTablesPCAT/SystemAgent/IntelIspDev2.asl b/ChvRefCodePkg/AcpiTablesPCAT/SystemAgent/IntelIspDev2.asl
new file mode 100644
index 0000000000..18419e3d42
--- /dev/null
+++ b/ChvRefCodePkg/AcpiTablesPCAT/SystemAgent/IntelIspDev2.asl
@@ -0,0 +1,66 @@
+/** @file
+ ACPI DSDT table
+ ISP Exist as B0D2F0 Software ACPI Reference Code for the CherryView Family.
+
+ Copyright (c) 1999 - 2015, Intel Corporation. All rights reserved.<BR>
+
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php.
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+ //
+ // Device ISP0
+ //
+ Device(ISP0) {
+ Name(_ADR, 0x22B8)
+ Name(_DDN, "CHV ISP - 808622B8")
+ Name(_UID, 0x01)
+
+ Method (_STA, 0, NotSerialized) {
+ //
+ // Dev2 need report ISP0 as GFX0 child
+ //
+ If (LAnd(LNotEqual(ISPA, 0), LEqual(ISPD,1)))
+ {
+ Return (0xF)
+ }
+ Else
+ {
+ Return (0x0)
+ }
+ }
+ Name(SBUF,ResourceTemplate () {
+ Memory32Fixed (ReadWrite, 0x00000000, 0x00400000, ISP0)
+ })
+ Method(_CRS, 0x0, NotSerialized) {
+ CreateDwordField(^SBUF, ^ISP0._BAS, B0BA)
+ Store(ISPA, B0BA)
+ Return (SBUF)
+ }
+ Method (_SRS, 0x1, NotSerialized)
+ {
+ }
+ Method (_DIS, 0x0, NotSerialized)
+ {
+ }
+ Method(_DSM, 0x4, NotSerialized) {
+ If (LEqual (Arg0, 0x01)) {
+ // Switch ISP to D3H
+ Return (0x01)
+ }
+ Elseif (LEqual (Arg0, 0x02)) {
+ // Switch ISP to D0
+ Return (0x02)
+ }
+ Else
+ {
+ //Do nothing
+ Return (0x0F)
+ }
+ }
+ } // End ISP0
diff --git a/ChvRefCodePkg/AcpiTablesPCAT/SystemAgent/Video.asl b/ChvRefCodePkg/AcpiTablesPCAT/SystemAgent/Video.asl
new file mode 100644
index 0000000000..f27817b6d6
--- /dev/null
+++ b/ChvRefCodePkg/AcpiTablesPCAT/SystemAgent/Video.asl
@@ -0,0 +1,32 @@
+/**@file
+ ACPI DSDT table
+
+ Copyright (c) 1999 - 2015, Intel Corporation. All rights reserved.<BR>
+
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php.
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+// Brightness Notification:
+// Generate a brightness related notification
+// to the LFP if its populated.
+//
+// Arguments:
+// Arg0: Notification value.
+//
+// Return Value:
+// None
+
+Method(BRTN,1,Serialized)
+{
+ If(LEqual(And(DIDX,0x0F00),0x400))
+ {
+ Notify(\_SB.PCI0.GFX0.DD1F,Arg0)
+ }
+}