From 39efbc3ada5545f6784e7d09b7c358684cb124fa Mon Sep 17 00:00:00 2001 From: li feng Date: Mon, 20 Nov 2017 17:19:41 -0800 Subject: ish i2c: add I2C Fast Mode Plus 1Mbps speed option Also added CONFI_ISH_I2C_PORT0_SPEED, CONFI_ISH_I2C_PORT1_SPEED, and CONFI_ISH_I2C_PORT2_SPEED to define speed for each ISH I2C port. By default, those are set to fast mode, 400kbps, I2C_SPEED_FAST. The values can be modified in board.h. BUG=None BRANCH=None TEST=On Soraka modified board for ISH, set I2C stardard mode, fast mode and fast mode plus, measured I2C clock freq using scope respectively and confirmed the freq matched I2C mode. Change-Id: I426b50dc935c3760903360a50f6069e99bd0abff Signed-off-by: li feng Reviewed-on: https://chromium-review.googlesource.com/784091 Commit-Ready: Li1 Feng Tested-by: Li1 Feng Reviewed-by: Aaron Durbin --- chip/ish/ish_i2c.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'chip/ish/ish_i2c.h') diff --git a/chip/ish/ish_i2c.h b/chip/ish/ish_i2c.h index 0a894593ea..9accddfebc 100644 --- a/chip/ish/ish_i2c.h +++ b/chip/ish/ish_i2c.h @@ -22,7 +22,8 @@ enum { /* speed mode values */ I2C_SPEED_STD = 0, I2C_SPEED_FAST = 1, - I2C_SPEED_HIGH = 2, + I2C_SPEED_FAST_PLUS = 2, + I2C_SPEED_HIGH = 3, /* freq mode values */ I2C_FREQ_25 = 0, I2C_FREQ_50 = 1, @@ -107,6 +108,7 @@ enum { MASTER_MODE_VAL = (MASTER_MODE << MASTER_MODE_OFFSET), STD_SPEED_VAL = (STD_SPEED << SPEED_OFFSET), FAST_SPEED_VAL = (FAST_SPEED << SPEED_OFFSET), + FAST_PLUS_SPEED_VAL = (FAST_SPEED << SPEED_OFFSET), HIGH_SPEED_VAL = (HIGH_SPEED << SPEED_OFFSET), SPEED_MASK = (0x3 << SPEED_OFFSET), IC_RESTART_EN_VAL = (IC_RESTART_EN << IC_RESTART_EN_OFFSET), @@ -173,6 +175,7 @@ struct i2c_bus_info { uint8_t bus_id; struct i2c_bus_data std_speed; struct i2c_bus_data fast_speed; + struct i2c_bus_data fast_plus_speed; struct i2c_bus_data high_speed; } __attribute__ ((__packed__)); -- cgit v1.2.1