mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Juergen Beisert <jbe@pengutronix.de>
Subject: [PATCH 2/9] ARM s3c boards: Do not hardcode image sizes
Date: Fri, 10 Aug 2012 22:00:58 +0200	[thread overview]
Message-ID: <1344628865-32574-3-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1344628865-32574-1-git-send-email-s.hauer@pengutronix.de>

The existing nand_boot functions all do the same, so move it to
a common place. To be flexible enough for future boards the real
image size is used instead of hardcoded 256k.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Juergen Beisert <jbe@pengutronix.de>
---
 arch/arm/boards/a9m2410/a9m2410.c               |    7 -------
 arch/arm/boards/a9m2440/a9m2440.c               |    7 -------
 arch/arm/boards/friendlyarm-mini2440/mini2440.c |    7 -------
 drivers/mtd/nand/nand_s3c24xx.c                 |   10 ++++++++++
 4 files changed, 10 insertions(+), 21 deletions(-)

diff --git a/arch/arm/boards/a9m2410/a9m2410.c b/arch/arm/boards/a9m2410/a9m2410.c
index fb3f1ba..8d97282 100644
--- a/arch/arm/boards/a9m2410/a9m2410.c
+++ b/arch/arm/boards/a9m2410/a9m2410.c
@@ -137,13 +137,6 @@ static int a9m2410_devices_init(void)
 
 device_initcall(a9m2410_devices_init);
 
-#ifdef CONFIG_S3C_NAND_BOOT
-void __bare_init nand_boot(void)
-{
-	s3c24x0_nand_load_image(_text, 256 * 1024, 0);
-}
-#endif
-
 static int a9m2410_console_init(void)
 {
 	s3c24xx_add_uart1();
diff --git a/arch/arm/boards/a9m2440/a9m2440.c b/arch/arm/boards/a9m2440/a9m2440.c
index 6beb72e..ac1c7a4 100644
--- a/arch/arm/boards/a9m2440/a9m2440.c
+++ b/arch/arm/boards/a9m2440/a9m2440.c
@@ -156,13 +156,6 @@ static int a9m2440_devices_init(void)
 
 device_initcall(a9m2440_devices_init);
 
-#ifdef CONFIG_S3C_NAND_BOOT
-void __bare_init nand_boot(void)
-{
-	s3c24x0_nand_load_image(_text, 256 * 1024, 0);
-}
-#endif
-
 static int a9m2440_console_init(void)
 {
 	s3c24xx_add_uart1();
diff --git a/arch/arm/boards/friendlyarm-mini2440/mini2440.c b/arch/arm/boards/friendlyarm-mini2440/mini2440.c
index a032fbc..251287e 100644
--- a/arch/arm/boards/friendlyarm-mini2440/mini2440.c
+++ b/arch/arm/boards/friendlyarm-mini2440/mini2440.c
@@ -324,13 +324,6 @@ static int mini2440_devices_init(void)
 
 device_initcall(mini2440_devices_init);
 
-#ifdef CONFIG_S3C_NAND_BOOT
-void __bare_init nand_boot(void)
-{
-	s3c24x0_nand_load_image(_text, 256 * 1024, 0);
-}
-#endif
-
 static int mini2440_console_init(void)
 {
 	/*
diff --git a/drivers/mtd/nand/nand_s3c24xx.c b/drivers/mtd/nand/nand_s3c24xx.c
index c629701..3d5732e 100644
--- a/drivers/mtd/nand/nand_s3c24xx.c
+++ b/drivers/mtd/nand/nand_s3c24xx.c
@@ -603,6 +603,16 @@ void __nand_boot_init s3c24x0_nand_load_image(void *dest, int size, int page)
 	disable_nand_controller(host);
 }
 
+#include <asm-generic/sections.h>
+
+void __nand_boot_init nand_boot(void)
+{
+	void *dest = _text;
+	int size = barebox_image_size;
+	int page = 0;
+
+	s3c24x0_nand_load_image(dest, size, page);
+}
 #ifdef CONFIG_NAND_S3C_BOOT_DEBUG
 #include <command.h>
 
-- 
1.7.10.4


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

  parent reply	other threads:[~2012-08-10 20:01 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-10 20:00 [PATCH] pbl updates Sascha Hauer
2012-08-10 20:00 ` [PATCH 1/9] ARM eukrea cpuimx25: Move flash_header to seperate file Sascha Hauer
2012-08-10 20:00 ` Sascha Hauer [this message]
2012-08-10 20:00 ` [PATCH 3/9] ARM boards: Make boards pbl safe Sascha Hauer
2012-08-10 20:01 ` [PATCH 4/9] ARM Makefile: Do not hardcode targets in MLO/netx/davinci/s5p Sascha Hauer
2012-08-10 20:01 ` [PATCH 5/9] ARM: fix netx/MLO/s5p image build for pbl Sascha Hauer
2012-08-11  9:37   ` Jean-Christophe PLAGNIOL-VILLARD
2012-08-12 12:09     ` Sascha Hauer
2012-08-12 13:21       ` Jean-Christophe PLAGNIOL-VILLARD
2012-08-10 20:01 ` [PATCH 6/9] ARM Makefile: generate a barebox-flash-image link Sascha Hauer
2012-08-11  9:37   ` Jean-Christophe PLAGNIOL-VILLARD
2012-08-12 13:23     ` Jean-Christophe PLAGNIOL-VILLARD
2012-08-10 20:01 ` [PATCH 7/9] ARM pbl: Fix zbarebox.S build Sascha Hauer
2012-08-11  9:38   ` Jean-Christophe PLAGNIOL-VILLARD
2012-08-10 20:01 ` [PATCH 8/9] ARM pbl: remove unnecessary FORCE Sascha Hauer
2012-08-11  9:39   ` Jean-Christophe PLAGNIOL-VILLARD
2012-08-12 12:36     ` Sascha Hauer
2012-08-12 13:24       ` Jean-Christophe PLAGNIOL-VILLARD
2012-08-10 20:01 ` [PATCH 9/9] ARM pbl: generate zbarebox.map in $(obj) 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=1344628865-32574-3-git-send-email-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=jbe@pengutronix.de \
    /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