summaryrefslogtreecommitdiff
path: root/chip
diff options
context:
space:
mode:
authorAndrey Petrov <andrey.petrov@intel.com>2015-06-09 11:28:46 -0700
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2015-06-11 01:21:14 +0000
commitc75e78cd50a6e7ab2fba293199ebf97bcf66ed13 (patch)
tree02e5397f861f7fb6bfd62d01f8237f282ab9bd11 /chip
parentbd7e885ae780493e37a58418a6f0197a4a3b951a (diff)
downloadchrome-ec-c75e78cd50a6e7ab2fba293199ebf97bcf66ed13.tar.gz
mec1322: fix flash_physical_get_writable_flags()
Add spi_enable() before SPI transaction. This fixes a problem where protect host cmd ended up messing up SPI controller state. Change-Id: Ief61f279cbd0a90e55ce87d0c350072dc8616c31 Signed-off-by: Andrey Petrov <andrey.petrov@intel.com> Reviewed-on: https://chromium-review.googlesource.com/276338 Reviewed-by: Shawn N <shawnn@chromium.org> Tested-by: Divya Jyothi <divya.jyothi@intel.com> Commit-Queue: Divya Jyothi <divya.jyothi@intel.com>
Diffstat (limited to 'chip')
-rw-r--r--chip/mec1322/flash.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/chip/mec1322/flash.c b/chip/mec1322/flash.c
index 343258e811..9681511f5a 100644
--- a/chip/mec1322/flash.c
+++ b/chip/mec1322/flash.c
@@ -172,7 +172,11 @@ uint32_t flash_physical_get_valid_flags(void)
uint32_t flash_physical_get_writable_flags(uint32_t cur_flags)
{
uint32_t ret = 0;
- enum spi_flash_wp wp_status = spi_flash_check_wp();
+ enum spi_flash_wp wp_status = SPI_WP_NONE;
+
+ spi_enable(1);
+ wp_status = spi_flash_check_wp();
+ spi_enable(0);
if (wp_status == SPI_WP_NONE || (wp_status == SPI_WP_HARDWARE &&
!(cur_flags & EC_FLASH_PROTECT_GPIO_ASSERTED)))