drivers: nand: brcmnand: fix nand_chip ecc layout structure
authorWilliam Zhang <william.zhang@broadcom.com>
Wed, 4 Sep 2019 17:51:13 +0000 (10:51 -0700)
committerDaniel Schwierzeck <daniel.schwierzeck@gmail.com>
Fri, 25 Oct 2019 15:20:43 +0000 (17:20 +0200)
commite365de90517ba4686d7a88417b1a729f5891d376
treeb46fb1a6d6f7f04e4a37199b8c4eb9385fad17d2
parenta69bae04fd4d002a9972d67446bb7b7752b4c6cb
drivers: nand: brcmnand: fix nand_chip ecc layout structure

The current brcmnand driver is based on 4.18 linux kernel which uses
mtd_set_ooblayout to set ecc layout. But nand base code in u-boot is from
old kernel which does not use this new API and expect nand_chip.ecc.layout
structure to be set. This cause nand_scan_tail function running into a bug
check if the device has a different oob size than the default ones.

This patch ports the brcmstb_choose_ecc_layout function from kernel 4.6.7
that supports the ecc layout struture and replaces the mtd_set_ooblayout
method

Signed-off-by: William Zhang <william.zhang@broadcom.com>
Reviewed-by: Philippe Reynes <philippe.reynes@softathome.com>
drivers/mtd/nand/raw/brcmnand/brcmnand.c