summaryrefslogtreecommitdiffstats
path: root/arch/arm/boards/freescale-mx51-babbage
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2014-05-08 08:54:02 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2014-05-19 08:37:13 +0200
commit7fe470e3e018ce4ba9c1727456331c4e303cf07b (patch)
tree1dfb19acfc19b9f736c100f01de90552358ea3b2 /arch/arm/boards/freescale-mx51-babbage
parentb42bcee8f4bfb36565483e8e681d8132c4c382c4 (diff)
downloadbarebox-7fe470e3e018ce4ba9c1727456331c4e303cf07b.tar.gz
barebox-7fe470e3e018ce4ba9c1727456331c4e303cf07b.tar.xz
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>
Diffstat (limited to 'arch/arm/boards/freescale-mx51-babbage')
-rw-r--r--arch/arm/boards/freescale-mx51-babbage/board.c27
1 files changed, 12 insertions, 15 deletions
diff --git a/arch/arm/boards/freescale-mx51-babbage/board.c b/arch/arm/boards/freescale-mx51-babbage/board.c
index adb4e65c93..0c72c741ef 100644
--- a/arch/arm/boards/freescale-mx51-babbage/board.c
+++ b/arch/arm/boards/freescale-mx51-babbage/board.c
@@ -14,6 +14,8 @@
*
*/
+#define pr_fmt(fmt) "babbage: " fmt
+
#include <common.h>
#include <init.h>
#include <environment.h>
@@ -44,17 +46,10 @@
#define MX51_CCM_CACRR 0x10
-static void babbage_power_init(void)
+static void babbage_power_init(struct mc13xxx *mc13xxx)
{
- struct mc13xxx *mc13xxx;
u32 val;
- mc13xxx = mc13xxx_get();
- if (!mc13xxx) {
- printf("could not get PMIC\n");
- return;
- }
-
/* Write needed to Power Gate 2 register */
mc13xxx_reg_read(mc13xxx, MC13892_REG_POWER_MISC, &val);
val &= ~0x10000;
@@ -149,18 +144,20 @@ static void babbage_power_init(void)
mc13xxx_reg_write(mc13xxx, MC13892_REG_MODE_1, val);
udelay(200);
+
+ pr_info("initialized PMIC\n");
+
+ console_flush();
+ imx51_init_lowlevel(800);
+ clock_notifier_call_chain();
}
-static int imx51_babbage_late_init(void)
+static int imx51_babbage_init(void)
{
if (!of_machine_is_compatible("fsl,imx51-babbage"))
return 0;
- babbage_power_init();
-
- console_flush();
- imx51_init_lowlevel(800);
- clock_notifier_call_chain();
+ mc13xxx_register_init_callback(babbage_power_init);
armlinux_set_architecture(MACH_TYPE_MX51_BABBAGE);
@@ -169,4 +166,4 @@ static int imx51_babbage_late_init(void)
return 0;
}
-late_initcall(imx51_babbage_late_init);
+coredevice_initcall(imx51_babbage_init);