Re: [U-Boot] [PATCH v2] powerpc/85xx: Add support for booting from NAND on MPC8572DS

2010-11-30 Thread Scott Wood
On Mon, 29 Nov 2010 14:35:07 -0600
Kumar Gala ga...@kernel.crashing.org wrote:

 diff --git a/boards.cfg b/boards.cfg
 index 2209676..a994c8a 100644
 --- a/boards.cfg
 +++ b/boards.cfg
 @@ -472,6 +472,7 @@ MPC8569MDS_ATM   powerpc mpc85xx 
 mpc8569mds  freesca
  MPC8569MDS_NAND  powerpc mpc85xx mpc8569mds  
 freescale  -   MPC8569MDS:NAND
  MPC8572DSpowerpc mpc85xx mpc8572ds   
 freescale  -   MPC8572DS
  MPC8572DS_36BIT  powerpc mpc85xx mpc8572ds   
 freescale  -   MPC8572DS:36BIT
 +MPC8572DS_NAND   powerpc mpc85xx mpc8572ds   
 freescale  -   MPC8572DS:NAND

No MPC8572DS_36BIT_NAND?

-Scott

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


Re: [U-Boot] [PATCH v2] powerpc/85xx: Add support for booting from NAND on MPC8572DS

2010-11-30 Thread Kumar Gala

On Nov 30, 2010, at 2:21 PM, Scott Wood wrote:

 On Mon, 29 Nov 2010 14:35:07 -0600
 Kumar Gala ga...@kernel.crashing.org wrote:
 
 diff --git a/boards.cfg b/boards.cfg
 index 2209676..a994c8a 100644
 --- a/boards.cfg
 +++ b/boards.cfg
 @@ -472,6 +472,7 @@ MPC8569MDS_ATM   powerpc mpc85xx 
 mpc8569mds  freesca
 MPC8569MDS_NAND  powerpc mpc85xx mpc8569mds  
 freescale  -   MPC8569MDS:NAND
 MPC8572DSpowerpc mpc85xx mpc8572ds   
 freescale  -   MPC8572DS
 MPC8572DS_36BIT  powerpc mpc85xx mpc8572ds   
 freescale  -   MPC8572DS:36BIT
 +MPC8572DS_NAND   powerpc mpc85xx mpc8572ds   
 freescale  -   MPC8572DS:NAND
 
 No MPC8572DS_36BIT_NAND?

Not yet, I tried adding one and need to cleanup some other code to reduce the 
spl size to fit and also figure out why we don't seem to boot.

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


[U-Boot] [PATCH v2] powerpc/85xx: Add support for booting from NAND on MPC8572DS

2010-11-29 Thread Kumar Gala
Mimic support that exists on MPC8536DS on the MPC8572DS to allow booting
from NAND.

Signed-off-by: Jin Qing b24...@freescale.com
Signed-off-by: Kumar Gala ga...@kernel.crashing.org
---
* Removed CONFIG_SYS_SPL as its not used and copied for older code

 board/freescale/mpc8572ds/config.mk|6 +
 board/freescale/mpc8572ds/tlb.c|   14 +++-
 boards.cfg |1 +
 include/configs/MPC8572DS.h|  115 ++---
 nand_spl/board/freescale/mpc8572ds/Makefile|  133 
 nand_spl/board/freescale/mpc8572ds/nand_boot.c |   82 +++
 6 files changed, 335 insertions(+), 16 deletions(-)
 create mode 100644 nand_spl/board/freescale/mpc8572ds/Makefile
 create mode 100644 nand_spl/board/freescale/mpc8572ds/nand_boot.c

diff --git a/board/freescale/mpc8572ds/config.mk 
b/board/freescale/mpc8572ds/config.mk
index 5413921..6cea41c 100644
--- a/board/freescale/mpc8572ds/config.mk
+++ b/board/freescale/mpc8572ds/config.mk
@@ -23,4 +23,10 @@
 #
 # mpc8572ds board
 #
+ifndef NAND_SPL
+ifeq ($(CONFIG_NAND), y)
+LDSCRIPT := $(TOPDIR)/$(CPUDIR)/u-boot-nand.lds
+endif
+endif
+
 RESET_VECTOR_ADDRESS = 0xeffc
