diff options
-rw-r--r-- | chip/mec1322/config_chip.h | 4 | ||||
-rw-r--r-- | chip/mec1322/flash.c | 5 |
2 files changed, 7 insertions, 2 deletions
diff --git a/chip/mec1322/config_chip.h b/chip/mec1322/config_chip.h index 8129ee469c..3accdfdf63 100644 --- a/chip/mec1322/config_chip.h +++ b/chip/mec1322/config_chip.h @@ -144,8 +144,8 @@ which contains Loader and RO Images */ /* Non-memmapped, external SPI */ -/* #define CONFIG_CODERAM_ARCH -#undef CONFIG_FLASH_MAPPED*/ +/* #define CONFIG_CODERAM_ARCH*/ +#undef CONFIG_FLASH_MAPPED #undef CONFIG_FLASH_PSTATE #define CONFIG_SPI_FLASH diff --git a/chip/mec1322/flash.c b/chip/mec1322/flash.c index fb6f56fc48..e9c752e917 100644 --- a/chip/mec1322/flash.c +++ b/chip/mec1322/flash.c @@ -27,6 +27,8 @@ int flash_physical_read(int offset, int size, char *data) { int ret; + offset += CONFIG_FLASH_BASE_SPI; + /* Fail if offset, size, and data aren't at least word-aligned */ if ((offset | size | (uint32_t)(uintptr_t)data) & 3) return EC_ERROR_INVAL; @@ -50,6 +52,8 @@ int flash_physical_write(int offset, int size, const char *data) { int ret, i, write_size; + offset += CONFIG_FLASH_BASE_SPI; + /* Fail if offset, size, and data aren't at least word-aligned */ if ((offset | size | (uint32_t)(uintptr_t)data) & 3) return EC_ERROR_INVAL; @@ -81,6 +85,7 @@ int flash_physical_erase(int offset, int size) { int ret; + offset += CONFIG_FLASH_BASE_SPI; spi_enable(1); ret = spi_flash_erase(offset, size); spi_enable(0); |