diff options
author | Michael Kinney <michael.d.kinney@intel.com> | 2016-01-07 22:43:31 +0000 |
---|---|---|
committer | mdkinney <mdkinney@Edk2> | 2016-01-07 22:43:31 +0000 |
commit | b7d5f6ca1348298359902443254c44a144802f34 (patch) | |
tree | 3e89819235303278205882dfd9243b809c307349 /QuarkPlatformPkg/Library | |
parent | 406d8575444ec50c7948a1b167673a993413c4e5 (diff) | |
download | edk2-b7d5f6ca1348298359902443254c44a144802f34.tar.gz edk2-b7d5f6ca1348298359902443254c44a144802f34.tar.bz2 edk2-b7d5f6ca1348298359902443254c44a144802f34.zip |
QuarkPlatformPkg/PlatformSecureLib: Remove redundant GPIO expander config
Remove GPIO expander configuration actions that are now performed in
PEI Phase in PlatformInit module. In order to detect physical presence
only the state of the Reset Button needs to be read.
Cc: Kelly Steele <kelly.steele@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Michael Kinney <michael.d.kinney@intel.com>
Reviewed-by: Kelly Steele <kelly.steele@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19621 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'QuarkPlatformPkg/Library')
-rw-r--r-- | QuarkPlatformPkg/Library/PlatformSecureLib/PlatformSecureLib.c | 71 |
1 files changed, 5 insertions, 66 deletions
diff --git a/QuarkPlatformPkg/Library/PlatformSecureLib/PlatformSecureLib.c b/QuarkPlatformPkg/Library/PlatformSecureLib/PlatformSecureLib.c index 169980c1b8..7f60c5c1e0 100644 --- a/QuarkPlatformPkg/Library/PlatformSecureLib/PlatformSecureLib.c +++ b/QuarkPlatformPkg/Library/PlatformSecureLib/PlatformSecureLib.c @@ -1,7 +1,7 @@ /** @file
Provides a secure platform-specific method to detect physically present user.
-Copyright (c) 2013 Intel Corporation.
+Copyright (c) 2013 - 2016 Intel Corporation.
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
@@ -39,26 +39,9 @@ CheckResetButtonState ( UINTN ReadLength;
UINT8 Buffer[2];
- DEBUG ((EFI_D_ERROR, "CheckResetButtonState(): mPlatformType == %d\n", mPlatformType));
+ DEBUG ((EFI_D_INFO, "CheckResetButtonState(): mPlatformType == %d\n", mPlatformType));
if (mPlatformType == GalileoGen2) {
//
- // Reset Button - EXP2.P1_7 should be configured as an input.
- //
- PlatformPcal9555GpioSetDir (
- GALILEO_GEN2_IOEXP2_7BIT_SLAVE_ADDR, // IO Expander 2.
- 15, // P1-7.
- FALSE
- );
-
- //
- // Reset Button - EXP2.P1_7 pullup should be disabled.
- //
- PlatformPcal9555GpioDisablePull (
- GALILEO_GEN2_IOEXP2_7BIT_SLAVE_ADDR, // IO Expander 2.
- 15 // P1-7.
- );
-
- //
// Read state of Reset Button - EXP2.P1_7
// This GPIO is pulled high when the button is not pressed
// This GPIO reads low when button is pressed
@@ -77,58 +60,14 @@ CheckResetButtonState ( } else {
I2CSlaveAddress.I2CDeviceAddress = GALILEO_IOEXP_J2LO_7BIT_SLAVE_ADDR;
}
+ DEBUG ((EFI_D_INFO, "Galileo GPIO Expender Slave Address = %02x\n", I2CSlaveAddress.I2CDeviceAddress));
//
- // Select Port 5
- //
- Length = 2;
- Buffer[0] = 0x18;
- Buffer[1] = 0x05;
- Status = I2cWriteMultipleByte (
- I2CSlaveAddress,
- EfiI2CSevenBitAddrMode,
- &Length,
- &Buffer
- );
- ASSERT_EFI_ERROR (Status);
-
- //
- // Read "Pin Direction" of Port 5
- //
- Length = 1;
- ReadLength = 1;
- Buffer[1] = 0x1C;
- Status = I2cReadMultipleByte (
- I2CSlaveAddress,
- EfiI2CSevenBitAddrMode,
- &Length,
- &ReadLength,
- &Buffer[1]
- );
- ASSERT_EFI_ERROR (Status);
-
- //
- // Set "Pin Direction" of Port 5, Bit 0 as input
- //
- Length = 2;
- Buffer[0] = 0x1C;
- Buffer[1] = Buffer[1] | BIT0;
-
- Status = I2cWriteMultipleByte (
- I2CSlaveAddress,
- EfiI2CSevenBitAddrMode,
- &Length,
- &Buffer
- );
- ASSERT_EFI_ERROR (Status);
-
- //
- // Read Port 5
+ // Read state of RESET_N_SHLD (GPORT5_BIT0)
//
Buffer[1] = 5;
Length = 1;
ReadLength = 1;
-
Status = I2cReadMultipleByte (
I2CSlaveAddress,
EfiI2CSevenBitAddrMode,
@@ -139,7 +78,7 @@ CheckResetButtonState ( ASSERT_EFI_ERROR (Status);
//
- // Return the state of Port 5, Bit 0
+ // Return the state of GPORT5_BIT0
//
return ((Buffer[1] & BIT0) != 0);
}
|