summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorBrian J. Nemec <bnemec@chromium.org>2019-05-24 11:31:12 -0700
committerchrome-bot <chrome-bot@chromium.org>2019-05-30 22:02:17 -0700
commit06b2bd507f7b64267d4e73885c354c917a9dfa5b (patch)
tree874044da2b030c84c75d88749f442942c1e87c38 /board
parent6b2899a38dd5848f63e2380d2718ce5f43f16fb7 (diff)
downloadchrome-ec-06b2bd507f7b64267d4e73885c354c917a9dfa5b.tar.gz
sweetberry: update I2C clock speeds to match spec/measurements.
All 4 I2C ports on the Sweetberry were configured at 800 KHz. 3 of the I2C ports are limited to 400 KHz and the FMP I2C port can be up to 1 MHz. This means that 3 of the slower speed I2C ports are out of spec by a factor of two. Traces of the rails showed that the rails were still functioning at 800 KHz, although the FMP I2C rail is actually at 896 KHz. The STM32F4 Reference Manual Rev4 does not indicate which potential problems occur when operating in this condition. The I2C speeds were adjusted to match spec with the 3 slow speed ports set to 400 KHZ. The I2C prescalers for the FMP I2C port do not have a suitable 1 MHz configuration at our system clock speed so the FMP I2C rail was adjusted to 900 KHz to match the measured speed within 2% for all rails. The cost of this change is the scan time for a group of 28 INA's increased from 4.9 ms to 5.5 ms. BRANCH=servo BUG=b:133503970 TEST=Verified Sweetberry can measure rails when used with powerlog. Observed I2C rail activity using a Saleae analyzer. Signed-off-by: Brian Nemec <bnemec@chromium.org> Change-Id: Id345c1dd902212b92089e5ab3e04dd187efb4542 Reviewed-on: https://chromium-review.googlesource.com/1628641 Commit-Ready: Brian Nemec <bnemec@chromium.org> Tested-by: Brian Nemec <bnemec@chromium.org> Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org> Reviewed-by: Todd Broch <tbroch@chromium.org> Reviewed-by: Brian Nemec <bnemec@chromium.org>
Diffstat (limited to 'board')
-rw-r--r--board/sweetberry/board.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/board/sweetberry/board.c b/board/sweetberry/board.c
index 2d94f06f76..66b21a81b9 100644
--- a/board/sweetberry/board.c
+++ b/board/sweetberry/board.c
@@ -59,13 +59,13 @@ struct dwc_usb usb_ctl = {
/* I2C ports */
const struct i2c_port_t i2c_ports[] = {
- {"i2c1", I2C_PORT_0, 800,
+ {"i2c1", I2C_PORT_0, 400,
GPIO_I2C1_SCL, GPIO_I2C1_SDA},
- {"i2c2", I2C_PORT_1, 800,
+ {"i2c2", I2C_PORT_1, 400,
GPIO_I2C2_SCL, GPIO_I2C2_SDA},
- {"i2c3", I2C_PORT_2, 800,
+ {"i2c3", I2C_PORT_2, 400,
GPIO_I2C3_SCL, GPIO_I2C3_SDA},
- {"fmpi2c4", FMPI2C_PORT_3, 800,
+ {"fmpi2c4", FMPI2C_PORT_3, 900,
GPIO_FMPI2C_SCL, GPIO_FMPI2C_SDA},
};
const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports);