From b5cebbaadb4966e9d1820b0dcabd690d3e5d762e Mon Sep 17 00:00:00 2001 From: Nicolas Boichat Date: Wed, 23 May 2018 13:54:06 +0800 Subject: console_channel.inc: Add more ifdef to reduce number of channels There are still more ifdef than can be added: this just takes out the low hanging fruits. BRANCH=poppy BUG=b:35647963 TEST=make buildall -j, see that we gain from 0 to 64 bytes on many boards. Change-Id: Ibe85b8bfa5d5c22c160e4a6656104256067beee9 Signed-off-by: Nicolas Boichat Reviewed-on: https://chromium-review.googlesource.com/1070948 Reviewed-by: Vincent Palatin --- board/nocturne/board.c | 2 +- common/throttle_ap.c | 4 ++-- include/config.h | 1 + include/console_channel.inc | 10 ++++++++++ test/console_edit.c | 8 ++++---- 5 files changed, 18 insertions(+), 7 deletions(-) diff --git a/board/nocturne/board.c b/board/nocturne/board.c index 4692f94c63..8cec89a877 100644 --- a/board/nocturne/board.c +++ b/board/nocturne/board.c @@ -449,7 +449,7 @@ void board_reset_pd_mcu(void) void board_rtc_reset(void) { - cprints(CC_CHIPSET, "Asserting RTCRST# to PCH"); + cprints(CC_SYSTEM, "Asserting RTCRST# to PCH"); gpio_set_level(GPIO_EC_PCH_RTCRST, 1); udelay(100); gpio_set_level(GPIO_EC_PCH_RTCRST, 0); diff --git a/common/throttle_ap.c b/common/throttle_ap.c index ef11302881..209948a482 100644 --- a/common/throttle_ap.c +++ b/common/throttle_ap.c @@ -14,8 +14,8 @@ #include "util.h" /* Console output macros */ -#define CPUTS(outstr) cputs(CC_CHIPSET, outstr) -#define CPRINTS(format, args...) cprints(CC_CHIPSET, format, ## args) +#define CPUTS(outstr) cputs(CC_THERMAL, outstr) +#define CPRINTS(format, args...) cprints(CC_THERMAL, format, ## args) /*****************************************************************************/ /* This enforces the virtual OR of all throttling sources. */ diff --git a/include/config.h b/include/config.h index a7cdc1b3f6..4a44d82df8 100644 --- a/include/config.h +++ b/include/config.h @@ -3600,6 +3600,7 @@ */ #ifndef HAS_TASK_CHIPSET +#undef CONFIG_AP_HANG_DETECT #undef CONFIG_CHIPSET_APOLLOLAKE #undef CONFIG_CHIPSET_BRASWELL #undef CONFIG_CHIPSET_CANNONLAKE diff --git a/include/console_channel.inc b/include/console_channel.inc index bcd92373f6..369bd5e287 100644 --- a/include/console_channel.inc +++ b/include/console_channel.inc @@ -26,12 +26,16 @@ CONSOLE_CHANNEL(CC_EXTENSION, "extension") CONSOLE_CHANNEL(CC_CCD, "ccd") #endif CONSOLE_CHANNEL(CC_CHARGER, "charger") +#ifdef HAS_TASK_CHIPSET CONSOLE_CHANNEL(CC_CHIPSET, "chipset") +#endif CONSOLE_CHANNEL(CC_CLOCK, "clock") #ifdef CONFIG_DMA CONSOLE_CHANNEL(CC_DMA, "dma") #endif +#if defined(CONFIG_DEVICE_EVENT) || defined(CONFIG_HOSTCMD_EVENTS) CONSOLE_CHANNEL(CC_EVENTS, "events") +#endif #ifdef HAS_TASK_FPSENSOR CONSOLE_CHANNEL(CC_FP, "fingerprint") #endif @@ -46,8 +50,12 @@ CONSOLE_CHANNEL(CC_HOSTCMD, "hostcmd") CONSOLE_CHANNEL(CC_I2C, "i2c") #endif CONSOLE_CHANNEL(CC_KEYBOARD, "keyboard") +#ifdef HAS_TASK_KEYSCAN CONSOLE_CHANNEL(CC_KEYSCAN, "keyscan") +#endif +#ifdef CONFIG_LID_ANGLE_UPDATE CONSOLE_CHANNEL(CC_LIDANGLE, "lidangle") +#endif #ifdef HAS_TASK_LIGHTBAR CONSOLE_CHANNEL(CC_LIGHTBAR, "lightbar") #endif @@ -85,7 +93,9 @@ CONSOLE_CHANNEL(CC_DPTF, "dptf") CONSOLE_CHANNEL(CC_ALS, "als") #endif CONSOLE_CHANNEL(CC_THERMAL, "thermal") +#ifdef CHIP_G CONSOLE_CHANNEL(CC_TPM, "tpm") +#endif CONSOLE_CHANNEL(CC_USB, "usb") CONSOLE_CHANNEL(CC_USBCHARGE, "usbcharge") #if defined(CONFIG_USB_POWER_DELIVERY) || defined(CONFIG_USB_PD_TCPC) diff --git a/test/console_edit.c b/test/console_edit.c index b6ca3cad6e..5a1b8d4d76 100644 --- a/test/console_edit.c +++ b/test/console_edit.c @@ -254,8 +254,8 @@ static int test_output_channel(void) UART_INJECT("chan 0\n"); msleep(30); test_capture_console(1); - cprintf(CC_CHARGER, "shouldn't see this\n"); - cputs(CC_CHIPSET, "shouldn't see this either\n"); + cprintf(CC_SYSTEM, "shouldn't see this\n"); + cputs(CC_TASK, "shouldn't see this either\n"); cflush(); test_capture_console(0); TEST_ASSERT(compare_multiline_string(test_get_captured_console(), @@ -263,8 +263,8 @@ static int test_output_channel(void) UART_INJECT("chan restore\n"); msleep(30); test_capture_console(1); - cprintf(CC_CHARGER, "see me\n"); - cputs(CC_CHIPSET, "me as well\n"); + cprintf(CC_SYSTEM, "see me\n"); + cputs(CC_TASK, "me as well\n"); cflush(); test_capture_console(0); TEST_ASSERT(compare_multiline_string(test_get_captured_console(), -- cgit v1.2.1