[U-Boot] [PATCH 6/6] S5PC100: Add onenand_ipl for SMDKC100 support
Wolfgang Denk
wd at denx.de
Sun Jul 19 22:04:42 CEST 2009
Dear HeungJun Kim,
In message <350d1ec30906250121q4e860812s35054aaee8c2016e at mail.gmail.com> you wrote:
> The SMDKC100 Board has 256MB onenand.
> So, It's bootable, if this patch is adapted thus the board use onenand_ipl.
>
> Signed-off-by: HeungJun, Kim <riverful.kim at samsung.com>
>
> ---
>
> This patch support onenand boot on SMDKC100 Board.
...
> diff --git a/onenand_ipl/board/samsung/smdkc100/Makefile
> b/onenand_ipl/board/samsung/smdkc100/Makefile
> new file mode 100644
> index 0000000..4301938
> --- /dev/null
> +++ b/onenand_ipl/board/samsung/smdkc100/Makefile
...
> +ALL = $(onenandobj)onenand-ipl $(onenandobj)onenand-ipl.bin
> $(onenandobj)onenand-ipl-2k.bin $(onenandobj)onenand-ipl-4k.bin
This patch is white-space corrupted. I gues this happened here because
the line was way too long.
> --- a/onenand_ipl/onenand_read.c
> +++ b/onenand_ipl/onenand_read.c
> @@ -37,10 +37,24 @@
> extern void *memcpy32(void *dest, void *src, int size);
> #endif
>
> +
> +
Please do not arbitrary empty lines.
> /* read a page with ECC */
> static inline int onenand_read_page(ulong block, ulong page,
> u_char * buf, int pagesize)
> {
> +#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;
I don't like to see such board specific code in global files.
Also, please use I/O accessor functions instead of register accesses.
> @@ -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
Again: why do we need such board specific code here?
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
I have a very small mind and must live with it. -- Edsger Dijkstra
More information about the U-Boot
mailing list