9
0
Fork 0

i.MX27: Export boot source to magic variables

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Alexander Shiyan 2012-03-25 21:15:16 +04:00 committed by Sascha Hauer
parent 71cd4b22ce
commit 904ebefe21
1 changed files with 27 additions and 2 deletions

View File

@ -86,9 +86,34 @@ static int imx_25_35_boot_save_loc(void)
return 0;
}
coredevice_initcall(imx_25_35_boot_save_loc);
BAREBOX_MAGICVAR(barebox_loc, "The source barebox has been booted from");
#endif
#if defined(CONFIG_ARCH_IMX27)
static int imx_27_boot_save_loc(void)
{
switch ((GPCR & GPCR_BOOT_MASK) >> GPCR_BOOT_SHIFT) {
case GPCR_BOOT_UART_USB:
setenv("barebox_loc", "serial");
break;
case GPCR_BOOT_8BIT_NAND_2k:
case GPCR_BOOT_16BIT_NAND_2k:
case GPCR_BOOT_16BIT_NAND_512:
case GPCR_BOOT_8BIT_NAND_512:
setenv("barebox_loc", "nand");
break;
default:
setenv("barebox_loc", "nor");
break;
}
export("barebox_loc");
return 0;
}
coredevice_initcall(imx_27_boot_save_loc);
BAREBOX_MAGICVAR(barebox_loc, "The source barebox has been booted from");
#endif