summaryrefslogtreecommitdiff
path: root/power/haswell.c
diff options
context:
space:
mode:
authorVic Yang <victoryang@chromium.org>2014-05-19 15:03:27 -0700
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-05-21 20:32:17 +0000
commitffac23c0ea1bd4ff4568f5bd709a98f912b833a7 (patch)
tree362dd0ba205731aa07be97dd35b44b237799b23b /power/haswell.c
parent478361de694b1fb45abf3c38dafbbf7fd1aa5f71 (diff)
downloadchrome-ec-ffac23c0ea1bd4ff4568f5bd709a98f912b833a7.tar.gz
Add cprints() and ccprints()
Our code base contains a lot of debug messages in this pattern: CPRINTF("[%T xxx]\n") or ccprintf("[%T xxx]\n") The strings are taking up spaces in the EC binaries, so let's refactor this by adding cprints() and ccprints(). cprints() is just like cprintf(), except that it adds the brackets and the timestamp. ccprints() is equivalent to cprints(CC_CONSOLE, ...) This saves us hundreds of bytes in EC binaries. BUG=chromium:374575 TEST=Build and check flash size BRANCH=None Change-Id: Ifafe8dc1b80e698b28ed42b70518c7917b49ee51 Signed-off-by: Vic Yang <victoryang@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/200490 Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'power/haswell.c')
-rw-r--r--power/haswell.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/power/haswell.c b/power/haswell.c
index b5250379ad..ae7cf7a14a 100644
--- a/power/haswell.c
+++ b/power/haswell.c
@@ -21,7 +21,7 @@
/* Console output macros */
#define CPUTS(outstr) cputs(CC_CHIPSET, outstr)
-#define CPRINTF(format, args...) cprintf(CC_CHIPSET, format, ## args)
+#define CPRINTS(format, args...) cprints(CC_CHIPSET, format, ## args)
/* Input state flags */
#define IN_PGOOD_PP5000 POWER_SIGNAL_MASK(X86_PGOOD_PP5000)
@@ -56,7 +56,7 @@ static int pause_in_s5; /* Pause in S5 when shutting down? */
void chipset_force_shutdown(void)
{
- CPRINTF("[%T %s()]\n", __func__);
+ CPRINTS("%s()", __func__);
/*
* Force power off. This condition will reset once the state machine
@@ -68,7 +68,7 @@ void chipset_force_shutdown(void)
void chipset_reset(int cold_reset)
{
- CPRINTF("[%T %s(%d)]\n", __func__, cold_reset);
+ CPRINTS("%s(%d)", __func__, cold_reset);
if (cold_reset) {
/*
* Drop and restore PWROK. This causes the PCH to reboot,
@@ -131,11 +131,11 @@ enum power_state power_chipset_init(void)
if ((power_get_signals() & IN_ALL_S0) == IN_ALL_S0) {
/* Disable idle task deep sleep when in S0. */
disable_sleep(SLEEP_MASK_AP_RUN);
- CPRINTF("[%T already in S0]\n");
+ CPRINTS("already in S0");
return POWER_S0;
} else {
/* Force all signals to their G3 states */
- CPRINTF("[%T forcing G3]\n");
+ CPRINTS("forcing G3");
gpio_set_level(GPIO_PCH_PWROK, 0);
gpio_set_level(GPIO_VCORE_EN, 0);
gpio_set_level(GPIO_SUSP_VR_EN, 0);