Skip to contentSkip to conversation

powerpc/mpc85xx: new SPL support for IFC NAND

PATCH Superseded Prabhakar Kushwaha 2 participants 7 messages Mar 22, 2013 – Apr 9, 2013

Subsystems (3)

v2 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 2/5 powerpc/mpc85xx: new SPL support for IFC NAND

Linker script is not able find start.o binary. So add its absolute path in u-boot-spl.lds. This change is similar to u-boot-nand.lds

common/Makefile: Avoid compiling unnecssary files

fsl_ifc_spl.c : It is is responsible for reading u-boot binary from NAND flash and copying into DDR. It also transfer cotrol from NAND SPL to u-boot image present in DDR.

---
Based upon git://git.denx.de/u-boot.git branch master

Changes for v2: Sending as it is

 arch/powerpc/cpu/mpc85xx/u-boot-spl.lds |    2 +-
 board/freescale/common/Makefile         |   10 ++
 drivers/mtd/nand/Makefile               |    1 +
 drivers/mtd/nand/fsl_ifc_spl.c          |  258 +++++++++++++++++++++++++++++++
 4 files changed, 270 insertions(+), 1 deletion(-)
 create mode 100644 drivers/mtd/nand/fsl_ifc_spl.c
arch/powerpc/cpu/mpc85xx/u-boot-spl.lds +1 -1
index f2b7bff..cf6fa7c 100644
@@ -60,7 +60,7 @@ SECTIONS
 #if defined(CONFIG_FSL_IFC) /* Restrict bootpg at 4K boundry for IFC */
 	.bootpg ADDR(.text) + 0x1000 :
 	{
-		start.o	(.bootpg)
+		arch/powerpc/cpu/mpc85xx/start.o (.bootpg)
 	}
 #define RESET_VECTOR_OFFSET 0x1ffc /* IFC has 8K sram */
 #elif defined(CONFIG_FSL_ELBC)
board/freescale/common/Makefile +10 -0
index 75725b4..a4d521c 100644
@@ -29,6 +29,15 @@ endif
 
 LIB	= $(obj)libfreescale.o
 
+MINIMAL=
+
+ifdef CONFIG_SPL_BUILD
+ifdef CONFIG_SPL_INIT_MINIMAL
+MINIMAL=y
+endif
+endif
+
+ifndef MINIMAL
 COBJS-$(CONFIG_FSL_CADMUS)	+= cadmus.o
 COBJS-$(CONFIG_FSL_VIA)		+= cds_via.o
 COBJS-$(CONFIG_FMAN_ENET)	+= fman.o
@@ -62,6 +71,7 @@ SUBLIB-$(CONFIG_P3041DS)	+= p_corenet/libp_corenet.o
 SUBLIB-$(CONFIG_P4080DS)	+= p_corenet/libp_corenet.o
 SUBLIB-$(CONFIG_P5020DS)	+= p_corenet/libp_corenet.o
 SUBLIB-$(CONFIG_P5040DS)	+= p_corenet/libp_corenet.o
+endif
 
 SRCS	:= $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
 OBJS	:= $(addprefix $(obj),$(COBJS-y))
drivers/mtd/nand/Makefile +1 -0
index c77c0c4..9d7deb8 100644
@@ -82,6 +82,7 @@ COBJS-$(CONFIG_NAND_PLAT) += nand_plat.o
 else  # minimal SPL drivers
 
 COBJS-$(CONFIG_NAND_FSL_ELBC) += fsl_elbc_spl.o
+COBJS-$(CONFIG_NAND_FSL_IFC) += fsl_ifc_spl.o
 
 endif # drivers
 endif # nand
drivers/mtd/nand/fsl_ifc_spl.c new file +258 -0

258 lines not on this page · raw message

Signature · 1 line
1.7.9.5
#1 lore raw

PATCH v2 2/5 powerpc/mpc85xx: new SPL support for IFC NAND

Quoted 28 lines · Prabhakar Kushwaha
board/freescale/common/Makefile +9 -0
index 75725b4..a4d521c 100644
@@ -29,6 +29,15 @@ endif
 
 LIB	= $(obj)libfreescale.o
 
