[U-Boot] Early I2C bus availability

Wolfgang Denk wd at denx.de
Thu Aug 12 21:54:05 CEST 2010


Dear Brent Bartson,

In message <83A42A417FD59E48917448F8390945B70BC0FD at Exchange1.qvm.local> you wrote:
>
> We're contemplating a new embedded design based on the MPC8641. This
> design is going to have the processor potentially running at two
> different clock frequencies and therefore (or so we're told by
> Freescale) the memory will need to run at different clock rates (same
> physical memory, but configured to run at different clock speed by

OK. This is not an uncommon requirement.

> uboot). All of this needs to be determined by jumpers (GPIO?) and

Why? You could use an environment variable as well - this allows to
change the settings on the fly (ok, requireing a reboot, but at least
without physical access to the hardware).

> then uboot needs to bring-up the memory using this different clock
> rate. All of this needs to happen before the memory is 'up', so early
> in the uboot init process.

To be a bit more precise, replace "memory" with "RAM". And "early in
the init process" just means "before relocation to RAM".

> Presuming all of that is possible, the problem becomes how to read
> the jumpers (GPIO) to get the configuration information to tell uboot
> what speed this memory should be run at. We are not going to have
> access to any GPIO directly located on the MPC8641. We are

If you use GPIOs (why would you want to do that?), then why would you
not have access to these?

> considering whether we can put a GPIO device on the I2C bus and have
> it read by the processor early in the uboot init process to get the
> information we need. My question is whether uboot will have enough
> resources early in the init process to do this?

Yes, this can be done. There is virtually no limit to making things
unneccesarily complicated.

> If I am going about this totally the wrong way and there is a better
> approach please steer me in the right direction please.

Just encode the setting in an environment variable. See for example
the "cpuclk" handling for some MPC8xx systems
(arch/powerpc/cpu/mpc8xx/speed.c etc.)

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Don't you know anything? I should have thought anyone knows that  who
knows anything about anything...      - Terry Pratchett, _Soul Music_


More information about the U-Boot mailing list