summaryrefslogtreecommitdiff
path: root/zephyr/drivers/cros_flash/cros_flash_it8xxx2.c
diff options
context:
space:
mode:
Diffstat (limited to 'zephyr/drivers/cros_flash/cros_flash_it8xxx2.c')
-rw-r--r--zephyr/drivers/cros_flash/cros_flash_it8xxx2.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/zephyr/drivers/cros_flash/cros_flash_it8xxx2.c b/zephyr/drivers/cros_flash/cros_flash_it8xxx2.c
index 7be6ef86fb..4838c5d583 100644
--- a/zephyr/drivers/cros_flash/cros_flash_it8xxx2.c
+++ b/zephyr/drivers/cros_flash/cros_flash_it8xxx2.c
@@ -1,4 +1,4 @@
-/* Copyright 2021 The Chromium OS Authors. All rights reserved.
+/* Copyright 2021 The ChromiumOS Authors
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
@@ -102,7 +102,7 @@ static int cros_flash_it8xxx2_init(const struct device *dev)
reset_flags = system_get_reset_flags();
prot_flags = crec_flash_get_protect();
unwanted_prot_flags = EC_FLASH_PROTECT_ALL_NOW |
- EC_FLASH_PROTECT_ERROR_INCONSISTENT;
+ EC_FLASH_PROTECT_ERROR_INCONSISTENT;
/*
* If we have already jumped between images, an earlier image could
@@ -113,12 +113,12 @@ static int cros_flash_it8xxx2_init(const struct device *dev)
if (prot_flags & EC_FLASH_PROTECT_GPIO_ASSERTED) {
/* Protect the entire flash of host interface */
- flash_protect_banks(0,
- CONFIG_FLASH_SIZE_BYTES / CONFIG_FLASH_BANK_SIZE,
+ flash_protect_banks(
+ 0, CONFIG_FLASH_SIZE_BYTES / CONFIG_FLASH_BANK_SIZE,
FLASH_WP_HOST);
/* Protect the entire flash of DBGR interface */
- flash_protect_banks(0,
- CONFIG_FLASH_SIZE_BYTES / CONFIG_FLASH_BANK_SIZE,
+ flash_protect_banks(
+ 0, CONFIG_FLASH_SIZE_BYTES / CONFIG_FLASH_BANK_SIZE,
FLASH_WP_DBGR);
/*
* Write protect is asserted. If we want RO flash protected,
@@ -126,8 +126,9 @@ static int cros_flash_it8xxx2_init(const struct device *dev)
*/
if ((prot_flags & EC_FLASH_PROTECT_RO_AT_BOOT) &&
!(prot_flags & EC_FLASH_PROTECT_RO_NOW)) {
- int rv = crec_flash_set_protect(EC_FLASH_PROTECT_RO_NOW,
- 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;
@@ -206,13 +207,13 @@ static int cros_flash_it8xxx2_erase(const struct device *dev, int offset,
* during erasing.
*/
if (IS_ENABLED(HAS_TASK_HOSTCMD) &&
- IS_ENABLED(CONFIG_HOST_COMMAND_STATUS)) {
+ IS_ENABLED(CONFIG_HOST_COMMAND_STATUS)) {
irq_enable(DT_IRQN(DT_NODELABEL(shi)));
}
/* Always use sector erase command */
for (; size > 0; size -= CONFIG_FLASH_ERASE_SIZE) {
ret = flash_erase(flash_controller, offset,
- CONFIG_FLASH_ERASE_SIZE);
+ CONFIG_FLASH_ERASE_SIZE);
if (ret)
break;
@@ -273,17 +274,16 @@ static int cros_flash_it8xxx2_protect_now(const struct device *dev, int all)
if (all) {
/* Protect the entire flash */
- flash_protect_banks(0,
- CONFIG_FLASH_SIZE_BYTES / CONFIG_FLASH_BANK_SIZE,
+ flash_protect_banks(
+ 0, CONFIG_FLASH_SIZE_BYTES / CONFIG_FLASH_BANK_SIZE,
FLASH_WP_EC);
data->all_protected = 1;
} else {
/* Protect the read-only section and persistent state */
- flash_protect_banks(WP_BANK_OFFSET,
- WP_BANK_COUNT, FLASH_WP_EC);
+ flash_protect_banks(WP_BANK_OFFSET, WP_BANK_COUNT, FLASH_WP_EC);
#ifdef PSTATE_BANK
- flash_protect_banks(PSTATE_BANK,
- PSTATE_BANK_COUNT, FLASH_WP_EC);
+ flash_protect_banks(PSTATE_BANK, PSTATE_BANK_COUNT,
+ FLASH_WP_EC);
#endif
}