diff options
author | Anton Staaf <robotboy@chromium.org> | 2015-04-13 08:57:21 -0700 |
---|---|---|
committer | ChromeOS Commit Bot <chromeos-commit-bot@chromium.org> | 2015-04-13 20:01:05 +0000 |
commit | af27fe89838f55cd14be98d0691326627e87b39f (patch) | |
tree | d89e66970a2be5818cc25d3882e0aaf9a205ed63 /common/main.c | |
parent | 8c0cef260727ba125def62cfd0ef9c09fc9c2172 (diff) | |
download | chrome-ec-af27fe89838f55cd14be98d0691326627e87b39f.tar.gz |
CCD: Switch PD_NO_DEBUG logic to use system_is_locked
The system_is_locked function encompases the required checks
for asserting PD_NO_DEBUG. It also supports forcing a
system to be unlocked at build time, as well as handling
systems without flash.
Signed-off-by: Anton Staaf <robotboy@chromium.org>
BRANCH=None
BUG=None
TEST=make buildall -j
Change-Id: I676acb5a2ae169f9739a19910a760706f69f5b7b
Reviewed-on: https://chromium-review.googlesource.com/265463
Trybot-Ready: Anton Staaf <robotboy@chromium.org>
Tested-by: Anton Staaf <robotboy@chromium.org>
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Commit-Queue: Anton Staaf <robotboy@chromium.org>
Diffstat (limited to 'common/main.c')
-rw-r--r-- | common/main.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/common/main.c b/common/main.c index 8f9c48e4af..f30f2970cd 100644 --- a/common/main.c +++ b/common/main.c @@ -80,17 +80,12 @@ test_mockable int main(void) #if defined(CONFIG_CASE_CLOSED_DEBUG) /* - * If the device is both soft (EC flash protection active) and hard - * (WP hardware signal active) write protected then we assert - * PD_NO_DEBUG, preventing the EC from interfering with the AP's - * access to the SPI flash. The PD_NO_DEBUG signal is latched in - * hardware, so changing this GPIO later has no effect. + * If the device is locked we assert PD_NO_DEBUG, preventing the EC + * from interfering with the AP's access to the SPI flash. + * The PD_NO_DEBUG signal is latched in hardware, so changing this + * GPIO later has no effect. */ -#define FLASH_PROTECT_MASK (EC_FLASH_PROTECT_RO_NOW | \ - EC_FLASH_PROTECT_GPIO_ASSERTED) - - if ((flash_get_protect() & FLASH_PROTECT_MASK) == FLASH_PROTECT_MASK) - gpio_set_level(GPIO_PD_DISABLE_DEBUG, 1); + gpio_set_level(GPIO_PD_DISABLE_DEBUG, system_is_locked()); #endif /* Set the CPU clocks / PLLs. System is now running at full speed. */ |