summaryrefslogtreecommitdiff
path: root/src/mainboard/intel/kunimitsu/chromeos.c
diff options
context:
space:
mode:
authorrobbie zhang <robbie.zhang@intel.com>2015-08-25 16:13:53 -0700
committerPatrick Georgi <pgeorgi@google.com>2015-08-29 07:35:04 +0000
commitfada85e655879efc3774fc602987b078bc20fb41 (patch)
treecac9085ab6be65b5ecc4e2418e07edfb2703eb6b /src/mainboard/intel/kunimitsu/chromeos.c
parent302aeb7a4ee10897d42298726b85e2d0bb26e788 (diff)
downloadcoreboot-fada85e655879efc3774fc602987b078bc20fb41.tar.xz
intel/kunimitsu: port the change from glados for correctly reading lid
switch and SPI write protect for fill_lb_gpios() to coreboot table. BUG=chrome-os-partner:43707 BRANCH=none TEST=build and boot on kunimits Signed-off-by: robbie zhang <robbie.zhang@intel.com> Change-Id: I82cd3f74d0ac26e369ee4274b2c65f4f93c1fd3b Signed-off-by: Patrick Georgi <patrick@georgi-clan.de> Original-Commit-Id: 804a8a60951321e1b5b1d7ddacb97ddbe0cd7680 Original-Change-Id: I31ed6c0e48089b84ef9d52753484253a091d5aa5 Original-Reviewed-on: https://chromium-review.googlesource.com/295580 Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org> Original-Commit-Queue: Wenkai Du <wenkai.du@intel.com> Original-Tested-by: Wenkai Du <wenkai.du@intel.com> Reviewed-on: http://review.coreboot.org/11436 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'src/mainboard/intel/kunimitsu/chromeos.c')
-rw-r--r--src/mainboard/intel/kunimitsu/chromeos.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/mainboard/intel/kunimitsu/chromeos.c b/src/mainboard/intel/kunimitsu/chromeos.c
index 66be521f46..d2cfeb76fd 100644
--- a/src/mainboard/intel/kunimitsu/chromeos.c
+++ b/src/mainboard/intel/kunimitsu/chromeos.c
@@ -23,6 +23,7 @@
#include <device/device.h>
#include <device/pci.h>
#include <ec/google/chromeec/ec.h>
+#include <gpio.h>
#include <soc/gpio.h>
#include <string.h>
#include <vendorcode/google/chromeos/chromeos.h>
@@ -57,13 +58,13 @@ void fill_lb_gpios(struct lb_gpios *gpios)
int get_lid_switch(void)
{
- /* Default to force open */
- return 1;
+ /* Read lid switch state from the EC. */
+ return !!(google_chromeec_get_switches() & EC_SWITCH_LID_OPEN);
}
-/* The dev-switch is virtual */
int get_developer_mode_switch(void)
{
+ /* No physical developer mode switch. */
return 0;
}
@@ -87,5 +88,6 @@ int clear_recovery_mode_switch(void)
int get_write_protect_state(void)
{
- return 0;
+ /* Read PCH_WP GPIO. */
+ return gpio_get(GPIO_PCH_WP);
}