Skip to contentSkip to conversation

powerpc/85xx: Integrated Flash Controller NAND support

PATCH New Kumar Gala 2 participants 2 messages Apr 9, 2011 – Apr 15, 2011

Subsystems (3)
lore
Share & tools
lore

Kumar Gala

author
#0 lore raw

PATCH 1/1 powerpc/85xx: Integrated Flash Controller NAND support

From: Dipen Dudhat <[email protected]>

Add nand_spl and 8-bit NAND support on IFC controller.

---
 arch/powerpc/cpu/mpc85xx/cpu_init_nand.c     |   10 +
 arch/powerpc/cpu/mpc85xx/u-boot-nand_spl.lds |   18 +-
 drivers/mtd/nand/Makefile                    |    1 +
 drivers/mtd/nand/fsl_ifc_nand.c              |  635 ++++++++++++++++++++++++++
 nand_spl/nand_boot_fsl_ifc.c                 |  222 +++++++++
 5 files changed, 883 insertions(+), 3 deletions(-)
 create mode 100644 drivers/mtd/nand/fsl_ifc_nand.c
 create mode 100644 nand_spl/nand_boot_fsl_ifc.c
arch/powerpc/cpu/mpc85xx/cpu_init_nand.c +10 -0
index 920bb47..4f98e0e 100644
@@ -21,10 +21,12 @@
  */
 
 #include <common.h>
+#include <asm/fsl_ifc.h>
 #include <asm/io.h>
 
 void cpu_init_f(void)
 {
+#ifdef CONFIG_FSL_LBC
 	fsl_lbc_t *lbc = LBC_BASE_ADDR;
 
 	/*
@@ -39,6 +41,14 @@ void cpu_init_f(void)
 #else
 #error  CONFIG_SYS_NAND_BR_PRELIM, CONFIG_SYS_NAND_OR_PRELIM must be defined
 #endif
+#endif
+#ifdef CONFIG_FSL_IFC
+#if defined(CONFIG_SYS_CSPR0) && defined(CONFIG_SYS_CSOR0)
+	set_ifc_cspr(IFC_CS0, CONFIG_SYS_CSPR0);
+	set_ifc_amask(IFC_CS0, CONFIG_SYS_AMASK0);
+	set_ifc_csor(IFC_CS0, CONFIG_SYS_CSOR0);
+#endif
+#endif
 
 #if defined(CONFIG_SYS_RAMBOOT) && defined(CONFIG_SYS_INIT_L2_ADDR)
 	ccsr_l2cache_t *l2cache = (void *)CONFIG_SYS_MPC85xx_L2_ADDR;
arch/powerpc/cpu/mpc85xx/u-boot-nand_spl.lds +15 -3
index 8410bd7..852f9aa 100644
@@ -23,6 +23,8 @@
  * MA 02111-1307 USA
  */
 
+#include "config.h"	/* CONFIG_BOARDDIR */
+
 OUTPUT_ARCH(powerpc)
 SECTIONS
 {
@@ -52,8 +54,18 @@ SECTIONS
 	. = ALIGN(8);
 	__init_begin = .;
 	__init_end = .;
-
-	.resetvec ADDR(.text) + 0xffc : {
+#if defined(CONFIG_FSL_IFC) /* Restrict bootpg at 4K boundry for IFC */
+	.bootpg ADDR(.text) + 0x1000 :
+	{
+		start.o	(.bootpg)
+	}
+#define RESET_VECTOR_OFFSET 0x1ffc /* IFC has 8K sram */
+#elif defined(CONFIG_FSL_ELBC)
+#define RESET_VECTOR_OFFSET 0xffc /* LBC has 4k sram */
+#else
+#error unknown NAND controller
+#endif
+	.resetvec ADDR(.text) + RESET_VECTOR_OFFSET : {
 		KEEP(*(.resetvec))
 	} = 0xffff
 
@@ -64,4 +76,4 @@ SECTIONS
 	}
 	__bss_end__ = .;
 }
-ASSERT(__init_end <= 0xfff00ffc, "NAND bootstrap too big");
+ASSERT(__init_end <= (0xfff00000 + RESET_VECTOR_OFFSET), "NAND bootstrap too big");
drivers/mtd/nand/Makefile +1 -0
index 8b598f6..3353dcd 100644
@@ -37,6 +37,7 @@ COBJS-$(CONFIG_NAND_ATMEL) += atmel_nand.o
 COBJS-$(CONFIG_DRIVER_NAND_BFIN) += bfin_nand.o
 COBJS-$(CONFIG_NAND_DAVINCI) += davinci_nand.o
 COBJS-$(CONFIG_NAND_FSL_ELBC) += fsl_elbc_nand.o
+COBJS-$(CONFIG_NAND_FSL_IFC) += fsl_ifc_nand.o
 COBJS-$(CONFIG_NAND_FSL_UPM) += fsl_upm.o
 COBJS-$(CONFIG_NAND_KB9202) += kb9202_nand.o
 COBJS-$(CONFIG_NAND_KIRKWOOD) += kirkwood_nand.o
drivers/mtd/nand/fsl_ifc_nand.c new file +635 -0

635 lines not on this page · raw message

nand_spl/nand_boot_fsl_ifc.c new file +222 -0

222 lines not on this page · raw message

Signature · 1 line
1.7.3.4
#1 lore raw

PATCH 1/1 powerpc/85xx: Integrated Flash Controller NAND support

Quoted 6 lines · Kumar Gala

From: Dipen Dudhat <[email protected]>

Add nand_spl and 8-bit NAND support on IFC controller.

Quoted 9 lines
---
 arch/powerpc/cpu/mpc85xx/cpu_init_nand.c     |   10 +
 arch/powerpc/cpu/mpc85xx/u-boot-nand_spl.lds |   18 +-
 drivers/mtd/nand/Makefile                    |    1 +
 drivers/mtd/nand/fsl_ifc_nand.c              |  635 ++++++++++++++++++++++++++
 nand_spl/nand_boot_fsl_ifc.c                 |  222 +++++++++
 5 files changed, 883 insertions(+), 3 deletions(-)
 create mode 100644 drivers/mtd/nand/fsl_ifc_nand.c
 create mode 100644 nand_spl/nand_boot_fsl_ifc.c

Is there a patch to add a board that selects this driver?

Wolfgang tends to not like code that gets added without something in boards.cfg using it -- and I can't easily check that it builds.

Also please check line length.

-Scott