summaryrefslogtreecommitdiff
path: root/zephyr/shim/src/flash.c
diff options
context:
space:
mode:
authorTim Lin <tim2.lin@ite.corp-partner.google.com>2021-06-29 16:13:44 +0800
committerCommit Bot <commit-bot@chromium.org>2021-07-01 15:00:54 +0000
commit300daebbb748a7b5f51bf411adfb985b83c085a4 (patch)
tree2c83f946ecabd09f4057316c3092c740e5dd1e12 /zephyr/shim/src/flash.c
parent1e6aad6a6c55d9d04158625766f9ed419fedcfd9 (diff)
downloadchrome-ec-300daebbb748a7b5f51bf411adfb985b83c085a4.tar.gz
zephyr/drivers: npcx: reorganizes the flash driver(2)
Move NPCX specific code flash_dev_init(), crec_flash_physical_write() and crec_flash_physical_erase() from shim/flash.c to cros_flash/cros_flash_npcx.c. BUG=b:187192628 BRANCH=none TEST=none Cq-Depend: chromium:2994429 Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com> Change-Id: I094e26c5b670402872a665ba4d24a6594f7ca77e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2994430 Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
Diffstat (limited to 'zephyr/shim/src/flash.c')
-rw-r--r--zephyr/shim/src/flash.c29
1 files changed, 0 insertions, 29 deletions
diff --git a/zephyr/shim/src/flash.c b/zephyr/shim/src/flash.c
index 4fe8e284b1..ce74a34398 100644
--- a/zephyr/shim/src/flash.c
+++ b/zephyr/shim/src/flash.c
@@ -44,14 +44,6 @@ int crec_flash_physical_write(int offset, int size, const char *data)
(CONFIG_FLASH_WRITE_SIZE - 1))
return EC_ERROR_INVAL;
- /* check protection */
- if (all_protected)
- return EC_ERROR_ACCESS_DENIED;
-
- /* check protection */
- if (flash_check_prot_range(offset, size))
- return EC_ERROR_ACCESS_DENIED;
-
/* Lock physical flash operations */
crec_flash_lock_mapped_storage(1);
@@ -67,14 +59,6 @@ int crec_flash_physical_erase(int offset, int size)
{
int rv;
- /* check protection */
- if (all_protected)
- return EC_ERROR_ACCESS_DENIED;
-
- /* check protection */
- if (flash_check_prot_range(offset, size))
- return EC_ERROR_ACCESS_DENIED;
-
/* Lock physical flash operations */
crec_flash_lock_mapped_storage(1);
@@ -179,19 +163,6 @@ static int flash_dev_init(const struct device *unused)
}
cros_flash_init(cros_flash_dev);
- /*
- * Protect status registers of internal spi-flash if WP# is active
- * during ec initialization.
- */
-#ifdef CONFIG_WP_ACTIVE_HIGH
- flash_protect_int_flash(gpio_get_level(GPIO_WP));
-#else
- flash_protect_int_flash(!gpio_get_level(GPIO_WP_L));
-#endif /*CONFIG_WP_ACTIVE_HIGH */
-
- /* Initialize UMA to unlocked */
- flash_uma_lock(0);
-
return 0;
}