[PATCH 1/7] I2C: i.MX: Add early i2c support for i.MX6

John Watts contact at jookia.org
Mon Jan 23 01:49:59 PST 2023


Thanks Marco,

The lack of commit message is a good catch though I'm not entirely sure
what to write in it.

One criticism of this patch I forgot to note is it it needs udelay() defined in
the PBL by the board. It might be better to move that in to this patch.

John.

On Mon, Jan 23, 2023 at 10:01:23AM +0100, Marco Felsch wrote:
> Hi John,
> 
> thanks for your patch.
> 
> albeit it is obvious we tend to have a small commit message here. The
> code change lgtm.
> 
> Regards,
>   Marco
> 
> On 23-01-22, John Watts wrote:
> > Signed-off-by: John Watts <contact at jookia.org>
> > ---
> >  drivers/i2c/busses/i2c-imx-early.c | 14 ++++++++++++++
> >  include/pbl/i2c.h                  |  1 +
> >  2 files changed, 15 insertions(+)
> > 
> > diff --git a/drivers/i2c/busses/i2c-imx-early.c b/drivers/i2c/busses/i2c-imx-early.c
> > index 4e0f7e517d..6c8bdc7904 100644
> > --- a/drivers/i2c/busses/i2c-imx-early.c
> > +++ b/drivers/i2c/busses/i2c-imx-early.c
> > @@ -303,6 +303,20 @@ struct pbl_i2c *ls1046_i2c_init(void __iomem *regs)
> >  	return &fsl_i2c.i2c;
> >  }
> >  
> > +struct pbl_i2c *imx6_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 = 0x36;
> > +
> > +	fsl_i2c.i2c.xfer = i2c_fsl_xfer;
> > +
> > +	return &fsl_i2c.i2c;
> > +}
> > +
> >  struct pbl_i2c *imx8m_i2c_early_init(void __iomem *regs)
> >  {
> >  	fsl_i2c.regs = regs;
> > diff --git a/include/pbl/i2c.h b/include/pbl/i2c.h
> > index d9910f531f..32e456d46b 100644
> > --- a/include/pbl/i2c.h
> > +++ b/include/pbl/i2c.h
> > @@ -16,6 +16,7 @@ static inline int pbl_i2c_xfer(struct pbl_i2c *i2c,
> >  }
> >  
> >  struct pbl_i2c *imx8m_i2c_early_init(void __iomem *regs);
> > +struct pbl_i2c *imx6_i2c_early_init(void __iomem *regs);
> >  struct pbl_i2c *ls1046_i2c_init(void __iomem *regs);
> >  
> >  static inline int i2c_dev_probe(struct pbl_i2c *i2c, int addr, bool onebyte)
> > -- 
> > 2.39.0
> > 
> > 
> > 



More information about the barebox mailing list