summaryrefslogtreecommitdiff
path: root/src/mainboard/google/butterfly
diff options
context:
space:
mode:
authorPatrick Georgi <pgeorgi@chromium.org>2015-07-27 23:18:15 +0200
committerPatrick Georgi <pgeorgi@google.com>2015-07-29 19:24:56 +0200
commit5e0a2e2d33433b564d121a20e5ab7726c74713ec (patch)
tree99ba47d06e7a498ffb2a3504c85206660f7bbae5 /src/mainboard/google/butterfly
parent7a625da84fee2659e38b17d7170823538911f044 (diff)
downloadcoreboot-5e0a2e2d33433b564d121a20e5ab7726c74713ec.tar.xz
google/butterfly: Implement functions required by CHROMEOS
BRANCH=none BUG=chromium:513990 TEST=google/butterfly builds Change-Id: Ia678ca4b0778ee4a2e55ba44a5d89ac6dd691b35 Signed-off-by: Patrick Georgi <pgeorgi@google.com> Original-Commit-Id: 0d82ea2090fae9c66f41ee05cc20a9b22d3641c0 Original-Change-Id: I2fea10c17b769ca76b9d0b80978b4c512ed8c680 Original-Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Original-Reviewed-on: https://chromium-review.googlesource.com/288851 Original-Reviewed-by: Stefan Reinauer <reinauer@chromium.org> Reviewed-on: http://review.coreboot.org/11062 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'src/mainboard/google/butterfly')
-rw-r--r--src/mainboard/google/butterfly/chromeos.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/mainboard/google/butterfly/chromeos.c b/src/mainboard/google/butterfly/chromeos.c
index fd7ef4ec82..c23f827136 100644
--- a/src/mainboard/google/butterfly/chromeos.c
+++ b/src/mainboard/google/butterfly/chromeos.c
@@ -56,7 +56,7 @@ void fill_lb_gpios(struct lb_gpios *gpios)
/* Write Protect: GPIO active Low */
gpios->gpios[0].port = WP_GPIO;
gpios->gpios[0].polarity = ACTIVE_LOW;
- gpios->gpios[0].value = get_pch_gpio(WP_GPIO);
+ gpios->gpios[0].value = !get_write_protect_state();
strncpy((char *)gpios->gpios[0].name,"write protect",
GPIO_MAX_NAME_LENGTH);
@@ -74,10 +74,9 @@ void fill_lb_gpios(struct lb_gpios *gpios)
GPIO_MAX_NAME_LENGTH);
/* lid switch value from EC */
- lidswitch = (ec_mem_read(EC_HW_GPI_STATUS) >> EC_GPI_LID_STAT_BIT) & 1;
gpios->gpios[3].port = -1;
gpios->gpios[3].polarity = ACTIVE_HIGH;
- gpios->gpios[3].value = lidswitch;
+ gpios->gpios[3].value = get_lid_switch();
strncpy((char *)gpios->gpios[3].name,"lid", GPIO_MAX_NAME_LENGTH);
printk(BIOS_DEBUG,"LID SWITCH FROM EC: %x\n", lidswitch);
@@ -126,6 +125,16 @@ int get_pch_gpio(unsigned char gpio_num)
return retval;
}
+int get_write_protect_state(void)
+{
+ return !get_pch_gpio(WP_GPIO);
+}
+
+int get_lid_switch(void)
+{
+ return (ec_mem_read(EC_HW_GPI_STATUS) >> EC_GPI_LID_STAT_BIT) & 1;
+}
+
int get_developer_mode_switch(void)
{
int dev_mode = 0;