Patrick Georgi (pgeorgi@google.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/11062
-gerrit
commit 01dbf17fd0c737296087963032995aed070403ca Author: Patrick Georgi pgeorgi@chromium.org Date: Mon Jul 27 23:18:15 2015 +0200
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 --- src/mainboard/google/butterfly/chromeos.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/src/mainboard/google/butterfly/chromeos.c b/src/mainboard/google/butterfly/chromeos.c index fd7ef4e..c23f827 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;