diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2013-07-16 15:45:01 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2013-07-23 06:57:32 +0200 |
commit | 6a37488917b22fcf24d99c695ed1755198a9393b (patch) | |
tree | 84ae4b08d610fc6613b29f2e589a8a35ae982104 /arch/arm/boards/efika-mx-smartbook | |
parent | 58cb7b4ab504e26afcd8c1621147bba3a5389e87 (diff) | |
download | barebox-6a37488917b22fcf24d99c695ed1755198a9393b.tar.gz barebox-6a37488917b22fcf24d99c695ed1755198a9393b.tar.xz |
ARM: i.MX51 efikasb: configure environment from devicetree
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/boards/efika-mx-smartbook')
-rw-r--r-- | arch/arm/boards/efika-mx-smartbook/board.c | 29 |
1 files changed, 10 insertions, 19 deletions
diff --git a/arch/arm/boards/efika-mx-smartbook/board.c b/arch/arm/boards/efika-mx-smartbook/board.c index 1735c3e088..85ff466127 100644 --- a/arch/arm/boards/efika-mx-smartbook/board.c +++ b/arch/arm/boards/efika-mx-smartbook/board.c @@ -210,6 +210,16 @@ static int efikamx_usb_init(void) mxc_iomux_v3_setup_pad(MX51_PAD_EIM_A26__USBH2_STP); } + switch (bootsource_get()) { + case BOOTSOURCE_MMC: + of_device_enable_path("/chosen/environment-sd"); + break; + case BOOTSOURCE_SPI: + default: + of_device_enable_path("/chosen/environment-spi"); + break; + } + return 0; } console_initcall(efikamx_usb_init); @@ -230,7 +240,6 @@ extern char flash_header_imx51_genesi_efikasb_end[]; static int efikamx_late_init(void) { - enum bootsource bootsource; int i; if (!of_machine_is_compatible("genesi,imx51-sb")) @@ -255,24 +264,6 @@ static int efikamx_late_init(void) armlinux_set_architecture(2370); armlinux_set_revision(0x5100 | imx_silicon_revision()); - bootsource = bootsource_get(); - - switch (bootsource) { - case BOOTSOURCE_MMC: - device_detect_by_name("mmc1"); - - devfs_add_partition("mmc1", 0x00000, 0x80000, - DEVFS_PARTITION_FIXED, "self0"); - devfs_add_partition("mmc1", 0x80000, 0x80000, - DEVFS_PARTITION_FIXED, "env0"); - break; - case BOOTSOURCE_SPI: - default: - devfs_add_partition("m25p0", 0x80000, 0x20000, - DEVFS_PARTITION_FIXED, "env0"); - break; - } - return 0; } late_initcall(efikamx_late_init); |