summaryrefslogtreecommitdiff
path: root/chip/mchp
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/mchp
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/mchp')
-rw-r--r--chip/mchp/flash.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/chip/mchp/flash.c b/chip/mchp/flash.c
index 043e2b268f..1679cf92cb 100644
--- a/chip/mchp/flash.c
+++ b/chip/mchp/flash.c
@@ -35,7 +35,7 @@ struct flash_wp_state {
* @param size Number of bytes to write.
* @param data Destination buffer for data.
*/
-int flash_physical_read(int offset, int size, char *data)
+int crec_flash_physical_read(int offset, int size, char *data)
{
trace13(0, FLASH, 0,
"flash_phys_read: offset=0x%08X size=0x%08X dataptr=0x%08X",
@@ -52,7 +52,7 @@ int flash_physical_read(int offset, int size, char *data)
* @param size Number of bytes to write.
* @param data Data to write to flash. Must be 32-bit aligned.
*/
-int flash_physical_write(int offset, int size, const char *data)
+int crec_flash_physical_write(int offset, int size, const char *data)
{
int ret = EC_SUCCESS;
int i, write_size;
@@ -87,7 +87,7 @@ int flash_physical_write(int offset, int size, const char *data)
* @param offset Flash offset to erase.
* @param size Number of bytes to erase.
*/
-int flash_physical_erase(int offset, int size)
+int crec_flash_physical_erase(int offset, int size)
{
int ret;
@@ -107,7 +107,7 @@ int flash_physical_erase(int offset, int size)
* @param bank Bank index to check.
* @return non-zero if bank is protected until reboot.
*/
-int flash_physical_get_protect(int bank)
+int crec_flash_physical_get_protect(int bank)
{
return spi_flash_check_protect(bank * CONFIG_FLASH_BANK_SIZE,
CONFIG_FLASH_BANK_SIZE);
@@ -121,7 +121,7 @@ int flash_physical_get_protect(int bank)
* @param all Protect all (=1) or just read-only
* @return non-zero if error.
*/
-int flash_physical_protect_now(int all)
+int crec_flash_physical_protect_now(int all)
{
if (all)
entire_flash_locked = 1;
@@ -142,7 +142,7 @@ int flash_physical_protect_now(int all)
*
* Uses the EC_FLASH_PROTECT_* flags from ec_commands.h
*/
-uint32_t flash_physical_get_protect_flags(void)
+uint32_t crec_flash_physical_get_protect_flags(void)
{
uint32_t flags = 0;
@@ -162,7 +162,7 @@ uint32_t flash_physical_get_protect_flags(void)
*
* @return A combination of EC_FLASH_PROTECT_* flags from ec_commands.h
*/
-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 |
@@ -175,7 +175,7 @@ uint32_t flash_physical_get_valid_flags(void)
* @param cur_flags The current flash protect flags.
* @return A combination of EC_FLASH_PROTECT_* flags from ec_commands.h
*/
-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;
enum spi_flash_wp wp_status = SPI_WP_NONE;
@@ -204,7 +204,7 @@ uint32_t flash_physical_get_writable_flags(uint32_t cur_flags)
* @param range The range to protect.
* @return EC_SUCCESS, or nonzero if error.
*/
-int flash_physical_protect_at_boot(uint32_t new_flags)
+int crec_flash_physical_protect_at_boot(uint32_t new_flags)
{
int offset, size, ret;
enum spi_flash_wp flashwp = SPI_WP_NONE;
@@ -234,13 +234,13 @@ int flash_physical_protect_at_boot(uint32_t new_flags)
*
* Applies at-boot protection settings if necessary.
*/
-int flash_pre_init(void)
+int crec_flash_pre_init(void)
{
- flash_physical_restore_state();
+ crec_flash_physical_restore_state();
return EC_SUCCESS;
}
-int flash_physical_restore_state(void)
+int crec_flash_physical_restore_state(void)
{
uint32_t reset_flags = system_get_reset_flags();
int version, size;