All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] stm32mp: stm32prog: accept device without partition
@ 2020-10-15 12:28 Patrick Delaunay
  2020-10-21 11:48 ` Patrice CHOTARD
  2020-10-21 13:44 ` Patrick DELAUNAY
  0 siblings, 2 replies; 3+ messages in thread
From: Patrick Delaunay @ 2020-10-15 12:28 UTC (permalink / raw)
  To: u-boot

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>
---

 arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c
index ec3355d816..a777827c55 100644
--- a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c
+++ b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c
@@ -768,9 +768,8 @@ static int init_device(struct stm32prog_data *data,
 			part_found = true;
 		}
 
+		/* no partition for this device */
 		if (!part_found) {
-			stm32prog_err("%s (0x%x): Invalid partition",
-				      part->name, part->id);
 			pr_debug("\n");
 			continue;
 		}
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH] stm32mp: stm32prog: accept device without partition
  2020-10-15 12:28 [PATCH] stm32mp: stm32prog: accept device without partition Patrick Delaunay
@ 2020-10-21 11:48 ` Patrice CHOTARD
  2020-10-21 13:44 ` Patrick DELAUNAY
  1 sibling, 0 replies; 3+ messages in thread
From: Patrice CHOTARD @ 2020-10-21 11:48 UTC (permalink / raw)
  To: u-boot

Hi Patrick

On 10/15/20 2:28 PM, Patrick Delaunay wrote:
> 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>
> ---
>
>  arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c
> index ec3355d816..a777827c55 100644
> --- a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c
> +++ b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c
> @@ -768,9 +768,8 @@ static int init_device(struct stm32prog_data *data,
>  			part_found = true;
>  		}
>  
> +		/* no partition for this device */
>  		if (!part_found) {
> -			stm32prog_err("%s (0x%x): Invalid partition",
> -				      part->name, part->id);
>  			pr_debug("\n");
>  			continue;
>  		}

Reviewed-by: Patrice Chotard <patrice.chotard@st.com>

Thanks

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] stm32mp: stm32prog: accept device without partition
  2020-10-15 12:28 [PATCH] stm32mp: stm32prog: accept device without partition Patrick Delaunay
  2020-10-21 11:48 ` Patrice CHOTARD
@ 2020-10-21 13:44 ` Patrick DELAUNAY
  1 sibling, 0 replies; 3+ messages in thread
From: Patrick DELAUNAY @ 2020-10-21 13:44 UTC (permalink / raw)
  To: u-boot

Hi,

> From: Patrick DELAUNAY <patrick.delaunay@st.com>
> Sent: jeudi 15 octobre 2020 14:28
> 
> 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>
> ---
> 
>  arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 

Applied to u-boot-stm/master, thanks!

Regards

Patrick

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-10-21 13:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-15 12:28 [PATCH] stm32mp: stm32prog: accept device without partition Patrick Delaunay
2020-10-21 11:48 ` Patrice CHOTARD
2020-10-21 13:44 ` Patrick DELAUNAY

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.