Skip to contentSkip to conversation

Nand boot: Add nand boot support for MPC8569mds board

PATCH New Liu Yu 2 participants 3 messages Jan 18, 2010 – Jan 27, 2010 Kbuild

lore
Share & tools
lore

Liu Yu

author
#0 lore raw

PATCH v2 1/1 Nand boot: Add nand boot support for MPC8569mds board

This patch add nand boot support for MPC8569mds board.

---
v2:
change subject and commit message.

 MAKEALL                                         |    1 +
 Makefile                                        |    3 +-
 board/freescale/mpc8569mds/config.mk            |    9 ++
 board/freescale/mpc8569mds/tlb.c                |   11 ++
 include/configs/MPC8569MDS.h                    |   64 +++++++++++-
 nand_spl/board/freescale/mpc8569mds/Makefile    |  133 +++++++++++++++++++++++
 nand_spl/board/freescale/mpc8569mds/nand_boot.c |   75 +++++++++++++
 7 files changed, 292 insertions(+), 4 deletions(-)
 create mode 100644 nand_spl/board/freescale/mpc8569mds/Makefile
 create mode 100644 nand_spl/board/freescale/mpc8569mds/nand_boot.c
MAKEALL +1 -0
index a6d0f20..2b303f8 100755
@@ -403,6 +403,7 @@ LIST_85xx="		\
 	MPC8560ADS	\
 	MPC8568MDS	\
 	MPC8569MDS	\
+	MPC8569MDS_NAND \
 	MPC8572DS	\
 	MPC8572DS_36BIT	\
 	P2020DS		\
Makefile +2 -1
index 1abe64a..3e3d11b 100644
@@ -2477,8 +2477,9 @@ MPC8555CDS_config:	unconfig
 MPC8568MDS_config:	unconfig
 	@$(MKCONFIG) $(@:_config=) ppc mpc85xx mpc8568mds freescale
 
+MPC8569MDS_NAND_config \
 MPC8569MDS_config:	unconfig
-	@$(MKCONFIG) $(@:_config=) ppc mpc85xx mpc8569mds freescale
+	@$(MKCONFIG) -t $(@:_config=) MPC8569MDS ppc mpc85xx mpc8569mds freescale
 
 MPC8572DS_36BIT_config \
 MPC8572DS_config:       unconfig
board/freescale/mpc8569mds/config.mk +9 -0
index 962f79b..7de0f7c 100644
@@ -23,4 +23,13 @@
 #
 # mpc8569mds board
 #
+ifndef NAND_SPL
+ifeq ($(CONFIG_MK_NAND), y)
+TEXT_BASE = $(CONFIG_RAMBOOT_TEXT_BASE)
+LDSCRIPT := $(TOPDIR)/cpu/$(CPU)/u-boot-nand.lds
+endif
+endif
+
+ifndef TEXT_BASE
 TEXT_BASE = 0xfff80000
+endif
board/freescale/mpc8569mds/tlb.c +11 -0
index 3b8ee05..73dcc3e 100644
@@ -90,6 +90,17 @@ struct fsl_e_tlb_entry tlb_table[] = {
 	SET_TLB_ENTRY(1, CONFIG_SYS_CCSRBAR, CONFIG_SYS_CCSRBAR_PHYS,
 		      MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
 		      0, 4, BOOKE_PAGESZ_64M, 1),
+
+#if defined(CONFIG_SYS_RAMBOOT) && defined(CONFIG_SYS_INIT_L2_ADDR)
+	/* *I*G - L2SRAM */
+	SET_TLB_ENTRY(1, CONFIG_SYS_INIT_L2_ADDR, CONFIG_SYS_INIT_L2_ADDR_PHYS,
+			MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
+			0, 5, BOOKE_PAGESZ_256K, 1),
+	SET_TLB_ENTRY(1, CONFIG_SYS_INIT_L2_ADDR + 0x40000,
+			CONFIG_SYS_INIT_L2_ADDR_PHYS + 0x40000,
+			MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
+			0, 6, BOOKE_PAGESZ_256K, 1),
+#endif
 };
 
 int num_tlb_entries = ARRAY_SIZE(tlb_table);
include/configs/MPC8569MDS.h +61 -3

121 lines not on this page · raw message

nand_spl/board/freescale/mpc8569mds/Makefile new file +133 -0

133 lines not on this page · raw message

nand_spl/board/freescale/mpc8569mds/nand_boot.c new file +75 -0

