[PATCH] I2C: i.MX: early: Use internal udelay

Sascha Hauer sha at pengutronix.de
Mon Jan 30 08:36:58 PST 2023


On Mon, Jan 30, 2023 at 11:56:20PM +1100, John Watts wrote:
> On Mon, Jan 30, 2023 at 01:31:42PM +0100, Sascha Hauer wrote:
> > As said, the code is also for other i.MX SoCs, so a fixed base address
> > won't do it. You would first have to detect the SoC type, but we can
> > only get this from the device tree.
> > 
> > I'm afraid there is no good solution for this problem, at least we
> > haven't found any over the years.
> > 
> > Sascha
> 
> Oh right, because Barebox does multi-image builds. That is an unsatisfying
> problem but it makes sense.
> 
> So for this patch I imagine I should just take the udelay you've written,
> use the I2C registers as the base address and just poke around for a while?

Yes, sounds good.

> 
> I'm still unsure on how to test this- can I just disable the MMU and dcache
> in board.c and do some prints with some type of timer?

You can't disable MMU during runtime, but you can compile without MMU
support, just disable CONFIG_MMU. However, the early I2C code already
runs with MMU disabled, can't you just put in some test code there?

Sascha


-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



More information about the barebox mailing list