mtd: nand: add support for Samsung K9LCG08U0B
Subsystems (2)
PATCH 1/1 mtd: nand: add support for Samsung K9LCG08U0B
Assume that:
tmp = ((extid >> 2) & 0x04) | (extid & 0x03));
Quoted 1 line
From the K9LCG08U0B's datasheet, we know that:
the oob size is 640 when tmp is 6;
the oob size is 1024 when tmp is 7;
--- drivers/mtd/nand/nand_base.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)
drivers/mtd/nand/nand_base.c +3 -1
@@ -3242,9 +3242,11 @@ static void nand_decode_ext_id(struct mtd_info *mtd, struct nand_chip *chip, mtd->oobsize =512 ;break ;case 6 : -default :/* Other cases are "reserved" (unknown) */ mtd->oobsize =640 ;break ; +case 7 : + mtd->oobsize =SZ_1K ; +break ; } extid >>=2 ;/* Calc blocksize */
Signature · 1 line
1.7.2.rc3
Quoted 17 lines · Huang Shijie
Assume that:
tmp = ((extid >> 2) & 0x04) | (extid & 0x03));From the K9LCG08U0B's datasheet, we know that:
the oob size is 640 when tmp is 6;
the oob size is 1024 when tmp is 7;Signed-off-by Huang Shijie <[email protected]>--- drivers/mtd/nand/nand_base.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)drivers/mtd/nand/nand_base.c +0
-0
drivers/mtd/nand/nand_base.c static void nand_decode_ext_id(struct mtd_info *mtd, struct nand_chip *chip, · line 3248
Quoted 8 lines
drivers/mtd/nand/nand_base.c +2
-1@@ -3242,9 +3242,11 @@ static void nand_decode_ext_id(struct mtd_info *mtd, struct nand_chip *chip, mtd->oobsize =512 ;break ;case 6 : -default :/* Other cases are "reserved" (unknown) */ mtd->oobsize =640 ;break ; +case 7 : + mtd->oobsize =SZ_1K ;
#include <linux/sizes.h>
Did you compile this?
Anyway, I think just using the literal 1024 is better. I can fix it up and push myself in a bit.
drivers/mtd/nand/nand_base.c static void nand_decode_ext_id(struct mtd_info *mtd, struct nand_chip *chip, · line 3252
Quoted 4 lines
drivers/mtd/nand/nand_base.c +1
-0+break ; } extid >>=2 ;/* Calc blocksize */
Brian
Quoted 6 lines · Brian Norris
drivers/mtd/nand/nand_base.c static void nand_decode_ext_id(struct mtd_info *mtd, struct nand_chip *chip, · line 3248
Quoted 2 lines
drivers/mtd/nand/nand_base.c +2
-0+case 7 : + mtd->oobsize =SZ_1K ;#include <
linux/sizes.h>Did you compile this?
we do not need this header.
I had already tested this patch with the l2-mtd tree.
Quoted 3 lines
Anyway, I think just using the literal 1024 is better. I can fix it up and push myself in a bit.
Different person has different taste. :)
It is okay to me if you the literal 1024.
thanks
Huang Shijie
Quoted 8 lines · Huang Shijie
Quoted 6 lines · Brian Norris
drivers/mtd/nand/nand_base.c static void nand_decode_ext_id(struct mtd_info *mtd, struct nand_chip *chip, · line 3248
Quoted 2 lines
drivers/mtd/nand/nand_base.c +2
-0+case 7 : + mtd->oobsize =SZ_1K ;#include <
linux/sizes.h>Did you compile this?
we do not need this header.
My compiler begs to differ :)
CC [M] drivers/mtd/nand/nand_base.odrivers/mtd/nand/nand_base.c: In function ‘nand_decode_ext_id’:drivers/mtd/nand/nand_base.c:3159:19: error: ‘SZ_1K’ undeclared (first use in this function)
mtd->oobsize = SZ_1K;
^drivers/mtd/nand/nand_base.c:3159:19: note: each undeclared identifier is reported only once for each function it appears in make[3]: *** [drivers/mtd/nand/nand_base.o] Error 1 make[2]: *** [drivers/mtd/nand] Error 2
make[1]: *** [drivers/mtd] Error 2
make: *** [drivers] Error 2
Maybe different ARCH's have implicit includes. But in any case, it's standard practice to explicitly include the headers you're using.
Quoted 6 lines
I had already tested this patch with the l2-mtd tree.
Quoted 3 lines
Anyway, I think just using the literal 1024 is better. I can fix it up and push myself in a bit.
Different person has different taste. :)
Well, all the other sizes are literals.
Quoted 1 line
It is okay to me if you the literal 1024.
You also dropped the 'default' case, which leaves out the 0 case. I'll reintroduce the default, to go along with case 7. I'll post the complete patch here when/if I push it.
Brian
Quoted 18 lines · Brian Norris
Quoted 8 lines · Huang Shijie
Quoted 6 lines · Brian Norris
drivers/mtd/nand/nand_base.c static void nand_decode_ext_id(struct mtd_info *mtd, struct nand_chip *chip, · line 3248
Quoted 2 lines
drivers/mtd/nand/nand_base.c +2
-0+case 7 : + mtd->oobsize =SZ_1K ;#include <
linux/sizes.h>Did you compile this?
we do not need this header.
My compiler begs to differ :)
CC [M]
drivers/mtd/nand/nand_base.odrivers/mtd/nand/nand_base.c: In function ‘nand_decode_ext_id’:drivers/mtd/nand/nand_base.c:3159:19: error: ‘SZ_1K’ undeclared (first use in this function)mtd->oobsize = SZ_1K; ^
Quoted 8 lines
drivers/mtd/nand/nand_base.c:3159:19: note: each undeclared identifier is reported only once for each function it appears in make[3]: *** [drivers/mtd/nand/nand_base.o] Error 1 make[2]: *** [drivers/mtd/nand] Error 2
make[1]: *** [drivers/mtd] Error 2
make: *** [drivers] Error 2Maybe different ARCH's have implicit includes. But in any case, it's
yes. i only tested in my imx6 board.
Quoted 1 line
standard practice to explicitly include the headers you're using.
got it.
Quoted 8 lines
Quoted 7 lines
I had already tested this patch with the l2-mtd tree.
Quoted 3 lines
Anyway, I think just using the literal 1024 is better. I can fix it up and push myself in a bit.
Different person has different taste. :)
Quoted 7 lines
Well, all the other sizes are literals.
Quoted 1 line
It is okay to me if you the literal 1024.
You also dropped the 'default' case, which leaves out the 0 case. I'll reintroduce the default, to go along with case 7. I'll post the complete patch here when/if I push it.
should i resend a new patch? or you fix it yourself?
thanks
Huang Shijie
PATCH 1/1 mtd: nand: add support for Samsung K9LCG08U0B
In reply to Brian NorrisAssume that:
tmp = ((extid >> 2) & 0x04) | (extid & 0x03));
Quoted 1 line
From the K9LCG08U0B's datasheet, we know that:
the oob size is 640 when tmp is 6;
the oob size is 1024 when tmp is 7;
---
[1] use the 1024, not the SZ_1k
[2] add back the default case for case 0.
--- drivers/mtd/nand/nand_base.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-)
drivers/mtd/nand/nand_base.c +4 -1
@@ -3285,9 +3285,12 @@ static void nand_decode_ext_id(struct mtd_info *mtd, struct nand_chip *chip, mtd->oobsize =512 ;break ;case 6 : -default :/* Other cases are "reserved" (unknown) */ mtd->oobsize =640 ;break ; +default :/* Other cases are "reserved" (unknown) */ +case 7 : + mtd->oobsize =1024 ; +break ; } extid >>=2 ;/* Calc blocksize */
Signature · 1 line
1.7.2.rc3
Quoted 7 lines · Huang Shijie
Assume that:
tmp = ((extid >> 2) & 0x04) | (extid & 0x03));From the K9LCG08U0B's datasheet, we know that:
the oob size is 640 when tmp is 6;
the oob size is 1024 when tmp is 7;
Quoted 5 lines
Signed-off-by Huang Shijie <[email protected]>---
[1] use the 1024, not the
SZ_1k
[2] add back the default case for case 0.
I was already running a modified version of your previous patch through some tests, so I have pushed it to l2-mtd.git. It's nearly identical to this version.
Thanks,
Brian