public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Stefano Babic <sbabic@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH V4] ARM: mxs: tools: Add mkimage support for MXS bootstream
Date: Mon, 26 Aug 2013 09:14:53 +0200	[thread overview]
Message-ID: <521B006D.4040005@denx.de> (raw)
In-Reply-To: <201308251833.27075.marex@denx.de>

Hi Marek,

On 25/08/2013 18:33, Marek Vasut wrote:
>>> +      MODE string_mode
>>> +      - Restart the CPU and start booting from device specified by the
>>> +	"string_mode" argument. The "string_mode" differs for each CPU
>>> +	and can be:
>>> +         i.MX23, string_mode = USB/I2C/SPI1_FLASH/SPI2_FLASH/NAND_BCH
>>> +                               JTAG/SPI3_EEPROM/SD_SSP0/SD_SSP1
>>> +         i.MX28, string_mode = USB/I2C/SPI2_FLASH/SPI3_FLASH/NAND_BCH
>>> +                               JTAG/SPI2_EEPROM/SD_SSP0/SD_SSP1
>>> +
>>
>> Is this equivalent to the "bmode" command on i.MX5/6 ?
> 
> BMODE command? How does that one work?

It sets for i.MX (MX5/MX6) from which source the BootROM must read the
image. We can say it is a soft way to overwrite the boot pin
configuration without having to write into fuses, useful to test
different boot conditions.

> 
>>>   * Compression Types
>>>
>>> diff --git a/tools/Makefile b/tools/Makefile
>>> index 33fad6b..bbae5a2 100644
>>> --- a/tools/Makefile
>>> +++ b/tools/Makefile
>>> @@ -83,6 +83,7 @@ NOPED_OBJ_FILES-y += aisimage.o
>>>
>>>  NOPED_OBJ_FILES-y += kwbimage.o
>>>  NOPED_OBJ_FILES-y += pblimage.o
>>>  NOPED_OBJ_FILES-y += imximage.o
>>>
>>> +NOPED_OBJ_FILES-y += mxsimage.o
>>
>> Can you reorder the list ?
> 
> How? It's out of order already.

I know - it would be nice if the list was in order again, at least for
the components of mkimage (NOPED_OBJ_FILES-).

>>> + * CRC32
>>> + */
>>> +static uint32_t crc32(uint8_t *data, uint32_t len)
>>> +{
>>> +	const uint32_t poly = 0x04c11db7;
>>
>> Comparing this polinomial with the one in lib/crc32.c, they are
>> identical. The crc32 function you define here should give the same
>> result as our old crc32 (global) in lib/crc32.c. Then, can you drop this
>> one and use the already implemented function ?
> 
> As I do not want to diverge more than necessary, this can be done in subsequent 
> patch.

However this adds a duplication in the code, and using the global crc
should be quite straightforward.

> 
> [...]
> 
>>> +	/*
>>> +	 * Append the command to the last section.
>>> +	 */
>>> +	if (!sctx->cmd_head) {
>>> +		sctx->cmd_head = cctx;
>>> +		sctx->cmd_tail = cctx;
>>> +	} else {
>>> +		sctx->cmd_tail->cmd = cctx;
>>> +		sctx->cmd_tail = cctx;
>>> +	}
>>> +
>>
>> This append stuff can be factorized at least with a macro - it is
>> repeated again and again in all commands.
> 
> This can (read : shall) be even replaced by include/linked_lists.h  , but not in 
> this patch.

Ok, that's fine.

Best regards,
Stefano Babic

-- 
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================

  reply	other threads:[~2013-08-26  7:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-19 23:45 [U-Boot] [PATCH V4] ARM: mxs: tools: Add mkimage support for MXS bootstream Marek Vasut
2013-08-20 13:14 ` Stefano Babic
2013-08-25 16:33   ` Marek Vasut
2013-08-26  7:14     ` Stefano Babic [this message]
2013-08-26 18:42       ` Marek Vasut

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=521B006D.4040005@denx.de \
    --to=sbabic@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