All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tom Rini <trini@ti.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/5] tools: mkimage: add support for gpimage format
Date: Mon, 20 Jan 2014 17:56:28 -0500	[thread overview]
Message-ID: <20140120225628.GA3277@bill-the-cat> (raw)
In-Reply-To: <20140120224649.5266D3803D0@gemini.denx.de>

On Mon, Jan 20, 2014 at 11:46:49PM +0100, Wolfgang Denk wrote:
> Dear Murali Karicheri,
> 
> In message <1390255810-19486-2-git-send-email-m-karicheri2@ti.com> you wrote:
> > This patch add support for gpimage format as a preparatory
> > patch for porting u-boot for keystone2 devices and is
> > based on omapimage format. It re-uses gph header to store the
> > size and loadaddr as done in omapimage.c
> ...
> > --- a/common/image.c
> > +++ b/common/image.c
> > @@ -137,6 +137,7 @@ static const table_entry_t uimage_type[] = {
> >  	{	IH_TYPE_STANDALONE, "standalone", "Standalone Program", },
> >  	{	IH_TYPE_UBLIMAGE,   "ublimage",   "Davinci UBL image",},
> >  	{	IH_TYPE_MXSIMAGE,   "mxsimage",   "Freescale MXS Boot Image",},
> > +	{	IH_TYPE_GPIMAGE,    "gpimage",    "TI KeyStone SPL Image",},
> >  	{	-1,		    "",		  "",			},
> 
> Please keep the list sorted.  While you are at it, please also fi the
> incorrect placement of the IH_TYPE_MXSIMAGE entry.
> 
> > --- a/tools/Makefile
> > +++ b/tools/Makefile
> > @@ -84,7 +84,9 @@ NOPED_OBJ_FILES-y += imagetool.o
> >  NOPED_OBJ_FILES-y += mkenvimage.o
> >  NOPED_OBJ_FILES-y += mkimage.o
> >  NOPED_OBJ_FILES-y += mxsimage.o
> > +NOPED_OBJ_FILES-y += gpimage-common.o
> >  NOPED_OBJ_FILES-y += omapimage.o
> > +NOPED_OBJ_FILES-y += gpimage.o
> >  NOPED_OBJ_FILES-y += os_support.o
> 
> Please keep the list sorted.
> 
> > @@ -219,7 +221,9 @@ $(obj)dumpimage$(SFX):	$(obj)aisimage.o \
> >  			$(obj)dumpimage.o \
> >  			$(obj)md5.o \
> >  			$(obj)mxsimage.o \
> > +			$(obj)gpimage-common.o \
> >  			$(obj)omapimage.o \
> > +			$(obj)gpimage.o \
> 
> Ditto.  Please fix this issue globally.
> 
> 
> > +uint32_t gpimage_swap32(uint32_t data)
> > +{
> > +	return cpu_to_be32(data);
> > +}
> 
> The function name is misleading.  Also it is not clear why you need
> this function at all.  You can use cpu_to_be32() directly - that will
> make the code much easier to read.
> 
> > +/* TODO: do we need the below 2 functions?? */
> > +int valid_gph_size(uint32_t size)
> > +{
> > +	return size;
> > +}
> > +
> > +int valid_gph_load_addr(uint32_t load_addr)
> > +{
> > +	return load_addr;
> > +}
> 
> These functions are obviously bogus.  Please dump them.
> 
> > +int gph_verify_header(struct gp_header *gph, int do_swap32)
> > +{
> > +	uint32_t gph_size, gph_load_addr;
> > +
> > +	if (do_swap32) {
> > +		gph_size = gpimage_swap32(gph->size);
> > +		gph_load_addr = gpimage_swap32(gph->load_addr);
> > +	} else {
> > +		gph_size = gph->size;
> > +		gph_load_addr = gph->load_addr;
> > +	}
> 
> I think it should be possible top write this code in such a way that
> you can avoid both the if-else and passing the  do_swap32  parameter.
> It is my impression that the whole endianess handling needs some
> refinemant.
> 
> Actually I cannot see a place where do_swap32=0 is used..

This appears to be a blind re-use of the omap code where we do have a
case where we have to do this kind of swap.

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140120/474b3cc0/attachment.pgp>

  reply	other threads:[~2014-01-20 22:56 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-20 22:10 [U-Boot] [PATCH 0/5] preparation to intriduce keystone support Murali Karicheri
2014-01-20 22:10 ` [U-Boot] [PATCH 1/5] tools: mkimage: add support for gpimage format Murali Karicheri
2014-01-20 22:46   ` Wolfgang Denk
2014-01-20 22:56     ` Tom Rini [this message]
     [not found]     ` <3E54258959B69E4282D79E01AB1F32B70466CE4A@DFLE11.ent.ti.com>
2014-01-21 19:34       ` Wolfgang Denk
2014-01-21 21:23         ` Tom Rini
2014-01-20 22:10 ` [U-Boot] [PATCH 2/5] ubifs: fix checkpatch warning Murali Karicheri
2014-02-21 19:56   ` [U-Boot] [U-Boot,2/5] " Tom Rini
2014-01-20 22:10 ` [U-Boot] [PATCH 3/5] ubifs: return filesize from ubifs load operations Murali Karicheri
2014-02-21 19:14   ` Tom Rini
2014-01-20 22:10 ` [U-Boot] [PATCH 4/5] arm: add support for arch timer Murali Karicheri
2014-01-20 22:50   ` Wolfgang Denk
     [not found]     ` <3E54258959B69E4282D79E01AB1F32B70466CE69@DFLE11.ent.ti.com>
2014-01-21 19:35       ` Wolfgang Denk
2014-01-20 22:10 ` [U-Boot] [PATCH 5/5] NAND: DaVinci: allow forced disable of subpage writes Murali Karicheri
2014-01-20 22:51   ` Wolfgang Denk
     [not found]     ` <3E54258959B69E4282D79E01AB1F32B70466CE81@DFLE11.ent.ti.com>
2014-01-21 19:37       ` Wolfgang Denk
2014-01-22 20:48   ` Scott Wood
     [not found]     ` <3E54258959B69E4282D79E01AB1F32B704672974@DFLE11.ent.ti.com>
2014-02-13  0:00       ` Scott Wood
2014-02-18 14:57         ` Tom Rini
2014-02-19 23:33           ` Murali Karicheri

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=20140120225628.GA3277@bill-the-cat \
    --to=trini@ti.com \
    --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 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.