summaryrefslogtreecommitdiff
path: root/src/mainboard/intel/galileo/gen2.h
diff options
context:
space:
mode:
authorLee Leahy <leroy.p.leahy@intel.com>2016-05-15 15:05:56 -0700
committerLeroy P Leahy <leroy.p.leahy@intel.com>2016-05-18 00:58:06 +0200
commit15843bdad076149e9d04dcfaa07f4eedda84acfa (patch)
tree42caf73696eccd79a2128718330111dc5495ea6d /src/mainboard/intel/galileo/gen2.h
parentac690b1e9ba1318375bc7fba088aef5c7e3c07ce (diff)
downloadcoreboot-15843bdad076149e9d04dcfaa07f4eedda84acfa.tar.xz
mainboard/intel/galileo: Add I2C chip initialization
Add I2C chip initialization for the Galileo boards. TEST=Build and run on Galileo Gen2 Change-Id: Ib5284d5cd7a67de2f3f98940837ceb2aa69af468 Signed-off-by: Lee Leahy <leroy.p.leahy@intel.com> Reviewed-on: https://review.coreboot.org/14829 Tested-by: build bot (Jenkins) Reviewed-by: Martin Roth <martinroth@google.com>
Diffstat (limited to 'src/mainboard/intel/galileo/gen2.h')
-rw-r--r--src/mainboard/intel/galileo/gen2.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/mainboard/intel/galileo/gen2.h b/src/mainboard/intel/galileo/gen2.h
index dc8b6f5d6f..108971b8ba 100644
--- a/src/mainboard/intel/galileo/gen2.h
+++ b/src/mainboard/intel/galileo/gen2.h
@@ -48,3 +48,28 @@ static const struct reg_script gen2_gpio_init[] = {
REG_SCRIPT_END
};
+
+static const struct reg_script gen2_i2c_init[] = {
+ /* Route I2C to Arduino Shield connector:
+ * Set AMUX1_IN (EXP2.P1_4) low
+ * Configure AMUX1_IN (EXP2.P1_4) as an output
+ *
+ * I2C_SDA -> ANALOG_A4
+ * I2C_SCL -> ANALOG_A5
+ */
+ REG_I2C_AND(GEN2_I2C_GPIO_EXP2, GEN2_GPIO_EXP_OUTPUT1, ~BIT4),
+ REG_I2C_AND(GEN2_I2C_GPIO_EXP2, GEN2_GPIO_EXP_CONFIG1, ~BIT4),
+
+ /* Set all GPIO expander pins connected to the Reset Button as inputs
+ * Configure Reset Button(EXP1.P1_7) as an input
+ * Disable pullup on Reset Button(EXP1.P1_7)
+ * Configure Reset Button(EXP2.P1_7) as an input
+ * Disable pullup on Reset Button(EXP2.P1_7)
+ */
+ REG_I2C_OR(GEN2_I2C_GPIO_EXP1, GEN2_GPIO_EXP_CONFIG1, BIT7),
+ REG_I2C_AND(GEN2_I2C_GPIO_EXP1, GEN2_GPIO_EXP_PULL_UP_DOWN_EN1, ~BIT7),
+ REG_I2C_OR(GEN2_I2C_GPIO_EXP2, GEN2_GPIO_EXP_CONFIG1, BIT7),
+ REG_I2C_AND(GEN2_I2C_GPIO_EXP2, GEN2_GPIO_EXP_PULL_UP_DOWN_EN1, ~BIT7),
+
+ REG_SCRIPT_END
+};