summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDino Li <Dino.Li@ite.com.tw>2022-10-13 16:42:39 +0800
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-10-20 06:11:04 +0000
commit4b98e1b902cadeae7ef5f0ff750920b2fe989c24 (patch)
tree9039e56251ae52ed1f735e3a9e06b756156a5b21
parentb65e11f66f7636d35068ea6fa5c6f85fc84170e1 (diff)
downloadchrome-ec-4b98e1b902cadeae7ef5f0ff750920b2fe989c24.tar.gz
krabby/tentacruel: enable i2c fifo mode on i2c1
I2C clock stretching allow devices to hold clock down to block communication temporarily when they are busy. And there is no limit for the duration for clock stretching. Most devices support this feature. But smart battery gauge ICs follow SMBus specification not i2c specification. SMBus spec is not allowed clock low over 25ms. If timeout is over 25ms, master might read the wrong data (eg. 0xff, because device has released data line). This change enables FIFO mode on i2c1 and disable i2c2’s FIFO mode. Because they share the same FIFO module. Only one port can use the FIFO module at a time. With FIFO mode enabled, EC only needs to set how much data will be send or receive to i2c controller. The controller will process transaction automatically without CPU intervention. So clock stretching between bytes on i2c1 can be eliminated. This change also disable CONFIG_PLATFORM_EC_SMBUS_PEC to perform single transfer for i2c read/write/write to read. BRANCH=none BUG=b:253349747, b:250746976 TEST=On tentacruel, EC will not stretch clock more than 25ms on i2c1. Signed-off-by: Dino Li <Dino.Li@ite.com.tw> Change-Id: Idb4433bf1d54b2c684268e88c64b0b37a8294921 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3950277 Reviewed-by: Eric Yilun Lin <yllin@google.com>
-rw-r--r--zephyr/projects/corsola/i2c_krabby_tentacruel.dtsi2
-rw-r--r--zephyr/projects/corsola/prj_it81202_base.conf1
2 files changed, 2 insertions, 1 deletions
diff --git a/zephyr/projects/corsola/i2c_krabby_tentacruel.dtsi b/zephyr/projects/corsola/i2c_krabby_tentacruel.dtsi
index 377eaafbca..6fd153e1fa 100644
--- a/zephyr/projects/corsola/i2c_krabby_tentacruel.dtsi
+++ b/zephyr/projects/corsola/i2c_krabby_tentacruel.dtsi
@@ -79,6 +79,7 @@
pinctrl-0 = <&i2c1_clk_gpc1_default
&i2c1_data_gpc2_default>;
pinctrl-names = "default";
+ fifo-enable;
};
&i2c2 {
@@ -89,6 +90,7 @@
pinctrl-0 = <&i2c2_clk_gpf6_default
&i2c2_data_gpf7_default>;
pinctrl-names = "default";
+ /delete-property/ fifo-enable;
bc12_ppc_port0: rt1739@70 {
compatible = "richtek,rt1739";
diff --git a/zephyr/projects/corsola/prj_it81202_base.conf b/zephyr/projects/corsola/prj_it81202_base.conf
index 6c7df90ef5..82f4e3cc3b 100644
--- a/zephyr/projects/corsola/prj_it81202_base.conf
+++ b/zephyr/projects/corsola/prj_it81202_base.conf
@@ -68,7 +68,6 @@ CONFIG_PLATFORM_EC_USBA=y
# USB-C
CONFIG_PLATFORM_EC_BC12_SINGLE_DRIVER=n
-CONFIG_PLATFORM_EC_SMBUS_PEC=y
CONFIG_PLATFORM_EC_USBC_PPC_RT1739=y
CONFIG_PLATFORM_EC_USBC_PPC_SYV682C=y
CONFIG_PLATFORM_EC_USBC_PPC_SYV682X=y