diff options
author | Boris Brezillon <boris.brezillon@free-electrons.com> | 2016-06-06 10:16:59 +0200 |
---|---|---|
committer | Scott Wood <oss@buserror.net> | 2016-06-19 19:12:01 -0500 |
commit | fa3011587887ba222bc9337d9ac17f3000db63b2 (patch) | |
tree | b99cbe9a61b1e2fb43499e57659f45c8d8594f7c /drivers/mtd/nand | |
parent | 80ef700f8df1f85dd3b0880584e2e2a998a9b3dd (diff) |
spl: nand: sunxi: stop guessing the redundant u-boot offset
Use CONFIG_SYS_NAND_U_BOOT_OFFS_REDUND value instead of trying to guess
where the redundant u-boot image is based on simple (and most of the time
erroneous) heuristics.
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Acked-by: Hans de Goede <hdegoede@redhat.com>
# Conflicts:
# drivers/mtd/nand/sunxi_nand_spl.c
Diffstat (limited to 'drivers/mtd/nand')
-rw-r--r-- | drivers/mtd/nand/sunxi_nand_spl.c | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/drivers/mtd/nand/sunxi_nand_spl.c b/drivers/mtd/nand/sunxi_nand_spl.c index 1739da26c7..13e6eab44b 100644 --- a/drivers/mtd/nand/sunxi_nand_spl.c +++ b/drivers/mtd/nand/sunxi_nand_spl.c @@ -344,26 +344,6 @@ static int nand_read_buffer(uint32_t offs, unsigned int size, void *dest) int nand_spl_load_image(uint32_t offs, unsigned int size, void *dest) { - /* - * u-boot partition sits after 2 eraseblocks (spl, spl-backup), look - * for backup u-boot 1 erase block further. - */ - const uint32_t eraseblock_size = CONFIG_SYS_NAND_U_BOOT_OFFS / 2; - const uint32_t boot_offsets[] = { - CONFIG_SYS_NAND_U_BOOT_OFFS, - CONFIG_SYS_NAND_U_BOOT_OFFS + eraseblock_size, - }; - int i; - - if (offs == CONFIG_SYS_NAND_U_BOOT_OFFS) { - for (i = 0; i < ARRAY_SIZE(boot_offsets); i++) { - if (nand_read_buffer(boot_offsets[i], size, - dest) == 0) - return 0; - } - return -1; - } - return nand_read_buffer(offs, size, dest); } |