mtd: rawnand: denali_dt: Add support for configuring SPARE_AREA_SKIP_BYTES
authorMarek Vasut <marex@denx.de>
Fri, 20 Dec 2019 11:31:52 +0000 (20:31 +0900)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Tue, 21 Jan 2020 19:00:33 +0000 (20:00 +0100)
commitf5561a7c42d690b51151d955d0a6a80fa3ad6689
tree1f9b4586e5efc26133ceaa290f0e2c991b2972e9
parent82348201384d4481ab92beecfbca7c195120670e
mtd: rawnand: denali_dt: Add support for configuring SPARE_AREA_SKIP_BYTES

The SPARE_AREA_SKIP_BYTES register is reset when the controller reset
signal is toggled. Yet, this register must be configured to match the
content of the NAND OOB area. The current default value is always set
to 8 and is programmed into the hardware in case the hardware was not
programmed before (e.g. in a bootloader) with a different value. This
however does not work when the block is reset properly by Linux.

On Altera SoCFPGA CycloneV, ArriaV and Arria10, which are the SoCFPGA
platforms which support booting from NAND, the SPARE_AREA_SKIP_BYTES
value must be set to 2. On Socionext Uniphier, the value is 8. This
patch adds support for preconfiguring the default value and handles
the special SoCFPGA case by setting the default to 2 on all SoCFPGA
platforms, while retaining the original behavior and default value of
8 on all the other platforms.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: Richard Weinberger <richard@nod.at>
Cc: Vignesh Raghavendra <vigneshr@ti.com>
To: linux-mtd@lists.infradead.org
Reviewed-by: Tudor Ambarus <tudor.ambarus@microchip.com>
Acked-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
drivers/mtd/nand/raw/denali.c
drivers/mtd/nand/raw/denali_dt.c