On Thu, Jun 25, 2009 at 05:21:45PM +0900, HeungJun Kim wrote:
> +#ifdef CONFIG_S5PC1XX
> +     unsigned int *p = (unsigned int *) buf;
> +     int mem_addr, i;
> +
> +     mem_addr = MEM_ADDR(block, page, 0);
> +
> +     pagesize >>= 2;
> +
> +     for (i = 0; i < pagesize; i++)
> +             *p++ = *(volatile unsigned int *)(CMD_MAP_01(mem_addr));
> +#else        /* CONFIG_S5PC1XX */
> +
>       unsigned long *base;
> 
>  #ifndef __HAVE_ARCH_MEMCPY32
> @@ -85,6 +99,7 @@ static inline int onenand_read_page(ulong block, ulong page,
>               *p++ = value;
>       }
>  #endif
> +#endif       /* CONFIG_S5PC1XX */

Please put each controller implementation in a separate file, with an
appropriate name.  Do not make anything which is SoC-specific look
generic.

If onenand_read_block() is not controller-specific (looks like everything
except the read of ONENAND_REG_TECHNOLOGY is generic), move it to
onenand_boot.c.

> @@ -114,6 +129,9 @@ int onenand_read_block(unsigned char *buf)
> 
>       erasesize = ONENAND_PAGES_PER_BLOCK * pagesize;
>       nblocks = (CONFIG_SYS_MONITOR_LEN + erasesize - 1) >> erase_shift;
> +#ifdef CONFIG_S5PC1XX
> +     nblocks = 1;
> +#endif

Why?

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

Reply via email to