From dd99400f9abaf7d74f31ee607b24f7aff3d3f22f Mon Sep 17 00:00:00 2001 From: Ting Shen Date: Thu, 6 Jan 2022 19:13:24 +0800 Subject: krabby: enable CBI BUG=b:213434576 TEST=Test cbi read/write on Krabby $ cbi set 0 3 1 (0 means BOARD_VERSION), Verify BOARD_VERSION changed $ version 22-01-06 19:14:08.043 Chip: ite it81202 bx 22-01-06 19:14:08.046 Board: 3 uart:~$ cbi 22-01-06 19:14:31.002 [245.250030 CBI Reading board info] 22-01-06 19:14:31.006 CBI_VERSION: 0x0000 22-01-06 19:14:31.008 TOTAL_SIZE: 14 22-01-06 19:14:31.010 BOARD_VERSION: 3 (0x3) BRANCH=main Signed-off-by: Ting Shen Change-Id: I00a3cc304b95a0072e62f3cd264465053bb5c33f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3369643 Reviewed-by: Eric Yilun Lin Commit-Queue: Ting Shen Tested-by: Ting Shen Auto-Submit: Ting Shen --- zephyr/projects/corsola/BUILD.py | 3 ++- zephyr/projects/corsola/cbi_eeprom.dts | 16 ++++++++++++++++ zephyr/projects/corsola/cbi_eeprom_kingler.dts | 16 ---------------- zephyr/projects/corsola/i2c_krabby.dts | 2 +- zephyr/projects/corsola/prj_krabby.conf | 4 ++++ 5 files changed, 23 insertions(+), 18 deletions(-) create mode 100644 zephyr/projects/corsola/cbi_eeprom.dts delete mode 100644 zephyr/projects/corsola/cbi_eeprom_kingler.dts diff --git a/zephyr/projects/corsola/BUILD.py b/zephyr/projects/corsola/BUILD.py index 1254b01003..918cb4bdbf 100644 --- a/zephyr/projects/corsola/BUILD.py +++ b/zephyr/projects/corsola/BUILD.py @@ -30,6 +30,7 @@ register_corsola_project( here / "battery_krabby.dts", here / "gpio_krabby.dts", here / "i2c_krabby.dts", + here / "cbi_eeprom.dts", here / "motionsense_krabby.dts", here / "pwm_krabby.dts", ], @@ -43,7 +44,7 @@ register_corsola_project( here / "adc_kingler.dts", here / "battery_kingler.dts", here / "i2c_kingler.dts", - here / "cbi_eeprom_kingler.dts", + here / "cbi_eeprom.dts", here / "gpio_kingler.dts", ], extra_kconfig_files=[here / "prj_kingler.conf"], diff --git a/zephyr/projects/corsola/cbi_eeprom.dts b/zephyr/projects/corsola/cbi_eeprom.dts new file mode 100644 index 0000000000..7f95e2ed6d --- /dev/null +++ b/zephyr/projects/corsola/cbi_eeprom.dts @@ -0,0 +1,16 @@ +/* Copyright 2021 The Chromium OS Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + + &i2c_pwr_cbi { + cbi_eeprom: eeprom@50 { + compatible = "atmel,at24"; + reg = <0x50>; + label = "EEPROM_CBI"; + size = <2048>; + pagesize = <16>; + address-width = <8>; + timeout = <5>; + }; +}; diff --git a/zephyr/projects/corsola/cbi_eeprom_kingler.dts b/zephyr/projects/corsola/cbi_eeprom_kingler.dts deleted file mode 100644 index 7f95e2ed6d..0000000000 --- a/zephyr/projects/corsola/cbi_eeprom_kingler.dts +++ /dev/null @@ -1,16 +0,0 @@ -/* Copyright 2021 The Chromium OS Authors. All rights reserved. - * Use of this source code is governed by a BSD-style license that can be - * found in the LICENSE file. - */ - - &i2c_pwr_cbi { - cbi_eeprom: eeprom@50 { - compatible = "atmel,at24"; - reg = <0x50>; - label = "EEPROM_CBI"; - size = <2048>; - pagesize = <16>; - address-width = <8>; - timeout = <5>; - }; -}; diff --git a/zephyr/projects/corsola/i2c_krabby.dts b/zephyr/projects/corsola/i2c_krabby.dts index 1dbfd83782..42e7218a9d 100644 --- a/zephyr/projects/corsola/i2c_krabby.dts +++ b/zephyr/projects/corsola/i2c_krabby.dts @@ -56,7 +56,7 @@ }; -&i2c0 { +i2c_pwr_cbi: &i2c0 { /* EC_I2C_PWR_CBI */ label = "I2C_PWR_CBI"; status = "okay"; diff --git a/zephyr/projects/corsola/prj_krabby.conf b/zephyr/projects/corsola/prj_krabby.conf index efafefedf1..1182b2bbb5 100644 --- a/zephyr/projects/corsola/prj_krabby.conf +++ b/zephyr/projects/corsola/prj_krabby.conf @@ -17,6 +17,10 @@ CONFIG_KERNEL_SHELL=y CONFIG_PLATFORM_EC_SYSTEM_UNLOCKED=y CONFIG_PLATFORM_EC_BRINGUP=y +# CBI +CONFIG_PLATFORM_EC_BOARD_VERSION_CBI=y +CONFIG_PLATFORM_EC_CBI_EEPROM=y + # Power Sequencing CONFIG_PLATFORM_EC_POWERSEQ=y CONFIG_PLATFORM_EC_POWERSEQ_HOST_SLEEP=y -- cgit v1.2.1