summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorAndrey Smirnov <andrew.smirnov@gmail.com>2015-01-15 18:32:36 -0800
committerSascha Hauer <s.hauer@pengutronix.de>2015-01-16 08:11:42 +0100
commit74f042c956febf58b990c094ec7120f3f6b92c2a (patch)
tree1f785878724755550fae2862f70e7d520ec21d3e /arch
parent3d3cf5e58e55a75f56cdf8804a9ffed13e9ac84d (diff)
downloadbarebox-74f042c956febf58b990c094ec7120f3f6b92c2a.tar.gz
barebox-74f042c956febf58b990c094ec7120f3f6b92c2a.tar.xz
i.MX6: phytec: Allow multiple MMC devices to contain boot environment
Add code so that when booting from different SDHCI controllers barebox would correctly set up where to look for bootloader environment. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/boards/phytec-phyflex-imx6/board.c10
-rw-r--r--arch/arm/dts/imx6qdl-phytec-pfla02.dtsi20
2 files changed, 26 insertions, 4 deletions
diff --git a/arch/arm/boards/phytec-phyflex-imx6/board.c b/arch/arm/boards/phytec-phyflex-imx6/board.c
index c731faf6f1..5f65261a9f 100644
--- a/arch/arm/boards/phytec-phyflex-imx6/board.c
+++ b/arch/arm/boards/phytec-phyflex-imx6/board.c
@@ -17,6 +17,7 @@
*
*/
+#include <malloc.h>
#include <envfs.h>
#include <environment.h>
#include <bootsource.h>
@@ -79,14 +80,15 @@ static int phytec_pfla02_init(void)
switch (bootsource_get()) {
case BOOTSOURCE_MMC:
- environment_path = "/chosen/environment-sd";
+ environment_path = asprintf("/chosen/environment-sd%d",
+ bootsource_get_instance() + 1);
break;
case BOOTSOURCE_NAND:
- environment_path = "/chosen/environment-nand";
+ environment_path = asprintf("/chosen/environment-nand");
break;
default:
case BOOTSOURCE_SPI:
- environment_path = "/chosen/environment-spinor";
+ environment_path = asprintf("/chosen/environment-spinor");
break;
}
@@ -95,6 +97,8 @@ static int phytec_pfla02_init(void)
pr_warn("Failed to enable environment partition '%s' (%d)\n",
environment_path, ret);
+ free(environment_path);
+
return 0;
}
device_initcall(phytec_pfla02_init);
diff --git a/arch/arm/dts/imx6qdl-phytec-pfla02.dtsi b/arch/arm/dts/imx6qdl-phytec-pfla02.dtsi
index 32ce088fee..85cfec3976 100644
--- a/arch/arm/dts/imx6qdl-phytec-pfla02.dtsi
+++ b/arch/arm/dts/imx6qdl-phytec-pfla02.dtsi
@@ -23,11 +23,29 @@
status = "disabled";
};
- environment-sd {
+ environment-sd1 {
+ compatible = "barebox,environment";
+ device-path = &usdhc1, "partname:barebox-environment";
+ status = "disabled";
+ };
+
+ environment-sd2 {
+ compatible = "barebox,environment";
+ device-path = &usdhc2, "partname:barebox-environment";
+ status = "disabled";
+ };
+
+ environment-sd3 {
compatible = "barebox,environment";
device-path = &usdhc3, "partname:barebox-environment";
status = "disabled";
};
+
+ environment-sd4 {
+ compatible = "barebox,environment";
+ device-path = &usdhc4, "partname:barebox-environment";
+ status = "disabled";
+ };
};
};