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 4/5] ARM: Phytec-phyCORE-imx27: Register NOR/NAND update handlers
Date: Thu, 12 Jun 2014 08:53:42 +0200	[thread overview]
Message-ID: <1402556023-1811-5-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1402556023-1811-1-git-send-email-s.hauer@pengutronix.de>

To make barebox_update work on the board.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/boards/phytec-phycore-imx27/pcm038.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boards/phytec-phycore-imx27/pcm038.c b/arch/arm/boards/phytec-phycore-imx27/pcm038.c
index 294f4ec..a4305f6 100644
--- a/arch/arm/boards/phytec-phycore-imx27/pcm038.c
+++ b/arch/arm/boards/phytec-phycore-imx27/pcm038.c
@@ -28,6 +28,7 @@
 #include <mach/imxfb.h>
 #include <mach/iomux-mx27.h>
 #include <mfd/mc13xxx.h>
+#include <mach/bbu.h>
 
 #include "pll.h"
 
@@ -105,7 +106,7 @@ static int pcm038_init(void)
 {
 	struct mc13xxx *mc13xxx = mc13xxx_get();
 	char *envdev;
-	uint32_t i;
+	uint32_t i, bbu_nand_flags = 0, bbu_nor_flags = 0;
 
 	if (!of_machine_is_compatible("phytec,imx27-pcm038"))
 		return 0;
@@ -123,10 +124,12 @@ static int pcm038_init(void)
 	switch (bootsource_get()) {
 	case BOOTSOURCE_NAND:
 		of_device_enable_path("/chosen/environment-nand");
+		bbu_nand_flags |= BBU_HANDLER_FLAG_DEFAULT;
 		envdev = "NAND";
 		break;
 	default:
 		of_device_enable_path("/chosen/environment-nor");
+		bbu_nor_flags |= BBU_HANDLER_FLAG_DEFAULT;
 		envdev = "NOR";
 		break;
 	}
@@ -175,6 +178,11 @@ static int pcm038_init(void)
 	/* Clock gating enable */
 	writel(0x00050f08, MX27_SYSCTRL_BASE_ADDR + MX27_GPCR);
 
+	imx_bbu_external_nand_register_handler("nand", "/dev/nand0.boot",
+			bbu_nand_flags);
+	imx_bbu_external_nor_register_handler("nor", "/dev/nor0.boot",
+			bbu_nor_flags);
+
 	defaultenv_append_directory(defaultenv_pcm038);
 
 	return 0;
-- 
2.0.0.rc2


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

  parent reply	other threads:[~2014-06-12  6:54 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-12  6:53 phyCORE-imx27 updates Sascha Hauer
2014-06-12  6:53 ` [PATCH 1/5] ARM: uncompress.c: copy executable to SDRAM if necessary Sascha Hauer
2014-06-12  6:53 ` [PATCH 2/5] ARM: Phytec-phyCORE-imx27: Register board env during runtime Sascha Hauer
2014-06-12  6:53 ` [PATCH 3/5] ARM: i.MX bbu: Add update handler for external NOR boot Sascha Hauer
2014-06-12  6:53 ` Sascha Hauer [this message]
2014-06-12  6:53 ` [PATCH 5/5] ARM: Phytec-phyCORE-imx27: Switch to multiimage support 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=1402556023-1811-5-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