[PATCH 2/3] ARM: i.MX DFI FS700-M60: Add SPI NOR flash update handler

Sascha Hauer s.hauer at pengutronix.de
Fri Jan 10 09:31:39 EST 2014


Signed-off-by: Sascha Hauer <s.hauer at 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




More information about the barebox mailing list