s5pc1xx: support onenand driver
Subsystems (3)
PATCH v2 2/4 s5pc1xx: support onenand driver
This patch includes the onenand driver for s5pc100
--- drivers/mtd/onenand/Makefile | 2 + drivers/mtd/onenand/samsung.c | 626 +++++++++++++++++++++++++++++++++++ include/linux/mtd/onenand.h | 1 + include/linux/mtd/onenand_regs.h | 4 + include/linux/mtd/samsung_onenand.h | 132 ++++++++ 5 files changed, 765 insertions(+), 0 deletions(-) create mode 100644 drivers/mtd/onenand/samsung.c create mode 100644 include/linux/mtd/samsung_onenand.h
drivers/mtd/onenand/Makefile +2 -0
@@ -26,6 +26,8 @@ include $(TOPDIR)/config.mk LIB := $(obj)libonenand.a COBJS-$(CONFIG_CMD_ONENAND) := onenand_uboot.o onenand_base.o onenand_bbt.o +COBJS-$(CONFIG_S3C64XX) += samsung.o +COBJS-$(CONFIG_S5PC1XX) += samsung.o COBJS := $(COBJS-y) SRCS := $(COBJS:.o=.c)
drivers/mtd/onenand/samsung.c new file +626 -0
626 lines not on this page · raw message
include/linux/mtd/onenand.h +1 -0
@@ -135,6 +135,7 @@ struct onenand_chip {#define ONENAND_HAS_CONT_LOCK (0x0001)#define ONENAND_HAS_UNLOCK_ALL (0x0002)#define ONENAND_HAS_2PLANE (0x0004) +#define ONENAND_RUNTIME_BADBLOCK_CHECK (0x0200)#define ONENAND_PAGEBUF_ALLOC (0x1000)#define ONENAND_OOBBUF_ALLOC (0x2000)
include/linux/mtd/onenand_regs.h +4 -0
@@ -121,6 +121,8 @@#define ONENAND_CMD_LOCK_TIGHT (0x2C)#define ONENAND_CMD_UNLOCK_ALL (0x27)#define ONENAND_CMD_ERASE (0x94) +#define ONENAND_CMD_MULTIBLOCK_ERASE (0x95) +#define ONENAND_CMD_ERASE_VERIFY (0x71)#define ONENAND_CMD_RESET (0xF0)#define ONENAND_CMD_READID (0x90)
@@ -184,7 +186,9 @@* ECC Status Reigser FF00h (R) */ #define ONENAND_ECC_1BIT (1 << 0) +#define ONENAND_ECC_1BIT_ALL (0x5555)#define ONENAND_ECC_2BIT (1 << 1)#define ONENAND_ECC_2BIT_ALL (0xAAAA) +#define ONENAND_ECC_4BIT_UNCORRECTABLE (0x1010)#endif /* __ONENAND_REG_H */
include/linux/mtd/samsung_onenand.h new file +132 -0
132 lines not on this page · raw message
Signature · 1 line
1.5.4.3
PATCH v2 2/4 s5pc1xx: support onenand driver
Dear Minkyu Kang,
Quoted 4 lines · In message <[email protected]> you wrote:
This patch includes the onenand driver for s5pc100
Signed-off-by Minkyu Kang <[email protected]>Signed-off-by Kyungmin Park <[email protected]>
...
Quoted 5 lines
drivers/mtd/onenand/samsung.c new file +5
-0+struct s3c_onenand { +struct mtd_info *mtd; + +void __iomem *base; +void __iomem *ahb_addr;
drivers/mtd/onenand/samsung.c line 85
Quoted 10 lines
drivers/mtd/onenand/samsung.c new file +10
-0+ +int bootram_command; + +void __iomem *page_buf; +void __iomem *oob_buf; + +unsigned int (*mem_addr)(int fba,int fpa,int fsa); + +struct samsung_onenand *reg; +};
Please drop these blank lines.
Quoted 9 lines
drivers/mtd/onenand/samsung.c new file +9
-0+/* +* 1Gb: FBA[21:12] FPA[11:6] FSA[5:4] +* 2Gb: FBA[22:12] FPA[11:6] FSA[5:4] +* 4Gb: FBA[23:12] FPA[11:6] FSA[5:4] +*/ +static unsigned int s3c64xx_mem_addr (int fba,int fpa,int fsa) +{ +return (fba <<12 ) | (fpa <<6 ) | (fsa <<4 ); +}
drivers/mtd/onenand/samsung.c line 117
Quoted 10 lines
drivers/mtd/onenand/samsung.c new file +10
-0+ +/* +* 1Gb: FBA[22:13] FPA[12:7] FSA[6:5] +* 2Gb: FBA[23:13] FPA[12:7] FSA[6:5] +* 4Gb: FBA[24:13] FPA[12:7] FSA[6:5] +*/ +static unsigned int s5pc100_mem_addr (int fba,int fpa,int fsa) +{ +return (fba <<13 ) | (fpa <<7 ) | (fsa <<5 ); +}
Hm... when I wrote "This function needs explanation. Please add a comment what it does, and how." I meant some comment that really explains what is goong on here - what the arguments are, what the return value is, and which sort of transformation the function performs. Your comment is not exactly helpful.
I can see what the code is doing, but I have no idea what that means - reading your comments don't help my understanding.
What I see raises just additional questions: should there be no error checking? I mean, something like
... ((fpa & 0x3f) << 7) | ((fsa & 3) << 5)
?
Quoted 5 lines
include/linux/mtd/samsung_onenand.h new file +0
-0
...
include/linux/mtd/samsung_onenand.h line 41
Quoted 8 lines
include/linux/mtd/samsung_onenand.h new file +8
-0+#ifndef __ASSEMBLY__ +struct samsung_onenand { + unsigned long MEM_CFG; /* 0x0000 */ + unsigned char res1[0xc]; + unsigned long BURST_LEN; /* 0x0010 */ + unsigned char res2[0xc]; + unsigned long MEM_RESET; /* 0x0020 */ + unsigned char res3[0xc];
...
Upper case vaiable names are not allowed. Upper case identifiers are reserved for macros only. Please use lower case names.
Best regards,
Wolfgang Denk
Signature · 6 lines
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 That's the thing about people who think they hate computers. What they really hate is lousy programmers. - Larry Niven and Jerry Pournelle in "Oath of Fealty"
PATCH v2 2/4 s5pc1xx: support onenand driver
Dear Wolfgang
2009/9/10 Wolfgang Denk <[email protected]>:
Quoted 17 lines
Dear Minkyu Kang,
Quoted 4 lines · In message <[email protected]> you wrote:
This patch includes the onenand driver for s5pc100
Signed-off-by Minkyu Kang <[email protected]>Signed-off-by Kyungmin Park <[email protected]>...
Quoted 9 lines
(quoted diff) +9
-0+struct s3c_onenand { + ? ? struct mtd_info *mtd; + + ? ? void __iomem ? ?*base; + ? ? void __iomem ? ?*ahb_addr; + + ? ? int ? ? ? ? ? ? bootram_command; + + ? ? void __iomem ? ?*page_buf;
Quoted 9 lines
drivers/mtd/onenand/samsung.c line 85
Quoted 6 lines
+ ? ? void
__iomem? ?*oob_buf;drivers/mtd/onenand/samsung.c new file +5
-0+ + ? ? unsigned int ? ?(*mem_addr)(int fba, int fpa, int fsa); + + ? ? struct samsung_onenand *reg; +};Please drop these blank lines.
ok.
Quoted 27 lines
Quoted 10 lines
drivers/mtd/onenand/samsung.c new file +9
-0+/* +* 1Gb: FBA[21:12] FPA[11:6] FSA[5:4] +* 2Gb: FBA[22:12] FPA[11:6] FSA[5:4] +* 4Gb: FBA[23:12] FPA[11:6] FSA[5:4] +*/ +static unsigned int s3c64xx_mem_addr (int fba,int fpa,int fsa) +{ + ? ? return (fba << 12) | (fpa << 6) | (fsa << 4); +}drivers/mtd/onenand/samsung.c line 117
Quoted 10 lines
drivers/mtd/onenand/samsung.c new file +10
-0+ +/* +* 1Gb: FBA[22:13] FPA[12:7] FSA[6:5] +* 2Gb: FBA[23:13] FPA[12:7] FSA[6:5] +* 4Gb: FBA[24:13] FPA[12:7] FSA[6:5] +*/ +static unsigned int s5pc100_mem_addr (int fba,int fpa,int fsa) +{ + ? ? return (fba << 13) | (fpa << 7) | (fsa << 5); +}Hm... when I wrote "This function needs explanation. Please add a comment what it does, and how." I meant some comment that really explains what is goong on here - what the arguments are, what the return value is, and which sort of transformation the function performs. Your comment is not exactly helpful.
Quoted 3 lines
I can see what the code is doing, but I have no idea what that means - reading your comments don't help my understanding.
ok I'll write more comments.
Quoted 7 lines
What I see raises just additional questions: should there be no error checking? I mean, something like
? ? ? ?... ((fpa &
0x3f) << 7) | ((fsa & 3) << 5)?
hm.. I think no need.
because of each capacity have different offset and each argument is got from mtd. Kyungmin, how you think?
Quoted 17 lines
Quoted 6 lines
include/linux/mtd/samsung_onenand.h new file +0
-0...
Quoted 8 lines
include/linux/mtd/samsung_onenand.h new file +8
-0+#ifndef __ASSEMBLY__ +struct samsung_onenand { + ? ? unsigned long ? MEM_CFG; ? ? ? ?/* 0x0000 */ + ? ? unsigned char ? res1[0xc]; + ? ? unsigned long ? BURST_LEN; ? ? ?/* 0x0010 */ + ? ? unsigned char ? res2[0xc]; + ? ? unsigned long ? MEM_RESET; ? ? ?/* 0x0020 */ + ? ? unsigned char ? res3[0xc];...
Quoted 2 lines
Upper case vaiable names are not allowed. Upper case identifiers are reserved for macros only. Please use lower case names.
sure i do.
Quoted 5 lines
Best regards,
Wolfgang Denk
Quoted 12 lines
--
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 That's the thing about people who think ?they ?hate ?computers. ?What they really hate is lousy programmers.
- Larry Niven and Jerry Pournelle in "Oath of Fealty"
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot
thanks
Minkyu Kang
Signature · 2 lines
from. prom. www.promsoft.net
PATCH v3 2/4 s5pc1xx: support onenand driver
This patch includes the onenand driver for s5pc100
---
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
drivers/mtd/onenand/Makefile +1 -0
@@ -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)
drivers/mtd/onenand/samsung.c new file +622 -0
622 lines not on this page · raw message
include/linux/mtd/onenand.h +1 -0
@@ -135,6 +135,7 @@ struct onenand_chip {#define ONENAND_HAS_CONT_LOCK (0x0001)#define ONENAND_HAS_UNLOCK_ALL (0x0002)#define ONENAND_HAS_2PLANE (0x0004) +#define ONENAND_RUNTIME_BADBLOCK_CHECK (0x0200)#define ONENAND_PAGEBUF_ALLOC (0x1000)#define ONENAND_OOBBUF_ALLOC (0x2000)
include/linux/mtd/onenand_regs.h +4 -0
@@ -121,6 +121,8 @@#define ONENAND_CMD_LOCK_TIGHT (0x2C)#define ONENAND_CMD_UNLOCK_ALL (0x27)#define ONENAND_CMD_ERASE (0x94) +#define ONENAND_CMD_MULTIBLOCK_ERASE (0x95) +#define ONENAND_CMD_ERASE_VERIFY (0x71)#define ONENAND_CMD_RESET (0xF0)#define ONENAND_CMD_READID (0x90)
@@ -184,7 +186,9 @@* ECC Status Reigser FF00h (R) */ #define ONENAND_ECC_1BIT (1 << 0) +#define ONENAND_ECC_1BIT_ALL (0x5555)#define ONENAND_ECC_2BIT (1 << 1)#define ONENAND_ECC_2BIT_ALL (0xAAAA) +#define ONENAND_ECC_4BIT_UNCORRECTABLE (0x1010)#endif /* __ONENAND_REG_H */
include/linux/mtd/samsung_onenand.h new file +131 -0
131 lines not on this page · raw message
Signature · 1 line
1.5.4.3
PATCH v3 2/4 s5pc1xx: support onenand driver
Quoted 42 lines · Minkyu Kang
This patch includes the onenand driver for s5pc100
Signed-off-by Minkyu Kang <[email protected]>Signed-off-by Kyungmin Park <[email protected]>---
Changes since v1:
- movesamsung_onenand.htoinclude/linux/mtd/
- make C struct instead of base+offset
- Remove the "1 &&" in while loopChanges since v2:
- drop blank lines
- adds some comments
- modify to lower case letter in C structdrivers/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.hdrivers/mtd/onenand/Makefile +1
-0@@ -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)drivers/mtd/onenand/samsung.c new file +0
-0
drivers/mtd/onenand/samsung.c line 9
Quoted 9 lines
drivers/mtd/onenand/samsung.c new file +9
-0@@ -0,0 +1,622 @@ +/* +* S3C64XX/S5PC100 OneNAND driver at U-Boot +* +* Copyright (C) 2008-2009 Samsung Electronics +* Kyungmin Park <[email protected]> +* +* 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.
Quoted 5 lines
drivers/mtd/onenand/samsung.c new file +5
-0+* +* Implementation: +* Emulate the pseudo BufferRAM +*/ +
<snip>
drivers/mtd/onenand/samsung.c line 61
Quoted 12 lines
drivers/mtd/onenand/samsung.c new file +12
-0+ +#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
PATCH v3 2/4 s5pc1xx: support onenand driver
Dear Tom.
2009/9/22 Tom <[email protected]>:
Quoted 46 lines
Quoted 45 lines · Minkyu Kang
This patch includes the onenand driver for s5pc100
Signed-off-by Minkyu Kang <[email protected]>Signed-off-by Kyungmin Park <[email protected]>---
Changes since v1:
- movesamsung_onenand.htoinclude/linux/mtd/
- make C struct instead of base+offset
- Remove the "1 &&" in while loopChanges 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 100644include/linux/mtd/samsung_onenand.hdrivers/mtd/onenand/Makefile +0
-0@@ -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)drivers/mtd/onenand/samsung.c new file +3
-0@@ -0,0 +1,622 @@ +/* +* S3C64XX/S5PC100 OneNAND driver at U-Boot +*
Quoted 8 lines
drivers/mtd/onenand/samsung.c line 9
Quoted 6 lines
drivers/mtd/onenand/samsung.c new file +6
-0+* ?Copyright (C) 2008-2009 Samsung Electronics +* ?Kyungmin Park <[email protected]> +* +* 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
Quoted 8 lines
Quoted 6 lines
drivers/mtd/onenand/samsung.c new file +5
-0+* +* Implementation: +* ? Emulate the pseudo BufferRAM +*/ +<snip>
Quoted 15 lines
drivers/mtd/onenand/samsung.c
Quoted 12 lines
drivers/mtd/onenand/samsung.c new file +12
-0+ +#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
Quoted 10 lines
Otherwise fine.
Just fix the copyright.Tom
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot
Thanks
Minkyu Kang
Signature · 2 lines
from. prom. www.promsoft.net
PATCH v3 2/4 s5pc1xx: support onenand driver
Quoted 84 lines · Minkyu Kang
Dear Tom.
2009/9/22 Tom <[email protected]>:
Quoted 46 lines
Quoted 45 lines · Minkyu Kang
This patch includes the onenand driver for s5pc100
Signed-off-by Minkyu Kang <[email protected]>Signed-off-by Kyungmin Park <[email protected]>---
Changes since v1:
- movesamsung_onenand.htoinclude/linux/mtd/
- make C struct instead of base+offset
- Remove the "1 &&" in while loopChanges 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 100644include/linux/mtd/samsung_onenand.hdrivers/mtd/onenand/Makefile +0
-0@@ -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)drivers/mtd/onenand/samsung.c new file +3
-0@@ -0,0 +1,622 @@ +/* +* S3C64XX/S5PC100 OneNAND driver at U-Boot +* Quoted 8 lines
drivers/mtd/onenand/samsung.c line 9
Quoted 6 lines
drivers/mtd/onenand/samsung.c new file +6
-0+* ?Copyright (C) 2008-2009 Samsung Electronics +* ?Kyungmin Park <[email protected]> +* +* 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
Quoted 8 lines
Quoted 6 lines
drivers/mtd/onenand/samsung.c new file +5
-0+* +* Implementation: +* ? Emulate the pseudo BufferRAM +*/ +<snip>
Quoted 15 lines
drivers/mtd/onenand/samsung.c
Quoted 12 lines
drivers/mtd/onenand/samsung.c new file +12
-0+ +#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?
Quoted 1 line
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.
Thank you,
Kyungmin Park
PATCH v3 2/4 s5pc1xx: support onenand driver
Quoted 80 lines · Kyungmin Park
Quoted 79 lines · Minkyu Kang
Dear Tom.
2009/9/22 Tom <[email protected]>:
Quoted 45 lines
Quoted 44 lines · Minkyu Kang
This patch includes the onenand driver for s5pc100
Signed-off-by Minkyu Kang <[email protected]>Signed-off-by Kyungmin Park <[email protected]>---
Changes since v1:
- movesamsung_onenand.htoinclude/linux/mtd/
- make C struct instead of base+offset
- Remove the "1 &&" in while loopChanges since v2:
- drop blank lines
- adds some comments
- modify to lower case letter in C structdrivers/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.hdrivers/mtd/onenand/Makefile +1
-0@@ -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)drivers/mtd/onenand/samsung.c new file +2
-0@@ -0,0 +1,622 @@ +/* +* S3C64XX/S5PC100 OneNAND driver at U-Boot Quoted 8 lines
drivers/mtd/onenand/samsung.c line 9
Quoted 7 lines
drivers/mtd/onenand/samsung.c new file +7
-0+* +* Copyright (C) 2008-2009 Samsung Electronics +* Kyungmin Park <[email protected]> +* +* 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
Quoted 21 lines
Quoted 5 lines
drivers/mtd/onenand/samsung.c new file +5
-0+* +* Implementation: +* Emulate the pseudo BufferRAM +*/ +<snip>
drivers/mtd/onenand/samsung.c line 61
Quoted 12 lines
drivers/mtd/onenand/samsung.c new file +12
-0+ +#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?
Quoted 5 lines
Quoted 1 line
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
Quoted 2 lines
Thank you,
Kyungmin Park
PATCH v3 2/4 s5pc1xx: support onenand driver
In reply to TomDear Tom, Kyungmin & Minkyu,
Quoted 1 line · In message <[email protected]> Tom Rix wrote:
...
Quoted 5 lines
Quoted 3 lines
+ * 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.
To avoid misunderstandings: the required phrase is "GPL, either version 2, or (at your option) any later version"; please see note 1 at http://www.denx.de/wiki/U-Boot/Patches for details.
Best regards,
Wolfgang Denk
Signature · 6 lines
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 In the beginning there was nothing. And the Lord said "Let There Be Light!" And still there was nothing, but at least now you could see it.
PATCH v3 2/4 s5pc1xx: support onenand driver
Quoted 9 lines · Wolfgang Denk
Dear Tom, Kyungmin & Minkyu,
Quoted 1 line · In message <[email protected]> Tom Rix wrote:
...
Quoted 4 lines
Quoted 3 lines
+ * 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.
Quoted 5 lines
Quoted 1 line
Add full GPL 2 copyright.
To avoid misunderstandings: the required phrase is "GPL, either version 2, or (at your option) any later version"; please see note 1 at http://www.denx.de/wiki/U-Boot/Patches for details.
Does this mean you will not accept any more patches that import new NAND code from Linux, as that code is v2-only?
-Scott
PATCH v4 2/4 s5pc1xx: support onenand driver
This patch includes the onenand driver for s5pc100
---
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
Changes since v3:
- fix the copyright
drivers/mtd/onenand/Makefile | 1 + drivers/mtd/onenand/samsung.c | 636 +++++++++++++++++++++++++++++++++++ include/linux/mtd/onenand.h | 1 + include/linux/mtd/onenand_regs.h | 4 + include/linux/mtd/samsung_onenand.h | 131 +++++++ 5 files changed, 773 insertions(+), 0 deletions(-) create mode 100644 drivers/mtd/onenand/samsung.c create mode 100644 include/linux/mtd/samsung_onenand.h
drivers/mtd/onenand/Makefile +1 -0
@@ -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)
drivers/mtd/onenand/samsung.c new file +636 -0
636 lines not on this page · raw message
include/linux/mtd/onenand.h +1 -0
@@ -135,6 +135,7 @@ struct onenand_chip {#define ONENAND_HAS_CONT_LOCK (0x0001)#define ONENAND_HAS_UNLOCK_ALL (0x0002)#define ONENAND_HAS_2PLANE (0x0004) +#define ONENAND_RUNTIME_BADBLOCK_CHECK (0x0200)#define ONENAND_PAGEBUF_ALLOC (0x1000)#define ONENAND_OOBBUF_ALLOC (0x2000)
include/linux/mtd/onenand_regs.h +4 -0
@@ -121,6 +121,8 @@#define ONENAND_CMD_LOCK_TIGHT (0x2C)#define ONENAND_CMD_UNLOCK_ALL (0x27)#define ONENAND_CMD_ERASE (0x94) +#define ONENAND_CMD_MULTIBLOCK_ERASE (0x95) +#define ONENAND_CMD_ERASE_VERIFY (0x71)#define ONENAND_CMD_RESET (0xF0)#define ONENAND_CMD_READID (0x90)
@@ -184,7 +186,9 @@* ECC Status Reigser FF00h (R) */ #define ONENAND_ECC_1BIT (1 << 0) +#define ONENAND_ECC_1BIT_ALL (0x5555)#define ONENAND_ECC_2BIT (1 << 1)#define ONENAND_ECC_2BIT_ALL (0xAAAA) +#define ONENAND_ECC_4BIT_UNCORRECTABLE (0x1010)#endif /* __ONENAND_REG_H */
include/linux/mtd/samsung_onenand.h new file +131 -0
131 lines not on this page · raw message
Signature · 1 line
1.5.4.3
PATCH v4 2/4 s5pc1xx: support onenand driver
Quoted 18 lines · Minkyu Kang
This patch includes the onenand driver for s5pc100
Signed-off-by Minkyu Kang <[email protected]>Signed-off-by Kyungmin Park <[email protected]>---
Changes since v1:
- movesamsung_onenand.htoinclude/linux/mtd/
- make C struct instead of base+offset
- Remove the "1 &&" in while loopChanges since v2:
- drop blank lines
- adds some comments
- modify to lower case letter in C structChanges since v3:
- fix the copyright
Quoted 9 lines
drivers/mtd/onenand/Makefile | 1 + drivers/mtd/onenand/samsung.c | 636 +++++++++++++++++++++++++++++++++++ include/linux/mtd/onenand.h | 1 + include/linux/mtd/onenand_regs.h | 4 + include/linux/mtd/samsung_onenand.h | 131 +++++++ 5 files changed, 773 insertions(+), 0 deletions(-) create mode 100644 drivers/mtd/onenand/samsung.c create mode 100644 include/linux/mtd/samsung_onenand.h
applied to u-boot-samsung
Minkyu Kang
PATCH v3 2/4 s5pc1xx: support onenand driver
In reply to Scott WoodDear Scott Wood,
Quoted 7 lines · In message <[email protected]> you wrote:
Quoted 4 lines
To avoid misunderstandings: the required phrase is "GPL, either version 2, or (at your option) any later version"; please see note 1 at http://www.denx.de/wiki/U-Boot/Patches for details.
Does this mean you will not accept any more patches that import new NAND code from Linux, as that code is v2-only?
Importing code from Linux is one big exception - well knowing, that we will have to solve these issues in some future time.
Best regards,
Wolfgang Denk
Signature · 5 lines
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 There's no sense in being precise when you don't even know what you're talking about. -- John von Neumann