Commit 5820a0e7 authored by Angus Ainslie (Purism)'s avatar Angus Ainslie (Purism)
Browse files

i2c: reconfigure the i2c interfaces for testing


Signed-off-by: default avatarAngus Ainslie (Purism) <angus@akkea.ca>
parent 1025e34a
......@@ -56,15 +56,15 @@
pinctrl_i2c2: i2c2grp {
fsl,pins = <
MX8MQ_IOMUXC_I2C2_SCL_I2C2_SCL 0x4000003f
MX8MQ_IOMUXC_I2C2_SDA_I2C2_SDA 0x4000003f
MX8MQ_IOMUXC_I2C2_SCL_I2C2_SCL 0x4000001f
MX8MQ_IOMUXC_I2C2_SDA_I2C2_SDA 0x4000001f
>;
};
pinctrl_i2c3: i2c3grp {
fsl,pins = <
MX8MQ_IOMUXC_I2C3_SCL_I2C3_SCL 0x4000003f
MX8MQ_IOMUXC_I2C3_SDA_I2C3_SDA 0x4000003f
MX8MQ_IOMUXC_I2C3_SCL_I2C3_SCL 0x4000001f
MX8MQ_IOMUXC_I2C3_SDA_I2C3_SDA 0x4000001f
>;
};
......
......@@ -38,7 +38,7 @@ void spl_dram_init(void)
ddr_init(&dram_timing_b0);
}
#define I2C_PAD_CTRL (PAD_CTL_DSE6 | PAD_CTL_HYS | PAD_CTL_PUE)
#define I2C_PAD_CTRL (PAD_CTL_DSE7 | PAD_CTL_SPEED_MAX)
#define PC MUX_PAD_CTRL(I2C_PAD_CTRL)
struct i2c_pads_info i2c_pad_info1 = {
.scl = {
......@@ -53,6 +53,32 @@ struct i2c_pads_info i2c_pad_info1 = {
},
};
struct i2c_pads_info i2c_pad_info2 = {
.scl = {
.i2c_mode = IMX8MQ_PAD_I2C2_SCL__I2C2_SCL | PC,
.gpio_mode = IMX8MQ_PAD_I2C2_SCL__GPIO5_IO16 | PC,
.gp = IMX_GPIO_NR(5, 16),
},
.sda = {
.i2c_mode = IMX8MQ_PAD_I2C2_SDA__I2C2_SDA | PC,
.gpio_mode = IMX8MQ_PAD_I2C2_SDA__GPIO5_IO17 | PC,
.gp = IMX_GPIO_NR(5, 17),
},
};
struct i2c_pads_info i2c_pad_info3 = {
.scl = {
.i2c_mode = IMX8MQ_PAD_I2C3_SCL__I2C3_SCL | PC,
.gpio_mode = IMX8MQ_PAD_I2C3_SCL__GPIO5_IO18 | PC,
.gp = IMX_GPIO_NR(5, 18),
},
.sda = {
.i2c_mode = IMX8MQ_PAD_I2C3_SDA__I2C3_SDA | PC,
.gpio_mode = IMX8MQ_PAD_I2C3_SDA__GPIO5_IO19 | PC,
.gp = IMX_GPIO_NR(5, 19),
},
};
struct i2c_pads_info i2c_pad_info4 = {
.scl = {
.i2c_mode = IMX8MQ_PAD_I2C4_SCL__I2C4_SCL | PC,
......@@ -330,6 +356,10 @@ void board_init_f(ulong dummy)
enable_tzc380();
/* Enable and configure i2c buses not used below */
setup_i2c(1, CONFIG_SYS_I2C_SPEED, 0x7f, &i2c_pad_info1);
setup_i2c(2, CONFIG_SYS_I2C_SPEED, 0x7f, &i2c_pad_info2);
power_init_board();
/* initialize this for M4 even if u-boot doesn't have SF_CMD */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment