/** @file\r
Provides a secure platform-specific method to detect physically present user.\r
\r
-Copyright (c) 2013 Intel Corporation.\r
+Copyright (c) 2013 - 2016 Intel Corporation.\r
\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
UINTN ReadLength;\r
UINT8 Buffer[2];\r
\r
- DEBUG ((EFI_D_ERROR, "CheckResetButtonState(): mPlatformType == %d\n", mPlatformType));\r
+ DEBUG ((EFI_D_INFO, "CheckResetButtonState(): mPlatformType == %d\n", mPlatformType));\r
if (mPlatformType == GalileoGen2) {\r
- //\r
- // Reset Button - EXP2.P1_7 should be configured as an input.\r
- //\r
- PlatformPcal9555GpioSetDir (\r
- GALILEO_GEN2_IOEXP2_7BIT_SLAVE_ADDR, // IO Expander 2.\r
- 15, // P1-7.\r
- FALSE\r
- );\r
-\r
- //\r
- // Reset Button - EXP2.P1_7 pullup should be disabled.\r
- //\r
- PlatformPcal9555GpioDisablePull (\r
- GALILEO_GEN2_IOEXP2_7BIT_SLAVE_ADDR, // IO Expander 2.\r
- 15 // P1-7.\r
- );\r
-\r
//\r
// Read state of Reset Button - EXP2.P1_7\r
// This GPIO is pulled high when the button is not pressed\r
} else {\r
I2CSlaveAddress.I2CDeviceAddress = GALILEO_IOEXP_J2LO_7BIT_SLAVE_ADDR;\r
}\r
+ DEBUG ((EFI_D_INFO, "Galileo GPIO Expender Slave Address = %02x\n", I2CSlaveAddress.I2CDeviceAddress));\r
\r
//\r
- // Select Port 5\r
- //\r
- Length = 2;\r
- Buffer[0] = 0x18;\r
- Buffer[1] = 0x05;\r
- Status = I2cWriteMultipleByte (\r
- I2CSlaveAddress,\r
- EfiI2CSevenBitAddrMode,\r
- &Length,\r
- &Buffer\r
- );\r
- ASSERT_EFI_ERROR (Status);\r
-\r
- //\r
- // Read "Pin Direction" of Port 5\r
- //\r
- Length = 1;\r
- ReadLength = 1;\r
- Buffer[1] = 0x1C;\r
- Status = I2cReadMultipleByte (\r
- I2CSlaveAddress,\r
- EfiI2CSevenBitAddrMode,\r
- &Length,\r
- &ReadLength,\r
- &Buffer[1]\r
- );\r
- ASSERT_EFI_ERROR (Status);\r
-\r
- //\r
- // Set "Pin Direction" of Port 5, Bit 0 as input\r
- //\r
- Length = 2;\r
- Buffer[0] = 0x1C;\r
- Buffer[1] = Buffer[1] | BIT0;\r
-\r
- Status = I2cWriteMultipleByte (\r
- I2CSlaveAddress,\r
- EfiI2CSevenBitAddrMode,\r
- &Length,\r
- &Buffer\r
- );\r
- ASSERT_EFI_ERROR (Status);\r
-\r
- //\r
- // Read Port 5\r
+ // Read state of RESET_N_SHLD (GPORT5_BIT0)\r
//\r
Buffer[1] = 5;\r
Length = 1;\r
ReadLength = 1;\r
-\r
Status = I2cReadMultipleByte (\r
I2CSlaveAddress,\r
EfiI2CSevenBitAddrMode,\r
ASSERT_EFI_ERROR (Status);\r
\r
//\r
- // Return the state of Port 5, Bit 0\r
+ // Return the state of GPORT5_BIT0\r
//\r
return ((Buffer[1] & BIT0) != 0);\r
}\r