Re: [U-Boot] [PATCH v5 1/1] imximage: Add MX53 boot image support

2011-02-01 Thread Stefano Babic
On 01/19/2011 08:40 PM, Jason Liu wrote:
> This patch add the MX53 boot image support.
> 
> This patch has been tested on Freescale MX53EVK board
> and MX51EVK board.
> 
> Signed-off-by: Jason Liu 
> 
> ---

Applied to u-boot-imx, thanks

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-0 Fax: +49-8142-66989-80  Email: off...@denx.de
=
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v5 1/1] imximage: Add MX53 boot image support

2011-01-27 Thread Stefano Babic
On 01/27/2011 07:24 PM, Albert ARIBAUD wrote:
>>
>> Any feedback about this patch?
> 
> I think Stefano should be added in Cc: as IMX custodian.

I have already got it. This is the revisited patch that was too fast
merged in u-boot-imx.

Jason, I have no remarks on it and for testing purpose I have already
merged all pending imx patches into the next branch of u-boot-imx. If
there will be no further comments, all these patches will be part of my
next pull request.

Stefano

-- 
=
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: off...@denx.de
=
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v5 1/1] imximage: Add MX53 boot image support

2011-01-27 Thread Albert ARIBAUD
Le 25/01/2011 08:56, Jason Liu a écrit :
> Hi, Wolfgang,
>
> 2011/1/20 Jason Liu:
>> This patch add the MX53 boot image support.
>>
>> This patch has been tested on Freescale MX53EVK board
>> and MX51EVK board.
>>
>> Signed-off-by: Jason Liu
>>
>> ---
>> Changes for v2:
>> - Address the following comments from Stefano,
>>   - Get rid of  #ifdef in the imximage.h and .c file and use
>> the runtime check for imximage version
>>   - Document the IMXIMAGE_VERSION definiton in doc/README.imximage
>>   - Move mx53evk/config.mk and mx53evk/imximage.cfg to MX53EVK board
>> support patch.
>>
>> Changes for v3:
>> - Address the following comments from Stefano,
>>   - Not change the mx51evk file. The code should take VERSION=1 as default,
>>and we do not need to change the actual boards.
>>   - add a note in the documentation and raise an error in code if the
>>VERSION command is read after any other suitable commands.
>>   - Change command IMXIMAGE_VERSION simply to IMAGE_VERSION
>>   - Need recognize the version directly from its structure and not storing 
>> the
>>version into the header when do header verify and print.
>>   - Use function pointer to simpliy the code when the version of header is 
>> recognized
>> Changes for v4:
>> - Address the following comments from Wolfgang,
>>   - Keep the imximage_cmds table sorted,
>>   - Add braces for (expx)&&  (expy) gloably,
>>   - Return failure to upper call if met errors for function
>>   - Add comments for function set_dcd_rst_v1 alike,
>>   - Re-orgnize code to avoid deep nesting,
>> Changes for v5:
>>   - Remove the blank line before the only one line statement and
>>   not using braces for the one line statment for the sake of the
>>   same coding style of this file. For example,
>>   if (!exp)
>> return ret;
>> ---
>>   doc/README.imximage |   12 +-
>>   tools/imximage.c|  525 
>> +--
>>   tools/imximage.h|  110 +--
>>   3 files changed, 487 insertions(+), 160 deletions(-)
>>
>
> Any feedback about this patch?

I think Stefano should be added in Cc: as IMX custodian.

Amicalement,
-- 
Albert.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v5 1/1] imximage: Add MX53 boot image support

2011-01-24 Thread Jason Liu
Hi, Wolfgang,

2011/1/20 Jason Liu :
> This patch add the MX53 boot image support.
>
> This patch has been tested on Freescale MX53EVK board
> and MX51EVK board.
>
> Signed-off-by: Jason Liu 
>
> ---
> Changes for v2:
> - Address the following comments from Stefano,
>  - Get rid of  #ifdef in the imximage.h and .c file and use
>    the runtime check for imximage version
>  - Document the IMXIMAGE_VERSION definiton in doc/README.imximage
>  - Move mx53evk/config.mk and mx53evk/imximage.cfg to MX53EVK board
>    support patch.
>
> Changes for v3:
> - Address the following comments from Stefano,
>  - Not change the mx51evk file. The code should take VERSION=1 as default,
>   and we do not need to change the actual boards.
>  - add a note in the documentation and raise an error in code if the
>   VERSION command is read after any other suitable commands.
>  - Change command IMXIMAGE_VERSION simply to IMAGE_VERSION
>  - Need recognize the version directly from its structure and not storing the
>   version into the header when do header verify and print.
>  - Use function pointer to simpliy the code when the version of header is 
> recognized
> Changes for v4:
> - Address the following comments from Wolfgang,
>  - Keep the imximage_cmds table sorted,
>  - Add braces for (expx) && (expy) gloably,
>  - Return failure to upper call if met errors for function
>  - Add comments for function set_dcd_rst_v1 alike,
>  - Re-orgnize code to avoid deep nesting,
> Changes for v5:
>  - Remove the blank line before the only one line statement and
>  not using braces for the one line statment for the sake of the
>  same coding style of this file. For example,
>  if (!exp)
>        return ret;
> ---
>  doc/README.imximage |   12 +-
>  tools/imximage.c    |  525 
> +--
>  tools/imximage.h    |  110 +--
>  3 files changed, 487 insertions(+), 160 deletions(-)
>

