diff options
author | Randall Spangler <rspangler@chromium.org> | 2013-09-24 15:34:03 -0700 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2013-09-25 01:23:29 +0000 |
commit | a617846582a52f90883f49c3c75324dcbb5e7fdb (patch) | |
tree | 13aca1ecf2e340acf960077430d6923026a6ee5a | |
parent | 32d073f6c6e876c55a8dd13053ce49964773e75f (diff) | |
download | chrome-ec-a617846582a52f90883f49c3c75324dcbb5e7fdb.tar.gz |
Make support for dedicated recovery GPIO signal optional
switch.c currently assumes that all boards have GPIO_RECOVERY_L. This
is not true for Rambi, and also isn't true for ARM boards (which
should also eventually use the common switch implementation).
Add a new CONFIG_SWITCH_DEDICATED_RECOVERY option to control whether
to compile this support.
BUG=chrome-os-partner:22893
BRANCH=none
TEST=compile all boards; pass unit tests
Change-Id: If6f34d1afd580c9d79a8edcdda18833068e70f66
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/170489
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
-rw-r--r-- | board/bolt/board.h | 1 | ||||
-rw-r--r-- | board/falco/board.h | 1 | ||||
-rw-r--r-- | board/link/board.h | 1 | ||||
-rw-r--r-- | board/peppy/board.h | 1 | ||||
-rw-r--r-- | board/slippy/board.h | 1 | ||||
-rw-r--r-- | common/switch.c | 4 | ||||
-rw-r--r-- | include/config.h | 3 |
7 files changed, 12 insertions, 0 deletions
diff --git a/board/bolt/board.h b/board/bolt/board.h index b5751b9a36..3c60f91e0d 100644 --- a/board/bolt/board.h +++ b/board/bolt/board.h @@ -43,6 +43,7 @@ #define CONFIG_FAN_POWER_GOOD GPIO_PP5000_PGOOD #define CONFIG_PWM #define CONFIG_PWM_KBLIGHT +#define CONFIG_SWITCH_DEDICATED_RECOVERY #define CONFIG_TEMP_SENSOR #define CONFIG_UART_HOST 2 #define CONFIG_WIRELESS diff --git a/board/falco/board.h b/board/falco/board.h index 4c9e2c0201..363e9b9ec0 100644 --- a/board/falco/board.h +++ b/board/falco/board.h @@ -29,6 +29,7 @@ #define CONFIG_POWER_BUTTON #define CONFIG_POWER_BUTTON_X86 #define CONFIG_PWM +#define CONFIG_SWITCH_DEDICATED_RECOVERY #define CONFIG_TEMP_SENSOR #define CONFIG_TEMP_SENSOR_G781 #define CONFIG_UART_HOST 2 diff --git a/board/link/board.h b/board/link/board.h index f2de5ddfd4..91730efd0f 100644 --- a/board/link/board.h +++ b/board/link/board.h @@ -33,6 +33,7 @@ #define CONFIG_POWER_BUTTON_X86 #define CONFIG_PWM #define CONFIG_PWM_KBLIGHT +#define CONFIG_SWITCH_DEDICATED_RECOVERY #define CONFIG_TEMP_SENSOR #define CONFIG_TEMP_SENSOR_TMP006 #define CONFIG_UART_HOST 1 diff --git a/board/peppy/board.h b/board/peppy/board.h index ff51c73936..837b872e22 100644 --- a/board/peppy/board.h +++ b/board/peppy/board.h @@ -31,6 +31,7 @@ #define CONFIG_POWER_BUTTON #define CONFIG_POWER_BUTTON_X86 #define CONFIG_PWM +#define CONFIG_SWITCH_DEDICATED_RECOVERY #define CONFIG_TEMP_SENSOR #define CONFIG_TEMP_SENSOR_G781 #define CONFIG_UART_HOST 2 diff --git a/board/slippy/board.h b/board/slippy/board.h index 3ea81d97f4..a90f9310ad 100644 --- a/board/slippy/board.h +++ b/board/slippy/board.h @@ -31,6 +31,7 @@ #define CONFIG_POWER_BUTTON #define CONFIG_POWER_BUTTON_X86 #define CONFIG_PWM +#define CONFIG_SWITCH_DEDICATED_RECOVERY #define CONFIG_TEMP_SENSOR #define CONFIG_TEMP_SENSOR_G781 #define CONFIG_UART_HOST 2 diff --git a/common/switch.c b/common/switch.c index 73f1c16edb..a8cf4eaebd 100644 --- a/common/switch.c +++ b/common/switch.c @@ -53,10 +53,12 @@ static void switch_update(void) else *memmap_switches &= ~EC_SWITCH_WRITE_PROTECT_DISABLED; +#ifdef CONFIG_SWITCH_DEDICATED_RECOVERY if (gpio_get_level(GPIO_RECOVERY_L) == 0) *memmap_switches |= EC_SWITCH_DEDICATED_RECOVERY; else *memmap_switches &= ~EC_SWITCH_DEDICATED_RECOVERY; +#endif if (prev != *memmap_switches) CPRINTF("[%T SW 0x%02x]\n", *memmap_switches); @@ -76,8 +78,10 @@ static void switch_init(void) /* Switch data is now present */ *host_get_memmap(EC_MEMMAP_SWITCHES_VERSION) = 1; +#ifdef CONFIG_SWITCH_DEDICATED_RECOVERY /* Enable interrupts, now that we've initialized */ gpio_enable_interrupt(GPIO_RECOVERY_L); +#endif /* * TODO(rspangler): It's weird that flash_common.c owns reading the diff --git a/include/config.h b/include/config.h index fda29dfca6..5234a77e10 100644 --- a/include/config.h +++ b/include/config.h @@ -556,6 +556,9 @@ */ #undef CONFIG_SWITCH +/* Compile support for dedicated recovery signal from servo board */ +#undef CONFIG_SWITCH_DEDICATED_RECOVERY + /* * System should remain unlocked even if write protect is enabled. * |