From b7c51c9cf4864df6aabb99a1ae843becd577237c Mon Sep 17 00:00:00 2001 From: raywu Date: Fri, 15 Jun 2018 00:00:50 +0800 Subject: init. 1AQQW051 --- Board/EM/Platform/SsdtSensorHub/SsdtSensorHub.asl | 180 ++++++++++++++++++++++ Board/EM/Platform/SsdtSensorHub/SsdtSensorHub.cif | 10 ++ Board/EM/Platform/SsdtSensorHub/SsdtSensorHub.mak | 80 ++++++++++ Board/EM/Platform/SsdtSensorHub/SsdtSensorHub.sdl | 32 ++++ 4 files changed, 302 insertions(+) create mode 100644 Board/EM/Platform/SsdtSensorHub/SsdtSensorHub.asl create mode 100644 Board/EM/Platform/SsdtSensorHub/SsdtSensorHub.cif create mode 100644 Board/EM/Platform/SsdtSensorHub/SsdtSensorHub.mak create mode 100644 Board/EM/Platform/SsdtSensorHub/SsdtSensorHub.sdl (limited to 'Board/EM/Platform/SsdtSensorHub') 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 @@ + + name = "SsdtSensorHub" + category = ModulePart + LocalRoot = "Board\EM\Platform\SsdtSensorHub" + RefName = "SsdtSensorHub" +[files] +"SsdtSensorHub.sdl" +"SsdtSensorHub.mak" +"SsdtSensorHub.asl" + 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 ** +#** ** +#************************************************************************* +#************************************************************************* + +#************************************************************************* +# +# +# Name: SsdtAcpiDebug.mak +# +# Description: MAke file to build Aptio ACPI ASL components +# +# +# +#************************************************************************* +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 + } +} +<