Any feedback about this patch?

>
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v5 1/1] imximage: Add MX53 boot image support

2011-01-19 Thread Jason Liu
This patch add the MX53 boot image support.

This patch has been tested on Freescale MX53EVK board
and MX51EVK board.

Signed-off-by: Jason Liu 

---
Changes for v2:
- Address the following comments from Stefano,
  - Get rid of  #ifdef in the imximage.h and .c file and use
the runtime check for imximage version
  - Document the IMXIMAGE_VERSION definiton in doc/README.imximage
  - Move mx53evk/config.mk and mx53evk/imximage.cfg to MX53EVK board
support patch.

Changes for v3:
- Address the following comments from Stefano,
 - Not change the mx51evk file. The code should take VERSION=1 as default,
   and we do not need to change the actual boards.
 - add a note in the documentation and raise an error in code if the
   VERSION command is read after any other suitable commands.
 - Change command IMXIMAGE_VERSION simply to IMAGE_VERSION
 - Need recognize the version directly from its structure and not storing the
   version into the header when do header verify and print.
 - Use function pointer to simpliy the code when the version of header is 
recognized
Changes for v4:
- Address the following comments from Wolfgang,
 - Keep the imximage_cmds table sorted,
 - Add braces for (expx) && (expy) gloably,
 - Return failure to upper call if met errors for function
 - Add comments for function set_dcd_rst_v1 alike,
 - Re-orgnize code to avoid deep nesting,
Changes for v5:
 - Remove the blank line before the only one line statement and
  not using braces for the one line statment for the sake of the
  same coding style of this file. For example,
  if (!exp)
return ret;
---
 doc/README.imximage |   12 +-
 tools/imximage.c|  525 +--
 tools/imximage.h|  110 +--
 3 files changed, 487 insertions(+), 160 deletions(-)

diff --git a/doc/README.imximage b/doc/README.imximage
index 3378f7e..c74239d 100644
--- a/doc/README.imximage
+++ b/doc/README.imximage
@@ -57,6 +57,13 @@ Configuration command line syntax:
 2. Following are the valid command strings and associated data strings:-
Command string  data string
--  ---
+   IMXIMAGE_VERSION1/2
+   1 is for mx25/mx35/mx51 compatible,
+   2 is for mx53 compatible,
+   others is invalid and error is generated.
+   This command need appear the fist before
+   other valid commands in configuration file.
+
BOOT_FROM   nand/spi/sd/onenand
Example:
BOOT_FROM spi
@@ -69,8 +76,9 @@ Configuration command line syntax:
Example (write to IOMUXC):
DATA 4 0x73FA88a0 0x200
 
-The processor support up to 60 register programming commands. An error
-is generated if more commands are found in the configuration file.
+The processor support up to 60 register programming commands for 
IMXIMAGE_VERSION 1
+and 121 register programming commands for IMXIMAGE_VERSION 2.
+An error is generated if more commands are found in the configuration file.
 
 3. All commands are optional to program.
 
diff --git a/tools/imximage.c b/tools/imximage.c
index 39f89c2..8e81bdb 100644
--- a/tools/imximage.c
+++ b/tools/imximage.c
@@ -36,9 +36,10 @@
  * Supported commands for configuration file
  */
 static table_entry_t imximage_cmds[] = {
-   {CMD_BOOT_FROM, "BOOT_FROM","boot command", },
-   {CMD_DATA,  "DATA", "Reg Write Data", },
-   {-1,"", "", },
+   {CMD_BOOT_FROM, "BOOT_FROM","boot command",   },
+   {CMD_DATA,  "DATA", "Reg Write Data", },
+   {CMD_IMAGE_VERSION, "IMAGE_VERSION","image version",  },
+   {-1,"", "",   },
 };
 
 /*
@@ -53,8 +54,21 @@ static table_entry_t imximage_bootops[] = {
{-1,"", "Invalid",  },
 };
 
+/*
+ * IMXIMAGE version definition for i.MX chips
+ */
+static table_entry_t imximage_versions[] = {
+   {IMXIMAGE_V1,   "", " (i.MX25/35/51 compatible)", },
+   {IMXIMAGE_V2,   "", " (i.MX53 compatible)",   },
+   {-1,"", " (Invalid)", },
+};
 
 static struct imx_header imximage_header;
+static uint32_t imximage_version;
+
+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 get_cfg_value(char *token, char *name,  int linenr)
 {
@@ -71,67 +85,353 @@ static uint32_t get_cfg_value(char *token, char *name,  
int linenr)
return value;
 }
 
-static int imximage_check_image_types(uint8_t type)
+static uint32_t detect_imximage_version(struct imx_header *imx_hdr)
 {
-   if (type == IH