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

Tom
2009-09-24T01:17:15Z

Kyungmin Park wrote:
> On Wed, Sep 23, 2009 at 7:49 PM, Minkyu Kang <promsoft@gmail.com> wrote:
>> Dear Tom.
>>
>> 2009/9/22 Tom <Tom.Rix@windriver.com>:
>>> Minkyu Kang wrote:
>>>> This patch includes the onenand driver for s5pc100
>>>>
>>>> Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
>>>> Signed-off-by: Kyungmin Park <kyungmin.park@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@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.
>> Ok, thanks
>>
>>>> + *
>>>> + * 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?
>> It will be moved H file thanks
>
> No, No. Please leave it. User must know that which MAP bit are used.
> Later I will remove #ifdef.
>

I was not referring to just the MAP bits.
There is in general a large number of #defines and other information
that may be better handled by moving them to an H file.

Moving them in not a requirement.

Please resubmit with just the copyright change if you do not
want to do the move.

Tom

> Thank you,
> Kyungmin Park