[U-Boot] [PATCH 2/4 v3] s5pc1xx: support onenand driver

Tom Tom.Rix at windriver.com
Tue Sep 22 16:48:42 CEST 2009


Minkyu Kang wrote:
> This patch includes the onenand driver for s5pc100
> 
> Signed-off-by: Minkyu Kang <mk7.kang at samsung.com>
> Signed-off-by: Kyungmin Park <kyungmin.park at samsung.com>
> ---
> Changes since v1:
> - move samsung_onenand.h to include/linux/mtd/
> - make C struct instead of base+offset
> - Remove the "1 &&" in while loop
> 
> Changes since v2:
> - drop blank lines
> - adds some comments
> - modify to lower case letter in C struct
> 
>  drivers/mtd/onenand/Makefile        |    1 +
>  drivers/mtd/onenand/samsung.c       |  622 +++++++++++++++++++++++++++++++++++
>  include/linux/mtd/onenand.h         |    1 +
>  include/linux/mtd/onenand_regs.h    |    4 +
>  include/linux/mtd/samsung_onenand.h |  131 ++++++++
>  5 files changed, 759 insertions(+), 0 deletions(-)
>  create mode 100644 drivers/mtd/onenand/samsung.c
>  create mode 100644 include/linux/mtd/samsung_onenand.h
> 
> diff --git a/drivers/mtd/onenand/Makefile b/drivers/mtd/onenand/Makefile
> index 1d35a57..2571df0 100644
> --- a/drivers/mtd/onenand/Makefile
> +++ b/drivers/mtd/onenand/Makefile
> @@ -26,6 +26,7 @@ include $(TOPDIR)/config.mk
>  LIB	:= $(obj)libonenand.a
>  
>  COBJS-$(CONFIG_CMD_ONENAND)	:= onenand_uboot.o onenand_base.o onenand_bbt.o
> +COBJS-$(CONFIG_SAMSUNG_ONENAND)	+= samsung.o
>  
>  COBJS	:= $(COBJS-y)
>  SRCS	:= $(COBJS:.o=.c)
> diff --git a/drivers/mtd/onenand/samsung.c b/drivers/mtd/onenand/samsung.c
> new file mode 100644
> index 0000000..5433f19
> --- /dev/null
> +++ b/drivers/mtd/onenand/samsung.c
> @@ -0,0 +1,622 @@
> +/*
> + * S3C64XX/S5PC100 OneNAND driver at U-Boot
> + *
> + *  Copyright (C) 2008-2009 Samsung Electronics
> + *  Kyungmin Park <kyungmin.park at samsung.com>
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.

Add full GPL 2 copyright.

> + *
> + * Implementation:
> + *	Emulate the pseudo BufferRAM
> + */
> +
<snip>

> +
> +#if defined(CONFIG_S3C64XX)
> +#define MAP_00				(0x0 << 24)
> +#define MAP_01				(0x1 << 24)
> +#define MAP_10				(0x2 << 24)
> +#define MAP_11				(0x3 << 24)
> +#elif defined(CONFIG_S5PC1XX)
> +#define MAP_00				(0x0 << 26)
> +#define MAP_01				(0x1 << 26)
> +#define MAP_10				(0x2 << 26)
> +#define MAP_11				(0x3 << 26)
> +#endif

This and other struct, #defines may be better handled in a H file.
Why did you include them all here?

Otherwise fine.
Just fix the copyright.

Tom


More information about the U-Boot mailing list