mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 9/9] ARM: i.MX Datamodul edmqx6: configure environment from devicetree
Date: Wed, 10 Jul 2013 12:52:08 +0200	[thread overview]
Message-ID: <1373453528-3723-10-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1373453528-3723-1-git-send-email-s.hauer@pengutronix.de>

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>
---
 arch/arm/boards/dmo-mx6-realq7/board.c | 16 ----------------
 arch/arm/configs/dmo-realq7_defconfig  |  1 +
 arch/arm/dts/imx6q-dmo-realq7.dts      | 24 ++++++++++++++++++++++++
 3 files changed, 25 insertions(+), 16 deletions(-)

diff --git a/arch/arm/boards/dmo-mx6-realq7/board.c b/arch/arm/boards/dmo-mx6-realq7/board.c
index 9cf6c31..95371e7 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);
diff --git a/arch/arm/configs/dmo-realq7_defconfig b/arch/arm/configs/dmo-realq7_defconfig
index ab8aa43..501a182 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 a33a700..d8675e5 100644
--- a/arch/arm/dts/imx6q-dmo-realq7.dts
+++ b/arch/arm/dts/imx6q-dmo-realq7.dts
@@ -19,6 +19,30 @@
 
 	chosen {
 		linux,stdout-path = "/soc/aips-bus@02100000/serial@021e8000";
+
+		barebox {
+			environment@0 {
+				compatible = "barebox,environment";
+				device-path = &flash, "partname:barebox-environment";
+			};
+
+			nor-partitions {
+				compatible = "barebox,partition";
+				device-path = &flash;
+				#address-cells = <1>;
+				#size-cells = <1>;
+
+				partition@0 {
+					label = "barebox";
+					reg = <0x0 0x80000>;
+				};
+
+				partition@1 {
+					label = "barebox-environment";
+					reg = <0x80000 0x20000>;
+				};
+			};
+		};
 	};
 
 	aliases {
-- 
1.8.3.2


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2013-07-10 10:52 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-10 10:51 [PATCH] Allow configuration from the devicetree Sascha Hauer
2013-07-10 10:52 ` [PATCH 1/9] devfs: let devfs_add_partition return the new partition Sascha Hauer
2013-07-10 10:52 ` [PATCH 2/9] of: export of_default_bus_match_table Sascha Hauer
2013-07-10 10:52 ` [PATCH 3/9] of: partitions: factor out function to parse a single partition Sascha Hauer
2013-07-10 10:52 ` [PATCH 4/9] cdev: introduce partition names Sascha Hauer
2013-07-10 10:52 ` [PATCH 5/9] cdev: allow to open a struct cdev Sascha Hauer
2013-07-10 10:52 ` [PATCH 6/9] cdev: add device_find_partition Sascha Hauer
2013-07-10 10:52 ` [PATCH 7/9] mci: set partnames of eMMC boot partitions Sascha Hauer
2013-07-10 10:52 ` [PATCH 8/9] Add configurability via devicetree Sascha Hauer
2013-07-10 13:17   ` Jean-Christophe PLAGNIOL-VILLARD
2013-07-10 13:34     ` Sascha Hauer
2013-07-10 14:33       ` Jean-Christophe PLAGNIOL-VILLARD
2013-07-10 14:42         ` Sascha Hauer
2013-07-10 15:50           ` Jean-Christophe PLAGNIOL-VILLARD
2013-07-10 20:17             ` Sascha Hauer
2013-07-15 10:11               ` Jean-Christophe PLAGNIOL-VILLARD
2013-07-16 14:27                 ` Sascha Hauer
2013-07-10 10:52 ` Sascha Hauer [this message]
2013-07-11  7:37 ` [PATCH] Allow configuration from the devicetree Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1373453528-3723-10-git-send-email-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox