summaryrefslogtreecommitdiff
path: root/chip/host/flash.c
diff options
context:
space:
mode:
authorTim Lin <tim2.lin@ite.corp-partner.google.com>2021-06-04 14:11:25 +0800
committerCommit Bot <commit-bot@chromium.org>2021-06-09 18:54:47 +0000
commit670bd7e258d352a2ea197e055e46b60690935afc (patch)
tree9a223dbbdde5e822f63475fdb0a39c0dc1300112 /chip/host/flash.c
parent3bf7cf9dfe738f1f156d6b9dc5ade87290d1d78e (diff)
downloadchrome-ec-670bd7e258d352a2ea197e055e46b60690935afc.tar.gz
include/flash: rename the APIs
The names conflict when enabling both Zephyr's flash driver and CONFIG_FLASH_CROS option. Rename all the APIs in include/flash.h BUG=b:187192628 BRANCH=none TEST=make buildall -j4 Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com> Change-Id: If1fd0ea28fa9f5cec1c1daa8f72f63eb7a0e6500 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2931749 Commit-Queue: Keith Short <keithshort@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Denis Brockus <dbrockus@chromium.org>
Diffstat (limited to 'chip/host/flash.c')
-rw-r--r--chip/host/flash.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/chip/host/flash.c b/chip/host/flash.c
index 95d46d9f34..75212737e0 100644
--- a/chip/host/flash.c
+++ b/chip/host/flash.c
@@ -67,7 +67,7 @@ static void flash_get_persistent(void)
release_persistent_storage(f);
}
-int flash_physical_write(int offset, int size, const char *data)
+int crec_flash_physical_write(int offset, int size, const char *data)
{
ASSERT((size & (CONFIG_FLASH_WRITE_SIZE - 1)) == 0);
@@ -83,7 +83,7 @@ int flash_physical_write(int offset, int size, const char *data)
return EC_SUCCESS;
}
-int flash_physical_erase(int offset, int size)
+int crec_flash_physical_erase(int offset, int size)
{
ASSERT((size & (CONFIG_FLASH_ERASE_SIZE - 1)) == 0);
@@ -99,12 +99,12 @@ int flash_physical_erase(int offset, int size)
return EC_SUCCESS;
}
-int flash_physical_get_protect(int bank)
+int crec_flash_physical_get_protect(int bank)
{
return __host_flash_protect[bank];
}
-uint32_t flash_physical_get_protect_flags(void)
+uint32_t crec_flash_physical_get_protect_flags(void)
{
int i;
uint32_t flags = EC_FLASH_PROTECT_ALL_NOW;
@@ -116,20 +116,20 @@ uint32_t flash_physical_get_protect_flags(void)
return flags;
}
-int flash_physical_protect_now(int all)
+int crec_flash_physical_protect_now(int all)
{
memset(__host_flash_protect, 1, all ? PHYSICAL_BANKS : WP_BANK_COUNT);
return EC_SUCCESS;
}
-uint32_t flash_physical_get_valid_flags(void)
+uint32_t crec_flash_physical_get_valid_flags(void)
{
return EC_FLASH_PROTECT_RO_AT_BOOT |
EC_FLASH_PROTECT_RO_NOW |
EC_FLASH_PROTECT_ALL_NOW;
}
-uint32_t flash_physical_get_writable_flags(uint32_t cur_flags)
+uint32_t crec_flash_physical_get_writable_flags(uint32_t cur_flags)
{
uint32_t ret = 0;
@@ -148,13 +148,13 @@ uint32_t flash_physical_get_writable_flags(uint32_t cur_flags)
return ret;
}
-int flash_pre_init(void)
+int crec_flash_pre_init(void)
{
uint32_t prot_flags;
flash_get_persistent();
- prot_flags = flash_get_protect();
+ prot_flags = crec_flash_get_protect();
if (prot_flags & EC_FLASH_PROTECT_GPIO_ASSERTED) {
/*
@@ -163,13 +163,13 @@ int flash_pre_init(void)
*/
if ((prot_flags & EC_FLASH_PROTECT_RO_AT_BOOT) &&
!(prot_flags & EC_FLASH_PROTECT_RO_NOW)) {
- int rv = flash_set_protect(EC_FLASH_PROTECT_RO_NOW,
+ int rv = crec_flash_set_protect(EC_FLASH_PROTECT_RO_NOW,
EC_FLASH_PROTECT_RO_NOW);
if (rv)
return rv;
/* Re-read flags */
- prot_flags = flash_get_protect();
+ prot_flags = crec_flash_get_protect();
}
}