All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCHV2] tools: plbimage support generate rcw file
@ 2017-02-26  0:38 yuan linyu
  2017-03-25 16:41 ` york sun
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: yuan linyu @ 2017-02-26  0:38 UTC (permalink / raw)
  To: u-boot

From: yuan linyu <Linyu.Yuan@alcatel-sbell.com.cn>

some system will not generate pbl format u-boot, but require rcw.

Signed-off-by: yuan linyu <Linyu.Yuan@alcatel-sbell.com.cn>
---
 tools/pblimage.c | 48 +++++++++++++++++++++++++++---------------------
 1 file changed, 27 insertions(+), 21 deletions(-)

diff --git a/tools/pblimage.c b/tools/pblimage.c
index 16d94c98c6..30055a9463 100644
--- a/tools/pblimage.c
+++ b/tools/pblimage.c
@@ -194,17 +194,20 @@ void pbl_load_uboot(int ifd, struct image_tool_params *params)
 	pbl_parser(params->imagename);
 
 	/* parse the pbi.cfg file. */
-	pbl_parser(params->imagename2);
+	if (params->imagename2[0] != '\0')
+		pbl_parser(params->imagename2);
+
+	if (params->datafile) {
+		fp_uboot = fopen(params->datafile, "r");
+		if (fp_uboot == NULL) {
+			printf("Error: %s open failed\n", params->datafile);
+			exit(EXIT_FAILURE);
+		}
 
-	fp_uboot = fopen(params->datafile, "r");
-	if (fp_uboot == NULL) {
-		printf("Error: %s open failed\n", params->datafile);
-		exit(EXIT_FAILURE);
+		load_uboot(fp_uboot);
+		fclose(fp_uboot);
 	}
-
-	load_uboot(fp_uboot);
 	add_end_cmd();
-	fclose(fp_uboot);
 	lseek(ifd, 0, SEEK_SET);
 
 	size = pbl_size;
@@ -265,21 +268,24 @@ int pblimage_check_params(struct image_tool_params *params)
 	if (!params)
 		return EXIT_FAILURE;
 
-	fp_uboot = fopen(params->datafile, "r");
-	if (fp_uboot == NULL) {
-		printf("Error: %s open failed\n", params->datafile);
-		exit(EXIT_FAILURE);
-	}
-	fd = fileno(fp_uboot);
+	if (params->datafile) {
+		fp_uboot = fopen(params->datafile, "r");
+		if (fp_uboot == NULL) {
+			printf("Error: %s open failed\n", params->datafile);
+			exit(EXIT_FAILURE);
+		}
+		fd = fileno(fp_uboot);
 
-	if (fstat(fd, &st) == -1) {
-		printf("Error: Could not determine u-boot image size. %s\n",
-		       strerror(errno));
-		exit(EXIT_FAILURE);
-	}
+		if (fstat(fd, &st) == -1) {
+			printf("Error: Could not determine u-boot image size. %s\n",
+				   strerror(errno));
+			exit(EXIT_FAILURE);
+		}
 
-	/* For the variable size, we need to pad it to 64 byte boundary */
-	uboot_size = roundup(st.st_size, 64);
+		/* For the variable size, we need to pad it to 64 byte boundary */
+		uboot_size = roundup(st.st_size, 64);
+		fclose(fp_uboot);
+	}
 
 	if (params->arch == IH_ARCH_ARM) {
 		arch_flag = IH_ARCH_ARM;
-- 
2.11.1

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

* [U-Boot] [PATCHV2] tools: plbimage support generate rcw file
  2017-02-26  0:38 [U-Boot] [PATCHV2] tools: plbimage support generate rcw file yuan linyu
@ 2017-03-25 16:41 ` york sun
  2017-03-27  3:38   ` Alison Wang
  2017-03-26 18:43 ` york sun
  2017-03-28 17:59 ` york sun
  2 siblings, 1 reply; 6+ messages in thread
From: york sun @ 2017-03-25 16:41 UTC (permalink / raw)
  To: u-boot

On 02/25/2017 04:38 PM, yuan linyu wrote:
> From: yuan linyu <Linyu.Yuan@alcatel-sbell.com.cn>
>
> some system will not generate pbl format u-boot, but require rcw.
>
> Signed-off-by: yuan linyu <Linyu.Yuan@alcatel-sbell.com.cn>
> ---
>  tools/pblimage.c | 48 +++++++++++++++++++++++++++---------------------
>  1 file changed, 27 insertions(+), 21 deletions(-)
>

Alison,

This patch looks OK to me. Would you confirm?

York

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

* [U-Boot] [PATCHV2] tools: plbimage support generate rcw file
  2017-02-26  0:38 [U-Boot] [PATCHV2] tools: plbimage support generate rcw file yuan linyu
  2017-03-25 16:41 ` york sun
