Signed-off-by: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx> --- drivers/i2c/busses/i2c-imx-early.c | 12 ++++++++++++ include/i2c/i2c-early.h | 1 + 2 files changed, 13 insertions(+) diff --git a/drivers/i2c/busses/i2c-imx-early.c b/drivers/i2c/busses/i2c-imx-early.c index d67226441e..26922c1044 100644 --- a/drivers/i2c/busses/i2c-imx-early.c +++ b/drivers/i2c/busses/i2c-imx-early.c @@ -308,3 +308,15 @@ void *ls1046_i2c_init(void __iomem *regs) return &fsl_i2c; } + +void *imx8m_i2c_early_init(void __iomem *regs) +{ + fsl_i2c.regs = regs; + fsl_i2c.regshift = 2; + fsl_i2c.i2cr_ien_opcode = I2CR_IEN_OPCODE_1; + fsl_i2c.i2sr_clr_opcode = I2SR_CLR_OPCODE_W0C; + /* Divider for ~100kHz when coming from the ROM */ + fsl_i2c.ifdr = 0x0f; + + return &fsl_i2c; +} diff --git a/include/i2c/i2c-early.h b/include/i2c/i2c-early.h index 27efd25109..d64c1a4384 100644 --- a/include/i2c/i2c-early.h +++ b/include/i2c/i2c-early.h @@ -5,6 +5,7 @@ int i2c_fsl_xfer(void *ctx, struct i2c_msg *msgs, int num); +void *imx8m_i2c_early_init(void __iomem *regs); void *ls1046_i2c_init(void __iomem *regs); #endif /* __I2C_EARLY_H */ -- 2.25.0 _______________________________________________ barebox mailing list barebox@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/barebox