diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2013-07-05 10:38:01 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2013-07-18 13:54:42 +0200 |
commit | a72e3b1f3861393e5f6a4ed867be3b66188a4fc5 (patch) | |
tree | f561728729d8fc0abfc0822b55fc8f31d4d689cf | |
parent | 874f318037b6941ad7261e398a03d177f3383eb1 (diff) | |
download | barebox-a72e3b1f3861393e5f6a4ed867be3b66188a4fc5.tar.gz barebox-a72e3b1f3861393e5f6a4ed867be3b66188a4fc5.tar.xz |
ARM: i.MX Datamodul edmqx6: configure environment from devicetree
This drops support for storing the environment in the eMMC,
but the standard bootsource is the SPI NOR flash.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r-- | arch/arm/boards/dmo-mx6-realq7/board.c | 26 | ||||
-rw-r--r-- | arch/arm/configs/dmo-realq7_defconfig | 1 | ||||
-rw-r--r-- | arch/arm/dts/imx6q-dmo-realq7.dts | 31 |
3 files changed, 42 insertions, 16 deletions
diff --git a/arch/arm/boards/dmo-mx6-realq7/board.c b/arch/arm/boards/dmo-mx6-realq7/board.c index 9cf6c3175c..69d93f85fb 100644 --- a/arch/arm/boards/dmo-mx6-realq7/board.c +++ b/arch/arm/boards/dmo-mx6-realq7/board.c @@ -114,22 +114,6 @@ static int realq7_env_init(void) BBU_HANDLER_FLAG_DEFAULT, NULL, 0, 0x00907000); imx6_bbu_internal_mmc_register_handler("mmc", "/dev/mmc3.barebox", 0, NULL, 0, 0x00907000); - - switch (bootsource_get()) { - case BOOTSOURCE_MMC: - device_detect_by_name("mmc3"); - devfs_add_partition("mmc3", 0, SZ_1M, DEVFS_PARTITION_FIXED, "mmc3.barebox"); - devfs_add_partition("mmc3", SZ_1M, SZ_1M, DEVFS_PARTITION_FIXED, "mmc3.bareboxenv"); - default_environment_path = "/dev/mmc3.bareboxenv"; - break; - default: - case BOOTSOURCE_SPI: - devfs_add_partition("m25p0", 0, SZ_256K, DEVFS_PARTITION_FIXED, "m25p0.barebox"); - devfs_add_partition("m25p0", SZ_256K, SZ_256K, DEVFS_PARTITION_FIXED, "m25p0.bareboxenv"); - default_environment_path = "/dev/m25p0.bareboxenv"; - break; - } - return 0; } late_initcall(realq7_env_init); @@ -141,6 +125,16 @@ static int realq7_console_init(void) imx6_init_lowlevel(); + switch (bootsource_get()) { + case BOOTSOURCE_MMC: + of_device_enable_path("/chosen/environment-emmc"); + break; + default: + case BOOTSOURCE_SPI: + of_device_enable_path("/chosen/environment-spi"); + break; + } + return 0; } postcore_initcall(realq7_console_init); diff --git a/arch/arm/configs/dmo-realq7_defconfig b/arch/arm/configs/dmo-realq7_defconfig index ab8aa433c2..501a182b8e 100644 --- a/arch/arm/configs/dmo-realq7_defconfig +++ b/arch/arm/configs/dmo-realq7_defconfig @@ -71,6 +71,7 @@ CONFIG_NET_NFS=y CONFIG_NET_PING=y CONFIG_NET_RESOLV=y CONFIG_OFDEVICE=y +CONFIG_OF_BAREBOX_DRIVERS=y CONFIG_DRIVER_NET_FEC_IMX=y CONFIG_DRIVER_SPI_IMX=y CONFIG_I2C=y diff --git a/arch/arm/dts/imx6q-dmo-realq7.dts b/arch/arm/dts/imx6q-dmo-realq7.dts index a33a700548..672f15d27d 100644 --- a/arch/arm/dts/imx6q-dmo-realq7.dts +++ b/arch/arm/dts/imx6q-dmo-realq7.dts @@ -19,6 +19,18 @@ chosen { linux,stdout-path = "/soc/aips-bus@02100000/serial@021e8000"; + + environment-emmc { + compatible = "barebox,environment"; + device-path = &usdhc4, "partname:barebox-environment"; + status = "disabled"; + }; + + environment-spi { + compatible = "barebox,environment"; + device-path = &flash, "partname:barebox-environment"; + status = "disabled"; + }; }; aliases { @@ -87,6 +99,18 @@ compatible = "m25p80"; spi-max-frequency = <40000000>; reg = <0>; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "barebox"; + reg = <0x0 0x80000>; + }; + + partition@1 { + label = "barebox-environment"; + reg = <0x80000 0x20000>; + }; }; }; @@ -351,4 +375,11 @@ non-removable; bus-width = <8>; status = "okay"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "barebox-environment"; + reg = <0x0 0x80000>; + }; }; |