@ 2017-03-26 18:43 ` york sun
  2017-03-27  0:05   ` YUAN Linyu
  2017-03-28 17:59 ` york sun
  2 siblings, 1 reply; 6+ messages in thread
From: york sun @ 2017-03-26 18:43 UTC (permalink / raw)
  To: u-boot

On 02/25/2017 04:38 PM, yuan linyu wrote:
> From: yuan linyu <Linyu.Yuan@alcatel-sbell.com.cn>
>
> some system will not generate pbl format u-boot, but require rcw.
>
> Signed-off-by: yuan linyu <Linyu.Yuan@alcatel-sbell.com.cn>
> ---
>  tools/pblimage.c | 48 +++++++++++++++++++++++++++---------------------
>  1 file changed, 27 insertions(+), 21 deletions(-)
>
> diff --git a/tools/pblimage.c b/tools/pblimage.c
> index 16d94c98c6..30055a9463 100644
> --- a/tools/pblimage.c
> +++ b/tools/pblimage.c

<snip>

> -		exit(EXIT_FAILURE);
> -	}
> +		if (fstat(fd, &st) == -1) {
> +			printf("Error: Could not determine u-boot image size. %s\n",
> +				   strerror(errno));

Alignment mismatch.

> +			exit(EXIT_FAILURE);
> +		}
>
> -	/* For the variable size, we need to pad it to 64 byte boundary */
> -	uboot_size = roundup(st.st_size, 64);
> +		/* For the variable size, we need to pad it to 64 byte boundary */

Line too long.

> +		uboot_size = roundup(st.st_size, 64);
> +		fclose(fp_uboot);
> +	}
>
>  	if (params->arch == IH_ARCH_ARM) {
>  		arch_flag = IH_ARCH_ARM;
>

Only minor cosmetic issues. I will fix them for you this time if no 
issue found during further testing.

York

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

* [U-Boot] [PATCHV2] tools: plbimage support generate rcw file
  2017-03-26 18:43 ` york sun
@ 2017-03-27  0:05   ` YUAN Linyu
  0 siblings, 0 replies; 6+ messages in thread
From: YUAN Linyu @ 2017-03-27  0:05 UTC (permalink / raw)
  To: u-boot



> -----Original Message-----
> From: york sun [mailto:york.sun at nxp.com]
> Sent: Monday, March 27, 2017 2:44 AM
> To: yuan linyu; u-boot at lists.denx.de
> Cc: YUAN Linyu
> Subject: Re: [PATCHV2] tools: plbimage support generate rcw file
> 
> 
> Only minor cosmetic issues. I will fix them for you this time if no
> issue found during further testing.
> 
thanks.
> York

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

* [U-Boot] [PATCHV2] tools: plbimage support generate rcw file
  2017-03-25 16:41 ` york sun
@ 2017-03-27  3:38   ` Alison Wang
  0 siblings, 0 replies; 6+ messages in thread
From: Alison Wang @ 2017-03-27  3:38 UTC (permalink / raw)
  To: u-boot

> On 02/25/2017 04:38 PM, yuan linyu wrote:
> > From: yuan linyu <Linyu.Yuan@alcatel-sbell.com.cn>
> >
> > some system will not generate pbl format u-boot, but require rcw.
> >
> > Signed-off-by: yuan linyu <Linyu.Yuan@alcatel-sbell.com.cn>
> > ---
> >  tools/pblimage.c | 48 +++++++++++++++++++++++++++-------------------
> --
> >  1 file changed, 27 insertions(+), 21 deletions(-)
> >
> 
> Alison,
> 
> This patch looks OK to me. Would you confirm?
> 
[Alison Wang] This patch looks OK to me too.

Reviewed-by: Alison Wang <alison.wang@nxp.com>

Best Regards,
Alison Wang

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

* [U-Boot] [PATCHV2] tools: plbimage support generate rcw file
  2017-02-26  0:38 [U-Boot] [PATCHV2] tools: plbimage support generate rcw file yuan linyu
  2017-03-25 16:41 ` york sun
  2017-03-26 18:43 ` york sun
@ 2017-03-28 17:59 ` york sun
  2 siblings, 0 replies; 6+ messages in thread
From: york sun @ 2017-03-28 17:59 UTC (permalink / raw)
  To: u-boot

On 02/25/2017 04:38 PM, yuan linyu wrote:
> From: yuan linyu <Linyu.Yuan@alcatel-sbell.com.cn>
>
> some system will not generate pbl format u-boot, but require rcw.
>
> Signed-off-by: yuan linyu <Linyu.Yuan@alcatel-sbell.com.cn>
> ---

Applied to fsl-qoriq master, awaiting upstream. Thanks.

York

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

end of thread, other threads:[~2017-03-28 17:59 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-26  0:38 [U-Boot] [PATCHV2] tools: plbimage support generate rcw file yuan linyu
2017-03-25 16:41 ` york sun
2017-03-27  3:38   ` Alison Wang
2017-03-26 18:43 ` york sun
2017-03-27  0:05   ` YUAN Linyu
2017-03-28 17:59 ` york sun

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.