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 2/3] ARM: i.MX DFI FS700-M60: Add SPI NOR flash update handler
Date: Fri, 10 Jan 2014 15:31:39 +0100	[thread overview]
Message-ID: <1389364300-8742-2-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1389364300-8742-1-git-send-email-s.hauer@pengutronix.de>

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>

Conflicts:
	arch/arm/boards/dfi-fs700-m60/board.c
---
 arch/arm/boards/dfi-fs700-m60/board.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boards/dfi-fs700-m60/board.c b/arch/arm/boards/dfi-fs700-m60/board.c
index 96f1b0e..7544ec1 100644
--- a/arch/arm/boards/dfi-fs700-m60/board.c
+++ b/arch/arm/boards/dfi-fs700-m60/board.c
@@ -19,6 +19,9 @@
 #define pr_fmt(fmt)  "dfi-fs700-m60: " fmt
 
 #include <generated/mach-types.h>
+#include <environment.h>
+#include <bootsource.h>
+#include <globalvar.h>
 #include <common.h>
 #include <sizes.h>
 #include <envfs.h>
@@ -64,13 +67,22 @@ static int ar8031_phy_fixup(struct phy_device *dev)
 
 static int dfi_fs700_m60_init(void)
 {
+	unsigned flag_spi = 0, flag_mmc = 0;
+
 	if (!of_machine_is_compatible("dfi,fs700-m60"))
 		return 0;
 
 	phy_register_fixup_for_uid(PHY_ID_AR8031, AR_PHY_ID_MASK, ar8031_phy_fixup);
 
+	if (bootsource_get() == BOOTSOURCE_SPI)
+		flag_spi |= BBU_HANDLER_FLAG_DEFAULT;
+	else
+		flag_mmc |= BBU_HANDLER_FLAG_DEFAULT;
+
 	imx6_bbu_internal_mmc_register_handler("mmc", "/dev/mmc3.boot0",
-		BBU_HANDLER_FLAG_DEFAULT, NULL, 0, 0);
+		flag_mmc, NULL, 0, 0);
+	imx6_bbu_internal_spi_i2c_register_handler("spiflash", "/dev/m25p0",
+		flag_spi, NULL, 0, 0);
 
 	armlinux_set_architecture(MACH_TYPE_MX6Q_SABRESD);
 
-- 
1.8.5.2


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

  reply	other threads:[~2014-01-10 14:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-10 14:31 [PATCH 1/3] ARM: i.MX DFI FS700-M60: Add SPI NOR flash support Sascha Hauer
2014-01-10 14:31 ` Sascha Hauer [this message]
2014-01-10 14:31 ` [PATCH 3/3] ARM: i.MX DFI FS700-M60: Update for new boards 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=1389364300-8742-2-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