mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Juergen Beisert <jbe@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Juergen Beisert <juergen@kreuzholzen.de>
Subject: [PATCH 13/15] mini2440: Add booting from NAND support
Date: Sun, 13 Feb 2011 15:10:50 +0100	[thread overview]
Message-ID: <1297606252-802-14-git-send-email-jbe@pengutronix.de> (raw)
In-Reply-To: <1297606252-802-1-git-send-email-jbe@pengutronix.de>

From: Juergen Beisert <juergen@kreuzholzen.de>

With this patch barebox can now be booted from RAM, NOR and NAND on the
mini2440 platform. 'CONFIG_S3C24XX_NAND_BOOT' must still be 'y' to be able to
boot from NAND.

Signed-off-by: Juergen Beisert <juergen@kreuzholzen.de>
---
 arch/arm/boards/mini2440/Makefile        |    2 +-
 arch/arm/boards/mini2440/lowlevel_init.S |   39 ++++++++++++++++++++++++++++++
 arch/arm/mach-s3c24xx/Kconfig            |    4 +++
 3 files changed, 44 insertions(+), 1 deletions(-)
 create mode 100644 arch/arm/boards/mini2440/lowlevel_init.S

diff --git a/arch/arm/boards/mini2440/Makefile b/arch/arm/boards/mini2440/Makefile
index 09f7e7d..856fed0 100644
--- a/arch/arm/boards/mini2440/Makefile
+++ b/arch/arm/boards/mini2440/Makefile
@@ -1,2 +1,2 @@
 
-obj-y += mini2440.o
+obj-y += mini2440.o lowlevel_init.o
diff --git a/arch/arm/boards/mini2440/lowlevel_init.S b/arch/arm/boards/mini2440/lowlevel_init.S
new file mode 100644
index 0000000..41f50cb
--- /dev/null
+++ b/arch/arm/boards/mini2440/lowlevel_init.S
@@ -0,0 +1,39 @@
+/*
+ * Low level initialization for the FriendlyARM mini2440 board
+ */
+
+#include <config.h>
+#include <mach/s3c24x0-iomap.h>
+
+	.section ".text_bare_init.board_init_lowlevel","ax"
+
+/* ------------------------------------------------------------------------ */
+
+.globl board_init_lowlevel
+board_init_lowlevel:
+
+	mov r10, lr		/* save the link register */
+
+	bl s3c24x0_disable_wd
+
+	/* skip everything here if we are already running from SDRAM */
+	cmp pc, #S3C24X0_SDRAM_BASE
+	blo 1f
+	cmp pc, #S3C24X0_SDRAM_END
+	bhs 1f
+
+	mov pc, r10
+
+/* we are running from NOR or NAND/SRAM memory. Do further initialisation */
+1:
+	bl s3c24x0_pll_init
+
+	bl s3c24x0_sdram_init
+
+#ifdef CONFIG_S3C24XX_NAND_BOOT
+	mov lr, r10		/* restore the link register */
+/* up to here we are running from the internal SRAM area */
+	b s3c24x0_nand_boot	/* does return directly to our caller into SDRAM */
+#else
+	mov pc, r10
+#endif
diff --git a/arch/arm/mach-s3c24xx/Kconfig b/arch/arm/mach-s3c24xx/Kconfig
index 8b86d2d..33d230c 100644
--- a/arch/arm/mach-s3c24xx/Kconfig
+++ b/arch/arm/mach-s3c24xx/Kconfig
@@ -41,6 +41,10 @@ config MACH_A9M2440
 config MACH_MINI2440
 	bool "Mini 2440"
 	select CPU_S3C2440
+	select MACH_HAS_LOWLEVEL_INIT
+	select MACH_DO_LOWLEVEL_INIT
+	select S3C24XX_PLL_INIT
+	select S3C24XX_SDRAM_INIT
 	select HAS_DM9000
 	help
 	  Say Y here if you are using Mini 2440 dev board equipped
-- 
1.7.2.3


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

  parent reply	other threads:[~2011-02-13 14:11 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-13 14:10 RFC: Booting from NAND for mini2440 platform Juergen Beisert
2011-02-13 14:10 ` [PATCH 01/15] S3C24xx: Just remove a trailing whitespace Juergen Beisert
2011-02-13 14:10 ` [PATCH 02/15] MACH-S3C24xx: Fix typo in UART2_SIZE macro Juergen Beisert
2011-02-13 14:10 ` [PATCH 03/15] MACH-S324xx: Change detection method of the second SDRAM bank Juergen Beisert
2011-02-13 14:10 ` [PATCH 04/15] mini2440: Be a little be pedantic with the include file order Juergen Beisert
2011-02-13 14:10 ` [PATCH 05/15] mini2440: Fix a runtime warning when '.id=0' is used Juergen Beisert
2011-02-13 14:10 ` [PATCH 06/15] mini2440: Add some useful documentation Juergen Beisert
2011-02-13 14:10 ` [PATCH 07/15] mini2440: Add PLL settings Juergen Beisert
2011-02-13 14:10 ` [PATCH 08/15] mini2440: Add SDRAM config settings Juergen Beisert
2011-02-13 14:10 ` [PATCH 09/15] mini2440: Configure debug UART pins very early Juergen Beisert
2011-02-13 14:10 ` [PATCH 10/15] mini2440: Add SDRAM size autodetection Juergen Beisert
2011-02-13 14:10 ` [PATCH 11/15] mini2440: Add GPIO settings Juergen Beisert
2011-02-13 14:10 ` [PATCH 12/15] mini2440: Add MCI support Juergen Beisert
2011-02-13 14:10 ` Juergen Beisert [this message]
2011-02-13 14:10 ` [PATCH 14/15] mini2440: Remove some A9M2440 platform leftovers Juergen Beisert
2011-02-14  9:35   ` Juergen Beisert
2011-02-13 14:10 ` [PATCH 15/15] mini2440: Use generic environment Juergen Beisert
2011-02-13 19:01   ` mini2440: Forgotten patches to make it work (1 of 2) Juergen Beisert
2011-02-13 19:49     ` mini2440: Forgotten patches to make it work (2 " Juergen Beisert

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=1297606252-802-14-git-send-email-jbe@pengutronix.de \
    --to=jbe@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=juergen@kreuzholzen.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