[U-Boot] [PATCH V4 06/11] imximage: move set_imx_hdr to struct data_src

Liu Hui-R64343 r64343 at freescale.com
Wed Nov 28 11:45:37 CET 2012


>-----Original Message-----
>From: Troy Kisky [mailto:troy.kisky at boundarydevices.com]
>Sent: Wednesday, November 28, 2012 9:32 AM
>To: sbabic at denx.de
>Cc: dirk.behme at googlemail.com; u-boot at lists.denx.de; Liu Hui-R64343;
>festevam at gmail.com; Troy Kisky
>Subject: [PATCH V4 06/11] imximage: move set_imx_hdr to struct data_src
>

It's better to not let the commit log empty.

>Signed-off-by: Troy Kisky <troy.kisky at boundarydevices.com>

Acked-by: Jason Liu <r64343 at freescale.com>

>
>---
>v3: new patch
>---
> tools/imximage.c |   13 ++++++-------
> tools/imximage.h |    1 +
> 2 files changed, 7 insertions(+), 7 deletions(-)
>
>diff --git a/tools/imximage.c b/tools/imximage.c index ddac95f..30f3c81
>100644
>--- a/tools/imximage.c
>+++ b/tools/imximage.c
>@@ -67,7 +67,6 @@ static table_entry_t imximage_versions[] = {
>
> static set_dcd_val_t set_dcd_val;
> static set_dcd_rst_t set_dcd_rst;
>-static set_imx_hdr_t set_imx_hdr;
> static uint32_t max_dcd_entries;
> static uint32_t *header_size_ptr;
> static uint32_t g_flash_offset;
>@@ -253,19 +252,19 @@ static int set_imx_hdr_v2(struct data_src *ds,
>uint32_t dcd_len,
> 	return header_length;
> }
>
>-static void set_hdr_func(struct imx_header *imxhdr, uint32_t
>imximage_version)
>+static void set_hdr_func(struct data_src *ds, uint32_t
>+imximage_version)
> {
> 	switch (imximage_version) {
> 	case IMXIMAGE_V1:
> 		set_dcd_val = set_dcd_val_v1;
> 		set_dcd_rst = set_dcd_rst_v1;
>-		set_imx_hdr = set_imx_hdr_v1;
>+		ds->set_imx_hdr = set_imx_hdr_v1;
> 		max_dcd_entries = MAX_HW_CFG_SIZE_V1;
> 		break;
> 	case IMXIMAGE_V2:
> 		set_dcd_val = set_dcd_val_v2;
> 		set_dcd_rst = set_dcd_rst_v2;
>-		set_imx_hdr = set_imx_hdr_v2;
>+		ds->set_imx_hdr = set_imx_hdr_v2;
> 		max_dcd_entries = MAX_HW_CFG_SIZE_V2;
> 		break;
> 	default:
>@@ -346,7 +345,7 @@ static void parse_cfg_cmd(struct data_src *ds, int32_t
>cmd, char *token,
> 			exit(EXIT_FAILURE);
> 		}
> 		cmd_ver_first = 1;
>-		set_hdr_func(ds->imxhdr, imximage_version);
>+		set_hdr_func(ds, imximage_version);
> 		break;
> 	case CMD_BOOT_FROM:
> 		g_flash_offset = get_table_entry_id(imximage_bootops,
>@@ -431,7 +430,7 @@ static int parse_cfg_file(struct imx_header *imxhdr,
>char *name,
> 	 * by adding VERSION command into it, here need
> 	 * set up function ptr group to V1 by default.
> 	 */
>-	set_hdr_func(imxhdr, IMXIMAGE_V1);
>+	set_hdr_func(&ds, IMXIMAGE_V1);
> 	fd = fopen(name, "r");
> 	if (fd == 0) {
> 		fprintf(stderr, "Error: %s - Can't open DCD file\n", name); @@ -
>474,7 +473,7 @@ static int parse_cfg_file(struct imx_header *imxhdr, char
>*name,
> 		exit(EXIT_FAILURE);
> 	}
> 	/* Set the imx header */
>-	return (*set_imx_hdr)(&ds, dcd_len, entry_point, g_flash_offset);
>+	return (*ds.set_imx_hdr)(&ds, dcd_len, entry_point, g_flash_offset);
> }
>
> static int imximage_check_image_types(uint8_t type) diff --git
>a/tools/imximage.h b/tools/imximage.h index 3054d55..f27a2ef 100644
>--- a/tools/imximage.h
>+++ b/tools/imximage.h
>@@ -174,5 +174,6 @@ typedef int (*set_imx_hdr_t)(struct data_src *ds,
>uint32_t dcd_len,
>
> struct data_src {
> 	struct imx_header *imxhdr;
>+	set_imx_hdr_t set_imx_hdr;
> };
> #endif /* _IMXIMAGE_H_ */
>--
>1.7.9.5
>




More information about the U-Boot mailing list