+MINIMAL=
+
+ifdef CONFIG_SPL_BUILD
+ifdef CONFIG_SPL_INIT_MINIMAL
+MINIMAL=y
+endif
+endif
+
+ifndef MINIMAL
 COBJS-$(CONFIG_FSL_CADMUS)	+= cadmus.o
 COBJS-$(CONFIG_FSL_VIA)		+= cds_via.o
 COBJS-$(CONFIG_FMAN_ENET)	+= fman.o
@@ -62,6 +71,7 @@ SUBLIB-$(CONFIG_P3041DS)	+=  

p_corenet/libp_corenet.o
SUBLIB-$(CONFIG_P4080DS) += p_corenet/libp_corenet.o
SUBLIB-$(CONFIG_P5020DS) += p_corenet/libp_corenet.o
SUBLIB-$(CONFIG_P5040DS) += p_corenet/libp_corenet.o
+endif

Quoted 2 lines

SRCS := $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
OBJS := $(addprefix $(obj),$(COBJS-y))

If this is needed to avoid pulling in any files from this directory, why did p1_p2_rdb_pc not need this? Is there a particular file that is failing to build or failing to get optimized away?

-Scott

#2 lore raw

PATCH v2 2/5 powerpc/mpc85xx: new SPL support for IFC NAND

Quoted 29 lines · Scott Wood
Quoted 28 lines · Prabhakar Kushwaha
board/freescale/common/Makefile +9 -0
index 75725b4..a4d521c 100644
@@ -29,6 +29,15 @@ endif
 
 LIB    = $(obj)libfreescale.o
 
+MINIMAL=
+
+ifdef CONFIG_SPL_BUILD
+ifdef CONFIG_SPL_INIT_MINIMAL
+MINIMAL=y
+endif
+endif
+
+ifndef MINIMAL
 COBJS-$(CONFIG_FSL_CADMUS)    += cadmus.o
 COBJS-$(CONFIG_FSL_VIA)        += cds_via.o
 COBJS-$(CONFIG_FMAN_ENET)    += fman.o
@@ -62,6 +71,7 @@ SUBLIB-$(CONFIG_P3041DS)    += 

p_corenet/libp_corenet.o

 SUBLIB-$(CONFIG_P4080DS)    += p_corenet/libp_corenet.o
 SUBLIB-$(CONFIG_P5020DS)    += p_corenet/libp_corenet.o
 SUBLIB-$(CONFIG_P5040DS)    += p_corenet/libp_corenet.o

+endif

Quoted 6 lines
Quoted 2 lines

SRCS := $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
OBJS := $(addprefix $(obj),$(COBJS-y))

If this is needed to avoid pulling in any files from this directory, why did p1_p2_rdb_pc not need this? Is there a particular file that is failing to build or failing to get optimized away

