9
0
Fork 0

ARM: i.MX51 babbage: use mc13xxx_register_callback to initialize PMIC

This makes sure the PMIC is initialized once it's available. Move the
initcall to coredevice_initcall to make sure we initialize the PMIC
before the FEC driver is initialized. The ethernet phy needs vgen3
enabled in the PMIC initialization.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Sascha Hauer 2014-05-08 08:54:02 +02:00
parent b42bcee8f4
commit 7fe470e3e0
1 changed files with 13 additions and 16 deletions

View File

@ -14,6 +14,8 @@
* *
*/ */
#define pr_fmt(fmt) "babbage: " fmt
#include <common.h> #include <common.h>
#include <init.h> #include <init.h>
#include <environment.h> #include <environment.h>
@ -44,17 +46,10 @@
#define MX51_CCM_CACRR 0x10 #define MX51_CCM_CACRR 0x10
static void babbage_power_init(void) static void babbage_power_init(struct mc13xxx *mc13xxx)
{ {
struct mc13xxx *mc13xxx;
u32 val; u32 val;
mc13xxx = mc13xxx_get();
if (!mc13xxx) {
printf("could not get PMIC\n");
return;
}
/* Write needed to Power Gate 2 register */ /* Write needed to Power Gate 2 register */
mc13xxx_reg_read(mc13xxx, MC13892_REG_POWER_MISC, &val); mc13xxx_reg_read(mc13xxx, MC13892_REG_POWER_MISC, &val);
val &= ~0x10000; val &= ~0x10000;
@ -149,18 +144,20 @@ static void babbage_power_init(void)
mc13xxx_reg_write(mc13xxx, MC13892_REG_MODE_1, val); mc13xxx_reg_write(mc13xxx, MC13892_REG_MODE_1, val);
udelay(200); udelay(200);
}
static int imx51_babbage_late_init(void) pr_info("initialized PMIC\n");
{
if (!of_machine_is_compatible("fsl,imx51-babbage"))
return 0;
babbage_power_init();
console_flush(); console_flush();
imx51_init_lowlevel(800); imx51_init_lowlevel(800);
clock_notifier_call_chain(); clock_notifier_call_chain();
}
static int imx51_babbage_init(void)
{
if (!of_machine_is_compatible("fsl,imx51-babbage"))
return 0;
mc13xxx_register_init_callback(babbage_power_init);
armlinux_set_architecture(MACH_TYPE_MX51_BABBAGE); armlinux_set_architecture(MACH_TYPE_MX51_BABBAGE);
@ -169,4 +166,4 @@ static int imx51_babbage_late_init(void)
return 0; return 0;
} }
late_initcall(imx51_babbage_late_init); coredevice_initcall(imx51_babbage_init);