[U-Boot] [PATCH] mx53loco: Call PMIC related functions from board_late_init()

Stefano Babic
2012-12-27T10:09:39Z

On 26/12/2012 16:50, Fabio Estevam wrote:
> From: Fabio Estevam <fabio.estevam@freescale.com>
>
> Since commit c733681 (pmic: Extend PMIC framework to support multiple instances
> of PMIC devices) mx53loco fails to allocate the memory for PMIC:
>
> U-Boot 2013.01-rc2-dirty (Dec 20 2012 - 15:55:01)
>
> Board: MX53 LOCO
> I2C: ready
> DRAM: 1 GiB
> pmic_alloc: No available memory for allocation!
> pmic_init: POWER allocation error!
> CPU: Freescale i.MX53 family rev2.0 at 800 MHz
> Reset cause: POR
> MMC: FSL_SDHC: 0, FSL_SDHC: 1
>
> Calling the PMIC related functions at a later stage, ie, from board_late_init()
> fixes the issue.
>
> Reported-by: Robert Nelson <robertcnelson@gmail.com>
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> ---

Hi Fabio, hi Robert,

the new pmic framework calls malloc(), that the reason. It is then safe
to call the init from board_late_init().

Tested-by: Stefano Babic <sbabic@denx.de>

Applied to u-boot-imx, thanks.

gcc 4.6.4, it boots always here.

Best regards,
Stefano Babic