mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-12-29 10:00:51 +00:00
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>
This commit is contained in:
committed by
ChromeOS Commit Bot
parent
bd7e885ae7
commit
c75e78cd50
@@ -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)))
|
||||
|
||||
Reference in New Issue
Block a user