[U-Boot] [PATCH v2 1/2] powerpc:mpc85xx: Add ifc nand boot support for TPL/SPL

Scott Wood scottwood at freescale.com
Sat Dec 7 02:33:05 CET 2013


On Thu, 2013-12-05 at 14:18 +0800, Po Liu wrote:
> diff --git a/drivers/mtd/nand/fsl_ifc_spl.c b/drivers/mtd/nand/fsl_ifc_spl.c
> index 9de327b..93303b4 100644
> --- a/drivers/mtd/nand/fsl_ifc_spl.c
> +++ b/drivers/mtd/nand/fsl_ifc_spl.c
> @@ -88,7 +88,11 @@ static inline int bad_block(uchar *marker, int port_size)
>  		return __raw_readw((u16 *)marker) != 0xffff;
>  }
>  
> +#ifdef CONFIG_TPL_BUILD
> +void nand_spl_load_image(uint32_t offs, int uboot_size, void *vdst)
> +#else
>  static void nand_load(unsigned int offs, int uboot_size, uchar *dst)
> +#endif
>  {
>  	struct fsl_ifc *ifc = IFC_BASE_ADDR;
>  	uchar *buf = (uchar *)CONFIG_SYS_NAND_BASE;
> @@ -105,6 +109,9 @@ static void nand_load(unsigned int offs, int uboot_size, uchar *dst)
>  
>  	int sram_addr;
>  	int pg_no;
> +#ifdef CONFIG_TPL_BUILD
> +	char *dst = vdst;
> +#endif

Use uchar to be consistent.

>  	/* Get NAND Flash configuration */
>  	csor = CONFIG_SYS_NAND_CSOR;
> @@ -211,6 +218,15 @@ static void nand_load(unsigned int offs, int uboot_size, uchar *dst)
>  }
>  
>  /*
> ++ * Defines a static function nand_load_image() here, because non-static makes
> ++ * the code too large for certain SPLs(minimal SPL, maximum size <= 4Kbytes)
> ++ */
> +#ifndef CONFIG_TPL_BUILD

Too many pluses -- did you copy and paste from a patch?

> diff --git a/spl/Makefile b/spl/Makefile
> index 2a787af..908af35 100644
> --- a/spl/Makefile
> +++ b/spl/Makefile
> @@ -79,6 +79,7 @@ LIBS-$(CONFIG_SPL_LIBGENERIC_SUPPORT) += lib/
>  LIBS-$(CONFIG_SPL_POWER_SUPPORT) += drivers/power/ \
>  	drivers/power/pmic/
>  LIBS-$(CONFIG_SPL_NAND_SUPPORT) += drivers/mtd/nand/
> +LIBS-$(CONFIG_SPL_IFC_SUPPORT) += drivers/misc/

Make a CONFIG_SPL_DRIVERS_MISC_SUPPORT instead.

-Scott





More information about the U-Boot mailing list