From d9b16f3b048243fd7d4c4513875f7f241261ce50 Mon Sep 17 00:00:00 2001 From: David Hendricks Date: Wed, 6 Mar 2013 19:16:10 -0800 Subject: [PATCH] snow: add real values for GPIOs in fill_lb_gpios() This adds some real GPIO mappings where virtual GPIOs were used before. Change-Id: I25d4be45f986c8d622b97151f8bdae2651baf3e6 Signed-off-by: David Hendricks Reviewed-on: http://review.coreboot.org/2603 Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich --- src/mainboard/google/snow/chromeos.c | 35 ++++++++++++++++++---------- 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/src/mainboard/google/snow/chromeos.c b/src/mainboard/google/snow/chromeos.c index fd2006c751..14da49c71d 100644 --- a/src/mainboard/google/snow/chromeos.c +++ b/src/mainboard/google/snow/chromeos.c @@ -22,6 +22,10 @@ #include #include +#include +#include +#include + #include #define ACTIVE_LOW 0 @@ -30,6 +34,8 @@ #define DEVMODE_GPIO 54 #define FORCE_RECOVERY_MODE 0 #define FORCE_DEVELOPER_MODE 0 +#define LID_OPEN 3 +#define POWER_BUTTON 3 #include #include @@ -38,33 +44,38 @@ void fill_lb_gpios(struct lb_gpios *gpios) { + struct exynos5_gpio_part1 *gpio_pt1; + struct exynos5_gpio_part2 *gpio_pt2; gpios->size = sizeof(*gpios) + (GPIO_COUNT * sizeof(struct lb_gpio)); gpios->count = GPIO_COUNT; - /* Write Protect: virtual GPIO active Low */ - gpios->gpios[0].port = -1; + gpio_pt1 = (struct exynos5_gpio_part1 *)EXYNOS5_GPIO_PART1_BASE; + gpio_pt2 = (struct exynos5_gpio_part2 *)EXYNOS5_GPIO_PART2_BASE; + + /* Write Protect: active Low */ + gpios->gpios[0].port = EXYNOS5_GPD1; gpios->gpios[0].polarity = ACTIVE_LOW; - gpios->gpios[0].value = 1; + gpios->gpios[0].value = s5p_gpio_get_value(&gpio_pt1->d1, WP_GPIO); strncpy((char *)gpios->gpios[0].name,"write protect", GPIO_MAX_NAME_LENGTH); - /* Recovery: virtual GPIO active high */ - gpios->gpios[1].port = -1; + /* Recovery: active high */ + gpios->gpios[1].port = EXYNOS5_GPY1; gpios->gpios[1].polarity = ACTIVE_HIGH; - gpios->gpios[1].value = 0; + gpios->gpios[2].value = s5p_gpio_get_value(&gpio_pt1->y1, FORCE_RECOVERY_MODE); strncpy((char *)gpios->gpios[1].name,"recovery", GPIO_MAX_NAME_LENGTH); /* Lid: the "switch" comes from the EC */ - gpios->gpios[2].port = -1; - gpios->gpios[2].polarity = ACTIVE_HIGH; - gpios->gpios[2].value = 0; + gpios->gpios[2].port = EXYNOS5_GPX3; + gpios->gpios[2].polarity = ACTIVE_LOW; + gpios->gpios[2].value = s5p_gpio_get_value(&gpio_pt2->x3, LID_OPEN); strncpy((char *)gpios->gpios[2].name,"lid", GPIO_MAX_NAME_LENGTH); - /* Power: hardcoded as not pressed */ + /* Power: virtual GPIO active low */ gpios->gpios[3].port = -1; - gpios->gpios[3].polarity = ACTIVE_HIGH; - gpios->gpios[3].value = 0; + gpios->gpios[3].polarity = ACTIVE_LOW; + gpios->gpios[3].value = 1; strncpy((char *)gpios->gpios[3].name,"power", GPIO_MAX_NAME_LENGTH); /* Developer: virtual GPIO active high */