summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2012-04-24 17:55:01 -0700
committerRandall Spangler <rspangler@chromium.org>2012-04-24 18:34:46 -0700
commit470916fb0f856945f2a93c7fd160845b5f659be1 (patch)
tree18652a5cff68223ec72650afc12e1e2e727c8529 /common
parent135f14bf498ab19b6e75efc3a0d18ef7c8a8752d (diff)
downloadchrome-ec-470916fb0f856945f2a93c7fd160845b5f659be1.tar.gz
Use console output instead of uart output for console commands
This completes console output cleanup. The remaining calls to uart_puts() and uart_printf() actually need to be that way. Signed-off-by: Randall Spangler <rspangler@chromium.org> BUG=chrome-os-partner:7464 TEST=manual Change-Id: Ib1d6d370d30429017b3d11994894fece75fab6ea
Diffstat (limited to 'common')
-rw-r--r--common/charger_bq24725.c31
-rw-r--r--common/console.c16
-rw-r--r--common/eoption.c17
-rw-r--r--common/flash_commands.c66
-rw-r--r--common/gaia_power.c11
-rw-r--r--common/gpio_commands.c21
-rw-r--r--common/host_event_commands.c29
-rw-r--r--common/keyboard.c4
-rw-r--r--common/memory_commands.c14
-rw-r--r--common/port80.c2
-rw-r--r--common/power_led.c9
-rw-r--r--common/pstore_commands.c5
-rw-r--r--common/smart_battery.c83
-rw-r--r--common/temp_sensor.c10
-rw-r--r--common/thermal.c59
-rw-r--r--common/tmp006.c20
-rw-r--r--common/usb_charge.c20
-rw-r--r--common/vboot.c10
-rw-r--r--common/x86_power.c4
19 files changed, 215 insertions, 216 deletions
diff --git a/common/charger_bq24725.c b/common/charger_bq24725.c
index 5df2cc7803..6ab586e370 100644
--- a/common/charger_bq24725.c
+++ b/common/charger_bq24725.c
@@ -12,7 +12,6 @@
#include "common.h"
#include "i2c.h"
#include "smart_battery.h"
-#include "uart.h"
#include "util.h"
/* Sense resistor configurations and macros */
@@ -179,10 +178,10 @@ int charger_post_init(void)
static void print_usage(void)
{
- uart_puts("Usage: charger [set_command value]\n");
- uart_puts(" charger input input_current_in_mA\n");
- uart_puts(" charger voltage voltage_limit_in_mV\n");
- uart_puts(" charger current current_limit_in_mA\n\n");
+ ccputs("Usage: charger [set_command value]\n");
+ ccputs(" charger input input_current_in_mA\n");
+ ccputs(" charger voltage voltage_limit_in_mV\n");
+ ccputs(" charger current current_limit_in_mA\n\n");
}
static int print_info(void)
@@ -191,46 +190,46 @@ static int print_info(void)
int d;
const struct charger_info *info;
- uart_puts("Charger properties : now (max, min, step)\n");
+ ccputs("Charger properties : now (max, min, step)\n");
/* info */
info = charger_get_info();
- uart_printf(" name : %s\n", info->name);
+ ccprintf(" name : %s\n", info->name);
/* manufacturer id */
rv = charger_manufacturer_id(&d);
if (rv)
return rv;
- uart_printf(" manufacturer id: 0x%04x\n", d);
+ ccprintf(" manufacturer id: 0x%04x\n", d);
/* device id */
rv = charger_device_id(&d);
if (rv)
return rv;
- uart_printf(" device id : 0x%04x\n", d);
+ ccprintf(" device id : 0x%04x\n", d);
/* charge voltage limit */
rv = charger_get_voltage(&d);
if (rv)
return rv;
- uart_printf(" voltage : %5d (%5d, %4d, %3d)\n", d,
- info->voltage_max, info->voltage_min, info->voltage_step);
+ ccprintf(" voltage : %5d (%5d, %4d, %3d)\n", d,
+ info->voltage_max, info->voltage_min, info->voltage_step);
/* charge current limit */
rv = charger_get_current(&d);
if (rv)
return rv;
- uart_printf(" current : %5d (%5d, %4d, %3d)\n", d,
- info->current_max, info->current_min, info->current_step);
+ ccprintf(" current : %5d (%5d, %4d, %3d)\n", d,
+ info->current_max, info->current_min, info->current_step);
/* input current limit */
rv = charger_get_input_current(&d);
if (rv)
return rv;
- uart_printf(" input current : %5d (%5d, %4d, %3d)\n", d,
- info->input_current_max, info->input_current_min,
- info->input_current_step);
+ ccprintf(" input current : %5d (%5d, %4d, %3d)\n", d,
+ info->input_current_max, info->input_current_min,
+ info->input_current_step);
return EC_SUCCESS;
}
diff --git a/common/console.c b/common/console.c
index 0eff6e3529..4a94588535 100644
--- a/common/console.c
+++ b/common/console.c
@@ -25,7 +25,11 @@ static char input_buf[80]; /* Current console command line */
static const char *channel_names[CC_CHANNEL_COUNT] = {
"command",
"charger",
+ "chipset",
+ "dma",
+ "gpio",
"hostcmd",
+ "i2c",
"i8042",
"keyboard",
"keyscan",
@@ -36,7 +40,7 @@ static const char *channel_names[CC_CHANNEL_COUNT] = {
"system",
"task",
"usbcharge",
- "x86power",
+ "vboot",
};
/*****************************************************************************/
@@ -160,8 +164,8 @@ static int console_init(void)
{
*input_buf = '\0';
uart_set_console_mode(1);
- uart_printf("Console is enabled; type HELP for help.\n");
- uart_puts(PROMPT);
+ ccprintf("Console is enabled; type HELP for help.\n");
+ ccputs(PROMPT);
/* TODO: restore channel list from EEPROM */
@@ -183,8 +187,8 @@ static void console_process(void)
rv = handle_command(input_buf);
if (rv != EC_SUCCESS)
- uart_printf("Command returned error %d\n", rv);
- uart_puts(PROMPT);
+ ccprintf("Command returned error %d\n", rv);
+ ccputs(PROMPT);
}
}
@@ -220,7 +224,7 @@ static int command_help(int argc, char **argv)
const char *prev = " ";
int i;
- uart_puts("Known commands:");
+ ccputs("Known commands:");
/* Sort the commands by name */
for (i = 0; i < ncmds; i++) {
diff --git a/common/eoption.c b/common/eoption.c
index cf70fd537d..f25efcd68d 100644
--- a/common/eoption.c
+++ b/common/eoption.c
@@ -9,7 +9,6 @@
#include "console.h"
#include "eeprom.h"
#include "eoption.h"
-#include "uart.h"
#include "util.h"
#define EOPTION_MAGIC 0x456f /* Magic number for header 'Eo' */
@@ -142,22 +141,22 @@ static int command_eoption_get(int argc, char **argv)
if (argc == 2) {
i = find_option_by_name(argv[1], bool_opts);
if (i == -1) {
- uart_puts("Unknown option.\n");
+ ccputs("Unknown option.\n");
return EC_ERROR_INVAL;
}
d = bool_opts + i;
- uart_printf(" %d %s\n", eoption_get_bool(i), d->name);
+ ccprintf(" %d %s\n", eoption_get_bool(i), d->name);
return EC_SUCCESS;
}
/* Otherwise print them all */
- uart_puts("Boolean options:\n");
+ ccputs("Boolean options:\n");
for (i = 0, d = bool_opts; d->name; i++, d++) {
- uart_printf(" %d %s\n", eoption_get_bool(i), d->name);
+ ccprintf(" %d %s\n", eoption_get_bool(i), d->name);
/* We have enough options that we'll overflow the output buffer
* without flushing */
- uart_flush_output();
+ cflush();
}
return EC_SUCCESS;
}
@@ -170,13 +169,13 @@ static int command_eoption_set(int argc, char **argv)
int v, i;
if (argc < 3) {
- uart_puts("Usage: optset <option> <value>\n");
+ ccputs("Usage: optset <option> <value>\n");
return EC_ERROR_INVAL;
}
v = strtoi(argv[2], &e, 0);
if (*e) {
- uart_puts("Invalid value.\n");
+ ccputs("Invalid value.\n");
return EC_ERROR_INVAL;
}
@@ -184,7 +183,7 @@ static int command_eoption_set(int argc, char **argv)
if (i != -1) {
return eoption_set_bool(i, v);
} else {
- uart_puts("Unknown option.\n");
+ ccputs("Unknown option.\n");
return EC_ERROR_INVAL;
}
}
diff --git a/common/flash_commands.c b/common/flash_commands.c
index 1e08f26769..1ef8956db2 100644
--- a/common/flash_commands.c
+++ b/common/flash_commands.c
@@ -11,7 +11,6 @@
#include "registers.h" /* TODO: remove; only for temp debugging */
#include "shared_mem.h"
#include "system.h"
-#include "uart.h"
#include "util.h"
/* Parse offset and size from command line argv[0] and argv[1].
@@ -26,24 +25,24 @@ static int parse_offset_size(int argc, char **argv, int *offset, int *size)
if (argc >= 1) {
i = (uint32_t)strtoi(argv[0], &e, 0);
if (e && *e) {
- uart_printf("Invalid offset \"%s\"\n", argv[0]);
+ ccprintf("Invalid offset \"%s\"\n", argv[0]);
return EC_ERROR_INVAL;
}
*offset = i;
} else if (*offset < 0) {
- uart_puts("Must specify offset.\n");
+ ccputs("Must specify offset.\n");
return EC_ERROR_INVAL;
}
if (argc >= 2) {
i = (uint32_t)strtoi(argv[1], &e, 1);
if (e && *e) {
- uart_printf("Invalid size \"%s\"\n", argv[1]);
+ ccprintf("Invalid size \"%s\"\n", argv[1]);
return EC_ERROR_INVAL;
}
*size = i;
} else if (*size < 0) {
- uart_puts("Must specify offset and size.\n");
+ ccputs("Must specify offset and size.\n");
return EC_ERROR_INVAL;
}
@@ -60,34 +59,34 @@ static int command_flash_info(int argc, char **argv)
int banks = flash_get_size() / flash_get_protect_block_size();
int i;
- uart_printf("Physical size: %4d KB\n", flash_physical_size() / 1024);
- uart_printf("Usable size: %4d KB\n", flash_get_size() / 1024);
- uart_printf("Write block: %4d B\n", flash_get_write_block_size());
- uart_printf("Erase block: %4d B\n", flash_get_erase_block_size());
- uart_printf("Protect block: %4d B\n", flash_get_protect_block_size());
+ ccprintf("Physical size: %4d KB\n", flash_physical_size() / 1024);
+ ccprintf("Usable size: %4d KB\n", flash_get_size() / 1024);
+ ccprintf("Write block: %4d B\n", flash_get_write_block_size());
+ ccprintf("Erase block: %4d B\n", flash_get_erase_block_size());
+ ccprintf("Protect block: %4d B\n", flash_get_protect_block_size());
i = flash_get_protect_lock();
- uart_printf("Protect lock: %s%s\n",
- (i & FLASH_PROTECT_LOCK_SET) ? "LOCKED" : "unlocked",
- (i & FLASH_PROTECT_LOCK_APPLIED) ? " AND APPLIED" : "");
- uart_printf("WP pin: %s\n", (i & FLASH_PROTECT_PIN_ASSERTED) ?
- "ASSERTED" : "deasserted");
+ ccprintf("Protect lock: %s%s\n",
+ (i & FLASH_PROTECT_LOCK_SET) ? "LOCKED" : "unlocked",
+ (i & FLASH_PROTECT_LOCK_APPLIED) ? " AND APPLIED" : "");
+ ccprintf("WP pin: %s\n", (i & FLASH_PROTECT_PIN_ASSERTED) ?
+ "ASSERTED" : "deasserted");
wp = flash_get_protect_array();
- uart_puts("Protected now:");
+ ccputs("Protected now:");
for (i = 0; i < banks; i++) {
if (!(i & 7))
- uart_puts(" ");
- uart_puts(wp[i] & FLASH_PROTECT_UNTIL_REBOOT ? "Y" : ".");
+ ccputs(" ");
+ ccputs(wp[i] & FLASH_PROTECT_UNTIL_REBOOT ? "Y" : ".");
}
- uart_puts("\n Persistent: ");
+ ccputs("\n Persistent: ");
for (i = 0; i < banks; i++) {
if (!(i & 7))
- uart_puts(" ");
- uart_puts(wp[i] & FLASH_PROTECT_PERSISTENT ? "Y" : ".");
+ ccputs(" ");
+ ccputs(wp[i] & FLASH_PROTECT_PERSISTENT ? "Y" : ".");
}
- uart_puts("\n");
+ ccputs("\n");
return EC_SUCCESS;
}
@@ -104,7 +103,7 @@ static int command_flash_erase(int argc, char **argv)
if (rv)
return rv;
- uart_printf("Erasing %d bytes at offset 0x%x (%d)...\n",
+ ccprintf("Erasing %d bytes at offset 0x%x (%d)...\n",
size, offset, offset);
return flash_erase(offset, size);
}
@@ -125,14 +124,14 @@ static int command_flash_write(int argc, char **argv)
return rv;
if (size > shared_mem_size()) {
- uart_puts("Truncating size\n");
+ ccputs("Truncating size\n");
size = shared_mem_size();
}
/* Acquire the shared memory buffer */
rv = shared_mem_acquire(size, 0, &data);
if (rv) {
- uart_printf("Unable to acquire %d byte buffer\n", size);
+ ccprintf("Unable to acquire %d byte buffer\n", size);
return rv;
}
@@ -140,13 +139,13 @@ static int command_flash_write(int argc, char **argv)
for (i = 0; i < size; i++)
data[i] = i;
- uart_printf("Writing %d bytes to offset 0x%x (%d)...\n",
- size, offset, offset);
+ ccprintf("Writing %d bytes to offset 0x%x (%d)...\n",
+ size, offset, offset);
rv = flash_write(offset, size, data);
if (rv == EC_SUCCESS)
- uart_puts("done.\n");
+ ccputs("done.\n");
else
- uart_printf("failed. (error %d)\n", rv);
+ ccprintf("failed. (error %d)\n", rv);
/* Free the buffer */
shared_mem_release(data);
@@ -168,7 +167,7 @@ static int command_flash_wp(int argc, char **argv)
int rv;
if (argc < 2) {
- uart_puts(flash_wp_help);
+ ccputs(flash_wp_help);
return EC_ERROR_INVAL;
}
@@ -190,7 +189,7 @@ static int command_flash_wp(int argc, char **argv)
else if (!strcasecmp(argv[1], "clear"))
return flash_set_protect(offset, size, 0);
else {
- uart_puts(flash_wp_help);
+ ccputs(flash_wp_help);
return EC_ERROR_INVAL;
}
@@ -225,11 +224,8 @@ enum lpc_status flash_command_checksum(uint8_t *data)
int j;
for (cs = 0, j = 0; j < p->size; ++j) {
- if (flash_read(p->offset + j, 1, &byte)) {
- uart_printf("flash_read() error at 0x%02x.\n",
- p->offset + j);
+ if (flash_read(p->offset + j, 1, &byte))
return EC_LPC_RESULT_ERROR;
- }
BYTE_IN(cs, byte);
}
diff --git a/common/gaia_power.c b/common/gaia_power.c
index 110157481c..ec06fb2d98 100644
--- a/common/gaia_power.c
+++ b/common/gaia_power.c
@@ -11,9 +11,12 @@
#include "gpio.h"
#include "task.h"
#include "timer.h"
-#include "uart.h"
#include "util.h"
+/* Console output macros */
+#define CPUTS(outstr) cputs(CC_CHIPSET, outstr)
+#define CPRINTF(format, args...) cprintf(CC_CHIPSET, format, ## args)
+
/* Time necessary for the 5v regulator output to stabilize */
#define DELAY_5V_SETUP 1000 /* 1ms */
@@ -56,7 +59,7 @@ static int wait_in_signal(enum gpio_signal signal, int value, int timeout)
if ((now.val >= deadline.val) ||
(task_wait_event(deadline.val - now.val) ==
TASK_EVENT_TIMER)) {
- uart_printf("Timeout waiting for GPIO %d\n", signal);
+ CPRINTF("Timeout waiting for GPIO %d\n", signal);
return EC_ERROR_TIMEOUT;
}
}
@@ -179,7 +182,7 @@ void gaia_power_task(void)
/* Power ON state */
ap_on = 1;
- uart_printf("AP running ...\n");
+ CPUTS("AP running ...\n");
/* Wait for power off from AP or long power button press */
wait_for_power_off();
@@ -187,7 +190,7 @@ void gaia_power_task(void)
gpio_set_level(GPIO_EN_PP3300, 0);
gpio_set_level(GPIO_EN_PP1350, 0);
gpio_set_level(GPIO_EN_PP5000, 0);
- uart_printf("Shutdown complete.\n");
+ CPUTS("Shutdown complete.\n");
/* Ensure the power button is released */
wait_in_signal(GPIO_EC_PWRON, 0, -1);
diff --git a/common/gpio_commands.c b/common/gpio_commands.c
index 66bebb4b8d..c1f444a0c7 100644
--- a/common/gpio_commands.c
+++ b/common/gpio_commands.c
@@ -8,7 +8,6 @@
#include "board.h"
#include "console.h"
#include "gpio.h"
-#include "uart.h"
#include "util.h"
@@ -61,30 +60,30 @@ static int command_gpio_get(int argc, char **argv)
if (argc == 2) {
i = find_signal_by_name(argv[1]);
if (i == GPIO_COUNT) {
- uart_puts("Unknown signal name.\n");
+ ccputs("Unknown signal name.\n");
return EC_ERROR_UNKNOWN;
}
g = gpio_list + i;
v = gpio_get_level(i);
changed = last_val_changed(i, v);
- uart_printf(" %d%c %s\n", v, (changed ? '*' : ' '), g->name);
+ ccprintf(" %d%c %s\n", v, (changed ? '*' : ' '), g->name);
return EC_SUCCESS;
}
/* Otherwise print them all */
- uart_puts("Current GPIO levels:\n");
+ ccputs("Current GPIO levels:\n");
for (i = 0; i < GPIO_COUNT; i++, g++) {
if (!g->mask)
continue; /* Skip unsupported signals */
v = gpio_get_level(i);
changed = last_val_changed(i, v);
- uart_printf(" %d%c %s\n", v, (changed ? '*' : ' '), g->name);
+ ccprintf(" %d%c %s\n", v, (changed ? '*' : ' '), g->name);
/* We have enough GPIOs that we'll overflow the output buffer
* without flushing */
- uart_flush_output();
+ cflush();
}
return EC_SUCCESS;
}
@@ -98,29 +97,29 @@ static int command_gpio_set(int argc, char **argv)
int v, i;
if (argc < 3) {
- uart_puts("Usage: gpioset <signal_name> <0|1>\n");
+ ccputs("Usage: gpioset <signal_name> <0|1>\n");
return EC_ERROR_UNKNOWN;
}
i = find_signal_by_name(argv[1]);
if (i == GPIO_COUNT) {
- uart_puts("Unknown signal name.\n");
+ ccputs("Unknown signal name.\n");
return EC_ERROR_UNKNOWN;
}
g = gpio_list + i;
if (!g->mask) {
- uart_puts("Signal is not implemented.\n");
+ ccputs("Signal is not implemented.\n");
return EC_ERROR_UNKNOWN;
}
if (!(g->flags & GPIO_OUTPUT)) {
- uart_puts("Signal is not an output.\n");
+ ccputs("Signal is not an output.\n");
return EC_ERROR_UNKNOWN;
}
v = strtoi(argv[2], &e, 0);
if (*e) {
- uart_puts("Invalid signal value.\n");
+ ccputs("Invalid signal value.\n");
return EC_ERROR_UNKNOWN;
}
diff --git a/common/host_event_commands.c b/common/host_event_commands.c
index 955f062728..3590966fd2 100644
--- a/common/host_event_commands.c
+++ b/common/host_event_commands.c
@@ -8,7 +8,6 @@
#include "console.h"
#include "host_command.h"
#include "lpc.h"
-#include "uart.h"
#include "util.h"
/*****************************************************************************/
@@ -21,39 +20,39 @@ static int command_host_event(int argc, char **argv)
char *e;
int i = strtoi(argv[2], &e, 0);
if (*e) {
- uart_puts("Invalid event mask\n");
+ ccputs("Invalid event mask\n");
return EC_ERROR_INVAL;
}
if (!strcasecmp(argv[1], "set")) {
- uart_printf("Setting host event mask 0x%08x\n", i);
+ ccprintf("Setting host event mask 0x%08x\n", i);
lpc_set_host_events(i);
} else if (!strcasecmp(argv[1], "clear")) {
- uart_printf("Clearing host event mask 0x%08x\n", i);
+ ccprintf("Clearing host event mask 0x%08x\n", i);
lpc_clear_host_events(i);
} else if (!strcasecmp(argv[1], "smi")) {
- uart_printf("Setting SMI mask to 0x%08x\n", i);
+ ccprintf("Setting SMI mask to 0x%08x\n", i);
lpc_set_host_event_mask(LPC_HOST_EVENT_SMI, i);
} else if (!strcasecmp(argv[1], "sci")) {
- uart_printf("Setting SCI mask to 0x%08x\n", i);
+ ccprintf("Setting SCI mask to 0x%08x\n", i);
lpc_set_host_event_mask(LPC_HOST_EVENT_SCI, i);
} else if (!strcasecmp(argv[1], "wake")) {
- uart_printf("Setting wake mask to 0x%08x\n", i);
+ ccprintf("Setting wake mask to 0x%08x\n", i);
lpc_set_host_event_mask(LPC_HOST_EVENT_WAKE, i);
} else {
- uart_puts("Unknown sub-command\n");
+ ccputs("Unknown sub-command\n");
return EC_ERROR_INVAL;
}
}
/* Print current SMI/SCI status */
- uart_printf("Raw host events: 0x%08x\n", lpc_get_host_events());
- uart_printf("SMI mask: 0x%08x\n",
- lpc_get_host_event_mask(LPC_HOST_EVENT_SMI));
- uart_printf("SCI mask: 0x%08x\n",
- lpc_get_host_event_mask(LPC_HOST_EVENT_SCI));
- uart_printf("Wake mask: 0x%08x\n",
- lpc_get_host_event_mask(LPC_HOST_EVENT_WAKE));
+ ccprintf("Raw host events: 0x%08x\n", lpc_get_host_events());
+ ccprintf("SMI mask: 0x%08x\n",
+ lpc_get_host_event_mask(LPC_HOST_EVENT_SMI));
+ ccprintf("SCI mask: 0x%08x\n",
+ lpc_get_host_event_mask(LPC_HOST_EVENT_SCI));
+ ccprintf("Wake mask: 0x%08x\n",
+ lpc_get_host_event_mask(LPC_HOST_EVENT_WAKE));
return EC_SUCCESS;
}
DECLARE_CONSOLE_COMMAND(hostevent, command_host_event);
diff --git a/common/keyboard.c b/common/keyboard.c
index 3764329d91..0e56a6dd9c 100644
--- a/common/keyboard.c
+++ b/common/keyboard.c
@@ -735,8 +735,6 @@ static int command_codeset(int argc, char **argv)
return EC_ERROR_UNKNOWN;
}
- uart_flush_output();
-
return EC_SUCCESS;
}
DECLARE_CONSOLE_COMMAND(codeset, command_codeset);
@@ -768,8 +766,6 @@ static int command_controller_ram(int argc, char **argv)
return EC_ERROR_UNKNOWN;
}
- uart_flush_output();
-
return EC_SUCCESS;
}
DECLARE_CONSOLE_COMMAND(ctrlram, command_controller_ram);
diff --git a/common/memory_commands.c b/common/memory_commands.c
index 476aa92498..e8bff757cd 100644
--- a/common/memory_commands.c
+++ b/common/memory_commands.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
+/* Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
@@ -6,7 +6,6 @@
/* System module for Chrome EC */
#include "console.h"
-#include "uart.h"
#include "util.h"
@@ -16,14 +15,14 @@ static int command_write_word(int argc, char **argv)
uint32_t value;
if (argc != 3) {
- uart_puts("Usage: ww <address> <value>\n");
+ ccputs("Usage: ww <address> <value>\n");
return EC_ERROR_UNKNOWN;
}
address = (uint32_t*)strtoi(argv[1], NULL, 0);
value = strtoi(argv[2], NULL, 0);
- uart_printf("write word 0x%p = 0x%08x\n", address, value);
- uart_flush_output();
+ ccprintf("write word 0x%p = 0x%08x\n", address, value);
+ cflush(); /* Flush before writing in case this crashes */
*address = value;
@@ -39,14 +38,13 @@ static int command_read_word(int argc, char **argv)
uint32_t value;
if (argc != 2) {
- uart_puts("Usage: rw <address>\n");
+ ccputs("Usage: rw <address>\n");
return EC_ERROR_UNKNOWN;
}
address = (uint32_t*)strtoi(argv[1], NULL, 0);
value = *address;
- uart_printf("read word 0x%p = 0x%08x\n", address, value);
- uart_flush_output();
+ ccprintf("read word 0x%p = 0x%08x\n", address, value);
return EC_SUCCESS;
}
diff --git a/common/port80.c b/common/port80.c
index f048a54884..edfdb7c54a 100644
--- a/common/port80.c
+++ b/common/port80.c
@@ -24,7 +24,7 @@ void port_80_write(int data)
/* Note that this currently prints from inside the LPC interrupt
* itself. Probably not worth the system overhead to buffer the data
* and print it from a task, because we're printing a small amount of
- * data and uart_printf() doesn't block. */
+ * data and cprintf() doesn't block. */
CPRINTF("%c[%T Port 80: 0x%02x]", scroll ? '\n' : '\r', data);
history[head] = data;
diff --git a/common/power_led.c b/common/power_led.c
index b90c72ae95..6f38c0f202 100644
--- a/common/power_led.c
+++ b/common/power_led.c
@@ -9,7 +9,6 @@
#include "onewire.h"
#include "power_led.h"
#include "timer.h"
-#include "uart.h"
#include "util.h"
#define POWERLED_RETRIES 10
@@ -87,14 +86,14 @@ static int command_powerled(int argc, char **argv)
}
}
if (i >= POWERLED_COLOR_COUNT) {
- uart_puts("Please specify a color:");
+ ccputs("Please specify a color:");
for (i = 0; i < POWERLED_COLOR_COUNT; i++)
- uart_printf(" %s", color_names[i]);
- uart_puts("\n");
+ ccprintf(" %s", color_names[i]);
+ ccputs("\n");
return EC_ERROR_INVAL;
}
- uart_printf("Setting power LED to %s...\n", color_names[i]);
+ ccprintf("Setting power LED to %s...\n", color_names[i]);
return powerled_set(i);
}
DECLARE_CONSOLE_COMMAND(powerled, command_powerled);
diff --git a/common/pstore_commands.c b/common/pstore_commands.c
index 489e554941..afb9a16852 100644
--- a/common/pstore_commands.c
+++ b/common/pstore_commands.c
@@ -8,17 +8,14 @@
#include "board.h"
#include "eeprom.h"
#include "host_command.h"
-#include "uart.h"
#include "util.h"
+
enum lpc_status pstore_command_get_info(uint8_t *data)
{
struct lpc_response_pstore_info *r =
(struct lpc_response_pstore_info *)data;
- uart_printf("ee block size=%d, count=%d\n",
- eeprom_get_block_size(), eeprom_get_block_count());
-
ASSERT(EEPROM_BLOCK_START_PSTORE + EEPROM_BLOCK_COUNT_PSTORE <=
eeprom_get_block_count());
diff --git a/common/smart_battery.c b/common/smart_battery.c
index 49ed800afe..f921ba15f4 100644
--- a/common/smart_battery.c
+++ b/common/smart_battery.c
@@ -8,7 +8,6 @@
#include "console.h"
#include "smart_battery.h"
#include "timer.h"
-#include "uart.h"
#include "util.h"
/* Read battery discharging current
@@ -106,6 +105,7 @@ int battery_manufacturer_date(int *year, int *month, int *day)
return EC_SUCCESS;
}
+/*****************************************************************************/
/* Console commands */
static int command_battery(int argc, char **argv)
@@ -116,69 +116,69 @@ static int command_battery(int argc, char **argv)
char text[32];
const char *unit;
- uart_puts("Reading battery...\n");
+ ccputs("Reading battery...\n");
rv = battery_temperature(&d);
if (rv)
return rv;
- uart_printf(" Temperature: 0x%04x = %d x 0.1K (%d C)\n",
- d, d, (d-2731)/10);
+ ccprintf(" Temperature: 0x%04x = %d x 0.1K (%d C)\n",
+ d, d, (d-2731)/10);
- uart_printf(" Manufacturer: %s\n",
- battery_manufacturer_name(text, sizeof(text)) == EC_SUCCESS ?
- text : "(error)");
+ ccprintf(" Manufacturer: %s\n",
+ battery_manufacturer_name(text, sizeof(text)) == EC_SUCCESS ?
+ text : "(error)");
- uart_printf(" Device: %s\n",
- battery_device_name(text, sizeof(text)) == EC_SUCCESS ?
- text : "(error)");
+ ccprintf(" Device: %s\n",
+ battery_device_name(text, sizeof(text)) == EC_SUCCESS ?
+ text : "(error)");
- uart_printf(" Chemistry: %s\n",
- battery_device_chemistry(text, sizeof(text)) == EC_SUCCESS ?
- text : "(error)");
+ ccprintf(" Chemistry: %s\n",
+ battery_device_chemistry(text, sizeof(text)) == EC_SUCCESS ?
+ text : "(error)");
battery_serial_number(&d);
- uart_printf(" Serial number: 0x%04x\n", d);
+ ccprintf(" Serial number: 0x%04x\n", d);
battery_voltage(&d);
- uart_printf(" Voltage: 0x%04x = %d mV\n", d, d);
+ ccprintf(" Voltage: 0x%04x = %d mV\n", d, d);
battery_desired_voltage(&d);
- uart_printf(" Desired voltage 0x%04x = %d mV\n", d, d);
+ ccprintf(" Desired voltage 0x%04x = %d mV\n", d, d);
battery_design_voltage(&d);
- uart_printf(" Design output voltage 0x%04x = %d mV\n", d, d);
+ ccprintf(" Design output voltage 0x%04x = %d mV\n", d, d);
battery_current(&d);
- uart_printf(" Current: 0x%04x = %d mA",
+ ccprintf(" Current: 0x%04x = %d mA",
d & 0xffff, d);
if (d > 0)
- uart_puts("(CHG)");
+ ccputs("(CHG)");
else if (d < 0)
- uart_puts("(DISCHG)");
- uart_puts("\n");
+ ccputs("(DISCHG)");
+ ccputs("\n");
battery_desired_current(&d);
- uart_printf(" Desired current 0x%04x = %d mA\n", d, d);
+ ccprintf(" Desired current 0x%04x = %d mA\n", d, d);
battery_get_battery_mode(&d);
- uart_printf(" Battery mode: 0x%04x\n", d);
+ ccprintf(" Battery mode: 0x%04x\n", d);
unit = (d & MODE_CAPACITY) ? "0 mW" : " mAh";
battery_state_of_charge(&d);
- uart_printf(" %% of charge: %d %%\n", d);
+ ccprintf(" %% of charge: %d %%\n", d);
battery_state_of_charge_abs(&d);
- uart_printf(" Abs %% of charge: %d %%\n", d);
+ ccprintf(" Abs %% of charge: %d %%\n", d);
battery_remaining_capacity(&d);
- uart_printf(" Remaining capacity: %d%s\n", d, unit);
+ ccprintf(" Remaining capacity: %d%s\n", d, unit);
battery_full_charge_capacity(&d);
- uart_printf(" Full charge capacity: %d%s\n", d, unit);
+ ccprintf(" Full charge capacity: %d%s\n", d, unit);
battery_design_capacity(&d);
- uart_printf(" Design capacity: %d%s\n", d, unit);
+ ccprintf(" Design capacity: %d%s\n", d, unit);
battery_time_to_empty(&d);
if (d == 65535) {
@@ -188,7 +188,7 @@ static int command_battery(int argc, char **argv)
hour = d / 60;
minute = d % 60;
}
- uart_printf(" Time to empty: %dh:%d\n", hour, minute);
+ ccprintf(" Time to empty: %dh:%d\n", hour, minute);
battery_time_to_full(&d);
if (d == 65535) {
@@ -198,12 +198,13 @@ static int command_battery(int argc, char **argv)
hour = d / 60;
minute = d % 60;
}
- uart_printf(" Time to full: %dh:%d\n", hour, minute);
+ ccprintf(" Time to full: %dh:%d\n", hour, minute);
return EC_SUCCESS;
}
DECLARE_CONSOLE_COMMAND(battery, command_battery);
+
static int command_sb(int argc, char **argv)
{
int rv;
@@ -215,39 +216,39 @@ static int command_sb(int argc, char **argv)
cmd = strtoi(argv[2], &e, 0);
if (*e) {
- uart_puts("Invalid cmd.\n");
+ ccputs("Invalid cmd.\n");
goto usage;
}
if (argv[1][0] == 'r') {
rv = i2c_read16(I2C_PORT_BATTERY, BATTERY_ADDR, cmd, &d);
if (rv) {
- uart_puts("I2C read failed.\n");
+ ccputs("I2C read failed.\n");
return rv;
}
- uart_printf("R SBCMD[%04x] 0x%04x (%d)\n", cmd, d, d);
+ ccprintf("R SBCMD[%04x] 0x%04x (%d)\n", cmd, d, d);
return EC_SUCCESS;
} else if (argc >= 4 && argv[1][0] == 'w') {
d = strtoi(argv[3], &e, 0);
if (*e) {
- uart_puts("Invalid w_word.\n");
+ ccputs("Invalid w_word.\n");
goto usage;
}
- uart_printf("W SBCMD[%04x] 0x%04x (%d)\n", cmd, d, d);
+ ccprintf("W SBCMD[%04x] 0x%04x (%d)\n", cmd, d, d);
rv = i2c_write16(I2C_PORT_BATTERY, BATTERY_ADDR, cmd, d);
if (rv) {
- uart_puts("I2C write failed.\n");
+ ccputs("I2C write failed.\n");
return rv;
}
return EC_SUCCESS;
}
usage:
- uart_puts("Usage:sb <r/w> cmd [uint16_t w_word]\n");
- uart_puts(" sb r 0x14 // desired charging current\n");
- uart_puts(" sb r 0x15 // desired charging voltage\n");
- uart_puts(" sb r 0x3 // battery mode\n");
- uart_puts(" sb w 0x3 0xe001 // set battery mode\n");
+ ccputs("Usage:sb <r/w> cmd [uint16_t w_word]\n");
+ ccputs(" sb r 0x14 // desired charging current\n");
+ ccputs(" sb r 0x15 // desired charging voltage\n");
+ ccputs(" sb r 0x3 // battery mode\n");
+ ccputs(" sb w 0x3 0xe001 // set battery mode\n");
return EC_SUCCESS;
}
DECLARE_CONSOLE_COMMAND(sb, command_sb);
diff --git a/common/temp_sensor.c b/common/temp_sensor.c
index 36c24632cb..013b4f0d87 100644
--- a/common/temp_sensor.c
+++ b/common/temp_sensor.c
@@ -19,7 +19,6 @@
#include "thermal.h"
#include "timer.h"
#include "tmp006.h"
-#include "uart.h"
#include "util.h"
/* Defined in board_temp_sensor.c. Must be in the same order as
@@ -27,6 +26,7 @@
*/
extern const struct temp_sensor_t temp_sensors[TEMP_SENSOR_COUNT];
+
int temp_sensor_read(enum temp_sensor_id id)
{
const struct temp_sensor_t *sensor;
@@ -107,17 +107,17 @@ static int command_temps(int argc, char **argv)
int rv = 0;
int t;
- uart_puts("Reading temperature sensors...\n");
+ ccputs("Reading temperature sensors...\n");
for (i = 0; i < TEMP_SENSOR_COUNT; ++i) {
- uart_printf(" %-20s: ", temp_sensors[i].name);
+ ccprintf(" %-20s: ", temp_sensors[i].name);
t = temp_sensor_read(i);
if (t < 0) {
- uart_printf("Error\n");
+ ccprintf("Error\n");
rv = -1;
}
else
- uart_printf("%d K = %d C\n", t, t - 273);
+ ccprintf("%d K = %d C\n", t, t - 273);
}
if (rv == -1)
diff --git a/common/thermal.c b/common/thermal.c
index 866f857d32..2143007adc 100644
--- a/common/thermal.c
+++ b/common/thermal.c
@@ -16,7 +16,6 @@
#include "temp_sensor.h"
#include "thermal.h"
#include "timer.h"
-#include "uart.h"
#include "util.h"
#include "x86_power.h"
@@ -28,7 +27,7 @@ extern const struct temp_sensor_t temp_sensors[TEMP_SENSOR_COUNT];
/* Temperature threshold configuration. Must be in the same order as in
* enum temp_sensor_type. Threshold values for overheated action first.
* Followed by fan speed stepping thresholds. */
-struct thermal_config_t thermal_config[TEMP_SENSOR_TYPE_COUNT] = {
+static struct thermal_config_t thermal_config[TEMP_SENSOR_TYPE_COUNT] = {
/* TEMP_SENSOR_TYPE_CPU */
{THERMAL_CONFIG_WARNING_ON_FAIL,
{343, 348, 353, 318, 323, 328, 333, 338}},
@@ -44,7 +43,8 @@ struct thermal_config_t thermal_config[TEMP_SENSOR_TYPE_COUNT] = {
* turn off fan according to temperature readings. Modify this to turn off fan
* when we have reliable temperature readings. See crosbug.com/p/8479
*/
-const int fan_speed[THERMAL_FAN_STEPS + 1] = {4000, 5000, 6000, 7000, 8000, -1};
+static const int fan_speed[THERMAL_FAN_STEPS + 1] = {4000, 5000, 6000, 7000,
+ 8000, -1};
/* Number of consecutive overheated events for each temperature sensor. */
static int8_t ot_count[TEMP_SENSOR_COUNT][THRESHOLD_COUNT + THERMAL_FAN_STEPS];
@@ -204,13 +204,13 @@ void thermal_task(void)
static void print_thermal_config(enum temp_sensor_type type)
{
const struct thermal_config_t *config = thermal_config + type;
- uart_printf("Sensor Type %d:\n", type);
- uart_printf("\tWarning: %d K \n",
- config->thresholds[THRESHOLD_WARNING]);
- uart_printf("\tCPU Down: %d K \n",
- config->thresholds[THRESHOLD_CPU_DOWN]);
- uart_printf("\tPower Down: %d K \n",
- config->thresholds[THRESHOLD_POWER_DOWN]);
+ ccprintf("Sensor Type %d:\n", type);
+ ccprintf("\tWarning: %d K\n",
+ config->thresholds[THRESHOLD_WARNING]);
+ ccprintf("\tCPU Down: %d K\n",
+ config->thresholds[THRESHOLD_CPU_DOWN]);
+ ccprintf("\tPower Down: %d K\n",
+ config->thresholds[THRESHOLD_POWER_DOWN]);
}
@@ -219,12 +219,12 @@ static void print_fan_stepping(enum temp_sensor_type type)
const struct thermal_config_t *config = thermal_config + type;
int i;
- uart_printf("Sensor Type %d:\n", type);
- uart_printf("\tLowest speed: %d RPM\n", fan_speed[0]);
+ ccprintf("Sensor Type %d:\n", type);
+ ccprintf("\tLowest speed: %d RPM\n", fan_speed[0]);
for (i = 0; i < THERMAL_FAN_STEPS; ++i)
- uart_printf("\t%3d K: %d RPM\n",
- config->thresholds[THRESHOLD_COUNT + i],
- fan_speed[i+1]);
+ ccprintf("\t%3d K: %d RPM\n",
+ config->thresholds[THRESHOLD_COUNT + i],
+ fan_speed[i+1]);
}
@@ -234,14 +234,15 @@ static int command_thermal_config(int argc, char **argv)
int sensor_type, threshold_id, value;
if (argc != 2 && argc != 4) {
- uart_puts("Usage: thermal <sensor_type> [<threshold_id> <value>]\n");
+ ccputs("Usage: thermal <sensor_type> "
+ "[<threshold_id> <value>]\n");
return EC_ERROR_UNKNOWN;
}
sensor_type = strtoi(argv[1], &e, 0);
if ((e && *e) || sensor_type < 0 ||
sensor_type >= TEMP_SENSOR_TYPE_COUNT) {
- uart_puts("Bad sensor type ID.\n");
+ ccputs("Bad sensor type ID.\n");
return EC_ERROR_UNKNOWN;
}
@@ -252,19 +253,19 @@ static int command_thermal_config(int argc, char **argv)
threshold_id = strtoi(argv[2], &e, 0);
if ((e && *e) || threshold_id < 0 || threshold_id >= THRESHOLD_COUNT) {
- uart_puts("Bad threshold ID.\n");
+ ccputs("Bad threshold ID.\n");
return EC_ERROR_UNKNOWN;
}
value = strtoi(argv[3], &e, 0);
if ((e && *e) || value < 0) {
- uart_puts("Bad threshold value.\n");
+ ccputs("Bad threshold value.\n");
return EC_ERROR_UNKNOWN;
}
thermal_config[sensor_type].thresholds[threshold_id] = value;
- uart_printf("Setting threshold %d of sensor type %d to %d\n",
- threshold_id, sensor_type, value);
+ ccprintf("Setting threshold %d of sensor type %d to %d\n",
+ threshold_id, sensor_type, value);
return EC_SUCCESS;
}
@@ -277,14 +278,15 @@ static int command_fan_config(int argc, char **argv)
int sensor_type, stepping_id, value;
if (argc != 2 && argc != 4) {
- uart_puts("Usage: thermalfan <sensor_type> [<stepping_id> <value>]\n");
+ ccputs("Usage: thermalfan <sensor_type> "
+ "[<stepping_id> <value>]\n");
return EC_ERROR_UNKNOWN;
}
sensor_type = strtoi(argv[1], &e, 0);
if ((e && *e) || sensor_type < 0 ||
sensor_type >= TEMP_SENSOR_TYPE_COUNT) {
- uart_puts("Bad sensor type ID.\n");
+ ccputs("Bad sensor type ID.\n");
return EC_ERROR_UNKNOWN;
}
@@ -295,19 +297,20 @@ static int command_fan_config(int argc, char **argv)
stepping_id = strtoi(argv[2], &e, 0);
if ((e && *e) || stepping_id < 0 || stepping_id >= THERMAL_FAN_STEPS) {
- uart_puts("Bad stepping ID.\n");
+ ccputs("Bad stepping ID.\n");
return EC_ERROR_UNKNOWN;
}
value = strtoi(argv[3], &e, 0);
if ((e && *e) || value < 0) {
- uart_puts("Bad threshold value.\n");
+ ccputs("Bad threshold value.\n");
return EC_ERROR_UNKNOWN;
}
- thermal_config[sensor_type].thresholds[THRESHOLD_COUNT + stepping_id] = value;
- uart_printf("Setting fan step %d of sensor type %d to %d K\n",
- stepping_id, sensor_type, value);
+ thermal_config[sensor_type].thresholds[THRESHOLD_COUNT + stepping_id] =
+ value;
+ ccprintf("Setting fan step %d of sensor type %d to %d K\n",
+ stepping_id, sensor_type, value);
return EC_SUCCESS;
}
diff --git a/common/tmp006.c b/common/tmp006.c
index 46cd8dbe30..f95706ca1b 100644
--- a/common/tmp006.c
+++ b/common/tmp006.c
@@ -203,6 +203,8 @@ static int tmp006_poll_sensor(int sensor_id)
return EC_SUCCESS;
}
+
+/* Print temperature info for a sensor; used by console command. */
static int tmp006_print(int idx)
{
int vraw, v;
@@ -212,35 +214,35 @@ static int tmp006_print(int idx)
int addr = tmp006_sensors[idx].addr;
- uart_printf("Debug data from %s:\n", tmp006_sensors[idx].name);
+ ccprintf("Debug data from %s:\n", tmp006_sensors[idx].name);
/* TODO: For now, all TMP006 sensors are powered by VS. Modify this
* if we have different design.
*/
if (gpio_get_level(GPIO_PGOOD_1_8VS) == 0) {
- uart_puts("Sensor powered off.\n");
+ ccputs("Sensor powered off.\n");
return EC_ERROR_UNKNOWN;
}
rv = i2c_read16(TMP006_PORT(addr), TMP006_REG(addr), 0xfe, &d);
if (rv)
return rv;
- uart_printf(" Manufacturer ID: 0x%04x\n", d);
+ ccprintf(" Manufacturer ID: 0x%04x\n", d);
rv = i2c_read16(TMP006_PORT(addr), TMP006_REG(addr), 0xff, &d);
- uart_printf(" Device ID: 0x%04x\n", d);
+ ccprintf(" Device ID: 0x%04x\n", d);
rv = i2c_read16(TMP006_PORT(addr), TMP006_REG(addr), 0x02, &d);
- uart_printf(" Config: 0x%04x\n", d);
+ ccprintf(" Config: 0x%04x\n", d);
rv = i2c_read16(TMP006_PORT(addr), TMP006_REG(addr), 0x00, &vraw);
v = ((int)(int16_t)vraw * 15625) / 100;
- uart_printf(" Voltage: 0x%04x = %d nV\n", vraw, v);
+ ccprintf(" Voltage: 0x%04x = %d nV\n", vraw, v);
rv = i2c_read16(TMP006_PORT(addr), TMP006_REG(addr), 0x01, &traw);
t = ((int)(int16_t)traw * 100) / 128;
- uart_printf(" Temperature: 0x%04x = %d.%02d C\n",
- traw, t / 100, t > 0 ? t % 100 : 100 - (t % 100));
+ ccprintf(" Temperature: 0x%04x = %d.%02d C\n",
+ traw, t / 100, t > 0 ? t % 100 : 100 - (t % 100));
return EC_SUCCESS;
}
@@ -285,7 +287,7 @@ static int command_sensor_info(int argc, char **argv)
rv = tmp006_print(i);
if (rv != EC_SUCCESS)
rv1 = rv;
- uart_flush_output();
+ cflush();
}
return rv1;
diff --git a/common/usb_charge.c b/common/usb_charge.c
index f14cfe393d..ace535fbe4 100644
--- a/common/usb_charge.c
+++ b/common/usb_charge.c
@@ -9,10 +9,10 @@
#include "console.h"
#include "gpio.h"
#include "hooks.h"
-#include "uart.h"
#include "usb_charge.h"
#include "util.h"
+
static void usb_charge_set_control_mode(int port_id, int mode)
{
if (port_id == 0) {
@@ -91,28 +91,28 @@ static int command_set_mode(int argc, char **argv)
char* endptr;
if (argc != 3) {
- uart_puts("Usage: usbchargemode <port_id> <mode>\n");
- uart_puts("Modes: 0=Disabled.\n"
- " 1=Dedicated charging. Auto select.\n"
- " 2=Dedicated charging. BC 1.2.\n"
- " 3=Downstream. Max 500mA.\n"
- " 4=Downstream. Max 1.5A.\n");
+ ccputs("Usage: usbchargemode <port_id> <mode>\n");
+ ccputs("Modes: 0=Disabled.\n"
+ " 1=Dedicated charging. Auto select.\n"
+ " 2=Dedicated charging. BC 1.2.\n"
+ " 3=Downstream. Max 500mA.\n"
+ " 4=Downstream. Max 1.5A.\n");
return EC_ERROR_UNKNOWN;
}
port_id = strtoi(argv[1], &endptr, 0);
if (*endptr || port_id < 0 || port_id >= USB_CHARGE_PORT_COUNT) {
- uart_puts("Invalid port ID.\n");
+ ccputs("Invalid port ID.\n");
return EC_ERROR_UNKNOWN;
}
mode = strtoi(argv[2], &endptr, 0);
if (*endptr || mode < 0 || mode >= USB_CHARGE_MODE_COUNT) {
- uart_puts("Invalid mode.\n");
+ ccputs("Invalid mode.\n");
return EC_ERROR_UNKNOWN;
}
- uart_printf("Setting USB mode...\n");
+ ccprintf("Setting USB mode...\n");
return usb_charge_set_mode(port_id, mode);
}
DECLARE_CONSOLE_COMMAND(usbchargemode, command_set_mode);
diff --git a/common/vboot.c b/common/vboot.c
index 727a92ef4b..b96765b97b 100644
--- a/common/vboot.c
+++ b/common/vboot.c
@@ -5,13 +5,17 @@
/* Verified boot module for Chrome EC */
+#include "console.h"
#include "gpio.h"
#include "keyboard_scan.h"
#include "system.h"
-#include "uart.h"
#include "util.h"
#include "vboot.h"
+/* Console output macros */
+#define CPUTS(outstr) cputs(CC_VBOOT, outstr)
+#define CPRINTF(format, args...) cprintf(CC_VBOOT, format, ## args)
+
/* Jumps to one of the RW images if necessary. */
static void jump_to_other_image(void)
@@ -23,7 +27,7 @@ static void jump_to_other_image(void)
#ifdef CONFIG_TASK_KEYSCAN
/* Don't jump if recovery requested */
if (keyboard_scan_recovery_pressed()) {
- uart_puts("Vboot staying in RO because key pressed.\n");
+ CPUTS("[Vboot staying in RO because key pressed]\n");
return;
}
#endif
@@ -37,7 +41,7 @@ static void jump_to_other_image(void)
/* TODO: (crosbug.com/p/8572) Daisy and discovery don't define a GPIO
* for the recovery signal from servo, so can't check it. */
if (gpio_get_level(GPIO_RECOVERYn) == 0) {
- uart_puts("Vboot staying in RO due to recovery signal.\n");
+ CPUTS("[Vboot staying in RO due to recovery signal]\n");
return;
}
#endif
diff --git a/common/x86_power.c b/common/x86_power.c
index de6a5cfe5d..1d4a228c88 100644
--- a/common/x86_power.c
+++ b/common/x86_power.c
@@ -20,8 +20,8 @@
#include "x86_power.h"
/* Console output macros */
-#define CPUTS(outstr) cputs(CC_X86POWER, outstr)
-#define CPRINTF(format, args...) cprintf(CC_X86POWER, format, ## args)
+#define CPUTS(outstr) cputs(CC_CHIPSET, outstr)
+#define CPRINTF(format, args...) cprintf(CC_CHIPSET, format, ## args)
/* Default timeout in us; if we've been waiting this long for an input
* transition, just jump to the next state. */