ARM: IMX: Embedsky E9: Choose right environment when booting from SD or EMMC.
Signed-off-by: Andrey Panov <rockford@yandex.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
parent
74f042c956
commit
ff0b8822d4
|
@ -40,6 +40,7 @@
|
|||
#include <mach/spi.h>
|
||||
#include <mach/usb.h>
|
||||
#include <envfs.h>
|
||||
#include <bootsource.h>
|
||||
|
||||
#define PHY_ID_RTL8211E 0x001cc915
|
||||
#define PHY_ID_MASK 0xffffffff
|
||||
|
@ -59,11 +60,25 @@ static int rtl8211e_phy_fixup(struct phy_device *dev)
|
|||
|
||||
static int e9_devices_init(void)
|
||||
{
|
||||
int ret;
|
||||
char *environment_path;
|
||||
|
||||
if (!of_machine_is_compatible("embedsky,e9"))
|
||||
return 0;
|
||||
|
||||
armlinux_set_architecture(3980);
|
||||
barebox_set_hostname("e9");
|
||||
|
||||
environment_path = asprintf("/chosen/environment-mmc%d",
|
||||
bootsource_get_instance());
|
||||
|
||||
ret = of_device_enable_path(environment_path);
|
||||
|
||||
if (ret < 0)
|
||||
pr_warn("Failed to enable environment partition '%s' (%d)\n",
|
||||
environment_path, ret);
|
||||
|
||||
free(environment_path);
|
||||
|
||||
defaultenv_append_directory(defaultenv_e9);
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -2,5 +2,5 @@
|
|||
|
||||
mount /dev/mmc3.0
|
||||
|
||||
global.bootm.image=/mnt/mmc3.0/boot/zImage
|
||||
global.linux.bootargs.dyn.root="root=/dev/mmcblk1p1 rootwait"
|
||||
global.bootm.image=/mnt/mmc3.0/zImage
|
||||
global.linux.bootargs.dyn.root="root=/dev/mmcblk0p2 rootwait"
|
||||
|
|
|
@ -19,9 +19,16 @@
|
|||
chosen {
|
||||
linux,stdout-path = &uart4;
|
||||
|
||||
environment@0 {
|
||||
environment-mmc1 {
|
||||
compatible = "barebox,environment";
|
||||
device-path = &usdhc2, "partname:barebox-environment";
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
environment-mmc3 {
|
||||
compatible = "barebox,environment";
|
||||
device-path = &usdhc4, "partname:barebox-environment";
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
};
|
||||
|
@ -40,3 +47,17 @@
|
|||
reg = <0x80000 0x80000>;
|
||||
};
|
||||
};
|
||||
|
||||
&usdhc4 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
partition@0 {
|
||||
label = "barebox";
|
||||
reg = <0x0 0x80000>;
|
||||
};
|
||||
partition@1 {
|
||||
label = "barebox-environment";
|
||||
reg = <0x80000 0x80000>;
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue