From 9c10a3074ef834688fea46c03551c2e3e54e44a8 Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Thu, 10 Oct 2013 03:46:14 -0700 Subject: [PATCH] nyan: Initialize the i2c pins and controllers. Set up the i2c controllers that are used on nyan. BUG=None TEST=Built and booted into the bootblock on nyan. BRANCH=None Change-Id: Ibdd5685e3effdd13ca560b8f18db25e9edadc07b Signed-off-by: Gabe Black Reviewed-on: https://chromium-review.googlesource.com/172584 Reviewed-by: Ronald Minnich Reviewed-by: Julius Werner Tested-by: Gabe Black Commit-Queue: Gabe Black --- src/mainboard/google/nyan/bootblock.c | 34 +++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/src/mainboard/google/nyan/bootblock.c b/src/mainboard/google/nyan/bootblock.c index e193ab1b94..4fba7d9976 100644 --- a/src/mainboard/google/nyan/bootblock.c +++ b/src/mainboard/google/nyan/bootblock.c @@ -18,9 +18,43 @@ */ #include +#include +#include +#include #include +#include void bootblock_mainboard_init(void) { clock_config(); + + // I2C1 clock. + pinmux_set_config(PINMUX_GEN1_I2C_SCL_INDEX, + PINMUX_GEN1_I2C_SCL_FUNC_I2C1 | PINMUX_INPUT_ENABLE); + // I2C1 data. + pinmux_set_config(PINMUX_GEN1_I2C_SDA_INDEX, + PINMUX_GEN1_I2C_SDA_FUNC_I2C1 | PINMUX_INPUT_ENABLE); + // I2C2 clock. + pinmux_set_config(PINMUX_GEN2_I2C_SCL_INDEX, + PINMUX_GEN2_I2C_SCL_FUNC_I2C2 | PINMUX_INPUT_ENABLE); + // I2C2 data. + pinmux_set_config(PINMUX_GEN2_I2C_SDA_INDEX, + PINMUX_GEN2_I2C_SDA_FUNC_I2C2 | PINMUX_INPUT_ENABLE); + // I2C3 (cam) clock. + pinmux_set_config(PINMUX_CAM_I2C_SCL_INDEX, + PINMUX_CAM_I2C_SCL_FUNC_I2C3 | PINMUX_INPUT_ENABLE); + // I2C3 (cam) data. + pinmux_set_config(PINMUX_CAM_I2C_SDA_INDEX, + PINMUX_CAM_I2C_SDA_FUNC_I2C3 | PINMUX_INPUT_ENABLE); + // I2C5 (PMU) clock. + pinmux_set_config(PINMUX_PWR_I2C_SCL_INDEX, + PINMUX_PWR_I2C_SCL_FUNC_I2CPMU | PINMUX_INPUT_ENABLE); + // I2C5 (PMU) data. + pinmux_set_config(PINMUX_PWR_I2C_SDA_INDEX, + PINMUX_PWR_I2C_SDA_FUNC_I2CPMU | PINMUX_INPUT_ENABLE); + + i2c_init(0); + i2c_init(1); + i2c_init(2); + i2c_init(4); }