public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Wolfgang Denk <wd@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH V2 1/9] mkimage: Add Freescale imx Boot Image support (imximage)
Date: Fri, 15 Jan 2010 16:39:28 +0100	[thread overview]
Message-ID: <20100115153928.6FA873F6DA@gemini.denx.de> (raw)
In-Reply-To: <1263376259-29764-2-git-send-email-sbabic@denx.de>

Dear Stefano Babic,

In message <1263376259-29764-2-git-send-email-sbabic@denx.de> you wrote:
> This patch adds support for "imximage" (MX Boot Image)
> to the mkimage utility. The imximage is used on the Freescales's
> MX.51 processors.
> 
> Further details under doc/README.imximage.
> 
> This patch was tested on a Freescale mx51evk board.
...
> diff --git a/tools/Makefile b/tools/Makefile
> index 5b8c3c3..afc1d44 100644
> --- a/tools/Makefile
> +++ b/tools/Makefile
> @@ -73,6 +73,7 @@ OBJ_FILES-$(CONFIG_CMD_NET) += gen_eth_addr.o
>  OBJ_FILES-$(CONFIG_CMD_LOADS) += img2srec.o
>  OBJ_FILES-$(CONFIG_INCA_IP) += inca-swap-bytes.o
>  NOPED_OBJ_FILES-y += kwbimage.o
> +NOPED_OBJ_FILES-y += imximage.o
>  NOPED_OBJ_FILES-y += mkimage.o
>  OBJ_FILES-$(CONFIG_NETCONSOLE) += ncb.o
>  NOPED_OBJ_FILES-y += os_support.o
> @@ -159,6 +160,7 @@ $(obj)mkimage$(SFX):	$(obj)crc32.o \
>  			$(obj)fit_image.o \
>  			$(obj)image.o \
>  			$(obj)kwbimage.o \
> +			$(obj)imximage.o \
>  			$(obj)md5.o \
>  			$(obj)mkimage.o \
>  			$(obj)os_support.o \

Please keep lists sorted.

> +			case CFG_COMMAND:
> +				cmd = get_table_entry_id(imximage_cmds,
> +					"imximage commands", token);
> +				if (cmd < 0) {
> +					fprintf(stderr, "Error: %s[%d] - Invalid command (%s)\n",

Line to long. And please try to stick with a consistent error message
format.

> +			case CFG_REG_SIZE:
> +				switch (cmd) {
> +				case CMD_BOOT_FROM:
> +					/* Get flash header offset */
> +					imxhdr->flash_offset = get_table_entry_id(imximage_bootops,

Ditto, and so on. Please fix globally.

> +int imximage_check_params(struct mkimage_params *params)
> +{
> +	if (!params)
> +		return CFG_INVALID;
> +	if (!strlen(params->imagename)) {
> +		fprintf(stderr, "Error:%s - Configuration file not specified, "
> +			"it is needed for imximage generation\n",
> +			params->cmdname);
> +		return CFG_INVALID;
> +	}
> +	return	(params->dflag && (params->fflag || params->lflag)) ||
> +		(params->fflag && (params->dflag || params->lflag)) ||
> +		(params->lflag && (params->dflag || params->fflag)) ||
> +		(params->xflag) || !(strlen(params->imagename));

I cannot understand this code.

> +static struct image_type_params imximage_params = {
> +	.name = "Freescale i.MX 51 Boot Image support",
> +	.header_size = sizeof(struct imx_header),
> +	.hdr = (void *)&imximage_header,
> +	.check_image_type = imximage_check_image_types,
> +	.verify_header = imximage_verify_header,
> +	.print_header = imximage_print_header,
> +	.set_header = imximage_set_header,
> +	.check_params = imximage_check_params,
> +};

How about using TABs to make this easier to read, say:

static struct image_type_params imximage_params = {
	.name		= "Freescale i.MX 51 Boot Image support",
	.header_size	= sizeof(struct imx_header),
	.hdr		= (void *)&imximage_header,
	.check_image_type = imximage_check_image_types,
	.verify_header	= imximage_verify_header,
	.print_header	= imximage_print_header,
	.set_header	= imximage_set_header,
	.check_params	= imximage_check_params,
};


Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Brontosaurus Principle: Organizations  can  grow  faster  than  their
brains  can manage them in relation to their environment and to their
own physiology: when this occurs, they are an endangered species.
                                                - Thomas K. Connellan

  parent reply	other threads:[~2010-01-15 15:39 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-13  9:50 [U-Boot] MX51 Support V2 Stefano Babic
2010-01-13  9:50 ` [U-Boot] [PATCH V2 1/9] mkimage: Add Freescale imx Boot Image support (imximage) Stefano Babic
2010-01-13  9:50   ` [U-Boot] [PATCH V2 2/9] MX51: Add initial support for the Freescale MX51 Stefano Babic
2010-01-13  9:50     ` [U-Boot] [PATCH V2 3/9] MX51: Add register definitions Stefano Babic
2010-01-13  9:50       ` [U-Boot] [PATCH V2 4/9] MX51: Add pin and multiplexer definitions Stefano Babic
2010-01-13  9:50         ` [U-Boot] [PATCH V2 5/9] serial_mxc: add support for MX51 processor Stefano Babic
2010-01-13  9:50           ` [U-Boot] [PATCH V2 6/9] fec_mxc: " Stefano Babic
2010-01-13  9:50             ` [U-Boot] [PATCH V2 7/9] fsl_esdhc: add support for mx51 processor Stefano Babic
2010-01-13  9:50               ` [U-Boot] [PATCH V2 8/9] mmc: check correctness of the voltage mask in ocr Stefano Babic
2010-01-13  9:50                 ` [U-Boot] [PATCH V2 9/9] Add initial support for Freescale mx51evk board Stefano Babic
2010-01-19  8:26               ` [U-Boot] [PATCH V2 7/9] fsl_esdhc: add support for mx51 processor Andy Fleming
2010-01-20  9:33                 ` Stefano Babic
2010-01-13 17:08   ` [U-Boot] [PATCH V2 1/9] mkimage: Add Freescale imx Boot Image support (imximage) Fabio Estevam
2010-01-14  8:51     ` Stefano Babic
2010-01-15  0:56   ` Fabio Estevam
2010-01-15  8:40     ` stefano at babic.homelinux.org
2010-01-15 12:19       ` Fabio Estevam
2010-01-15 15:01         ` Stefano Babic
2010-01-15 15:39   ` Wolfgang Denk [this message]
2010-01-18  6:27     ` Stefano Babic

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100115153928.6FA873F6DA@gemini.denx.de \
    --to=wd@denx.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox