summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorShawn Nematbakhsh <shawnn@chromium.org>2015-03-10 11:50:39 -0700
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2015-03-11 23:18:09 +0000
commit27199e7b64659a2db7114c670b903578858f8d50 (patch)
tree71a7332d6b7bbbe3cd9c57ca21b1d736daff8f96 /include
parentd32be0292f1e1aa389da579ea29f7a151ae002e1 (diff)
downloadchrome-ec-27199e7b64659a2db7114c670b903578858f8d50.tar.gz
spi_flash: Add protect support for W25X40
W25X40 uses a different protection register encoding than our existing W25Q64 code. Move the SPI ROM option to a config, and add support for the new part. BUG=chrome-os-partner:37688 TEST=`make buildall -j`. W25X40 protection code tested in a subsequent commit. BRANCH=None Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Change-Id: Iaaeabf42c6c62c20debc91afd2cf8671c14244c8 Reviewed-on: https://chromium-review.googlesource.com/258440 Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'include')
-rw-r--r--include/config.h6
-rw-r--r--include/spi_flash.h6
2 files changed, 8 insertions, 4 deletions
diff --git a/include/config.h b/include/config.h
index c4974dd471..eee74b4389 100644
--- a/include/config.h
+++ b/include/config.h
@@ -1039,6 +1039,12 @@
/* Support SPI flash */
#undef CONFIG_SPI_FLASH
+/* Support W25Q64 SPI flash */
+#undef CONFIG_SPI_FLASH_W25Q64
+
+/* Support W25X40 SPI flash */
+#undef CONFIG_SPI_FLASH_W25X40
+
/* Size (bytes) of SPI flash memory */
#undef CONFIG_SPI_FLASH_SIZE
diff --git a/include/spi_flash.h b/include/spi_flash.h
index 9e83ea9e91..9b8a0a64d5 100644
--- a/include/spi_flash.h
+++ b/include/spi_flash.h
@@ -141,11 +141,9 @@ uint64_t spi_flash_get_unique_id(void);
* Note that this does not check the hardware WP pin as we might not be
* able to read the WP pin status.
*
- * @param wp Status register write protection mode
- *
- * @return EC_SUCCESS for no protection, or non-zero if error.
+ * @return enum spi_flash_wp status based on protection
*/
-int spi_flash_check_wp(void);
+enum spi_flash_wp spi_flash_check_wp(void);
/**
* Set SPI flash status register write protection