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 09/10] ARM: i.MX51 efikasb: configure environment from devicetree
Date: Tue, 16 Jul 2013 16:06:05 +0200	[thread overview]
Message-ID: <1373983566-27721-10-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1373983566-27721-1-git-send-email-s.hauer@pengutronix.de>

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/boards/efika-mx-smartbook/board.c | 29 ++++++++++-------------------
 arch/arm/dts/imx51-genesi-efika-sb.dts     | 26 ++++++++++++++++++++++++++
 2 files changed, 36 insertions(+), 19 deletions(-)

diff --git a/arch/arm/boards/efika-mx-smartbook/board.c b/arch/arm/boards/efika-mx-smartbook/board.c
index 1735c3e..85ff466 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);
diff --git a/arch/arm/dts/imx51-genesi-efika-sb.dts b/arch/arm/dts/imx51-genesi-efika-sb.dts
index dc92b2a..21b7c7e 100644
--- a/arch/arm/dts/imx51-genesi-efika-sb.dts
+++ b/arch/arm/dts/imx51-genesi-efika-sb.dts
@@ -18,6 +18,18 @@
 
 	chosen {
 		linux,stdout-path = "/soc/aips@70000000/serial@73fbc000";
+
+		environment-sd {
+			compatible = "barebox,environment";
+			device-path = &esdhc2, "partname:barebox-environment";
+			status = "disabled";
+		};
+
+		environment-spi {
+			compatible = "barebox,environment";
+			device-path = &flash, "partname:barebox-environment";
+			status = "disabled";
+		};
 	};
 
 	memory {
@@ -178,6 +190,13 @@
 	cd-gpios = <&gpio1 8 0>;
 	wp-gpios = <&gpio1 7 0>;
 	status = "okay";
+	#address-cells = <1>;
+	#size-cells = <1>;
+
+	partition@0 {
+		label = "barebox-environment";
+		reg = <0x80000 0x80000>;
+	};
 };
 
 &ecspi1 {
@@ -290,6 +309,13 @@
 		compatible = "sst,sst25vf032b", "m25p80";
 		spi-max-frequency = <15000000>;
 		reg = <1>;
+		#address-cells = <1>;
+		#size-cells = <1>;
+
+		partition@0 {
+			label = "barebox-environment";
+			reg = <0x80000 0x80000>;
+		};
 	};
 };
 
-- 
1.8.3.2


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

  parent reply	other threads:[~2013-07-16 14:06 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-16 14:05 [PATCH] " Sascha Hauer
2013-07-16 14:05 ` [PATCH 01/10] of: partition: check for valid node Sascha Hauer
2013-07-16 14:05 ` [PATCH 02/10] of: Add convenience functions to en/disable devicenodes Sascha Hauer
2013-07-16 14:05 ` [PATCH 03/10] mtd: Add devicetree partition parsing Sascha Hauer
2013-07-16 14:06 ` [PATCH 04/10] mci: " Sascha Hauer
2013-07-16 14:06 ` [PATCH 05/10] Add configurability via devicetree Sascha Hauer
2013-07-16 14:06 ` [PATCH 06/10] ARM: i.MX Datamodul edmqx6: configure environment from devicetree Sascha Hauer
2013-07-16 14:06 ` [PATCH 07/10] ARM: i.MX51 babbage: " Sascha Hauer
2013-07-16 14:06 ` [PATCH 08/10] ARM: i.MX53 QSB: " Sascha Hauer
2013-07-16 14:06 ` Sascha Hauer [this message]
2013-07-16 14:06 ` [PATCH 10/10] ARM: i.MX6 tqma6x: " 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=1373983566-27721-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