MLK-22259-2: cmd: mtdparts: skip invalid devices rather than quit
authorHan Xu <han.xu@nxp.com>
Fri, 12 Jul 2019 20:52:58 +0000 (15:52 -0500)
committerYe Li <ye.li@nxp.com>
Thu, 29 Apr 2021 07:56:18 +0000 (00:56 -0700)
commit90c6282e025c3978a48e0433393ac0091f46ac60
treecea4e9012e92fcba4832f71d8fd457961be21258
parentc433f1ac5aa961d5ffd768e33f16497b8b831273
MLK-22259-2: cmd: mtdparts: skip invalid devices rather than quit

mtdparts quit when invalid mtd devices found. Add thes patches to skip
the invalid devices, so NAND partitions can be alway found to burn boot
images.

For instance,

On i.MX6DL Sabreauto, nand config u-boot didn't enable the weim nor, so
parsing 8000000.nor leads to error:

Device nor0 not found!

With the patches, we can skip this invalid device and still get nand
boot partition table:

Device nor0 not found!
current device is invalid, skip it and check the next one

device nand0 <gpmi-nand>, # parts = 5
0: nandboot 0x04000000 0x00000000 0
1: nandkernel 0x01000000 0x04000000 0
2: nanddtb 0x01000000 0x05000000 0
3: nandtee 0x01000000 0x06000000 0
4: nandrootfs 0xf9000000 0x07000000 0

active partition: nand0,0 - (nandboot) 0x04000000 @ 0x00000000

Signed-off-by: Han Xu <han.xu@nxp.com>
(cherry picked from commit e674896123983e152ef3cc9d1304b775e5086a5e)
(cherry picked from commit 75e8911f64b27cc90b38b3780e9ebe88b2cadad2)
cmd/mtdparts.c