MTD: nand: mxs_nand: Allow driver to auto setup ECC in SPL
Subsystems (3)
PATCH 1/1 MTD: nand: mxs_nand: Allow driver to auto setup ECC in SPL
The initialization of the NAND in SPL hard-coded ecc.bytes, ecc.size, and ecc.strength which may work for some NAND parts, but it not appropriate for others. With the pending patch "mxs_nand: Fix BCH read timeout error on boards requiring ECC" the driver can auto configure the ECC when these entries are blank. This patch has been tested in NAND flash with oob 64 and oob 128.
drivers/mtd/nand/raw/mxs_nand.c +0 -3
@@ -1191,9 +1191,6 @@ int mxs_nand_init_spl(struct nand_chip *nand) nand->ecc.read_page = mxs_nand_ecc_read_page; nand->ecc.mode =NAND_ECC_HW ; - nand->ecc.bytes =9 ; - nand->ecc.size =512 ; - nand->ecc.strength =8 ;return 0 ; }
Signature · 1 line
2.17.1
PATCH 1/1 MTD: nand: mxs_nand: Allow driver to auto setup ECC in SPL
Hi,
Quoted 9 lines · Adam Ford
The initialization of the NAND in SPL hard-coded ecc.bytes, ecc.size, and ecc.strength which may work for some NAND parts, but it not appropriate for others. With the pending patch "
mxs_nand: Fix BCH read timeout error on boards requiring ECC" the driver can auto configure the ECC when these entries are blank. This patch has been tested in NAND flash with oob 64 and oob 128.Signed-off-by Adam Ford <[email protected]>
Maybe you can give me a hint where the driver actually does the auto configuration?
I've tested the patch on a custom i.MX6ULL board with a Micron NAND flash. The SPL loader is able to boot from NAND with and without this patch.
Quoted 14 lines
drivers/mtd/nand/raw/mxs_nand.c +0
-3@@ -1191,9 +1191,6 @@ int mxs_nand_init_spl(struct nand_chip *nand) nand->ecc.read_page = mxs_nand_ecc_read_page; nand->ecc.mode =NAND_ECC_HW ; - nand->ecc.bytes =9 ; - nand->ecc.size =512 ; - nand->ecc.strength =8 ;return 0 ; }
PATCH 1/1 MTD: nand: mxs_nand: Allow driver to auto setup ECC in SPL
Quoted 12 lines · Jörg Krause
Hi,
Quoted 8 lines · Adam Ford
The initialization of the NAND in SPL hard-coded ecc.bytes, ecc.size, and ecc.strength which may work for some NAND parts, but it not appropriate for others. With the pending patch "
mxs_nand: Fix BCH read timeout error on boards requiring ECC" the driver can auto configure the ECC when these entries are blank. This patch has been tested in NAND flash with oob 64 and oob 128.
Quoted 8 lines
Quoted 1 line
Signed-off-by Adam Ford <[email protected]>Maybe you can give me a hint where the driver actually does the auto configuration?
I've tested the patch on a custom i.MX6ULL board with a Micron NAND flash. The SPL loader is able to boot from NAND with and without this patch.
I am traveling right now, so I don;t have my editor or source code, but I can tell you that the patch found in
http://patchwork.ozlabs.org/patch/1020160/ sets up the ECC, and if these values are not set they will get set. I won't be back to the office until a week from Monday.
The reason I found I needed this patch was because I have boards with different flash parts that used different ECC values. One my board boards didn't need the patch because the ECC matched the values hard-coded here, but my other board would get ECC errors during SPL because these values didn't match what U-Boot used when it wrote to flash.
If your board works with and without the patch, I am guessing the ECC values generated by the above mentioned patch probably set them to the same values that were hard coded before.
adam
Quoted 18 lines
Tested-by Jörg Krause <[email protected]>Quoted 14 lines
drivers/mtd/nand/raw/mxs_nand.c +0
-3@@ -1191,9 +1191,6 @@ int mxs_nand_init_spl(struct nand_chip *nand) nand->ecc.read_page = mxs_nand_ecc_read_page; nand->ecc.mode =NAND_ECC_HW ; - nand->ecc.bytes =9 ; - nand->ecc.size =512 ; - nand->ecc.strength =8 ;return 0 ; }
PATCH 1/1 MTD: nand: mxs_nand: Allow driver to auto setup ECC in SPL
In reply to Adam FordQuoted 17 lines · Adam Ford
The initialization of the NAND in SPL hard-coded ecc.bytes, ecc.size, and ecc.strength which may work for some NAND parts, but it not appropriate for others. With the pending patch "
mxs_nand: Fix BCH read timeout error on boards requiring ECC" the driver can auto configure the ECC when these entries are blank. This patch has been tested in NAND flash with oob 64 and oob 128.Signed-off-by Adam Ford <[email protected]>drivers/mtd/nand/raw/mxs_nand.c +0
-0
drivers/mtd/nand/raw/mxs_nand.c int mxs_nand_init_spl(struct nand_chip *nand) · line 1196
Quoted 9 lines
drivers/mtd/nand/raw/mxs_nand.c +0
-3@@ -1191,9 +1191,6 @@ int mxs_nand_init_spl(struct nand_chip *nand) nand->ecc.read_page = mxs_nand_ecc_read_page; nand->ecc.mode =NAND_ECC_HW ; - nand->ecc.bytes =9 ; - nand->ecc.size =512 ; - nand->ecc.strength =8 ;return 0 ; }
Thanks Adam,
This resolves failed booting on Gateworks Ventana IMX6 with NAND SPL for Micron MT29F16G08AD 16Gbit (oob=224) and Cypress S34ML16G202BH 16Gbit (oob=128).
This fixes the regressions occuring with 5346c31e305a37d39f535cc0d5ae87d8b7e81230: mtd: nand: mxs_nand: use self init
for GW5104 with Micron MT29F16G08AD 16Gbit (oob=224) and Cypress S34ML16G202BH 16Gbit (oob=128)
Tim
PATCH 1/1 MTD: nand: mxs_nand: Allow driver to auto setup ECC in SPL
Quoted 39 lines · Tim Harvey
Quoted 17 lines · Adam Ford
The initialization of the NAND in SPL hard-coded ecc.bytes, ecc.size, and ecc.strength which may work for some NAND parts, but it not appropriate for others. With the pending patch "
mxs_nand: Fix BCH read timeout error on boards requiring ECC" the driver can auto configure the ECC when these entries are blank. This patch has been tested in NAND flash with oob 64 and oob 128.Signed-off-by Adam Ford <[email protected]>drivers/mtd/nand/raw/mxs_nand.c +0
-0drivers/mtd/nand/raw/mxs_nand.c int mxs_nand_init_spl(struct nand_chip *nand) · line 1196
Quoted 9 lines
drivers/mtd/nand/raw/mxs_nand.c +0
-3@@ -1191,9 +1191,6 @@ int mxs_nand_init_spl(struct nand_chip *nand) nand->ecc.read_page = mxs_nand_ecc_read_page; nand->ecc.mode =NAND_ECC_HW ; - nand->ecc.bytes =9 ; - nand->ecc.size =512 ; - nand->ecc.strength =8 ;return 0 ; }Thanks Adam,
This resolves failed booting on Gateworks Ventana IMX6 with NAND SPL for Micron MT29F16G08AD 16Gbit (oob=224) and Cypress S34ML16G202BH 16Gbit (oob=128).
This fixes the regressions occuring with
5346c31e305a37d39f535cc0d5ae87d8b7e81230: mtd: nand:mxs_nand: use self init
Quoted 6 lines
Acked-by Tim Harvey <[email protected]>Tested-by Tim Harvey <[email protected]>for GW5104 with Micron MT29F16G08AD 16Gbit (oob=224) and Cypress S34ML16G202BH 16Gbit (oob=128)
Scott / Stefano,
Any chance this can get reviewed and/or applied for the next release? We've got a few people who have their respective tested-by comments.
adam
Quoted 1 line
Tim
Quoted 16 lines
The initialization of the NAND in SPL hard-coded ecc.bytes, ecc.size, and ecc.strength which may work for some NAND parts, but it not appropriate for others. With the pending patch "
mxs_nand: Fix BCH read timeout error on boards requiring ECC" the driver can auto configure the ECC when these entries are blank. This patch has been tested in NAND flash with oob 64 and oob 128.Signed-off-by Adam Ford <[email protected]>Tested-by Jörg Krause <[email protected]>Acked-by Tim Harvey <[email protected]>Tested-by Tim Harvey <[email protected]>drivers/mtd/nand/raw/mxs_nand.c +0
-0
drivers/mtd/nand/raw/mxs_nand.c int mxs_nand_init_spl(struct nand_chip *nand) · line 1196
Quoted 9 lines
drivers/mtd/nand/raw/mxs_nand.c +0
-3@@ -1191,9 +1191,6 @@ int mxs_nand_init_spl(struct nand_chip *nand) nand->ecc.read_page = mxs_nand_ecc_read_page; nand->ecc.mode =NAND_ECC_HW ; - nand->ecc.bytes =9 ; - nand->ecc.size =512 ; - nand->ecc.strength =8 ;return 0 ; }
Applied to u-boot-imx, master, thanks !
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de =====================================================================