From b7d5f6ca1348298359902443254c44a144802f34 Mon Sep 17 00:00:00 2001 From: Michael Kinney Date: Thu, 7 Jan 2016 22:43:31 +0000 Subject: [PATCH] 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 Cc: Jiewen Yao Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Michael Kinney Reviewed-by: Kelly Steele git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19621 6f19259b-4bc3-4df7-8a09-765794883524 --- .../PlatformSecureLib/PlatformSecureLib.c | 71 ++----------------- 1 file 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,25 +39,8 @@ 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 @@ -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); } -- 2.39.2