All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] stm32mp: stm32prog: use defines for virtual partition size
@ 2021-07-05  7:39 Patrick Delaunay
  2021-07-05  8:57 ` Patrice CHOTARD
  2021-07-16  8:30 ` Patrick DELAUNAY
  0 siblings, 2 replies; 3+ messages in thread
From: Patrick Delaunay @ 2021-07-05  7:39 UTC (permalink / raw)
  To: u-boot; +Cc: Patrick Delaunay, Patrice Chotard, Simon Glass, U-Boot STM32

Use the existing defines PMIC_SIZE and OTP_SIZE and a new define
CMD_SIZE for virtual partition size.

This patch corrects the size for OTP partition in alternate name
(1024 instead of 512) and avoids other alignment issues.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
---

 arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c     | 6 +++---
 arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h     | 1 +
 arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog_usb.c | 2 +-
 3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c
index 4c4d8a7a69..8288646bb7 100644
--- a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c
+++ b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c
@@ -1195,13 +1195,13 @@ static int dfu_init_entities(struct stm32prog_data *data)
 	}
 
 	if (!ret)
-		ret = stm32prog_alt_add_virt(dfu, "virtual", PHASE_CMD, 512);
+		ret = stm32prog_alt_add_virt(dfu, "virtual", PHASE_CMD, CMD_SIZE);
 
 	if (!ret)
-		ret = stm32prog_alt_add_virt(dfu, "OTP", PHASE_OTP, 512);
+		ret = stm32prog_alt_add_virt(dfu, "OTP", PHASE_OTP, OTP_SIZE);
 
 	if (!ret && CONFIG_IS_ENABLED(DM_PMIC))
-		ret = stm32prog_alt_add_virt(dfu, "PMIC", PHASE_PMIC, 8);
+		ret = stm32prog_alt_add_virt(dfu, "PMIC", PHASE_PMIC, PMIC_SIZE);
 
 	if (ret)
 		stm32prog_err("dfu init failed: %d", ret);
diff --git a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h
index 581b10d0ac..6282c34bcc 100644
--- a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h
+++ b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h
@@ -19,6 +19,7 @@
 
 #define DEFAULT_ADDRESS		0xFFFFFFFF
 
+#define CMD_SIZE		512
 #define OTP_SIZE		1024
 #define PMIC_SIZE		8
 
diff --git a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog_usb.c b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog_usb.c
index bc44d9fc8f..3c0cc6a187 100644
--- a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog_usb.c
+++ b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog_usb.c
@@ -178,7 +178,7 @@ int stm32prog_get_medium_size_virt(struct dfu_entity *dfu, u64 *size)
 
 	switch (dfu->data.virt.dev_num) {
 	case PHASE_CMD:
-		*size = 512;
+		*size = CMD_SIZE;
 		break;
 	case PHASE_OTP:
 		*size = OTP_SIZE;
-- 
2.25.1


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

* Re: [PATCH] stm32mp: stm32prog: use defines for virtual partition size
  2021-07-05  7:39 [PATCH] stm32mp: stm32prog: use defines for virtual partition size Patrick Delaunay
@ 2021-07-05  8:57 ` Patrice CHOTARD
  2021-07-16  8:30 ` Patrick DELAUNAY
  1 sibling, 0 replies; 3+ messages in thread
From: Patrice CHOTARD @ 2021-07-05  8:57 UTC (permalink / raw)
  To: Patrick Delaunay, u-boot; +Cc: Simon Glass, U-Boot STM32

Hi Patrick

On 7/5/21 9:39 AM, Patrick Delaunay wrote:
> Use the existing defines PMIC_SIZE and OTP_SIZE and a new define
> CMD_SIZE for virtual partition size.
> 
> This patch corrects the size for OTP partition in alternate name
> (1024 instead of 512) and avoids other alignment issues.
> 
> Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
> ---
> 
>  arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c     | 6 +++---
>  arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h     | 1 +
>  arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog_usb.c | 2 +-
>  3 files changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c
> index 4c4d8a7a69..8288646bb7 100644
> --- a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c
> +++ b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c
> @@ -1195,13 +1195,13 @@ static int dfu_init_entities(struct stm32prog_data *data)
>  	}
>  
>  	if (!ret)
> -		ret = stm32prog_alt_add_virt(dfu, "virtual", PHASE_CMD, 512);
> +		ret = stm32prog_alt_add_virt(dfu, "virtual", PHASE_CMD, CMD_SIZE);
>  
>  	if (!ret)
> -		ret = stm32prog_alt_add_virt(dfu, "OTP", PHASE_OTP, 512);
> +		ret = stm32prog_alt_add_virt(dfu, "OTP", PHASE_OTP, OTP_SIZE);
>  
>  	if (!ret && CONFIG_IS_ENABLED(DM_PMIC))
> -		ret = stm32prog_alt_add_virt(dfu, "PMIC", PHASE_PMIC, 8);
> +		ret = stm32prog_alt_add_virt(dfu, "PMIC", PHASE_PMIC, PMIC_SIZE);
>  
>  	if (ret)
>  		stm32prog_err("dfu init failed: %d", ret);
> diff --git a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h
> index 581b10d0ac..6282c34bcc 100644
> --- a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h
> +++ b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h
> @@ -19,6 +19,7 @@
>  
>  #define DEFAULT_ADDRESS		0xFFFFFFFF
>  
> +#define CMD_SIZE		512
>  #define OTP_SIZE		1024
>  #define PMIC_SIZE		8
>  
> diff --git a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog_usb.c b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog_usb.c
> index bc44d9fc8f..3c0cc6a187 100644
> --- a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog_usb.c
> +++ b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog_usb.c
> @@ -178,7 +178,7 @@ int stm32prog_get_medium_size_virt(struct dfu_entity *dfu, u64 *size)
>  
>  	switch (dfu->data.virt.dev_num) {
>  	case PHASE_CMD:
> -		*size = 512;
> +		*size = CMD_SIZE;
>  		break;
>  	case PHASE_OTP:
>  		*size = OTP_SIZE;
> 
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>

Thanks
Patrice

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

* Re: [PATCH] stm32mp: stm32prog: use defines for virtual partition size
  2021-07-05  7:39 [PATCH] stm32mp: stm32prog: use defines for virtual partition size Patrick Delaunay
  2021-07-05  8:57 ` Patrice CHOTARD
@ 2021-07-16  8:30 ` Patrick DELAUNAY
  1 sibling, 0 replies; 3+ messages in thread
From: Patrick DELAUNAY @ 2021-07-16  8:30 UTC (permalink / raw)
  To: u-boot; +Cc: Patrice Chotard, Simon Glass, U-Boot STM32

Hi,

On 7/5/21 9:39 AM, Patrick Delaunay wrote:
> Use the existing defines PMIC_SIZE and OTP_SIZE and a new define
> CMD_SIZE for virtual partition size.
>
> This patch corrects the size for OTP partition in alternate name
> (1024 instead of 512) and avoids other alignment issues.
>
> Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
> ---
>
>   arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c     | 6 +++---
>   arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h     | 1 +
>   arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog_usb.c | 2 +-
>   3 files changed, 5 insertions(+), 4 deletions(-)
>

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

Regards
Patrick


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

end of thread, other threads:[~2021-07-16  8:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-05  7:39 [PATCH] stm32mp: stm32prog: use defines for virtual partition size Patrick Delaunay
2021-07-05  8:57 ` Patrice CHOTARD
2021-07-16  8:30 ` 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.