stm32mp: stm32prog: accept device without partition
authorPatrick Delaunay <patrick.delaunay@st.com>
Thu, 15 Oct 2020 12:28:17 +0000 (14:28 +0200)
committerPatrick Delaunay <patrick.delaunay@st.com>
Wed, 21 Oct 2020 16:12:20 +0000 (18:12 +0200)
commit53de79fecc53338b544b4d2c2d88daba9d82b007
tree34c3a6925cb72b4a0bfec68778b9045003d8472a
parent33f5000ee8ed7e7f6d8e81d2d5724e773e9e852d
stm32mp: stm32prog: accept device without partition

When partitions are not available on a device the command stm32prog raises
an error but a device can have no partition to check in init_device()
and the command need to continue to the next part_id.

This patch correct an issue for ram0 target, when block_dev and mtd
are NULL.

For example with the simple flashlayout file:

Opt Part Name Type Device Offset Binary
- 0x01 fsbl Binary none 0x0 tf-a-serialboot.stm32
- 0x03 ssbl Binary none 0x0 u-boot.stm32
P 0x10 kernel System ram0 0xC2000000 uImage.bin
P 0x11 dtb FileSytem ram0 0xC4000000 stm32mp157f-ev1.dtb

Fixes: ffc405e63b94 ("stm32mp: stm32prog: add upport of partial update")
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c