OMAP3: Fix broken NAND ECC HW switch
Subsystems (2)
Fix broken NAND ECC HW switch and invert logic of if(!hardware) for easier reading.
Signed-off-by Dirk Behme <[email protected]>
--- drivers/mtd/nand/omap_gpmc.c | 21 ++++++++++++++++----- 1 files changed, 16 insertions(+), 5 deletions(-)
drivers/mtd/nand/omap_gpmc.c +16 -5
@@ -255,12 +255,17 @@ void omap_nand_switch_ecc(int32_t hardwa nand->options =NAND_NO_PADDING |NAND_CACHEPRG |NAND_NO_AUTOINCR |NAND_NO_AUTOINCR ; +/* Reset ecc interface */ + nand->ecc.read_page =NULL ; + nand->ecc.write_page =NULL ; + nand->ecc.read_oob =NULL ; + nand->ecc.write_oob =NULL ; + nand->ecc.hwctl =NULL ; + nand->ecc.correct =NULL ; + nand->ecc.calculate =NULL ; +/* Setup the ecc configurations again */ -if (!hardware) { - nand->ecc.mode =NAND_ECC_SOFT ; -/* Use mtd default settings */ - nand->ecc.layout =NULL ; - }else { +if (hardware) { nand->ecc.mode =NAND_ECC_HW ; nand->ecc.layout = &hw_nand_oob; nand->ecc.size =512 ;
@@ -269,6 +274,12 @@ void omap_nand_switch_ecc(int32_t hardwa nand->ecc.correct = omap_correct_data; nand->ecc.calculate = omap_calculate_ecc;omap_hwecc_init (nand); +printf ("HW ECC selected\n" ); + }else { + nand->ecc.mode =NAND_ECC_SOFT ; +/* Use mtd default settings */ + nand->ecc.layout =NULL ; +printf ("SW ECC selected\n" ); }/* Update NAND handling after ECC mode switch */
Quoted 9 lines · dirk.behme at googlemail.com
Fix broken NAND ECC HW switch and invert logic of if(!hardware) for easier reading.
Signed-off-by Dirk Behme <[email protected]>--- drivers/mtd/nand/omap_gpmc.c | 21 ++++++++++++++++----- 1 files changed, 16 insertions(+), 5 deletions(-)
Applied to u-boot-arm/omap
Best Regards,
J.