summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2020-02-07 16:23:26 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2020-02-19 08:30:32 +0100
commitd19adc55f607fff299fb54d29aef3396cbdf0baa (patch)
tree03e46202380f9d3c29d9967460d5820c1796edc0 /drivers
parentd172474bd5b4db361b5b7f6b987f72291ccc2f1e (diff)
downloadbarebox-d19adc55f607fff299fb54d29aef3396cbdf0baa.tar.gz
I2C: i.MX: Add early i2c support for i.MX8M
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/i2c/busses/i2c-imx-early.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/i2c/busses/i2c-imx-early.c b/drivers/i2c/busses/i2c-imx-early.c
index d672264..26922c1 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;
+}