[meta-freescale] [meta-fsl-arm][PATCH 2/2] rcw: provides the tcl script for endian swap

B40290 at freescale.com B40290 at freescale.com
Tue Feb 3 00:59:06 PST 2015


Please ignore this patch.

-----Original Message-----
From: b40290 at freescale.com [mailto:b40290 at freescale.com] 
Sent: Tuesday, February 03, 2015 2:49 PM
To: meta-freescale at yoctoproject.org
Cc: Liu Ting-B28495; Luo Zhenhua-B19537; Guo Chunrong-B40290
Subject: [meta-fsl-arm][PATCH 2/2] rcw: provides the tcl script for endian swap

From: Chunrong Guo <B40290 at freescale.com>

Signed-off-by: Chunrong Guo <B40290 at freescale.com>
---
 recipes-bsp/rcw/rcw/byte_swap.tcl                  | 29 ++++++++++++++++++++++
 ...ake-BOARDS-DESTDIR-overidable-in-Makefile.patch |  2 +-
 recipes-bsp/rcw/rcw_git.bb                         |  3 ++-
 3 files changed, 32 insertions(+), 2 deletions(-)  create mode 100755 recipes-bsp/rcw/rcw/byte_swap.tcl

diff --git a/recipes-bsp/rcw/rcw/byte_swap.tcl b/recipes-bsp/rcw/rcw/byte_swap.tcl
new file mode 100755
index 0000000..aca956b
--- /dev/null
+++ b/recipes-bsp/rcw/rcw/byte_swap.tcl
@@ -0,0 +1,29 @@
+puts $argv
+set i_file [lindex $argv 0]
+set o_file [lindex $argv 1]
+set num_b  [lindex $argv 2]
+puts ""
+
+set fileid_i [open $i_file "r"]
+set fileid_o [open $o_file "w+"]
+fconfigure $fileid_i -translation {binary binary} fconfigure $fileid_o 
+-translation {binary binary}
+
+set old_bin [read $fileid_i]
+set new_bin {}
+for {set i 0} {$i<[string length $old_bin]} {incr i $num_b} {
+        for {set j $num_b} {$j>0} {incr j -1} {
+                append new_bin [string index $old_bin [expr $i+($j-1)]]
+        }
+}
+
+for {set i 0} {$i<[string length $old_bin]} {incr i $num_b} {
+        set binValue [string range $old_bin [expr $i+0] [expr $i+($num_b-1)]]
+        binary scan $binValue H[expr $num_b*2] hexValue
+        
+        set binValue [string range $new_bin [expr $i+0] [expr $i+($num_b-1)]]
+        binary scan $binValue H[expr $num_b*2] hexValue }
+
+puts -nonewline $fileid_o $new_bin
+close $fileid_o
diff --git a/recipes-bsp/rcw/rcw/rcw-make-BOARDS-DESTDIR-overidable-in-Makefile.patch b/recipes-bsp/rcw/rcw/rcw-make-BOARDS-DESTDIR-overidable-in-Makefile.patch
index 51f6eeb..f2617a3 100644
--- a/recipes-bsp/rcw/rcw/rcw-make-BOARDS-DESTDIR-overidable-in-Makefile.patch
+++ b/recipes-bsp/rcw/rcw/rcw-make-BOARDS-DESTDIR-overidable-in-Makefile
+++ .patch
@@ -45,7 +45,7 @@ index 4cadb2e..6e8b78f 100644
 -		$(INSTALL) -m 644 -D $$file $(DESTDIR)/$$file; \
 +		case $$file in \
 +			*qspiboot*) file_swap="`echo $$file | sed -e 's/qspiboot/qspiboot_swap/'`"; \
-+						tclsh byte_swap.tcl $$file $$file_swap 8 ; \
++						tclsh ../../byte_swap.tcl $$file $$file_swap 8 ; \
 +						$(INSTALL) -m 644 -D $$file_swap $(DESTDIR)/$$file_swap ;; \
 +			*) $(INSTALL) -m 644 -D $$file $(DESTDIR)/$$file; \
 +        esac \
diff --git a/recipes-bsp/rcw/rcw_git.bb b/recipes-bsp/rcw/rcw_git.bb index 0d10548..2b9949e 100644
--- a/recipes-bsp/rcw/rcw_git.bb
+++ b/recipes-bsp/rcw/rcw_git.bb
@@ -3,7 +3,7 @@ DESCRIPTION = "Reset Configuration Word - hardware boot-time parameters for the  LICENSE = "BSD"
 LIC_FILES_CHKSUM = "file://rcw.py;beginline=8;endline=28;md5=9ba0b28922dd187b06b6c8ebcfdd208e"
 
-DEPENDS += "u-boot-ls1-tools-native"
+DEPENDS += "tcl-native"
 
 inherit deploy
 
@@ -11,6 +11,7 @@ SRCBRANCH = "sdk-v1.7.x"
 SRCREV = "3e89f378ed70e9b856756de8c3dbdfccb045fa0c"
 SRC_URI = "git://git.freescale.com/ppc/sdk/rcw.git;branch=${SRCBRANCH} \
     file://rcw-make-BOARDS-DESTDIR-overidable-in-Makefile.patch \
+    file://byte_swap.tcl \
 "
 
 S = "${WORKDIR}/git"
--
1.9.2



More information about the meta-freescale mailing list