summaryrefslogtreecommitdiff
path: root/Board/EM/Platform/SsdtSensorHub
diff options
context:
space:
mode:
authorraywu <raywu0301@gmail.com>2018-06-15 00:00:50 +0800
committerraywu <raywu0301@gmail.com>2018-06-15 00:00:50 +0800
commitb7c51c9cf4864df6aabb99a1ae843becd577237c (patch)
treeeebe9b0d0ca03062955223097e57da84dd618b9a /Board/EM/Platform/SsdtSensorHub
downloadzprj-b7c51c9cf4864df6aabb99a1ae843becd577237c.tar.xz
init. 1AQQW051HEADmaster
Diffstat (limited to 'Board/EM/Platform/SsdtSensorHub')
-rw-r--r--Board/EM/Platform/SsdtSensorHub/SsdtSensorHub.asl180
-rw-r--r--Board/EM/Platform/SsdtSensorHub/SsdtSensorHub.cif10
-rw-r--r--Board/EM/Platform/SsdtSensorHub/SsdtSensorHub.mak80
-rw-r--r--Board/EM/Platform/SsdtSensorHub/SsdtSensorHub.sdl32
4 files changed, 302 insertions, 0 deletions
diff --git a/Board/EM/Platform/SsdtSensorHub/SsdtSensorHub.asl b/Board/EM/Platform/SsdtSensorHub/SsdtSensorHub.asl
new file mode 100644
index 0000000..0918fdb
--- /dev/null
+++ b/Board/EM/Platform/SsdtSensorHub/SsdtSensorHub.asl
@@ -0,0 +1,180 @@
+/**************************************************************************;
+;* *;
+;* Intel Confidential *;
+;* *;
+;* Intel Corporation - ACPI Reference Code for the Ivy Bridge *;
+;* Family of Customer Reference Boards. *;
+;* *;
+;* *;
+;* Copyright (c) 1999 - 2013 Intel Corporation. All rights reserved *;
+;* This software and associated documentation (if any) is furnished *;
+;* under a license and may only be used or copied in accordance *;
+;* with the terms of the license. Except as permitted by such *;
+;* license, no part of this software or documentation may be *;
+;* reproduced, stored in a retrieval system, or transmitted in any *;
+;* form or by any means without the express written consent of *;
+;* Intel Corporation. *;
+;* *;
+;* *;
+;**************************************************************************/
+/*++
+ This file contains a 'Sample Driver' and is licensed as such
+ under the terms of your license agreement with Intel or your
+ vendor. This file may be modified by the user, subject to
+ the additional terms of the license agreement
+--*/
+
+DefinitionBlock (
+ "SensorHubApp.aml",
+ "SSDT",
+ 0x01, // SHAD revision.
+ // A Revision field value greater than or equal to 2 signifies that integers
+ // declared within the Definition Block are to be evaluated as 64-bit values
+ "INTEL", // OEM ID (6 byte string)
+ "sensrhub", // OEM table ID (8 byte string)
+ 0x0 // OEM version of DSDT table (4 byte Integer)
+ )
+
+// BEGIN OF ASL SCOPE
+
+{
+ External(\GPBS)
+ External(\SDS0)
+ External(\USBH)
+ External(\_SB.RDGP, MethodObj)
+ External(\_SB.WTGP, MethodObj)
+ External(\_SB.PCI0.I2C0.SHUB, DeviceObj) // Sensor hub
+ External(\_SB.PCI0.I2C0.DFUD, DeviceObj) // DFU
+
+ Scope(\)
+ {
+ Device(SHAD) // Sensor Hub Application Device.
+ {
+ Name(_HID, EISAID("INT33D0"))
+ Name(_CID, EISAID("PNP0C02"))
+
+ Method(_STA, 0,Serialized)
+ {
+ If(LOr(And(SDS0,1), And(USBH,1)))
+ {
+ Return(0x000F) // Sensor Hub Enabled, Show it
+ }
+ Return(0x00) // Sensor Hub Disabled, Hide it
+ }
+
+ //
+ // _DSM : Device Specific Method supporting USB Sideband Deferring function
+ //
+ // Arg0: UUID Unique function identifier
+ // Arg1: Integer Revision Level
+ // Arg2: Integer Function Index
+ // Arg3: Package Parameters
+ //
+ Method (_DSM, 4, Serialized, 0, UnknownObj, {BuffObj, IntObj, IntObj, PkgObj})
+ {
+
+ // Define the Local Variables used throughout the method.
+
+ Name(PGCE, 0) // Power Gate Control Enable.
+ Name(PGCD, 0) // Power Gate Control Duration.
+ Name(DFUE, 0) // DFU Enable.
+ Name(DFUD, 0) // DFU Duration.
+ Name(OLDV, 0) // Old value of both Power Gate and DFU GPIO.
+ Name(PGCV, 0) // Power Gate Control Value
+ Name(DFUV, 0) // DFU Control Value
+
+ // Compare passed in UUID to supported UUID.
+
+ If (LEqual(Arg0, ToUUID ("03C868D5-563F-42A8-9F57-9A18D949B7CB")))
+ {
+
+ If (LEqual(1,ToInteger(Arg1))) // Revision 1.
+ {
+ Switch (ToInteger(Arg2)) // Switch to Function Index.
+ {
+ //
+ // Function 0, Query - return supported functions BitIndex.
+ //
+
+ Case (0)
+ {
+ Return (Buffer() {0x0F})
+ }
+
+ //
+ // Function 1, Power Gate Control - Pass in 2 value package via Arg3
+ //
+
+ Case (1)
+ {
+
+ Store (DeRefOf (Index (Arg3, 0)), PGCE)
+ Store (DeRefOf (Index (Arg3, 1)), PGCD)
+
+ Store(\_SB.RDGP(46), OLDV) // Save off GPIO46 = PWRGATE#
+ \_SB.WTGP(46, PGCE) // Set value to GPIO46 = PWRGATE#
+
+ If(LGreater(PGCD, 0)) // test duration value
+ {
+ Sleep(PGCD)
+ \_SB.WTGP(46, OLDV) // Restore GPIO46 = PWRGATE#
+ }
+
+ If (LEqual(\_SB.RDGP(46), 0x01)) // check for powered on (1 = on)
+ {
+ Sleep(150) // Delay so sensor hub has time to init.
+ If (LEqual(\_SB.RDGP(44), 0x01)) { // check mode, Sensor or DFU (1 = Sensor)
+ // Powering up in sensor hub mode
+ Notify(\_SB.PCI0.I2C0.SHUB, 1) // Check the sensor hub status
+ } Else {
+ // Powering up in DFU mode
+ Notify(\_SB.PCI0.I2C0.DFUD, 1) // Check the DFU device status
+ }
+ }
+
+ Return (0)
+ } // End Case (1)
+
+ //
+ // Function2, DFU Control - Pass in 2 value package via Arg3
+ //
+
+ Case (2)
+ {
+
+ Store (DeRefOf (Index (Arg3, 0)), DFUE)
+ Store (DeRefOf (Index (Arg3, 1)), DFUD)
+
+ Store(\_SB.RDGP(44), OLDV) // Save off GPIO44 = DFU_ENA#
+ \_SB.WTGP(44, DFUE) // Set Value to GPIO44 = DFU_ENA#
+
+ If (LGreater(DFUD, 0)) // Test duration value
+ {
+ Sleep(DFUD) // Delay for passed in duration.
+ \_SB.WTGP(44, OLDV) // Restore GPIO44 = DFU_ENA#
+ }
+
+ Return (0)
+ } // End Case 2...
+
+ //
+ // Function 3, Query Status ?Return the current status of GPIO signals.
+ //
+
+ Case (3)
+ {
+ Store(\_SB.RDGP(44), DFUV)
+ Store(\_SB.RDGP(46), PGCV)
+ Return(Package(){PGCV, DFUV})
+ } // End Case 3
+
+ } // End Function Index...
+ Return (0)
+ } // End Revision check...
+ Return (0)
+ } // End UUID check...
+ Return (0)
+ } // End _DSM Method...
+ } // End Device....
+ } // End Scope...
+} // End DefinitionBlock Termlist
diff --git a/Board/EM/Platform/SsdtSensorHub/SsdtSensorHub.cif b/Board/EM/Platform/SsdtSensorHub/SsdtSensorHub.cif
new file mode 100644
index 0000000..94dfc2a
--- /dev/null
+++ b/Board/EM/Platform/SsdtSensorHub/SsdtSensorHub.cif
@@ -0,0 +1,10 @@
+<component>
+ name = "SsdtSensorHub"
+ category = ModulePart
+ LocalRoot = "Board\EM\Platform\SsdtSensorHub"
+ RefName = "SsdtSensorHub"
+[files]
+"SsdtSensorHub.sdl"
+"SsdtSensorHub.mak"
+"SsdtSensorHub.asl"
+<endComponent>
diff --git a/Board/EM/Platform/SsdtSensorHub/SsdtSensorHub.mak b/Board/EM/Platform/SsdtSensorHub/SsdtSensorHub.mak
new file mode 100644
index 0000000..77444e6
--- /dev/null
+++ b/Board/EM/Platform/SsdtSensorHub/SsdtSensorHub.mak
@@ -0,0 +1,80 @@
+#*************************************************************************
+#*************************************************************************
+#** **
+#** (C)Copyright 1985-2011, American Megatrends, Inc. **
+#** **
+#** All Rights Reserved. **
+#** **
+#** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+#** **
+#** Phone: (770)-246-8600 **
+#** **
+#*************************************************************************
+#*************************************************************************
+
+#*************************************************************************
+#<AMI_FHDR_START>
+#
+# Name: SsdtAcpiDebug.mak
+#
+# Description: MAke file to build Aptio ACPI ASL components
+#
+#
+#<AMI_FHDR_END>
+#*************************************************************************
+all : BuildSENSORHUB
+
+BuildSENSORHUB : $(BUILD_DIR)\SENSORHUB.ffs
+
+#-----------------------------------------------------------------------
+# ASL compiler definition
+#-----------------------------------------------------------------------
+!IF "$(ACPIPLATFORM_ASL_COMPILER)"==""
+!ERROR It is an invalid path, please check your ASL compiler path.
+!ENDIF
+
+IASL = $(ACPIPLATFORM_ASL_COMPILER)
+#-----------------------------------------------------------------------
+$(BUILD_DIR)\SsdtSensorHub.aml : $(INTEL_SENSORHUB_ASL_FILE)
+ @cl /C /EP $(INTEL_SENSORHUB_ASL_FILE) > $(BUILD_DIR)\SsdtSensorHub.asl
+ $(IASL) -p $(BUILD_DIR)\SsdtSensorHub.aml $(BUILD_DIR)\SsdtSensorHub.asl
+
+$(BUILD_DIR)\SsdtSensorHub.sec: $(BUILD_DIR)\SsdtSensorHub.aml
+ $(GENSECTION) -I $*.aml -O $@ -S EFI_SECTION_RAW
+
+#Note. Expand the package with SsdtSensorHub tables.
+# DXE phase will load the tables
+# and update Aml contents if provided in Acpiplatform.c
+
+$(BUILD_DIR)\SENSORHUB.ffs: $(BUILD_DIR)\SsdtSensorHub.sec
+ $(GENFFSFILE) -B $(BUILD_DIR) -V -o $@ -P1 <<$(BUILD_DIR)\SsdtSensorHub.pkg
+
+PACKAGE.INF
+[.]
+BASE_NAME = SENSORHUB
+FFS_FILEGUID = A3201EEC-1612-4577-8924-CB32D542D22C
+FFS_FILETYPE = EFI_FV_FILETYPE_FREEFORM
+FFS_ATTRIB_CHECKSUM = TRUE
+
+IMAGE_SCRIPT =
+{
+ Compress (dummy) {
+ $(PROJECT_DIR)\$(BUILD_DIR)\SsdtSensorHub.sec
+ }
+}
+<<KEEP
+
+
+#*************************************************************************
+#*************************************************************************
+#** **
+#** (C)Copyright 1985-2011, American Megatrends, Inc. **
+#** **
+#** All Rights Reserved. **
+#** **
+#** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+#** **
+#** Phone: (770)-246-8600 **
+#** **
+#*************************************************************************
+#*************************************************************************
diff --git a/Board/EM/Platform/SsdtSensorHub/SsdtSensorHub.sdl b/Board/EM/Platform/SsdtSensorHub/SsdtSensorHub.sdl
new file mode 100644
index 0000000..3d66d8d
--- /dev/null
+++ b/Board/EM/Platform/SsdtSensorHub/SsdtSensorHub.sdl
@@ -0,0 +1,32 @@
+TOKEN
+ Name = "INTELSENSORHUB_SUPPORT"
+ Value = "1"
+ Help = "Main switch to support Intel SensorHub in Project"
+ TokenType = Boolean
+ TargetMAK = Yes
+ TargetH = Yes
+ Master = Yes
+ Token = "PCH_SKU" "=" "1"
+End
+
+PATH
+ Name = "INTEL_SSDTSENSORHUB_DIR"
+End
+
+TOKEN
+ Name = "INTEL_SENSORHUB_ASL_FILE"
+ Value = "$(INTEL_SSDTSENSORHUB_DIR)\SsdtSensorHub.asl"
+ TokenType = Expression
+ TargetMAK = Yes
+End
+
+MODULE
+ Help = "Includes SsdtSensorHub.mak to Project"
+ File = "SsdtSensorHub.mak"
+End
+
+ELINK
+ Name = "$(BUILD_DIR)\SENSORHUB.ffs"
+ Parent = "FV_MAIN"
+ InvokeOrder = AfterParent
+End