[U-Boot] [PATCH v4] socfpga: Add socfpga preloader signing to mkimage

Charles Manning cdhmanning at gmail.com
Thu Feb 27 22:52:33 CET 2014


On Friday 28 February 2014 10:23:11 Wolfgang Denk wrote:
> Dear Charles,
>
> sorry, I only send part of the message. Here is the rest.
>
> In message 
<CAE21AQp2GSPedrDakio1wPa3vGTwjd-3D1wSQM0WhG9r-8Bzcg at mail.gmail.com> you 
wrote:
> > > > Both Gerhard and me asked before: Why exactly do we need another
> > > > implementation of CRC32.  We already have some - why cannot we use
> > > > these?
>
> ...
>
> > The actual table values I am using are also found in lib/bzlib_crctable.c
>
> So could you use the bzlib implementation for your purposes?
>
> > This is, however, not exposed but is a private thing within bzlib.
> >
> > The best choice would possibly be to expose this with a new crc function,
> > but that means dragging bzlib (or parts thereof) into mkimage or at least
> > putting "hooks" into bzlib that were never intended to be there.
> >
> > The alternative is to maybe just add a new alt_crc.c to lib.
>
> Code duplication is always bad.  Please factor out common code parts.

Ok,  I will write a small wrapper thing that accesses the bzlib table.

That table will now be compiled in if you use either bzlib or the alternative 
crc32. 

Does that sound OK?

>
> > > > > + * Copyright for the CRC code:
> > > > > + *
> > > > > + * COPYRIGHT (C) 1986 Gary S. Brown.  You may use this program, or
> > > > > + *  code or tables extracted from it, as desired without
> > > > > restriction.
> > > >
> > > > I asked before:  Please provide _exact_ reference. See
>
> ...
>
> Exact reference includes some URL plus version id, etc.

That stuff is now gone

>
> > > > I also commented before: If you really need this copied code (i. e.
> > > > you canot use one of the already existing implementations of CRC32 -
> > > > which I seriously doubt), then better move this into a separate file,
> > > > and assign a separate license ID tag for it.
> > >
> > > You say "already exiting implementations". I see only one: lib/crc32.c.
> > > Perhaps I am not looking in the right place?
> > >
> > > I shall split this code out and call it alt_crc32 and put it in lib
> > > with one
> > > of those proxy files in tools.
>
> "alt" is a really bad name - you mentioned yourself that ther eis not
> only one alternative, so please rather use a descriptive name.

Is bzlib_crc32 Ok?

Thank you for your feedback.

-- CHarles



More information about the U-Boot mailing list