[U-Boot] [PATCH V4 2/5] omap-common: add nand spl support

Scott Wood scottwood at freescale.com
Tue Jul 26 20:06:31 CEST 2011


On Tue, 26 Jul 2011 14:09:15 +0200
Simon Schwarz <simonschwarzcor at googlemail.com> wrote:

> +#ifdef CONFIG_SPL_NAND_SUPPORT
> +static void nand_load_image(void)
> +{
> +	gpmc_init();
> +	nand_init();
> +	nand_copy_image(CONFIG_SYS_NAND_U_BOOT_OFFS,
> +		CONFIG_SYS_NAND_U_BOOT_SIZE,
> +		(uchar *)CONFIG_SYS_NAND_U_BOOT_DST);
> +#ifdef CONFIG_NAND_ENV_DST
> +	nand_copy_image(CONFIG_ENV_OFFSET, CONFIG_ENV_SIZE,
> +		(uchar *)CONFIG_NAND_ENV_DST);
> +#ifdef CONFIG_ENV_OFFSET_REDUND
> +	nand_copy_image(CONFIG_ENV_OFFSET_REDUND, CONFIG_ENV_SIZE,
> +		(uchar *)CONFIG_NAND_ENV_DST + CONFIG_ENV_SIZE);
> +#endif
> +#endif
> +	parse_image_header((struct image_header *)CONFIG_SYS_NAND_U_BOOT_DST);
> +}
> +#endif /* CONFIG_SPL_NAND_SUPPORT */

I'm not sure that "load" versus "copy" conveys the difference between this
function and the low-level nand_copy_image.

Where is nand_copy_image() defined?

> diff --git a/include/nand.h b/include/nand.h
> index 8d94b5c..e0f20f6 100644
> --- a/include/nand.h
> +++ b/include/nand.h
> @@ -132,6 +132,8 @@ int nand_lock( nand_info_t *meminfo, int tight );
>  int nand_unlock( nand_info_t *meminfo, ulong start, ulong length );
>  int nand_get_lock_status(nand_info_t *meminfo, loff_t offset);
>  
> +void nand_copy_image(unsigned int offs, unsigned int size, uchar *dst);

Use loff_t for offset.  Maybe call it "nand_spl_copy_image" or
"nand_spl_load_image".

-Scott



More information about the U-Boot mailing list