From 5514b2515e4c5d05b406595e54ef48a11ccccb5f Mon Sep 17 00:00:00 2001 From: Andrew McRae Date: Wed, 24 Aug 2022 13:08:22 +1000 Subject: port80: Add a config to avoid logging port80 codes Add a config item to disable logging all of the port80 history buffer as each code is received. Individual codes can still be logged as they are received when enabled via the console command 'port80 intprint' or using the CONFIG_PORT80_PRINT_IN_INT config item. This reduces the overhead at AP startup on the logging. It has been observed on the ITE81302 that logging the port80 codes causes significant overhead that may lead to watchdog timeouts. The port80 code history is still available via the 'port80' EC console command. BUG=b:243607643 TEST=zmake build nereid; flash & run BRANCH=none Signed-off-by: Andrew McRae Change-Id: I543b0391bcf474c9d040baa98ff75f6e2b9fd5a9 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3853308 Code-Coverage: Zoss Reviewed-by: Peter Marheine --- common/port80.c | 4 +++- zephyr/Kconfig.port80 | 8 ++++++++ zephyr/shim/include/config_chip.h | 5 +++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/common/port80.c b/common/port80.c index 66ad48be5e..72195c5793 100644 --- a/common/port80.c +++ b/common/port80.c @@ -62,7 +62,9 @@ void port_80_write(int data) data); } - hook_call_deferred(&port80_dump_buffer_data, 4 * SECOND); + if (!IS_ENABLED(CONFIG_PORT80_QUIET)) { + hook_call_deferred(&port80_dump_buffer_data, 4 * SECOND); + } /* Save current port80 code if system is resetting */ if (data == PORT_80_EVENT_RESET && writes) { diff --git a/zephyr/Kconfig.port80 b/zephyr/Kconfig.port80 index adeea08d20..649f4ae7ea 100644 --- a/zephyr/Kconfig.port80 +++ b/zephyr/Kconfig.port80 @@ -11,4 +11,12 @@ config PLATFORM_EC_PORT80_4_BYTE codes when AP sends 4-byte Port80 codes via eSPI PUT_IOWR_SHORT protocol in a single transaction. +config PLATFORM_EC_PORT80_QUIET + bool "Do not log Port80 codes when they are received" + help + Enable this config to avoid logging the entire buffer of + Port80 codes as each are received. + The history is still available via the 'port80' EC command. + Enabling this will reduce the logging overhead during AP startup. + endif # PLATFORM_EC_HOST_INTERFACE_ESPI diff --git a/zephyr/shim/include/config_chip.h b/zephyr/shim/include/config_chip.h index feba8177af..5a1eb4cb80 100644 --- a/zephyr/shim/include/config_chip.h +++ b/zephyr/shim/include/config_chip.h @@ -2534,6 +2534,11 @@ extern struct jump_data mock_jump_data; #define CONFIG_PORT80_4_BYTE #endif +#undef CONFIG_PORT80_QUIET +#ifdef CONFIG_PLATFORM_EC_PORT80_QUIET +#define CONFIG_PORT80_QUIET +#endif + #undef CONFIG_ASSERT_CCD_MODE_ON_DTS_CONNECT #ifdef CONFIG_PLATFORM_EC_ASSERT_CCD_MODE_ON_DTS_CONNECT #define CONFIG_ASSERT_CCD_MODE_ON_DTS_CONNECT -- cgit v1.2.1