[U-Boot] Detecting board revision that needs to be done after relocation

Hi,
I need to provide a get_board_rev() function that depends on I2C probe of a PMIC to decide between the board revision.
I2C is only available after relocation, so what is the correct way to "delay" get_board_rev, so that it gets called only at a time when I2C is ready?
Thanks,
Fabio Estevam

Dear Fabio Estevam,
Hi,
I need to provide a get_board_rev() function that depends on I2C probe of a PMIC to decide between the board revision.
I2C is only available after relocation,
On arm? Not at all ;-) check arch/arm/lib/board.c
so what is the correct way to "delay" get_board_rev, so that it gets called only at a time when I2C is ready?
Well ... implement board-specific hack in your boardfile that detects the PMIC early?
Thanks,
Fabio Estevam _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Best regards, Marek Vasut

On Tue, May 29, 2012 at 11:45 AM, Marek Vasut marek.vasut@gmail.com wrote:
Well ... implement board-specific hack in your boardfile that detects the PMIC early?
Yes, you are right. This works ;-)
Regards,
Fabio Estevam

On 05/28/2012 11:25 PM, Fabio Estevam wrote:
I need to provide a get_board_rev() function that depends on I2C probe of a PMIC to decide between the board revision.
I2C is only available after relocation, so what is the correct way to "delay" get_board_rev, so that it gets called only at a time when I2C is ready?
I2C is usually available earlier, as it is used to read the SPD on memory modules.
When I last did it, I had to change U-Boot slightly to support a second I2C bus, as the bus selection variable was located in flash before relocation (very old version of U-Boot, so may not apply still).
I've only had a problem using I2C very early in the boot sequence, like before the system clocks have been setup, then the solution to that was to just use a GPIO strapping instead for clock selection.

On Tue, May 29, 2012 at 08:55:34, Fabio Estevam wrote:
Hi,
I need to provide a get_board_rev() function that depends on I2C probe of a PMIC to decide between the board revision.
I2C is only available after relocation,
Not necessarily. You can use i2c probe & read even before relocation provided they are no data from bss section being used.
Look at below commits for details
http://git.denx.de/?p=u-boot.git;a=commitdiff;h=0b620ec97e05ddb09714d127a788...
http://arago-project.org/git/projects/?p=u-boot-am33x.git;a=commitdiff;h=482...
http://arago-project.org/git/projects/?p=u-boot-am33x.git;a=commitdiff;h=0ff...
so what is the correct way to "delay" get_board_rev, so that it gets called only at a time when I2C is ready?
Thanks,
Fabio Estevam _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Regards, Gururaja
participants (4)
-
Andrew E. Mileski
-
Fabio Estevam
-
Hebbar, Gururaja
-
Marek Vasut