Message ID | f3bc6eda0c826601e136f3dad91d9674@agner.ch (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On 28 Feb 2015, stefan@agner.ch wrote: > The flash chip mentioned above requires 8-bit error correction per 512 > byte block, hence I increased the ECC to the maximum available level > (60-byte ECC, see page below). One thing which is not very nice, in > order to fit the 60-byte ECC into the 64-byte OOB, I had to shorten > the BBT pattern and set it at the very beginning of the page. This > works fine, however this basically sets the page also to factory bad, > I'm not sure if this is ok? Otherwise, we also could use a BBT pattern > of length 1 (used by cafe_nand.c too). I guess that is a DT option? I wouldn't be an expert on this. So submitting it to the linux-mtd is good. I am also not sure if the HW ECC will work with 'sub-pages'. I think a college of your at Toradex submitted a patch to the u-boot. I am pretty sure that it could work with software ECC, but maybe disabling it is easiest. > What do you think? I would like to respin the NFC patch, with my > U-Boot changes and this change included... Please go ahead. Markus M <marb@ixxat.de> is also using the fsl_nfc driver on a Freescale MPC5125 board, so it is probably good to copy your patches to him. At least, he can test on a BE platform. People also complained about JFFS and this version of the driver. I didn't investigate that. Thanks, Bill Pringlemeir.
On 03/02/2015 08:05 AM, Bill Pringlemeir wrote: > On 28 Feb 2015, stefan@agner.ch wrote: > >> The flash chip mentioned above requires 8-bit error correction per 512 >> byte block, hence I increased the ECC to the maximum available level >> (60-byte ECC, see page below). One thing which is not very nice, in >> order to fit the 60-byte ECC into the 64-byte OOB, I had to shorten >> the BBT pattern and set it at the very beginning of the page. This >> works fine, however this basically sets the page also to factory bad, >> I'm not sure if this is ok? Otherwise, we also could use a BBT pattern >> of length 1 (used by cafe_nand.c too). > I guess that is a DT option? I wouldn't be an expert on this. So > submitting it to the linux-mtd is good. > > I am also not sure if the HW ECC will work with 'sub-pages'. I think a > college of your at Toradex submitted a patch to the u-boot. I am pretty > sure that it could work with software ECC, but maybe disabling it is > easiest. > >> What do you think? I would like to respin the NFC patch, with my >> U-Boot changes and this change included... > Please go ahead. Markus M <marb@ixxat.de> is also using the fsl_nfc > driver on a Freescale MPC5125 board, so it is probably good to copy your > patches to him. At least, he can test on a BE platform. > > People also complained about JFFS and this version of the driver. I > didn't investigate that. I also noticed a problem with JFFS2 and the driver, where fs changes were lost after reboot. Didn't investigate, switched to UBIFS..
On 2015-03-02 22:39, Aaron Brice wrote: > On 03/02/2015 08:05 AM, Bill Pringlemeir wrote: >> On 28 Feb 2015, stefan@agner.ch wrote: >> >>> The flash chip mentioned above requires 8-bit error correction per 512 >>> byte block, hence I increased the ECC to the maximum available level >>> (60-byte ECC, see page below). One thing which is not very nice, in >>> order to fit the 60-byte ECC into the 64-byte OOB, I had to shorten >>> the BBT pattern and set it at the very beginning of the page. This >>> works fine, however this basically sets the page also to factory bad, >>> I'm not sure if this is ok? Otherwise, we also could use a BBT pattern >>> of length 1 (used by cafe_nand.c too). >> I guess that is a DT option? I wouldn't be an expert on this. So >> submitting it to the linux-mtd is good. >> >> I am also not sure if the HW ECC will work with 'sub-pages'. I think a >> college of your at Toradex submitted a patch to the u-boot. I am pretty >> sure that it could work with software ECC, but maybe disabling it is >> easiest. >> >>> What do you think? I would like to respin the NFC patch, with my >>> U-Boot changes and this change included... >> Please go ahead. Markus M <marb@ixxat.de> is also using the fsl_nfc >> driver on a Freescale MPC5125 board, so it is probably good to copy your >> patches to him. At least, he can test on a BE platform. >> >> People also complained about JFFS and this version of the driver. I >> didn't investigate that. > > I also noticed a problem with JFFS2 and the driver, where fs changes > were lost after reboot. Didn't investigate, switched to UBIFS.. Did you happen to use HW ECC? The controller seems to use byte 19 onwards to store the ECC bytes, where also JFFS2 stores it's meta data when using a NAND chip with 64-byte OOB (see http://www.linux-mtd.infradead.org/doc/nand.html). However, I think UBI/UBIFS is a good choice anyway. -- Stefan
diff --git a/drivers/mtd/nand/fsl_nfc.c b/drivers/mtd/nand/fsl_nfc.c index bfc7b7b..3d6da80 100644 --- a/drivers/mtd/nand/fsl_nfc.c +++ b/drivers/mtd/nand/fsl_nfc.c @@ -70,6 +70,7 @@ /* NFC ECC mode define */ #define ECC_BYPASS 0 #define ECC_45_BYTE 6 +#define ECC_60_BYTE 7 /*** Register Mask and bit definitions */ @@ -155,15 +156,15 @@ struct fsl_nfc { }; #define mtd_to_nfc(_mtd) container_of(_mtd, struct fsl_nfc, mtd) -static u8 bbt_pattern[] = {'B', 'b', 't', '0' }; -static u8 mirror_pattern[] = {'1', 't', 'b', 'B' }; +static u8 bbt_pattern[] = {'B', 'b', 't' }; +static u8 mirror_pattern[] = {'t', 'b', 'B' }; static struct nand_bbt_descr bbt_main_descr = { .options = NAND_BBT_LASTBLOCK | NAND_BBT_CREATE | NAND_BBT_WRITE | NAND_BBT_2BIT | NAND_BBT_VERSION, - .offs = 11, - .len = 4, - .veroffs = 15, + .offs = 0, + .len = 3, + .veroffs = 3, .maxblocks = 4, .pattern = bbt_pattern, }; @@ -171,9 +172,9 @@ static struct nand_bbt_descr bbt_main_descr = { static struct nand_bbt_descr bbt_mirror_descr = { .options = NAND_BBT_LASTBLOCK | NAND_BBT_CREATE | NAND_BBT_WRITE | NAND_BBT_2BIT | NAND_BBT_VERSION, - .offs = 11, - .len = 4, - .veroffs = 15, + .offs = 0, + .len = 3, + .veroffs = 3, .maxblocks = 4, .pattern = mirror_pattern, }; @@ -191,6 +192,21 @@ static struct nand_ecclayout nfc_ecc45 = { .length = 11} } }; +static struct nand_ecclayout nfc_ecc60 = { + .eccbytes = 60, + .eccpos = { 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, + 44, 45, 46, 47, 48, 49, 50, 51, diff --git a/drivers/mtd/nand/fsl_nfc.c b/drivers/mtd/nand/fsl_nfc.c index bfc7b7b..3d6da80 100644 --- a/drivers/mtd/nand/fsl_nfc.c +++ b/drivers/mtd/nand/fsl_nfc.c @@ -70,6 +70,7 @@ /* NFC ECC mode define */ #define ECC_BYPASS 0 #define ECC_45_BYTE 6 +#define ECC_60_BYTE 7 /*** Register Mask and bit definitions */ @@ -155,15 +156,15 @@ struct fsl_nfc { }; #define mtd_to_nfc(_mtd) container_of(_mtd, struct fsl_nfc, mtd) -static u8 bbt_pattern[] = {'B', 'b', 't', '0' }; -static u8 mirror_pattern[] = {'1', 't', 'b', 'B' }; +static u8 bbt_pattern[] = {'B', 'b', 't' }; +static u8 mirror_pattern[] = {'t', 'b', 'B' }; static struct nand_bbt_descr bbt_main_descr = { .options = NAND_BBT_LASTBLOCK | NAND_BBT_CREATE | NAND_BBT_WRITE | NAND_BBT_2BIT | NAND_BBT_VERSION, - .offs = 11, - .len = 4, - .veroffs = 15, + .offs = 0, + .len = 3, + .veroffs = 3, .maxblocks = 4, .pattern = bbt_pattern,