[U-Boot] [PATCH] RFC: tegra: Avoid using I2C prior to relocation

Simon Glass sjg at chromium.org
Wed Aug 7 23:03:26 CEST 2013


Hi Stephen,

On Wed, Aug 7, 2013 at 10:20 AM, Stephen Warren <swarren at wwwdotorg.org>wrote:

> On 08/06/2013 11:52 PM, Simon Glass wrote:
> > Tegra recently moved to the new I2C framework, which sets up I2C prior to
> > relocation, and prior to calling i2c_init_board(). This causes a crash on
> > Tegra boards.
> >
> > note:
> >
> > There are many ways to fix this. I believe this is one. It disables
> i2c_init()
> > until relocation is complete. I have been unable to test it so far due to
> > problems getting my Seaboard to work. I will try another Tegra board, but
> > send this for comment in the meantime.
>
> Tested-by: Stephen Warren <swarren at nvidia.com>
>
> (On Beaver and Dalmore, tested booting to U-Boot command prompt followed
> by "i2c dev 0; i2c probe")
>
> Note: I believe this is an enormous hack that hacks around the problem
> of dynamic device initialization just not being well thought out
> relative to the restrictions of U-Boot's various boot stages. I'd still
> prefer an outright revert of the broken code.
>
> In other words, tegra_i2c_init() simply shouldn't be called at the wrong
> time; it shouldn't have to handle being called at the wrong time and
> null itself out when that happens.
>
> However, if this is what it takes to get U-Boot working again, then
> let's apply it ASAP.
>

Fair enough.

Restricting my comments to I2C only, I think that we could have (at least
until driver model happens) an I2C init for each driver (in this case it is
i2c_init_board() that is called by the I2C subsystem twice during init
(once from board_init_f() and once from board_init_r()). The i2c_init()
call is odd because it does an init of a single I2C bus, which isn't really
necessary for most hardware. But I'm not sure it is worth worrying about
this until we have driver model.

Regards,
Simon


More information about the U-Boot mailing list