summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Hemp <c.hemp@phytec.de>2014-09-12 15:33:47 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2014-09-15 07:31:51 +0200
commit86aac457be9e3a2f45998b59c73ba54a74ad1f84 (patch)
treeb1331ad2d7569455513b49dc48c7457f9c0015ef
parentc2a61d761d6f57fb0f476ae387abbab97511fee4 (diff)
downloadbarebox-86aac457be9e3a2f45998b59c73ba54a74ad1f84.tar.gz
barebox-86aac457be9e3a2f45998b59c73ba54a74ad1f84.tar.xz
ARM:phyFLEX-iMX6: Add bootsource detection
Signed-off-by: Christian Hemp <c.hemp@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--arch/arm/boards/phytec-phyflex-imx6/board.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/arch/arm/boards/phytec-phyflex-imx6/board.c b/arch/arm/boards/phytec-phyflex-imx6/board.c
index 843edac70..fe3d1b20e 100644
--- a/arch/arm/boards/phytec-phyflex-imx6/board.c
+++ b/arch/arm/boards/phytec-phyflex-imx6/board.c
@@ -18,6 +18,8 @@
*/
#include <envfs.h>
+#include <environment.h>
+#include <bootsource.h>
#include <common.h>
#include <gpio.h>
#include <init.h>
@@ -103,6 +105,19 @@ static int phytec_pfla02_init(void)
imx6_bbu_nand_register_handler("nand", BBU_HANDLER_FLAG_DEFAULT);
+ switch (bootsource_get()) {
+ case BOOTSOURCE_MMC:
+ of_device_enable_path("/chosen/environment-sd");
+ break;
+ case BOOTSOURCE_NAND:
+ of_device_enable_path("/chosen/environment-nand");
+ break;
+ default:
+ case BOOTSOURCE_SPI:
+ of_device_enable_path("/chosen/environment-spinor");
+ break;
+ }
+
defaultenv_append_directory(defaultenv_phyflex_imx6);
return 0;