mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* Early access I2C and/or clock for iMX6?
@ 2016-06-20 21:02 Michael D. Burkey
  0 siblings, 0 replies; 3+ messages in thread
From: Michael D. Burkey @ 2016-06-20 21:02 UTC (permalink / raw)
  To: barebox

The more I look into the I2C drivers, the less convinced I am that
fsl_i2c is where I need to be looking.

Additionally, although Variscite had included the fsl_i2c.h header and
had actually referenced fsl_i2c in some documentation and comments,
the more I dig through their code, it is looking like the only I2C
routines that are even getting compiled in their U-Boot implementation
are those in mxc_i2c.c -- which actually look to be a fairly clean
implementation for the i.MX series of parts that doesn't appear to
require much additional support code along with it (other than, once
again, some of the clock configuration routine). It appears to be much
more simplistic and bare metal than the i2c-imx.c that is currently
used in barebox.

Since the mxc_i2c.c driver in U-Boot was written also written by
Sascha Hauer, I'm sort of throwing this one out as a question to
Sascha or anyone else familiar with this code:

For an early access I2C driver on the i.MX6, do you think it would
make more sense to try starting from the fsl_i2c.c code under barebox
or from the original U-Boot mxc_i2c.c code?

I'm beginning to suspect the latter may actually be easier to start
from (and it would already match the function calls that Variscite is
using in the code I am transplanting from their U-Boot tree).

Thanks again!
Michael Burkey

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Early access I2C and/or clock for iMX6?
  2016-06-20 19:34 Michael D. Burkey
@ 2016-06-21  6:32 ` Sascha Hauer
  0 siblings, 0 replies; 3+ messages in thread
From: Sascha Hauer @ 2016-06-21  6:32 UTC (permalink / raw)
  To: Michael D. Burkey; +Cc: barebox

On Mon, Jun 20, 2016 at 03:34:06PM -0400, Michael D. Burkey wrote:
> In a quest to support the new Variscite SOM's EEPROM based DDR
> configuration, I am continuing to try to get all the pieces together.
> 
> Now that I have the SOM actually booting from IRAM, I am actually
> trying to get the "real" DDR configuration values out of the EEPROM on
> the SOM.
> 
> Which brings me to the next hurdle -- getting early I2C access up and running.
> 
> Thanks to some pointers from Sascha, I have been working with the
> fsl_i2c.c code that had already been used for this task on the mpc85xx
> PPC platform, and while the I2C controller is essentially the same,
> the clock tree  setup, etc. for the iMX6 is quite different.

The fsl_i2c.c driver as currently in arch/ppc/ needs the input clock
frequency and some timer for a timeout loop. The timeout could be
dropped from the loop which is ok for a early bringup driver. For the
input clock frequency you can pass in the reset default value,
statically compiled into the binary; no need to calculate it during
runtime. I still think fsl_i2c.c is the way to go, but you could also
you whatever else "early" variant of the driver, I wouldn't start from a
driver implementing the Linux I2C API though.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Early access I2C and/or clock for iMX6?
@ 2016-06-20 19:34 Michael D. Burkey
  2016-06-21  6:32 ` Sascha Hauer
  0 siblings, 1 reply; 3+ messages in thread
From: Michael D. Burkey @ 2016-06-20 19:34 UTC (permalink / raw)
  To: barebox

In a quest to support the new Variscite SOM's EEPROM based DDR
configuration, I am continuing to try to get all the pieces together.

Now that I have the SOM actually booting from IRAM, I am actually
trying to get the "real" DDR configuration values out of the EEPROM on
the SOM.

Which brings me to the next hurdle -- getting early I2C access up and running.

Thanks to some pointers from Sascha, I have been working with the
fsl_i2c.c code that had already been used for this task on the mpc85xx
PPC platform, and while the I2C controller is essentially the same,
the clock tree  setup, etc. for the iMX6 is quite different.

I also have the fsl_i2c.c implementation that Variscite has used in
their custom U-Boot and have been looking at it as well -- but it has
been changed pretty heavily since U-Boot and barebox diverged.
Additionally, I'm not certain that their modified version is actually
configuring the I2C clock timing correctly anyway.

Finally, I have also been looking at the code in i2c-imx.c to see
what, if any, of it could be used, but, unless I am mistaken, it
appears that almost everything it depends upon would not yet be
available this early in the boot process.

So, before I go to a lot more effort, has anyone else created an early
access I2C driver for the iMX6, or simple early access clock functions
for it (e.g. get_ticks(), get_timebase_clock(), etc.)?

I figured it would be worth asking to see if anyone else had ever
already dealt with this (before I spent a lot of time potentially
recreating something).

Thanks in advance,
Michael Burkey

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-06-21  6:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-20 21:02 Early access I2C and/or clock for iMX6? Michael D. Burkey
  -- strict thread matches above, loose matches on Subject: below --
2016-06-20 19:34 Michael D. Burkey
2016-06-21  6:32 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox