mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-19 11:24:42 +00:00
mx7ulp: Only enable LDO if it is not already enabled
LDO mode may be already enabled by the ROM and enabling it again can cause U-Boot to hang. Avoid this problem by only enabling LDO mode if it is initially disabled. Reported-by: Jorge Ramirez-Ortiz <jorge@foundries.io> Signed-off-by: Fabio Estevam <festevam@gmail.com> Tested-by: Jorge Ramirez-Ortiz <jorge@foundries.io> Reviewed-by: Peng Fan <peng.fan@nxp.com>
This commit is contained in:
parent
2cfdb3bca7
commit
cbc81b735e
1 changed files with 14 additions and 11 deletions
|
@ -118,12 +118,26 @@ void init_wdog(void)
|
||||||
disable_wdog(WDG2_RBASE);
|
disable_wdog(WDG2_RBASE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool ldo_mode_is_enabled(void)
|
||||||
|
{
|
||||||
|
unsigned int reg;
|
||||||
|
|
||||||
|
reg = readl(PMC0_BASE_ADDR + PMC0_CTRL);
|
||||||
|
if (reg & PMC0_CTRL_LDOEN)
|
||||||
|
return true;
|
||||||
|
else
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
#if !defined(CONFIG_SPL) || (defined(CONFIG_SPL) && defined(CONFIG_SPL_BUILD))
|
#if !defined(CONFIG_SPL) || (defined(CONFIG_SPL) && defined(CONFIG_SPL_BUILD))
|
||||||
#if defined(CONFIG_LDO_ENABLED_MODE)
|
#if defined(CONFIG_LDO_ENABLED_MODE)
|
||||||
static void init_ldo_mode(void)
|
static void init_ldo_mode(void)
|
||||||
{
|
{
|
||||||
unsigned int reg;
|
unsigned int reg;
|
||||||
|
|
||||||
|
if (ldo_mode_is_enabled())
|
||||||
|
return;
|
||||||
|
|
||||||
/* Set LDOOKDIS */
|
/* Set LDOOKDIS */
|
||||||
setbits_le32(PMC0_BASE_ADDR + PMC0_CTRL, PMC0_CTRL_LDOOKDIS);
|
setbits_le32(PMC0_BASE_ADDR + PMC0_CTRL, PMC0_CTRL_LDOOKDIS);
|
||||||
|
|
||||||
|
@ -193,17 +207,6 @@ const char *get_imx_type(u32 imxtype)
|
||||||
return "7ULP";
|
return "7ULP";
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool ldo_mode_is_enabled(void)
|
|
||||||
{
|
|
||||||
unsigned int reg;
|
|
||||||
|
|
||||||
reg = readl(PMC0_BASE_ADDR + PMC0_CTRL);
|
|
||||||
if (reg & PMC0_CTRL_LDOEN)
|
|
||||||
return true;
|
|
||||||
else
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
int print_cpuinfo(void)
|
int print_cpuinfo(void)
|
||||||
{
|
{
|
||||||
u32 cpurev;
|
u32 cpurev;
|
||||||
|
|
Loading…
Add table
Reference in a new issue