[PATCH 3/5] ARM: i.MX: edmqmx6: choose the environment at the correct time
Lucas Stach
l.stach at pengutronix.de
Thu Feb 27 08:53:21 EST 2014
From: Michael Olbrich <m.olbrich at pengutronix.de>
Signed-off-by: Michael Olbrich <m.olbrich at pengutronix.de>
Signed-off-by: Lucas Stach <l.stach at pengutronix.de>
---
v2 lst:
- correct compatible
- proper function naming
---
arch/arm/boards/datamodul-edm-qmx6/board.c | 21 +++++++++++++++------
1 file changed, 15 insertions(+), 6 deletions(-)
diff --git a/arch/arm/boards/datamodul-edm-qmx6/board.c b/arch/arm/boards/datamodul-edm-qmx6/board.c
index 8a49beee2faa..3184912c4782 100644
--- a/arch/arm/boards/datamodul-edm-qmx6/board.c
+++ b/arch/arm/boards/datamodul-edm-qmx6/board.c
@@ -111,15 +111,11 @@ static int realq7_env_init(void)
}
late_initcall(realq7_env_init);
-static int realq7_console_init(void)
+static int realq7_device_init(void)
{
if (!of_machine_is_compatible("dmo,imx6q-edmqmx6"))
return 0;
- barebox_set_hostname("eDM-QMX6");
-
- imx6_init_lowlevel();
-
switch (bootsource_get()) {
case BOOTSOURCE_MMC:
of_device_enable_path("/chosen/environment-emmc");
@@ -132,4 +128,17 @@ static int realq7_console_init(void)
return 0;
}
-postcore_initcall(realq7_console_init);
+device_initcall(realq7_device_init);
+
+static int realq7_postcore_init(void)
+{
+ if (!of_machine_is_compatible("dmo,imx6q-edmqmx6"))
+ return 0;
+
+ barebox_set_hostname("eDM-QMX6");
+
+ imx6_init_lowlevel();
+
+ return 0;
+}
+postcore_initcall(realq7_postcore_init);
--
1.8.5.3
More information about the barebox
mailing list