Re: [U-Boot] [PATCH]v2: Fixed lineendings in tools/img2brec.sh

2008-11-01 Thread Niklaus Giger
Am Freitag 31 Oktober 2008 00.23:32 schrieb Wolfgang Denk:
 Dear Niklaus Giger,

 In message [EMAIL PROTECTED] you wrote:
  This time I took a closer look at img2brec.sh. My conclusions are
  img2brec.sh was done for development under Windows (probably cygwin), as
  it uses a command filesize which is not available as such under Unix.
  Therefore I replaced with a functional equivalent (wc --bytes) which
  should also work under cygwin (not tested).
  I modified the script to git also rid of extra \M (LF) caracters in the
  output. Now the outputfile on my Debian system after calling
  tools/img2brec.sh u-boot.bin [u-boot.brec]
  looks fine.

 Hm but the \r\n sequences are probably intentional because  theyu
 are needed on Win* systems?

I think they were needed in previous versions of Cygwin. Also often programs 
transforrm automatically \n into \l\n sequences. Also if the destination 
program does not handle correctly Unix-linefeed one would have to add 
something like unix2dos into the shell.

Also cygwin has a variety of options whether mount points automatically 
transform textfiles from/to Unix to MS/DOS-format. Therefore I cannot perform 
tests a Win* systems.

Do you now of any user of this batch who could answer these question?

 Best regards,

 Wolfgang Denk

Best regards

Niklaus Giger

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


Re: [U-Boot] [PATCH]v2: Fixed lineendings in tools/img2brec.sh

2008-10-30 Thread Wolfgang Denk
Dear Niklaus Giger,

In message [EMAIL PROTECTED] you wrote:
 This time I took a closer look at img2brec.sh. My conclusions are
 img2brec.sh was done for development under Windows (probably cygwin), as
 it uses a command filesize which is not available as such under Unix. 
 Therefore
 I replaced with a functional equivalent (wc --bytes) which should also work 
 under
 cygwin (not tested).
 I modified the script to git also rid of extra \M (LF) caracters in the 
 output. Now
 the outputfile on my Debian system after calling 
 tools/img2brec.sh u-boot.bin [u-boot.brec]
 looks fine.

Hm but the \r\n sequences are probably intentional because  theyu
are needed on Win* systems?

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: [EMAIL PROTECTED]
A little suffering is good for the soul.
-- Kirk, The Corbomite Maneuver, stardate 1514.0
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH]v2: Fixed lineendings in tools/img2brec.sh

2008-10-23 Thread Niklaus Giger
This time I took a closer look at img2brec.sh. My conclusions are
img2brec.sh was done for development under Windows (probably cygwin), as
it uses a command filesize which is not available as such under Unix. Therefore
I replaced with a functional equivalent (wc --bytes) which should also work 
under
cygwin (not tested).
I modified the script to git also rid of extra \M (LF) caracters in the output. 
Now
the outputfile on my Debian system after calling 
tools/img2brec.sh u-boot.bin [u-boot.brec]
looks fine.


Signed-off-by: Niklaus Giger [EMAIL PROTECTED]
---
 tools/img2brec.sh |  580 ++--
 1 files changed, 290 insertions(+), 290 deletions(-)

diff --git a/tools/img2brec.sh b/tools/img2brec.sh
index 0fcdba2..7848773 100755
--- a/tools/img2brec.sh
+++ b/tools/img2brec.sh
@@ -61,318 +61,318 @@ if [ ! -f $INFILE ] ; then
 exit 1
 fi

-FILESIZE=`filesize $INFILE`
+FILESIZE=`(wc --bytes $INFILE)`

 output_init()
 {
 echo \
-
-* Initialize I/O Pad Driving Strength  *
-
-0021B80CC403AB
-
-* Initialize SDRAM *
-
-00221000C492120200   ; pre-charge command
-0820E4   ; special read
-
-00221000C4A2120200   ; auto-refresh command
-0800E4   ; 8 special read
-0800E4   ; 8 special read
-0800E4   ; 8 special read
-0800E4   ; 8 special read
-0800E4   ; 8 special read
-0800E4   ; 8 special read
-0800E4   ; 8 special read
-0800E4   ; 8 special read
-
-00221000C4B2120200   ; set mode register
-08111800E4   ; special read
-
-00221000C482124200   ; set normal mode
-

+
+* Initialize I/O Pad Driving Strength  *
+
+0021B80CC403AB
+
+* Initialize SDRAM *
+
+00221000C492120200   ; pre-charge command
+0820E4   ; special read
+
+00221000C4A2120200   ; auto-refresh command
+0800E4   ; 8 special read
+0800E4   ; 8 special read
+0800E4   ; 8 special read
+0800E4   ; 8 special read
+0800E4   ; 8 special read
+0800E4   ; 8 special read
+0800E4   ; 8 special read
+0800E4   ; 8 special read
+
+00221000C4B2120200   ; set mode register
+08111800E4   ; special read
+
+00221000C482124200   ; set normal mode
+
 }

 output_uboot()
 {
 echo \
-
-* U-Boot image as bootstrap records*
-*   will be stored in SDRAM at 0x0A00  *
-
-

+
+* U-Boot image as bootstrap records*
+*   will be stored in SDRAM at 0x0A00  *
+

 cat $INFILE | \
-hexdump -v -e \0A0%05.5_ax10\ 16/1 \%02x\\\r\n\ | \
+hexdump -v -e \0A0%05.5_ax10\ 16/1 \%02x\\\n\ | \
 tr [:lower:] [:upper:]
 }

 output_flashprog()
 {
 echo \
-
-* Address of arguments to flashProg*
-*  *
-* Source  : 0x0A00 *
-* Destination : 0x0C00 *

+
+* Address of arguments to flashProg*
+*  *
+* Source  : 0x0A00 *
+* Destination : 0x0C00 *
+

 # get the real size of the U-Boot image
-printf * Size: 0x%08X *\r\n $FILESIZE
-printf \r\n
-printf 0AFECC0A000C00%08X\r\n $FILESIZE
+printf * Size: 0x%08X *\n $FILESIZE
+printf \n
+printf 0AFECC0A000C00%08X\n $FILESIZE

-#;0AFECC0A000C006000
+#;0AFECC0A000C006000

 echo \
-
-* Flash Program*
-
-0AFE10001008D09FE5ACEA00F0A0E1A42DFE0A
-0AFE1010100080FE0A0DC0A0E100D82DE904B04CE2
-0AFE1020109820A0E318309FE5003093E5033082E0
-0AFE103010003093E5013003E2FF3003E20300A0E1
-0AFE10401000A81BE9A01DFE0A0DC0A0E100D82DE9
-0AFE10501004B04CE204D04DE20030A0E10D304BE5
-0AFE1060109820A0E330309FE5003093E5033082E0
-0AFE107010003093E5013903E253E3F70A
-0AFE1080104020A0E310309FE5003093E5032082E0
-0AFE1090100D305BE5003082E500A81BE9A01DFE0A
-0AFE10A0100DC0A0E100D82DE904B04CE2A0E1
-0AFE10B010D7EB0030A0E1FF3003E253E3
-0AFE10C010FA0A10309FE5003093E5003093E5
-0AFE10D010FF3003E20300A0E100A81BE9A01DFE0A
-0AFE10E0100DC0A0E100D82DE904B04CE204D04DE2
-0AFE10F0100030A0E10D304BE50D305BE52332A0E1
-0AFE1100100E304BE50E305BE5090053E3039A
-0AFE1110100E305BE5373083E20E304BE502EA