spl: nand: sunxi: remove support for so-called 'syndrome' mode
authorBoris Brezillon <boris.brezillon@free-electrons.com>
Mon, 6 Jun 2016 08:16:56 +0000 (10:16 +0200)
committerScott Wood <oss@buserror.net>
Sun, 19 Jun 2016 23:52:35 +0000 (18:52 -0500)
commitc4adf9db5d382be6d13a19585f28de6f3e4e3d61
tree1536604e86ceb4c6a36618ab8c91172a5145517d
parent667067faa18334f1e28c01b47530b5cce1b6182f
spl: nand: sunxi: remove support for so-called 'syndrome' mode

The sunxi SPL NAND controller driver supports use 'BootROM'-like configs,
that is, configs where the ECC bytes and real data are interleaved in the
page instead of putting ECC bytes in the OOB area.

Doing that has several drawbacks:
- since you're interleaving data and ECC bytes you can't use the whole page
  otherwise you might override the bad block marker with non-FF bytes.
- to solve the bad block marker problem, the ROM code supports partially
  using the page, but this introduces a huge penalty both in term of read
  speed and NAND memory usage. While this is fine for rather small
  binaries(like the SPL one which is at maximum 24KB large), it becomes
  non-negligible for the bootloader image (several hundred of KB).
- auto-detection of the page size is not reliable (this is in my opinion
  the biggest problem). If you get the page size wrong, you'll end up
  reading data at a different offset than what was specified by the caller
  and the reading may succeed (if valid data were written at this address).

For all those reasons I think it's wiser to completely remove support for
'syndrome' configs. If we ever need to support it again, then I'd recommend
specifying all the config parameters through Kconfig options.

Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Acked-by: Hans de Goede <hdegoede@redhat.com>
drivers/mtd/nand/sunxi_nand_spl.c