mpc83xx: Add NAND boot support for MPC8315E-RDB boards
PATCH 1/1 mpc83xx: Add NAND boot support for MPC8315E-RDB boards
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.
--- MAKEALL | 1 + Makefile | 11 ++++ board/freescale/mpc8315erdb/config.mk | 6 ++ board/freescale/mpc8315erdb/mpc8315erdb.c | 42 +++++++++++++ board/freescale/mpc8315erdb/sdram.c | 7 ++ include/configs/MPC8315ERDB.h | 90 +++++++++++++++++++++++------ 6 files changed, 138 insertions(+), 19 deletions(-)
MAKEALL +1 -0
@@ -360,6 +360,7 @@ LIST_83xx=" \ MPC8313ERDB_33 \ MPC8313ERDB_NAND_66 \ MPC8315ERDB \ + MPC8315ERDB_NAND \ MPC8323ERDB \ MPC832XEMDS \ MPC832XEMDS_ATM \
Makefile +11 -0
@@ -2291,8 +2291,19 @@ MPC8313ERDB_NAND_66_config: unconfig echo "CONFIG_NAND_U_BOOT = y" >> $(obj)include/config.mk ; \ fi ; +MPC8315ERDB_NAND_config \ MPC8315ERDB_config: unconfig + if [ "$(findstring _NAND_,$@)" ] ; then \ + $(XECHO) -n "...NAND..." ; \ + echo "TEXT_BASE = 0x00100000" > \ + $(obj)board/freescale/mpc8315erdb/config.tmp ; \ + echo "#define CONFIG_NAND_U_BOOT" >>$(obj)include/config.h ; \ + ln -sf mpc8313erdb nand_spl/board/freescale/mpc8315erdb ; \ + fi ; @$(MKCONFIG) -a MPC8315ERDB ppc mpc83xx mpc8315erdb freescale + @if [ "$(findstring _NAND_,$@)" ] ; then \ + echo "CONFIG_NAND_U_BOOT = y" >> $(obj)include/config.mk ; \ + fi ; MPC8323ERDB_config: unconfig @$(MKCONFIG) -a MPC8323ERDB ppc mpc83xx mpc8323erdb freescale
board/freescale/mpc8315erdb/config.mk +6 -0
@@ -1 +1,7 @@ +ifndef NAND_SPL +sinclude $(OBJTREE)/board/$(BOARDDIR)/config.tmp +endif + +ifndef TEXT_BASE TEXT_BASE = 0xFE000000 +endif
board/freescale/mpc8315erdb/mpc8315erdb.c +42 -0
57 lines not on this page · raw message
board/freescale/mpc8315erdb/sdram.c +7 -0
@@ -54,6 +54,7 @@ static void resume_from_sleep(void)* This is useful for faster booting in configs where the RAM is unlikely * to be changed, or for things like NAND booting where space is tight. */ +#ifndef CONFIG_SYS_RAMBOOT static long fixed_sdram (void ) {volatile immap_t *im = (volatile immap_t *)CONFIG_SYS_IMMR ;
@@ -100,6 +101,12 @@ static long fixed_sdram(void) return msize; } +#else +static long fixed_sdram (void ) +{ +return CONFIG_SYS_DDR_SIZE *1024 *1024 ; +} +#endif /* CONFIG_SYS_RAMBOOT */ phys_size_t initdram (int board_type) {
include/configs/MPC8315ERDB.h +71 -19
175 lines not on this page · raw message
Signature · 1 line
1.6.3.3
PATCH 1/1 mpc83xx: Add NAND boot support for MPC8315E-RDB boards
Quoted 49 lines · Anton Vorontsov
The core support for NAND booting is there already, so this patch is pretty straightforward.
There is one trick though: top level
Makefileexpectsnand_splto 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 <[email protected]>---
MAKEALL | 1 + Makefile | 11 ++++ board/freescale/mpc8315erdb/config.mk | 6 ++ board/freescale/mpc8315erdb/mpc8315erdb.c | 42 +++++++++++++ board/freescale/mpc8315erdb/sdram.c | 7 ++ include/configs/MPC8315ERDB.h | 90 ++++++++++++++++++++ +++------ 6 files changed, 138 insertions(+), 19 deletions(-)MAKEALL +1
-0@@ -360,6 +360,7 @@ LIST_83xx=" \ MPC8313ERDB_33 \ MPC8313ERDB_NAND_66 \ MPC8315ERDB \ + MPC8315ERDB_NAND \ MPC8323ERDB \ MPC832XEMDS \ MPC832XEMDS_ATM \Makefile +1
-0@@ -2291,8 +2291,19 @@ MPC8313ERDB_NAND_66_config: unconfig echo "CONFIG_NAND_U_BOOT = y" >> $(obj)include/config.mk ; \ fi ; +MPC8315ERDB_NAND_config \
MPC8315ERDB_config: unconfigMakefile +7
-0+ if [ "$(findstring _NAND_,$@)" ] ; then \ + $(XECHO) -n "...NAND..." ; \ + echo "TEXT_BASE = 0x00100000" > \ + $(obj)board/freescale/mpc8315erdb/config.tmp ; \ + echo "#define CONFIG_NAND_U_BOOT" >>$(obj)include/config.h ; \ + ln -sf mpc8313erdb nand_spl/board/freescale/mpc8315erdb ; \ + fi ;@$(MKCONFIG) -a MPC8315ERDB ppc mpc83xx mpc8315erdb freescale
Makefile MPC8313ERDB_NAND_66_config: unconfig · line 2306
Quoted 3 lines
Makefile +3
-0+ @if [ "$(findstring _NAND_,$@)" ] ; then \ + echo "CONFIG_NAND_U_BOOT = y" >> $(obj)include/config.mk ; \ + fi ;
Use the new -t option to mkconfig.
Quoted 3 lines
MPC8323ERDB_config: unconfig@$(MKCONFIG) -a MPC8323ERDB ppc mpc83xx mpc8323erdb freescale
- k
PATCH v2 1/1 mpc83xx: Add NAND boot support for MPC8315E-RDB boards
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.
---
On Thu, Nov 19, 2009 at 01:17:36PM -0600, Kumar Gala wrote:
[...]
Quoted 6 lines
Review
Quoted 4 lines
@$(MKCONFIG) -a MPC8315ERDB ppc mpc83xx mpc8315erdb freescale(quoted diff) +3
-0+ @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(-)
MAKEALL +1 -0
@@ -360,6 +360,7 @@ LIST_83xx=" \ MPC8313ERDB_33 \ MPC8313ERDB_NAND_66 \ MPC8315ERDB \ + MPC8315ERDB_NAND \ MPC8323ERDB \ MPC832XEMDS \ MPC832XEMDS_ATM \
Makefile +5 -1
@@ -2291,8 +2291,12 @@ MPC8313ERDB_NAND_66_config: unconfig echo "CONFIG_NAND_U_BOOT = y" >> $(obj)include/config.mk ; \ fi ; +MPC8315ERDB_NAND_config \ MPC8315ERDB_config: unconfig - @$(MKCONFIG) -a MPC8315ERDB ppc mpc83xx mpc8315erdb freescale + if [ "$(findstring _NAND_,$@)" ] ; then \ + ln -sf mpc8313erdb nand_spl/board/freescale/mpc8315erdb ; \ + fi ; + @$(MKCONFIG) -t $(@:_config=) MPC8315ERDB ppc mpc83xx mpc8315erdb freescale MPC8323ERDB_config: unconfig @$(MKCONFIG) -a MPC8323ERDB ppc mpc83xx mpc8323erdb freescale
board/freescale/mpc8315erdb/config.mk +8 -0
@@ -1 +1,9 @@ +ifndef NAND_SPL +ifeq ($(CONFIG_MK_NAND), y) +TEXT_BASE = $(CONFIG_RAMBOOT_TEXT_BASE) +endif +endif + +ifndef TEXT_BASE TEXT_BASE = 0xFE000000 +endif
board/freescale/mpc8315erdb/mpc8315erdb.c +42 -0
57 lines not on this page · raw message
board/freescale/mpc8315erdb/sdram.c +7 -0
@@ -54,6 +54,7 @@ static void resume_from_sleep(void)* This is useful for faster booting in configs where the RAM is unlikely * to be changed, or for things like NAND booting where space is tight. */ +#ifndef CONFIG_SYS_RAMBOOT static long fixed_sdram (void ) {volatile immap_t *im = (volatile immap_t *)CONFIG_SYS_IMMR ;
@@ -100,6 +101,12 @@ static long fixed_sdram(void) return msize; } +#else +static long fixed_sdram (void ) +{ +return CONFIG_SYS_DDR_SIZE *1024 *1024 ; +} +#endif /* CONFIG_SYS_RAMBOOT */ phys_size_t initdram (int board_type) {
include/configs/MPC8315ERDB.h +76 -19
186 lines not on this page · raw message
Signature · 1 line
1.6.3.3
PATCH v2 1/1 mpc83xx: Add NAND boot support for MPC8315E-RDB boards
Quoted 9 lines · On Tue, 24 Nov 2009 20:12:12 +0300 Anton Vorontsov <[email protected]>…
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(-)
please add NAND boot instructions to doc/README.mpc8315erdb also.
Quoted 17 lines
MAKEALL +1
-0@@ -360,6 +360,7 @@ LIST_83xx=" \ MPC8313ERDB_33 \ MPC8313ERDB_NAND_66 \ MPC8315ERDB \ + MPC8315ERDB_NAND \ MPC8323ERDB \ MPC832XEMDS \ MPC832XEMDS_ATM \Makefile +0
-0
Makefile MPC8313ERDB_NAND_66_config: unconfig · line 2296
Quoted 7 lines
Makefile +2
-1@@ -2291,8 +2291,12 @@ MPC8313ERDB_NAND_66_config: unconfig echo "CONFIG_NAND_U_BOOT = y" >> $(obj)include/config.mk ; \ fi ; +MPC8315ERDB_NAND_config \ MPC8315ERDB_config: unconfig - @$(MKCONFIG) -a MPC8315ERDB ppc mpc83xx mpc8315erdb freescale + if [ "$(findstring _NAND_,$@)" ] ; then \
missing leading @ - s/if/@if/.
Makefile MPC8313ERDB_NAND_66_config: unconfig · line 2298
Quoted 2 lines
Makefile +2
-0+ ln -sf mpc8313erdb nand_spl/board/freescale/mpc8315erdb ; \ + fi ;
can we instead permanently rename nand_spl/board/freescale/mpc8313erdb to mpc831xerdb...argh, probably not without merging the non-NAND parts also...
Quoted 1 line
Makefile +1
-0+++ b/board/freescale/mpc8315erdb/mpc8315erdb.c
...
Makefile
Quoted 9 lines
Makefile +9
-0+void board_init_f(ulong bootflag) +{ + board_early_init_f(); + NS16550_init((NS16550_t)(CONFIG_SYS_IMMR + 0x4500), + CONFIG_SYS_NS16550_CLK / 16 / CONFIG_BAUDRATE); + puts("NAND boot... "); + init_timebase(); + initdram(0); + relocate_code(CONFIG_SYS_NAND_U_BOOT_RELOC + 0x10000, (gd_t *)gd,
use CONFIG_SYS_NAND_U_BOOT_RELOC_SP
meanwhile, 8315 NAND boot doesn't build when applied to u-boot's next branch:
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'
perhaps due to some confusion with setting CONFIG_SYS_RAMBOOT?
Kim
PATCH v3 1/1 mpc83xx: Add NAND boot support for MPC8315E-RDB boards
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.
---
Quoted 4 lines · Kim Phillips
Quoted 2 lines
include/configs/MPC8315ERDB.h | 95 +++++++++++++++++++++++------ 6 files changed, 139 insertions(+), 20 deletions(-)please add NAND boot instructions to doc/README.mpc8315erdb also.
Done.
Quoted 3 lines
Review
Quoted 1 line
(quoted diff) +1
-0+ if [ "$(findstring _NAND_,$@)" ] ; then \missing leading @ - s/if/@if/.
Fixed, thanks.
Quoted 6 lines
Review
Quoted 2 lines
(quoted diff) +2
-0+ ln -sf mpc8313erdb nand_spl/board/freescale/mpc8315erdb ; \ + fi ;can we instead permanently rename nand_spl/board/freescale/mpc8313erdb to mpc831xerdb...argh, probably not without merging the non-NAND parts also...
Yep, not that easy.
Quoted 3 lines
Review
Quoted 1 line
(quoted diff) +1
-0+ relocate_code(CONFIG_SYS_NAND_U_BOOT_RELOC + 0x10000, (gd_t *)gd,use
CONFIG_SYS_NAND_U_BOOT_RELOC_SP
Done.
Quoted 8 lines
meanwhile, 8315 NAND boot doesn't build when applied to u-boot's next branch:
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'perhaps due to some confusion with setting
CONFIG_SYS_RAMBOOT?
This is due commit 3eb90bad651fab39cffba750ec4421a9c01d60e7 ("Generic udelay() with watchdog support"). SPL code doesn't use lib_generic/time.c, so nowadays we should use __udelay().
The commit above converted MPC8313ERDB boards, but didn't do the same for 8315 (there was no need since 8315 didn't use SPL at that time).
Thanks!
MAKEALL | 1 + Makefile | 6 ++- board/freescale/mpc8315erdb/config.mk | 8 +++ board/freescale/mpc8315erdb/mpc8315erdb.c | 42 +++++++++++++ board/freescale/mpc8315erdb/sdram.c | 9 +++- doc/README.mpc8315erdb | 24 +++++++- include/configs/MPC8315ERDB.h | 96 +++++++++++++++++++++++------ 7 files changed, 163 insertions(+), 23 deletions(-)
MAKEALL +1 -0
@@ -362,6 +362,7 @@ LIST_83xx=" \ MPC8313ERDB_33 \ MPC8313ERDB_NAND_66 \ MPC8315ERDB \ + MPC8315ERDB_NAND \ MPC8323ERDB \ MPC832XEMDS \ MPC832XEMDS_ATM \
Makefile +5 -1
@@ -2294,8 +2294,12 @@ MPC8313ERDB_NAND_66_config: unconfig echo "CONFIG_NAND_U_BOOT = y" >> $(obj)include/config.mk ; \ fi ; +MPC8315ERDB_NAND_config \ MPC8315ERDB_config: unconfig - @$(MKCONFIG) -a MPC8315ERDB ppc mpc83xx mpc8315erdb freescale + @if [ "$(findstring _NAND_,$@)" ] ; then \ + ln -sf mpc8313erdb nand_spl/board/freescale/mpc8315erdb ; \ + fi ; + @$(MKCONFIG) -t $(@:_config=) MPC8315ERDB ppc mpc83xx mpc8315erdb freescale MPC8323ERDB_config: unconfig @$(MKCONFIG) -a MPC8323ERDB ppc mpc83xx mpc8323erdb freescale
board/freescale/mpc8315erdb/config.mk +8 -0
@@ -1 +1,9 @@ +ifndef NAND_SPL +ifeq ($(CONFIG_MK_NAND), y) +TEXT_BASE = $(CONFIG_RAMBOOT_TEXT_BASE) +endif +endif + +ifndef TEXT_BASE TEXT_BASE = 0xFE000000 +endif
board/freescale/mpc8315erdb/mpc8315erdb.c +42 -0
57 lines not on this page · raw message
board/freescale/mpc8315erdb/sdram.c +8 -1
@@ -54,6 +54,7 @@ static void resume_from_sleep(void)* This is useful for faster booting in configs where the RAM is unlikely * to be changed, or for things like NAND booting where space is tight. */ +#ifndef CONFIG_SYS_RAMBOOT static long fixed_sdram (void ) {volatile immap_t *im = (volatile immap_t *)CONFIG_SYS_IMMR ;
@@ -68,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 ;
@@ -100,6 +101,12 @@ static long fixed_sdram(void) return msize; } +#else +static long fixed_sdram (void ) +{ +return CONFIG_SYS_DDR_SIZE *1024 *1024 ; +} +#endif /* CONFIG_SYS_RAMBOOT */ phys_size_t initdram (int board_type) {
doc/README.mpc8315erdb +22 -2
@@ -74,7 +74,27 @@ Freescale MPC8315ERDB Board or =>run ramboot -6 Notes +6. Booting from NAND flash + +6.1 Build U-Boot + + The steps are the same as described in section "4.", but + MPC8315ERDB_NAND_config should be used instead of + MPC8315ERDB_config. + +6.2 Reflash NAND U-Boot Image using U-Boot + + tftp 100000 u-boot-nand.bin + nand erase 0 80000 + nand write 100000 0 80000 + + (The actual U-Boot size might be less than 0x80000, but you + cannot write non-page aligned data into NAND flash). + +6.3 ?onfigure the board to boot from NAND Flash + + Set S4.4 switch to ON position and S3.4 switch to OFF position. + +7 Notes - Booting from NAND flash is not yet supported. The console baudrate for MPC8315ERDB is 115200bps.
include/configs/MPC8315ERDB.h +77 -19
186 lines not on this page · raw message
Signature · 1 line
1.6.3.3
Kim Phillips
AppliedPATCH v2 1/1 mpc83xx: Add NAND boot support for MPC8315E-RDB boards
In reply to Anton VorontsovQuoted 24 lines · On Tue, 24 Nov 2009 20:12:12 +0300 Anton Vorontsov <[email protected]>…
The core support for NAND booting is there already, so this patch is pretty straightforward.
There is one trick though: top level
Makefileexpectsnand_splto 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 <[email protected]>---
On Thu, Nov 19, 2009 at 01:17:36PM -0600, Kumar Gala wrote:
[...]Quoted 6 lines
Review
Quoted 4 lines
@$(MKCONFIG) -a MPC8315ERDB ppc mpc83xx mpc8315erdb freescale(quoted diff) +3
-0+ @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.
Quoted 7 lines
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
PATCH v2 1/1 mpc83xx: Add NAND boot support for MPC8315E-RDB boards
On Thu, Jan 07, 2010 at 06:53:00PM -0600, Kim Phillips wrote:
[...]
Quoted 6 lines
applied, with the below fixes merged into the same commit.
Thanks,
Kim
Quoted 8 lines
Quoted 1 line
From
792e1ba837c2ce6a77323a92aad57dab758ba042Mon Sep 17 00:00:00 2001From: Kim Phillips <[email protected]>
Date: Thu, 7 Jan 2010 15:44:18 -0600
Subject: [PATCH] mpc83xx: minor 8315 nand boot fixeso silence make during ln echo
o update documentation
o and avoid:
Hm.. strange, you didn't receive v3 of this patch? In v3 I fixed all the issues as well:
http://lists.denx.de/pipermail/u-boot/2009-December/065435.html
Just FYI...
Thanks!
Signature · 3 lines
Anton Vorontsov email: cbouatmailru at gmail.com irc://irc.freenode.net/bd2
PATCH v2 1/1 mpc83xx: Add NAND boot support for MPC8315E-RDB boards
Quoted 2 lines · On Mon, 11 Jan 2010 14:04:17 +0300 Anton Vorontsov <[email protected]>…
Hm.. strange, you didn't receive v3 of this patch? In v3 I fixed all the issues as well:
argh, you're right, I missed that one! Too much email, man...
I'll add the trivial ...RELOC_SP definition after WD pulls the current u-boot-mpc83xx tree - but as far as the documentation goes, I'll keep the version already on the tree, if you don't mind - I consider it better and without any lack of data from the v3 patch version :P
Kim