75 lines not on this page · raw message

Signature · 1 line
1.6.4
#1 lore raw

PATCH v2 1/1 Nand boot: Add nand boot support for MPC8569mds board

Quoted 7 lines · Liu Yu

This patch add nand boot support for MPC8569mds board.

---
v2:
change subject and commit message.

Quoted 10 lines
 MAKEALL                                         |    1 +
 Makefile                                        |    3 +-
 board/freescale/mpc8569mds/config.mk            |    9 ++
 board/freescale/mpc8569mds/tlb.c                |   11 ++
 include/configs/MPC8569MDS.h                    |   64 +++++++++++-
 nand_spl/board/freescale/mpc8569mds/Makefile    |  133 +++++++++++++++++++++++
 nand_spl/board/freescale/mpc8569mds/nand_boot.c |   75 +++++++++++++
 7 files changed, 292 insertions(+), 4 deletions(-)
 create mode 100644 nand_spl/board/freescale/mpc8569mds/Makefile
 create mode 100644 nand_spl/board/freescale/mpc8569mds/nand_boot.c

Applied to u-boot-nand-flash

-Scott

#2 lore raw

PATCH v2 1/1 Nand boot: Add nand boot support for MPC8569mds board

In reply to Liu Yu
Quoted 35 lines · Liu Yu

This patch add nand boot support for MPC8569mds board.

---
v2:
change subject and commit message.

 MAKEALL                                         |    1 +
 Makefile                                        |    3 +-
 board/freescale/mpc8569mds/config.mk            |    9 ++
 board/freescale/mpc8569mds/tlb.c                |   11 ++
 include/configs/MPC8569MDS.h                    |   64 +++++++++++-
 nand_spl/board/freescale/mpc8569mds/Makefile    |  133 +++++++++++++++++++++++
 nand_spl/board/freescale/mpc8569mds/nand_boot.c |   75 +++++++++++++
 7 files changed, 292 insertions(+), 4 deletions(-)
 create mode 100644 nand_spl/board/freescale/mpc8569mds/Makefile
 create mode 100644 nand_spl/board/freescale/mpc8569mds/nand_boot.c
MAKEALL +1 -0
index a6d0f20..2b303f8 100755
@@ -403,6 +403,7 @@ LIST_85xx="		\
 	MPC8560ADS	\
 	MPC8568MDS	\
 	MPC8569MDS	\
+	MPC8569MDS_NAND \
 	MPC8572DS	\
 	MPC8572DS_36BIT	\
 	P2020DS		\
Makefile +0 -0
index 1abe64a..3e3d11b 100644

Makefile MPC8555CDS_config: unconfig · line 2482

Quoted 7 lines
Makefile +2 -1
@@ -2477,8 +2477,9 @@ MPC8555CDS_config:	unconfig
 MPC8568MDS_config:	unconfig
 	@$(MKCONFIG) $(@:_config=) ppc mpc85xx mpc8568mds freescale
 
+MPC8569MDS_NAND_config \
 MPC8569MDS_config:	unconfig
-	@$(MKCONFIG) $(@:_config=) ppc mpc85xx mpc8569mds freescale
+	@$(MKCONFIG) -t $(@:_config=) MPC8569MDS ppc mpc85xx mpc8569mds freescale

An MPC8569MDS_ATM target has been merged upstream. I'll merge this as is, but I recommend adding (and testing) a config that supports both NAND and ATM, unless that is an impossible config for whatever reason.

You may want to consider doing something like this:
# Options: NAND ATM
MPC8569MDS%config: unconfig

	@$(MKCONFIG) -t $(@:_config=) MPC8569MDS ppc mpc85xx mpc8569mds freescale

BTW, I get this when building MPC8569 (either base or ATM, but not NAND, and not new with this patch) with gcc 4.2.1 and binutils 2.18 (but not gcc 4.0.2 and binutils 2.16.1):

powerpc-linux-ld: u-boot: section `.text' can't be allocated in segment 0
powerpc-linux-ld: final link failed: Bad value

If I compile with the bad toolchain but link with the good one, it works, so it seems to be a binutils/linker script issue, not a code size issue.

It seems to be related to not overriding RESET_VECTOR_ADDRESS, and thus having the BSS at zero (or rather, 0x10). mpc8544ds mpc8548cds also don't do this, and I see the same problem there, but I don't see it on e.g. mpc8572ds or p2020ds which do.

-Scott