I cannot avoid this directory :(.
because new SPL compile this directory even after undef QIXIS defines

#ifndef CONFIG_SPL_BUILD
#define CONFIG_FSL_QIXIS
#endif

make[3]: Leaving directory `/home/b32579/Workspace/MERGE/OPENSRC/U-BOOT/u-boot/board/freescale/bsc9132qds'
make -C
/home/b32579/Workspace/MERGE/OPENSRC/U-BOOT/u-boot/board/freescale/common/
make[3]: Entering directory `/home/b32579/Workspace/MERGE/OPENSRC/U-BOOT/u-boot/board/freescale/common'
--
-- /opt/freescale/usr/local/gcc-4.5.55-eglibc-2.11.55/powerpc-linux-gnu/bin/powerpc-linux-gnu-gcc
-g -Os -fpic -mrelocatable -ffunction-sections -fdata-sections -meabi
-D__KERNEL__ -ffunction-sections -fdata-sections
-DCONFIG_SYS_TEXT_BASE=0x00201000 -DCONFIG_SPL_TEXT_BASE=0xFFFFE000
-DCONFIG_SPL_BUILD
-I/home/b32579/Workspace/MERGE/OPENSRC/U-BOOT/u-boot/include
-fno-builtin -ffreestanding -nostdinc -isystem /opt/freescale/usr/local/gcc-4.5.55-eglibc-2.11.55/powerpc-linux-gnu/lib/gcc/powerpc-linux-gnu/4.5.1/include -pipe -DCONFIG_PPC -D__powerpc__ -ffixed-r2 -Wa,-me500 -msoft-float
-mno-string -mspe=yes -mno-spe -Wall -Wstrict-prototypes
-fno-stack-protector -Wno-format-nonliteral -Wno-format-security -o
/home/b32579/Workspace/MERGE/OPENSRC/U-BOOT/u-boot/spl/board/freescale/common/qixis.o qixis.c -c
qixis.c: In function 'qixis_read':
---
qixis.c:36:20: error: 'QIXIS_BASE' undeclared (first use in this function)
qixis.c:36:20: note: each undeclared identifier is reported only once
for each function it appears in
make: *** [BSC9132QDS_NAND_DDRCLK133] Error 2

Regards,
Prabhakar

#3 lore raw

PATCH v2 2/5 powerpc/mpc85xx: new SPL support for IFC NAND

Quoted 37 lines · Prabhakar Kushwaha
Quoted 29 lines · Scott Wood
Quoted 28 lines · Prabhakar Kushwaha
board/freescale/common/Makefile +9 -0
index 75725b4..a4d521c 100644
@@ -29,6 +29,15 @@ endif
 
 LIB    = $(obj)libfreescale.o
 
+MINIMAL=
+
+ifdef CONFIG_SPL_BUILD
+ifdef CONFIG_SPL_INIT_MINIMAL
+MINIMAL=y
+endif
+endif
+
+ifndef MINIMAL
 COBJS-$(CONFIG_FSL_CADMUS)    += cadmus.o
 COBJS-$(CONFIG_FSL_VIA)        += cds_via.o
 COBJS-$(CONFIG_FMAN_ENET)    += fman.o
@@ -62,6 +71,7 @@ SUBLIB-$(CONFIG_P3041DS)    +=  

p_corenet/libp_corenet.o

 SUBLIB-$(CONFIG_P4080DS)    += p_corenet/libp_corenet.o
 SUBLIB-$(CONFIG_P5020DS)    += p_corenet/libp_corenet.o
 SUBLIB-$(CONFIG_P5040DS)    += p_corenet/libp_corenet.o

+endif

Quoted 6 lines
Quoted 2 lines

SRCS := $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
OBJS := $(addprefix $(obj),$(COBJS-y))

If this is needed to avoid pulling in any files from this directory, why did p1_p2_rdb_pc not need this? Is there a particular file that is failing to build or failing to get optimized away

Quoted 6 lines

I cannot avoid this directory :(.
because new SPL compile this directory even after undef QIXIS defines

#ifndef CONFIG_SPL_BUILD
#define CONFIG_FSL_QIXIS
#endif

Yeah, the makefiles never see CONFIG_SPL_BUILD -- it only works for C code.

The P1022 SPL patch just does this in the makefile:

+ifndef CONFIG_SPL_BUILD
COBJS-$(CONFIG_FSL_NGPIXIS) += ngpixis.o
+endif

...which is less intrusive. We can revisit it if we end up actually needing pixis/qixis inside an SPL.

-Scott

#4 lore raw

PATCH v2 2/5 powerpc/mpc85xx: new SPL support for IFC NAND

Quoted 54 lines · Scott Wood
Quoted 37 lines · Prabhakar Kushwaha
Quoted 29 lines · Scott Wood
Quoted 28 lines · Prabhakar Kushwaha
board/freescale/common/Makefile +9 -0
index 75725b4..a4d521c 100644
@@ -29,6 +29,15 @@ endif
 
 LIB    = $(obj)libfreescale.o
 
+MINIMAL=
+
+ifdef CONFIG_SPL_BUILD
+ifdef CONFIG_SPL_INIT_MINIMAL
+MINIMAL=y
+endif
+endif
+
+ifndef MINIMAL
 COBJS-$(CONFIG_FSL_CADMUS)    += cadmus.o
 COBJS-$(CONFIG_FSL_VIA)        += cds_via.o
 COBJS-$(CONFIG_FMAN_ENET)    += fman.o
@@ -62,6 +71,7 @@ SUBLIB-$(CONFIG_P3041DS)    += 

p_corenet/libp_corenet.o

 SUBLIB-$(CONFIG_P4080DS)    += p_corenet/libp_corenet.o
 SUBLIB-$(CONFIG_P5020DS)    += p_corenet/libp_corenet.o
 SUBLIB-$(CONFIG_P5040DS)    += p_corenet/libp_corenet.o

+endif

Quoted 6 lines
Quoted 2 lines

SRCS := $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
OBJS := $(addprefix $(obj),$(COBJS-y))

If this is needed to avoid pulling in any files from this directory, why did p1_p2_rdb_pc not need this? Is there a particular file that is failing to build or failing to get optimized away

Quoted 6 lines

I cannot avoid this directory :(.
because new SPL compile this directory even after undef QIXIS defines

#ifndef CONFIG_SPL_BUILD
#define CONFIG_FSL_QIXIS
#endif

Yeah, the makefiles never see CONFIG_SPL_BUILD -- it only works for C code.

The P1022 SPL patch just does this in the makefile:

(quoted diff) +2 -0
+ifndef CONFIG_SPL_BUILD
 COBJS-$(CONFIG_FSL_NGPIXIS)    += ngpixis.o
+endif
Quoted 2 lines

...which is less intrusive. We can revisit it if we end up actually needing pixis/qixis inside an SP

Only putting qixis.c in ifndef CONFIG_SPI_BUILD may not work for 9132QDS. following change is also required i.e. to put CONFIG_ID_EEPROM in ifndef CONFIG_SPI_BUILD

+ifndef CONFIG_SPL_BUILD

  COBJS-$(CONFIG_FSL_QIXIS)    += qixis.o
-COBJS-$(CONFIG_PQ_MDS_PIB)    += pq-mds-pib.o
  COBJS-$(CONFIG_ID_EEPROM)    += sys_eeprom.o

+endif
+COBJS-$(CONFIG_PQ_MDS_PIB) += pq-mds-pib.o

It will be good to have original patch which do not compile any file for SPL. if any file needs to be compiled for SPL, it can be added in ifdef MINIMAL.

If we follow "ifndef CONFIG_SPL_BUILD" way, one has to add required define one by one for required platforms supporting SPL. It eventually may become equal to my original patch. (just guessing, it may never happen)

Regards,
Prabhakar

#5 lore raw

PATCH v2 2/5 powerpc/mpc85xx: new SPL support for IFC NAND

Quoted 71 lines · Prabhakar Kushwaha
Quoted 56 lines · Scott Wood
Quoted 38 lines · Prabhakar Kushwaha
Quoted 29 lines · Scott Wood
Quoted 28 lines · Prabhakar Kushwaha
board/freescale/common/Makefile +9 -0
index 75725b4..a4d521c 100644
@@ -29,6 +29,15 @@ endif
 
 LIB    = $(obj)libfreescale.o
 
+MINIMAL=
+
+ifdef CONFIG_SPL_BUILD
+ifdef CONFIG_SPL_INIT_MINIMAL
+MINIMAL=y
+endif
+endif
+
+ifndef MINIMAL
 COBJS-$(CONFIG_FSL_CADMUS)    += cadmus.o
 COBJS-$(CONFIG_FSL_VIA)        += cds_via.o
 COBJS-$(CONFIG_FMAN_ENET)    += fman.o
@@ -62,6 +71,7 @@ SUBLIB-$(CONFIG_P3041DS)    +=  

p_corenet/libp_corenet.o

 SUBLIB-$(CONFIG_P4080DS)    += p_corenet/libp_corenet.o
 SUBLIB-$(CONFIG_P5020DS)    += p_corenet/libp_corenet.o
 SUBLIB-$(CONFIG_P5040DS)    += p_corenet/libp_corenet.o

+endif

Quoted 7 lines
Quoted 2 lines

SRCS := $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
OBJS := $(addprefix $(obj),$(COBJS-y))

If this is needed to avoid pulling in any files from this directory, why did p1_p2_rdb_pc not need this? Is there a particular file that is failing to build or failing to get optimized away

Quoted 7 lines

I cannot avoid this directory :(.
because new SPL compile this directory even after undef QIXIS defines

#ifndef CONFIG_SPL_BUILD
#define CONFIG_FSL_QIXIS
#endif

Yeah, the makefiles never see CONFIG_SPL_BUILD -- it only works for C code.

The P1022 SPL patch just does this in the makefile:

(quoted diff) +2 -0
+ifndef CONFIG_SPL_BUILD
 COBJS-$(CONFIG_FSL_NGPIXIS)    += ngpixis.o
+endif
Quoted 2 lines

...which is less intrusive. We can revisit it if we end up actually needing pixis/qixis inside an SP

Only putting qixis.c in ifndef CONFIG_SPI_BUILD may not work for 9132QDS. following change is also required i.e. to put CONFIG_ID_EEPROM in ifndef CONFIG_SPI_BUILD

(quoted diff) +3 -1
+ifndef CONFIG_SPL_BUILD
 COBJS-$(CONFIG_FSL_QIXIS)    += qixis.o
-COBJS-$(CONFIG_PQ_MDS_PIB)    += pq-mds-pib.o
 COBJS-$(CONFIG_ID_EEPROM)    += sys_eeprom.o
+endif
+COBJS-$(CONFIG_PQ_MDS_PIB)    += pq-mds-pib.o
Quoted 3 lines

It will be good to have original patch which do not compile any file for SPL. if any file needs to be compiled for SPL, it can be added in ifdef MINIMAL.

OK.

-Scott

#6 lore raw

PATCH v2 2/5 powerpc/mpc85xx: new SPL support for IFC NAND

In reply to Scott Wood
Quoted 54 lines · Scott Wood
Quoted 37 lines · Prabhakar Kushwaha
Quoted 29 lines · Scott Wood
Quoted 28 lines · Prabhakar Kushwaha
board/freescale/common/Makefile +9 -0
index 75725b4..a4d521c 100644
@@ -29,6 +29,15 @@ endif
 
 LIB    = $(obj)libfreescale.o
 
+MINIMAL=
+
+ifdef CONFIG_SPL_BUILD
+ifdef CONFIG_SPL_INIT_MINIMAL
+MINIMAL=y
+endif
+endif
+
+ifndef MINIMAL
 COBJS-$(CONFIG_FSL_CADMUS)    += cadmus.o
 COBJS-$(CONFIG_FSL_VIA)        += cds_via.o
 COBJS-$(CONFIG_FMAN_ENET)    += fman.o
@@ -62,6 +71,7 @@ SUBLIB-$(CONFIG_P3041DS)    += 

p_corenet/libp_corenet.o

 SUBLIB-$(CONFIG_P4080DS)    += p_corenet/libp_corenet.o
 SUBLIB-$(CONFIG_P5020DS)    += p_corenet/libp_corenet.o
 SUBLIB-$(CONFIG_P5040DS)    += p_corenet/libp_corenet.o

+endif

Quoted 6 lines
Quoted 2 lines

SRCS := $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
OBJS := $(addprefix $(obj),$(COBJS-y))

If this is needed to avoid pulling in any files from this directory, why did p1_p2_rdb_pc not need this? Is there a particular file that is failing to build or failing to get optimized away

Quoted 6 lines

I cannot avoid this directory :(.
because new SPL compile this directory even after undef QIXIS defines

#ifndef CONFIG_SPL_BUILD
#define CONFIG_FSL_QIXIS
#endif

Yeah, the makefiles never see CONFIG_SPL_BUILD -- it only works for C code.

The P1022 SPL patch just does this in the makefile:

(quoted diff) +2 -0
+ifndef CONFIG_SPL_BUILD
 COBJS-$(CONFIG_FSL_NGPIXIS)    += ngpixis.o
+endif
Quoted 4 lines

...which is less intrusive. We can revisit it if we end up actually needing pixis/qixis inside an SPL.

I need to add config_mpc85xx.h here.

#define CONFIG_MPC85xx
#define CONFIG_FSL_IFC /* Enable IFC Support */
#define CONFIG_SYS_HAS_SERDES /* common SERDES init code */
+#include "../../arch/powerpc/include/asm/config_mpc85xx.h"

I tried just after CONFIG_P1010 but it is giving compilation error.

Just to mention, I need to provide relative path in order to compile. I will still suggest to keep original patch, As header file location may change over period of time then config file needs to be updated again.

Regards,
Prabhakar