9
0
Fork 0

ARM:phyFLEX-iMX6: Add bootsource detection

Signed-off-by: Christian Hemp <c.hemp@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Christian Hemp 2014-09-12 15:33:47 +02:00 committed by Sascha Hauer
parent c2a61d761d
commit 86aac457be
1 changed files with 15 additions and 0 deletions

View File

@ -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;