On Tue, 24 Nov 2009 20:12:12 +0300
Anton Vorontsov <avoront...@ru.mvista.com> wrote:

> The core support for NAND booting is there already, so this patch
> is pretty straightforward.
> 
> There is one trick though: top level Makefile expects nand_spl to
> be in nand_spl/board/$(BOARDDIR), but we can fully reuse the code
> from mpc8313erdb boards, and so to not duplicate the code we just
> symlink nand_spl/board/freescale/mpc8315erdb to mpc8313erdb.
> 
> Signed-off-by: Anton Vorontsov <avoront...@ru.mvista.com>
> ---
> 
> On Thu, Nov 19, 2009 at 01:17:36PM -0600, Kumar Gala wrote:
> [...]
> > >   @$(MKCONFIG) -a MPC8315ERDB ppc mpc83xx mpc8315erdb freescale
> > >+  @if [ "$(findstring _NAND_,$@)" ] ; then \
> > >+          echo "CONFIG_NAND_U_BOOT = y" >> $(obj)include/config.mk ; \
> > >+  fi ;
> > 
> > Use the new -t option to mkconfig.
> 
> Thanks for the hint.
> 
> Here is the updated patch.
> 
>  MAKEALL                                   |    1 +
>  Makefile                                  |    6 ++-
>  board/freescale/mpc8315erdb/config.mk     |    8 +++
>  board/freescale/mpc8315erdb/mpc8315erdb.c |   42 +++++++++++++
>  board/freescale/mpc8315erdb/sdram.c       |    7 ++
>  include/configs/MPC8315ERDB.h             |   95 
> +++++++++++++++++++++++------
>  6 files changed, 139 insertions(+), 20 deletions(-)

applied, with the below fixes merged into the same commit.

Thanks,

Kim

>From 792e1ba837c2ce6a77323a92aad57dab758ba042 Mon Sep 17 00:00:00 2001
From: Kim Phillips <kim.phill...@freescale.com>
Date: Thu, 7 Jan 2010 15:44:18 -0600
Subject: [PATCH] mpc83xx: minor 8315 nand boot fixes

o silence make during ln echo
o update documentation
o and avoid:

$ ./MAKEALL MPC8315ERDB_NAND
Configuring for MPC8315ERDB board...
sdram.o: In function `fixed_sdram':
/home/r1aaha/git/u-boot/nand_spl/board/freescale/mpc8313erdb/sdram.c:72: 
undefined reference to `udelay'

by renaming udelay -> __udelay in the spirit of commit
3eb90bad651fab39cffba750ec4421a9c01d60e7 "Generic udelay() with watchdog
support".

Signed-off-by: Kim Phillips <kim.phill...@freescale.com>
---
 Makefile                            |    2 +-
 board/freescale/mpc8315erdb/sdram.c |    2 +-
 doc/README.mpc8315erdb              |   29 +++++++++++++++++++++++++++--
 3 files changed, 29 insertions(+), 4 deletions(-)

diff --git a/Makefile b/Makefile
index cfbbb3a..7dca112 100644
--- a/Makefile
+++ b/Makefile
@@ -2263,7 +2263,7 @@ MPC8313ERDB_NAND_66_config: unconfig
 
 MPC8315ERDB_NAND_config \
 MPC8315ERDB_config: unconfig
-       if [ "$(findstring _NAND_,$@)" ] ; then \
+       @if [ "$(findstring _NAND_,$@)" ] ; then \
                ln -sf mpc8313erdb nand_spl/board/freescale/mpc8315erdb ; \
        fi ;
        @$(MKCONFIG) -t $(@:_config=) MPC8315ERDB ppc mpc83xx mpc8315erdb 
freescale
diff --git a/board/freescale/mpc8315erdb/sdram.c 
b/board/freescale/mpc8315erdb/sdram.c
index 02c99e9..fe8ec1e 100644
--- a/board/freescale/mpc8315erdb/sdram.c
+++ b/board/freescale/mpc8315erdb/sdram.c
@@ -69,7 +69,7 @@ static long fixed_sdram(void)
         * Erratum DDR3 requires a 50ms delay after clearing DDRCDR[DDR_cfg],
         * or the DDR2 controller may fail to initialize correctly.
         */
-       udelay(50000);
+       __udelay(50000);
 
        im->ddr.csbnds[0].csbnds = (msize - 1) >> 24;
        im->ddr.cs_config[0] = CONFIG_SYS_DDR_CS0_CONFIG;
diff --git a/doc/README.mpc8315erdb b/doc/README.mpc8315erdb
index 7d476d0..b32132d 100644
--- a/doc/README.mpc8315erdb
+++ b/doc/README.mpc8315erdb
@@ -15,6 +15,18 @@ Freescale MPC8315ERDB Board
          4321            4321
        (where the '*' indicates the position of the tab of the switch.)
 
+       To boot the image at the beginning of NAND flash, use these
+       DIP switch settings for S3 S4:
+
+       +------+        +------+
+       | *    |        |  *** |
+       |  *** |        | *    |
+       +------+ ON     +------+ ON
+         4321            4321
+       (where the '*' indicates the position of the tab of the switch.)
+
+       When booting from NAND, use u-boot-nand.bin, not u-boot.bin.
+
 2.     Memory Map
        The memory map looks like this:
 
@@ -26,6 +38,9 @@ Freescale MPC8315ERDB Board
        0xe060_0000     0xe060_7fff     NAND FLASH (CS1) 32K
        0xfe00_0000     0xfe7f_ffff     NOR FLASH (CS0)  8M
 
+       When booting from NAND, NAND flash is CS0 and NOR flash
+       is CS1.
+
 3.     Definitions
 
 3.1    Explanation of NEW definitions in:
@@ -43,13 +58,15 @@ Freescale MPC8315ERDB Board
 
        export CROSS_COMPILE=your-cross-compiler-prefix-
        make distclean
-       make MPC8315ERDB_config
+       make MPC8315ERDB_config (or MPC8315ERDB_NAND_config for u-boot-nand.bin)
        make all
 
 5.     Downloading and Flashing Images
 
 5.1    Reflash U-boot Image using U-boot
 
+       NOR flash:
+
        tftp 40000 u-boot.bin
        protect off all
        erase fe000000 fe1fffff
@@ -60,6 +77,15 @@ Freescale MPC8315ERDB Board
        You have to supply the correct byte count with 'xxxx'
        from the TFTP result log.
 
+       NAND flash:
+
+       =>tftpboot $loadaddr <filename>
+       =>nand erase 0 0x80000
+       =>nand write $loadaddr 0 0x80000
+
+       ...where 0x80000 is the filesize rounded up to
+       the next 0x20000 increment.
+
 5.2    Downloading and Booting Linux Kernel
 
        Ensure that all networking-related environment variables are set
@@ -76,5 +102,4 @@ Freescale MPC8315ERDB Board
 
 6      Notes
 
-       Booting from NAND flash is not yet supported.
        The console baudrate for MPC8315ERDB is 115200bps.
-- 
1.6.6

_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to