spl: fit: nand: allow for non-page-aligned elements
authorTim Harvey <tharvey@gateworks.com>
Mon, 1 Mar 2021 22:33:28 +0000 (14:33 -0800)
committerStefano Babic <sbabic@denx.de>
Thu, 8 Apr 2021 18:29:53 +0000 (20:29 +0200)
commitaa0032f67267232c6b315b5f6e1c086c217c9aae
tree19ae1e070b0bb31741cc8122bf54061889ba0ca2
parent39cb85043cdbc98d10b49f0b86596043d5f8e3f8
spl: fit: nand: allow for non-page-aligned elements

Add a weak nand_get_mtd function for nand drivers to provide mtd info
and use this to set pagesize such that reading of non page-aligned
elements can succeed.

The spl_load_simple_fit already handles block block access so all we
need to do is provide the nand writesize as the block length.

Further cleanup of the drivers which use nand_spl_loaders.c such as
am335x_spl_bch.c, atmel_nand.c, and nand_spl_simple.c could be done
using info from mtd_info instead of statically defined details.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
common/spl/spl_nand.c
drivers/mtd/nand/raw/mxs_nand_spl.c