diff --git a/board/freescale/mpc8572ds/tlb.c b/board/freescale/mpc8572ds/tlb.c
index 6a2a0b5..575bdb5 100644
--- a/board/freescale/mpc8572ds/tlb.c
+++ b/board/freescale/mpc8572ds/tlb.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2008 Freescale Semiconductor, Inc.
+ * Copyright 2008-2010 Freescale Semiconductor, Inc.
  *
  * (C) Copyright 2000
  * Wolfgang Denk, DENX Software Engineering, w...@denx.de.
@@ -85,6 +85,18 @@ struct fsl_e_tlb_entry tlb_table[] = {
SET_TLB_ENTRY(1, PIXIS_BASE, PIXIS_BASE_PHYS,
  MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
  0, 8, BOOKE_PAGESZ_4K, 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, 9, BOOKE_PAGESZ_256K, 1),
+   SET_TLB_ENTRY(1, CONFIG_SYS_INIT_L2_ADDR + 0x4,
+   CONFIG_SYS_INIT_L2_ADDR_PHYS + 0x4,
+   MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
+   0, 10, BOOKE_PAGESZ_256K, 1),
+#endif
 };
 
 int num_tlb_entries = ARRAY_SIZE(tlb_table);
diff --git a/boards.cfg b/boards.cfg
index 2209676..a994c8a 100644
--- a/boards.cfg
+++ b/boards.cfg
@@ -472,6 +472,7 @@ MPC8569MDS_ATM   powerpc mpc85xx 
mpc8569mds  freesca
 MPC8569MDS_NAND  powerpc mpc85xx mpc8569mds  
freescale  -   MPC8569MDS:NAND
 MPC8572DSpowerpc mpc85xx mpc8572ds   
freescale  -   MPC8572DS
 MPC8572DS_36BIT  powerpc mpc85xx mpc8572ds   
freescale  -   MPC8572DS:36BIT
+MPC8572DS_NAND   powerpc mpc85xx mpc8572ds   
freescale  -   MPC8572DS:NAND
 P1011RDB powerpc mpc85xx p1_p2_rdb   
freescale  -   P1_P2_RDB:P1011
 P1011RDB_NANDpowerpc mpc85xx p1_p2_rdb   
freescale  -   P1_P2_RDB:P1011,NAND
 P1011RDB_SDCARD  powerpc mpc85xx p1_p2_rdb   
freescale  -   P1_P2_RDB:P1011,SDCARD
diff --git a/include/configs/MPC8572DS.h b/include/configs/MPC8572DS.h
index 1ee95ae..9d2e209 100644
--- a/include/configs/MPC8572DS.h
+++ b/include/configs/MPC8572DS.h
@@ -33,6 +33,25 @@
 #define CONFIG_PHYS_64BIT
 #endif
 
+#ifdef CONFIG_NAND
+#define CONFIG_NAND_U_BOOT
+#define CONFIG_RAMBOOT_NAND
+#ifdef CONFIG_NAND_SPL
+#define CONFIG_SYS_TEXT_BASE_SPL 0xfff0
+#define CONFIG_SYS_MONITOR_BASECONFIG_SYS_TEXT_BASE_SPL /* start of 
monitor */
+#else
+#define CONFIG_SYS_TEXT_BASE   0xf8f82000
+#endif /* CONFIG_NAND_SPL */
+#endif
+
+#ifndef CONFIG_SYS_TEXT_BASE
+#define CONFIG_SYS_TEXT_BASE   0xeff8
+#endif
+
+#ifndef CONFIG_SYS_MONITOR_BASE
+#define CONFIG_SYS_MONITOR_BASECONFIG_SYS_TEXT_BASE/* start of 
monitor */
+#endif
+
 /* High Level Configuration Options */
 #define CONFIG_BOOKE   1   /* BOOKE */
 #define CONFIG_E5001   /* BOOKE e500 family */
@@ -41,10 +60,6 @@
 #define CONFIG_MPC8572DS   1
 #define CONFIG_MP  1   /* support multiple processors */
 
-#ifndef CONFIG_SYS_TEXT_BASE
-#define CONFIG_SYS_TEXT_BASE   0xeff8
-#endif
-
 #define CONFIG_FSL_ELBC1   /* Has Enhanced localbus 
controller */
 #define CONFIG_PCI 1   /* Enable PCI/PCIE */
 #define CONFIG_PCIE1   1   /* PCIE controler 1 (slot 1) */
@@ -81,10 +96,21 @@
 #define CONFIG_PANIC_HANG  /* do not reset board on panic */
 
 /*
+ * Config the L2 Cache as L2 SRAM
+ */
+#define