mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: John Watts <contact@jookia.org>
To: barebox@lists.infradead.org
Cc: John Watts <contact@jookia.org>
Subject: [PATCH 1/7] I2C: i.MX: Add early i2c support for i.MX6
Date: Sun, 22 Jan 2023 01:44:23 +1100	[thread overview]
Message-ID: <20230121144429.3524905-2-contact@jookia.org> (raw)
In-Reply-To: <20230121144429.3524905-1-contact@jookia.org>

Signed-off-by: John Watts <contact@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




  reply	other threads:[~2023-01-21 14:46 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-21 14:44 [PATCH 0/7] Support generating DIMM parameters on more systems John Watts
2023-01-21 14:44 ` John Watts [this message]
2023-01-23  9:01   ` [PATCH 1/7] I2C: i.MX: Add early i2c support for i.MX6 Marco Felsch
2023-01-23  9:49     ` John Watts
2023-01-21 14:44 ` [PATCH 2/7] ddr: fsl: Pass mclk_ps to ddr*_compute_dimm_parameters John Watts
2023-01-21 14:44 ` [PATCH 3/7] ddr_dimms: Move FSL dimm_params to include/ddr_dimms.h John Watts
2023-01-21 14:44 ` [PATCH 4/7] ddr: fsl: Remove includes to fsl-specific code John Watts
2023-01-21 14:44 ` [PATCH 5/7] ddr_dimms: Move ddr*_dimm_params to common John Watts
2023-01-21 14:44 ` [PATCH 6/7] ddr_dimms: Remove mclk_ps for DDR3 and DDR4 John Watts
2023-01-21 14:44 ` [PATCH 7/7] ddr_spd: Support reading SPD from DDR3 sticks John Watts
2023-01-24  8:26 ` [PATCH 0/7] Support generating DIMM parameters on more systems Sascha Hauer
2023-01-24 11:48   ` John Watts

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230121144429.3524905-2-contact@jookia.org \
    --to=contact@jookia.org \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox