Skip to content
Permalink
Browse files

boards : arm : Add I2C support for MEC15xx EVB

Expose 3 I2C instances with default SoC-Phy mappings for use with EVB

Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
  • Loading branch information...
Jose Alberto Meza authored and andrewboie committed May 1, 2019
1 parent a94f171 commit 35d529b6ec61b4f3ee1904c65d1b80d356534406
@@ -15,4 +15,19 @@ config UART_NS16550_PORT_0

endif

endif #BOARD_MEC15XXEVB_ASSY6853

if I2C_XEC

config I2C_XEC_0
default y

config I2C_XEC_1
default y

config I2C_XEC_2
default y

endif # I2C


endif #BOARD_MEC2016EVB_ASSY6797
@@ -23,3 +23,18 @@
status = "ok";
current-speed = <115200>;
};

&i2c0 {
status = "ok";
port_sel = <0>;
};

&i2c1 {
status = "ok";
port_sel = <1>;
};

&i2c2 {
status = "ok";
port_sel = <7>;
};
@@ -14,3 +14,6 @@ CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=48000000
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y
CONFIG_SERIAL=y

CONFIG_I2C=y
CONFIG_I2C_INIT_PRIORITY=60
@@ -50,6 +50,24 @@ static int board_pinmux_init(struct device *dev)
GPIO_CTRL_REGS->CTRL_0170 = UART_GPIO_CFG + MCHP_GPIO_CTRL_MUX_F1;
GPIO_CTRL_REGS->CTRL_0171 = UART_GPIO_CFG + MCHP_GPIO_CTRL_MUX_F1;
#endif

#ifdef CONFIG_I2C_XEC_0
/* Set muxing, for I2C0 - SMB00 */
GPIO_CTRL_REGS->CTRL_0004 = MCHP_GPIO_CTRL_MUX_F1;
GPIO_CTRL_REGS->CTRL_0003 = MCHP_GPIO_CTRL_MUX_F1;
#endif

#ifdef CONFIG_I2C_XEC_1
/* Set muxing for I2C1 - SMB01 */
GPIO_CTRL_REGS->CTRL_0130 = MCHP_GPIO_CTRL_MUX_F1;
GPIO_CTRL_REGS->CTRL_0131 = MCHP_GPIO_CTRL_MUX_F1;
#endif

#ifdef CONFIG_I2C_XEC_2
/* Set muxing, for I2C2 - SMB04 */
GPIO_CTRL_REGS->CTRL_0143 = MCHP_GPIO_CTRL_MUX_F1;
GPIO_CTRL_REGS->CTRL_0144 = MCHP_GPIO_CTRL_MUX_F1;
#endif
return 0;
}

0 comments on commit 35d529b

Please sign in to comment.
You can’t perform that action at this time.