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 3/4] ARM: i.MX51 efikasb: add flash environment support
Date: Mon, 24 Jun 2013 19:00:41 +0200	[thread overview]
Message-ID: <1372093242-11699-3-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1372093242-11699-1-git-send-email-s.hauer@pengutronix.de>

The Efikasb has a m25p80 SPI NOR flash. Add support for putting
the environment on it.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/boards/efika-mx-smartbook/board.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boards/efika-mx-smartbook/board.c b/arch/arm/boards/efika-mx-smartbook/board.c
index 98f9dcd..58600e3 100644
--- a/arch/arm/boards/efika-mx-smartbook/board.c
+++ b/arch/arm/boards/efika-mx-smartbook/board.c
@@ -475,11 +475,20 @@ device_initcall(efikamx_devices_init);
 
 static int efikamx_part_init(void)
 {
-	if (bootsource_get() == BOOTSOURCE_MMC) {
+	enum bootsource bootsource = bootsource_get();
+
+	switch (bootsource) {
+	case BOOTSOURCE_MMC:
 		devfs_add_partition("mmc_left", 0x00000, 0x80000,
 				DEVFS_PARTITION_FIXED, "self0");
 		devfs_add_partition("mmc_left", 0x80000, 0x80000,
 				DEVFS_PARTITION_FIXED, "env0");
+		break;
+	case BOOTSOURCE_SPI:
+	default:
+		devfs_add_partition("m25p0", 0x80000, 0x20000,
+				DEVFS_PARTITION_FIXED, "env0");
+		break;
 	}
 
 	return 0;
-- 
1.8.3.1


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

  parent reply	other threads:[~2013-06-24 17:01 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-24 17:00 [PATCH 1/4] usb: ehci: Fixup efika hack for devicetree Sascha Hauer
2013-06-24 17:00 ` [PATCH 2/4] usb: i.MX chipidea: probe ULPI phys later Sascha Hauer
2013-06-24 17:00 ` Sascha Hauer [this message]
2013-06-24 17:00 ` [PATCH 4/4] ARM: i.MX51 efikasb: Switch to devicetree probing 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=1372093242-11699-3-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