summaryrefslogtreecommitdiff
path: root/chip/max32660/flash_chip.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/max32660/flash_chip.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/max32660/flash_chip.c')
-rw-r--r--chip/max32660/flash_chip.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/chip/max32660/flash_chip.c b/chip/max32660/flash_chip.c
index ace87294a7..747d7dcc58 100644
--- a/chip/max32660/flash_chip.c
+++ b/chip/max32660/flash_chip.c
@@ -108,7 +108,7 @@ static int flash_device_page_erase(uint32_t address)
return EC_SUCCESS;
}
-int flash_physical_write(int offset, int size, const char *data)
+int crec_flash_physical_write(int offset, int size, const char *data)
{
int err;
uint32_t bytes_written;
@@ -232,7 +232,7 @@ int flash_physical_write(int offset, int size, const char *data)
/*****************************************************************************/
/* Physical layer APIs */
-int flash_physical_erase(int offset, int size)
+int crec_flash_physical_erase(int offset, int size)
{
int i;
int pages;
@@ -255,38 +255,38 @@ 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)
{
/* Not protected */
return 0;
}
-uint32_t flash_physical_get_protect_flags(void)
+uint32_t crec_flash_physical_get_protect_flags(void)
{
/* no flags set */
return 0;
}
-uint32_t flash_physical_get_valid_flags(void)
+uint32_t crec_flash_physical_get_valid_flags(void)
{
/* These are the flags we're going to pay attention to */
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)
{
/* no flags writable */
return 0;
}
-int flash_physical_protect_at_boot(uint32_t new_flags)
+int crec_flash_physical_protect_at_boot(uint32_t new_flags)
{
/* nothing to do here */
return EC_SUCCESS;
}
-int flash_physical_protect_now(int all)
+int crec_flash_physical_protect_now(int all)
{
/* nothing to do here */
return EC_SUCCESS;
@@ -295,7 +295,7 @@ int flash_physical_protect_now(int all)
/*****************************************************************************/
/* High-level APIs */
-int flash_pre_init(void)
+int crec_flash_pre_init(void)
{
return EC_SUCCESS;
}
@@ -330,10 +330,10 @@ static int command_flash_test1(int argc, char **argv)
/*
* erase page
*/
- error_status = flash_physical_erase(flash_address,
+ error_status = crec_flash_physical_erase(flash_address,
CONFIG_FLASH_ERASE_SIZE);
if (error_status != EC_SUCCESS) {
- CPRINTS("Error with flash_physical_erase\n");
+ CPRINTS("Error with crec_flash_physical_erase\n");
return EC_ERROR_UNKNOWN;
}
@@ -356,10 +356,10 @@ static int command_flash_test1(int argc, char **argv)
for (i = 0; i < BUFFER_SIZE; i++) {
buffer[i] = i + page;
}
- error_status = flash_physical_write(flash_address, BUFFER_SIZE,
- buffer);
+ error_status = crec_flash_physical_write(flash_address,
+ BUFFER_SIZE, buffer);
if (error_status != EC_SUCCESS) {
- CPRINTS("Error with flash_physical_write\n");
+ CPRINTS("Error with crec_flash_physical_write\n");
return EC_ERROR_UNKNOWN;
}
}
@@ -389,10 +389,10 @@ static int command_flash_test1(int argc, char **argv)
*/
for (page = PAGE_START; page <= PAGE_END; page++) {
flash_address = page * CONFIG_FLASH_ERASE_SIZE;
- error_status = flash_physical_erase(flash_address,
+ error_status = crec_flash_physical_erase(flash_address,
CONFIG_FLASH_ERASE_SIZE);
if (error_status != EC_SUCCESS) {
- CPRINTS("Error with flash_physical_erase\n");
+ CPRINTS("Error with crec_flash_physical_erase\n");
return EC_ERROR_UNKNOWN;
}
}