From 93f6525f1e3ed79cd27156b842593e401009d6b3 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 21 Jan 2021 14:59:48 -0700 Subject: zephyr: Add support for BOARD_VERSION Add Kconfig options for this feature. At present system_get_board_version() is not built for Zephyr. We could split it out but it seems better to wait until we have the existing file brought into the build in toto. BUG=b:178124020 BRANCH=none TEST=make BOARD=volteer -j30 boot zephyr for volteer and see that the options are defined Change-Id: I100c8f3f65db437fbe654e0230e07f59c6e0c7b4 Signed-off-by: Simon Glass Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2644177 --- zephyr/Kconfig | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) (limited to 'zephyr/Kconfig') diff --git a/zephyr/Kconfig b/zephyr/Kconfig index 3051e0831c..06d1fa03db 100644 --- a/zephyr/Kconfig +++ b/zephyr/Kconfig @@ -118,6 +118,59 @@ config PLATFORM_EC_BRINGUP - And more! You can search the codebase for CONFIG_BRINGUP to see all of the features this flag will toggle. +config PLATFORM_EC_BOARD_VERSION + bool "Support the notion of board version" + default y + help + Enable support for a board version, used to distinguish different + revisions of the same base design. Each board goes through a number + of development phases on the way to launch. Sometimes different boards + have different quirks and this version number can provide a way for + the EC to handle several board versions, avoiding the problem of + having to flash different images to different board versions. + +if PLATFORM_EC_BOARD_VERSION + +choice "Version source" + prompt "Select the source of the version number" + help + This allow selection of the source of the board version number + information. Several options are available, but BOARD_VERSION_CBI is + preferred for new boards, so long as the hardware supports it (i.e. + has an EEPROM). + +config PLATFORM_EC_BOARD_VERSION_CBI + bool "Chromium OS Board Info (CBI)" + depends on PLATFORM_EC_CBI + help + Choose this if the board version comes from Chromium Board Info + within the EEPROM. This is the recommended approach and is used on + newer boards. The version information is written into the EEPROM as + part of the factory process. + +config PLATFORM_EC_BOARD_VERSION_GPIO + bool "Strapping GPIOs" + help + Choose this if the board version is encoded with three GPIO signals + (GPIO_BOARD_VERSION1, GPIO_BOARD_VERSION2 and GPIO_BOARD_VERSION3) + forming the 3-digit binary number. GPIO_BOARD_VERSION1 is the LSB. + This provides 8 possible combinations. + + The GPIOs should have external pull-up/pull-down resistors installed + at the factory to select the correct value. + +config PLATFORM_EC_BOARD_VERSION_CUSTOM + bool "Custom board-specific algortihm" + help + Choose this if none of the standard methods is available and you must + perform special logic to find the board version. If this is chosen, + then the system code will call board_get_version() to find out the + version, so you should implement this function in your board code. + +endchoice + +endif # PLATFORM_EC_BOARD_VERSION + config PLATFORM_EC_CBI bool "CBI EEPROM support" depends on PLATFORM_EC_I2C -- cgit v1.2.1