From 2c37de83e78e98820ce2a7473932afdec029d2a6 Mon Sep 17 00:00:00 2001 From: Philip Chen Date: Fri, 2 Jul 2021 16:47:58 -0700 Subject: system: Clean up system_get_board_version() Refactor system_get_board_version() a bit so that we can remove CONFIG_BOARD_VERSION_CUSTOM and CONFIG_BOARD_VERSION from config.h. BRANCH=None BUG=b:186264627 TEST=make buildall -j TEST=zmake testall Cq-Depend: chromium:3015243 Change-Id: Id5ab809493c297b7d330ea13dcd6934ec00042a6 Signed-off-by: Philip Chen Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3004112 Commit-Queue: Philip Chen Tested-by: Philip Chen Reviewed-by: Keith Short Reviewed-by: Daisuke Nojiri --- include/config.h | 25 +++++-------------------- 1 file changed, 5 insertions(+), 20 deletions(-) (limited to 'include/config.h') diff --git a/include/config.h b/include/config.h index 6405a0b06d..8daf9025f6 100644 --- a/include/config.h +++ b/include/config.h @@ -733,16 +733,8 @@ */ #undef CONFIG_BOARD_PRE_INIT -/* - * EC has the notion of board version either through resistors or EEPROM. - * The common CONFIG_BOARD_VERSION is defined automatically when one of the - * specific options is used. - */ -#undef CONFIG_BOARD_VERSION /* The board version comes from Cros Board Info within EEPROM. */ #undef CONFIG_BOARD_VERSION_CBI -/* The board version function is defined in board code. */ -#undef CONFIG_BOARD_VERSION_CUSTOM /* * The board version is encoded with 3 GPIO signals where GPIO_BOARD_VERSION1 * is the LSB. @@ -5524,18 +5516,6 @@ #endif /* defined(CONFIG_EXPERIMENTAL_CONSOLE) */ -/******************************************************************************/ -/* - * Automatically define common CONFIG_BOARD_VERSION if any specific option is - * used. - */ - -#if defined(CONFIG_BOARD_VERSION_CBI) || \ - defined(CONFIG_BOARD_VERSION_CUSTOM) || \ - defined(CONFIG_BOARD_VERSION_GPIO) -#define CONFIG_BOARD_VERSION -#endif - /******************************************************************************/ /* * Thermal throttling AP must have temperature sensor enabled to get @@ -6376,6 +6356,11 @@ "when CONFIG_SYSTEM_UNLOCK is also enabled." #endif /* CONFIG_BYPASS_CBI_EEPROM_WP_CHECK && !CONFIG_SYSTEM_UNLOCK */ +#if defined(CONFIG_BOARD_VERSION_CBI) && defined(CONFIG_BOARD_VERSION_GPIO) +#error "CONFIG_BOARD_VERSION_CBI and CONFIG_BOARD_VERSION_GPIO " \ + "are mutually exclusive. " +#endif /* CONFIG_BOARD_VERSION_CBI && CONFIG_BOARD_VERSION_GPIO */ + #if !defined(CONFIG_ZEPHYR) && !defined(CONFIG_ACCELGYRO_ICM_COMM_SPI) && \ !defined(CONFIG_ACCELGYRO_ICM_COMM_I2C) #ifdef I2C_PORT_ACCEL -- cgit v1.2.1