summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMary Ruthven <mruthven@chromium.org>2019-06-12 14:03:16 -0700
committerVadim Bendebury <vbendeb@chromium.org>2019-09-21 19:11:24 -0700
commitaf8c5aa706fb19eb89b44c63f1fcea7326a9792e (patch)
treef19cb1c292e7043224e6e8824108af6c9aa1e439
parent5fc4c5f756365984310a0366a0e47b0e2c37c7b8 (diff)
downloadchrome-ec-af8c5aa706fb19eb89b44c63f1fcea7326a9792e.tar.gz
g: system: move print statements to CC_SYSTEM
Move the system prints to CC_SYSTEM, so we can disable them when we just want to print console output. BUG=none BRANCH=cr50 TEST=chan 0 disables these prints and they're still printed normally Change-Id: Id728729c8472a033d6a9702991c32c3b809588b1 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1656519 Reviewed-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-by: Namyoon Woo <namyoon@chromium.org> (cherry picked from commit de7ba1f17dcb388e58e826f2ff6117dd676ce670) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1664198 Tested-by: Vadim Bendebury <vbendeb@chromium.org> Commit-Queue: Vadim Bendebury <vbendeb@chromium.org> (cherry picked from commit 16003bb03d078cf52867dd1128466489fd332575) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1705733 (cherry picked from commit efb81b6654df117accaa8611b93496425ec184f8)
-rw-r--r--chip/g/system.c37
1 files changed, 18 insertions, 19 deletions
diff --git a/chip/g/system.c b/chip/g/system.c
index 26fea4b652..82e021a12a 100644
--- a/chip/g/system.c
+++ b/chip/g/system.c
@@ -16,6 +16,7 @@
#include "task.h"
#include "version.h"
+#define CPRINTS(format, args...) cprints(CC_SYSTEM, format, ## args)
/*
* Value of the retry counter which, if exceeded, indicates that the currently
* running RW image is not well and is rebooting before bringing the system
@@ -474,8 +475,8 @@ static int corrupt_header(volatile struct SignedHeader *header)
GWRITE_FIELD(GLOBALSEC, FLASH_REGION6_CTRL, RD_EN, 1);
GWRITE_FIELD(GLOBALSEC, FLASH_REGION6_CTRL, WR_EN, 1);
- ccprintf("%s: RW fallback must have happened, magic at %p before: %x\n",
- __func__, &header->magic, header->magic);
+ CPRINTS("%s: RW fallback must have happened, magic at %p before: %x",
+ __func__, &header->magic, header->magic);
rv = flash_physical_write((intptr_t)&header->magic -
CONFIG_PROGRAM_MEMORY_BASE,
@@ -483,8 +484,7 @@ static int corrupt_header(volatile struct SignedHeader *header)
/* Disable W access to the other header. */
GWRITE_FIELD(GLOBALSEC, FLASH_REGION6_CTRL, WR_EN, 0);
- ccprintf("%s: magic after: %x\n",
- __func__, header->magic);
+ CPRINTS("%s: magic after: %x", __func__, header->magic);
header_corrupted = !rv;
return rv;
@@ -527,7 +527,7 @@ int system_process_retry_counter(void)
{
struct SignedHeader *newer_image;
- ccprintf("%s: retry counter %d\n", __func__,
+ CPRINTS("%s: retry counter %d", __func__,
GREG32(PMU, LONG_LIFE_SCRATCH0));
system_clear_retry_counter();
@@ -535,14 +535,14 @@ int system_process_retry_counter(void)
return EC_SUCCESS;
if (current_image_is_newer(&newer_image)) {
- ccprintf("%s: "
- "this is odd, I am newer, but retry counter indicates "
- "the system rolledback\n", __func__);
+ CPRINTS("%s: "
+ "this is odd, I am newer, but retry counter indicates "
+ "the system rolledback", __func__);
return EC_SUCCESS;
}
if (header_corrupted) {
- ccprintf("%s: header already corrupted\n", __func__);
+ CPRINTS("%s: header already corrupted", __func__);
return EC_SUCCESS;
}
@@ -568,8 +568,8 @@ int system_rolling_reboot_suspected(void)
* cleared. There must be something wrong going, the chip is
* likely in rolling reboot.
*/
- ccprintf("%s: Try powercycling to clear this condition.\n",
- __func__);
+ CPRINTS("%s: Try powercycling to clear this condition.",
+ __func__);
return 1;
}
@@ -617,8 +617,7 @@ static void update_rollback_mask(const struct SignedHeader *header_a,
*/
if (flash_info_read_enable(INFO_RW_MAP_OFFSET, INFO_RW_MAP_SIZE) !=
EC_SUCCESS) {
- ccprintf("%s: failed to enable read access to info\n",
- __func__);
+ CPRINTS("%s: failed to enable read access to info", __func__);
return;
}
@@ -664,7 +663,7 @@ static void update_rollback_mask(const struct SignedHeader *header_a,
* adjacent at the LSB of the info mask field. Stop as
* soon as a non-zeroed bit is encountered.
*/
- ccprintf("%s: bailing out at bit %d\n", __func__, i);
+ CPRINTS("%s: bailing out at bit %d", __func__, i);
break;
}
@@ -672,7 +671,7 @@ static void update_rollback_mask(const struct SignedHeader *header_a,
if (flash_physical_info_read_word(byte_offset, &word) !=
EC_SUCCESS) {
- ccprintf("failed to read info mask word %d\n", i);
+ CPRINTS("failed to read info mask word %d", i);
continue;
}
@@ -683,8 +682,8 @@ static void update_rollback_mask(const struct SignedHeader *header_a,
if (flash_info_write_enable(
INFO_RW_MAP_OFFSET,
INFO_RW_MAP_SIZE) != EC_SUCCESS) {
- ccprintf("%s: failed to enable write access to"
- " info\n", __func__);
+ CPRINTS("%s: failed to enable write access to"
+ " info", __func__);
return;
}
write_enabled = 1;
@@ -695,7 +694,7 @@ static void update_rollback_mask(const struct SignedHeader *header_a,
sizeof(word),
(const char *) &word) !=
EC_SUCCESS) {
- ccprintf("failed to write info mask word %d\n", i);
+ CPRINTS("failed to write info mask word %d", i);
continue;
}
updated_words_count++;
@@ -705,7 +704,7 @@ static void update_rollback_mask(const struct SignedHeader *header_a,
return;
flash_info_write_disable();
- ccprintf("updated %d info map words\n", updated_words_count);
+ CPRINTS("updated %d info map words", updated_words_count);
#endif /* CR50_DEV ^^^^^^^^ NOT defined. */
}