diff options
author | Dawid Niedzwiecki <dn@semihalf.com> | 2021-06-04 12:23:49 +0200 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-06-09 17:33:36 +0000 |
commit | 43b1d390c1451a3083d5ab5fef21a40417a8298c (patch) | |
tree | 7b0fcccda9301b600ad14112be40c490a249b60e | |
parent | 478248fdc135d773ae6dbb881a3fcea14093c042 (diff) | |
download | chrome-ec-43b1d390c1451a3083d5ab5fef21a40417a8298c.tar.gz |
zephyr: Add I2C_PASSTHRU_RESTRICTED config
Add the I2C_PASSTHRU_RESTRICTED config to Zephyr.
BUG=b:188885798
BRANCH=none
TEST=zmake testall
Signed-off-by: Dawid Niedzwiecki <dn@semihalf.com>
Change-Id: I8338921da350cbe0a24f12686aa6ff06de57eca6
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2939674
Reviewed-by: Keith Short <keithshort@chromium.org>
Commit-Queue: Keith Short <keithshort@chromium.org>
-rw-r--r-- | zephyr/Kconfig | 8 | ||||
-rw-r--r-- | zephyr/shim/include/config_chip.h | 5 |
2 files changed, 13 insertions, 0 deletions
diff --git a/zephyr/Kconfig b/zephyr/Kconfig index 0953a9b1b2..60f44fa8d1 100644 --- a/zephyr/Kconfig +++ b/zephyr/Kconfig @@ -669,4 +669,12 @@ config PLATFORM_EC_CCD_USBC_PORT_NUMBER help USB port number of the CCD enabled USBC port. +config PLATFORM_EC_I2C_PASSTHRU_RESTRICTED + bool "Restrict I2C PASSTHRU command" + depends on PLATFORM_EC_I2C + help + Enables board-specific restrictions for the I2C PASSTHRU host command. + Once enabled, board_allow_i2c_passthru function has to be implemented, + which defines the allowed usage of the command. + endif # PLATFORM_EC diff --git a/zephyr/shim/include/config_chip.h b/zephyr/shim/include/config_chip.h index cc500cd748..544627da5d 100644 --- a/zephyr/shim/include/config_chip.h +++ b/zephyr/shim/include/config_chip.h @@ -161,6 +161,11 @@ #define I2C_PORT_VIRTUAL_BATTERY I2C_PORT_BATTERY #endif +#undef CONFIG_I2C_PASSTHRU_RESTRICTED +#ifdef CONFIG_PLATFORM_EC_I2C_PASSTHRU_RESTRICTED +#define CONFIG_I2C_PASSTHRU_RESTRICTED +#endif + #undef CONFIG_BATTERY_PRESENT_CUSTOM #ifdef CONFIG_PLATFORM_EC_BATTERY_PRESENT_CUSTOM #define CONFIG_BATTERY_PRESENT_CUSTOM |