summaryrefslogtreecommitdiffstats
path: root/recipes-bsp
diff options
context:
space:
mode:
authorZhenhua Luo <zhenhua.luo@nxp.com>2016-12-20 20:19:03 +0800
committerOtavio Salvador <otavio@ossystems.com.br>2017-01-11 10:53:43 -0200
commitd89725b366b7494b56c97f35bf3c45bd4bfcb776 (patch)
tree7fa7c0f8d3ca8138649899c5bce310acfe0eda9f /recipes-bsp
parent9bbf7ca14ebe7987aa950c3ab5c860d4af884254 (diff)
downloadmeta-freescale-d89725b366b7494b56c97f35bf3c45bd4bfcb776.tar.gz
change-file-endianess: update byte_swap script to support ls1046
Signed-off-by: Ting Liu <ting.liu@nxp.com> Signed-off-by: Zhenhua Luo <zhenhua.luo@nxp.com> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Diffstat (limited to 'recipes-bsp')
-rw-r--r--recipes-bsp/change-file-endianess/change-file-endianess.bb13
-rwxr-xr-xrecipes-bsp/change-file-endianess/change-file-endianess/byte_swap.tcl6
2 files changed, 16 insertions, 3 deletions
diff --git a/recipes-bsp/change-file-endianess/change-file-endianess.bb b/recipes-bsp/change-file-endianess/change-file-endianess.bb
index 2ad8c588..ff1828bc 100644
--- a/recipes-bsp/change-file-endianess/change-file-endianess.bb
+++ b/recipes-bsp/change-file-endianess/change-file-endianess.bb
@@ -3,12 +3,11 @@ LICENSE = "MIT"
3LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \ 3LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \
4 file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" 4 file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
5 5
6
7SRC_URI = "file://byte_swap.tcl" 6SRC_URI = "file://byte_swap.tcl"
8 7
9RDEPENDS += "tcl-native" 8RDEPENDS += "tcl-native"
10 9
11inherit native 10inherit native deploy
12 11
13S = "${WORKDIR}" 12S = "${WORKDIR}"
14 13
@@ -20,4 +19,14 @@ do_install () {
20 install -m 755 ${WORKDIR}/byte_swap.tcl ${D}/${bindir} 19 install -m 755 ${WORKDIR}/byte_swap.tcl ${D}/${bindir}
21} 20}
22 21
22do_deploy () {
23 :
24}
25
26do_deploy_class-native () {
27 install -d ${DEPLOYDIR}
28 cp -f ${STAGING_BINDIR_NATIVE}/byte_swap.tcl ${DEPLOYDIR}/
29}
30addtask deploy before do_build after do_populate_sysroot
31
23BBCLASSEXTEND = "native nativesdk" 32BBCLASSEXTEND = "native nativesdk"
diff --git a/recipes-bsp/change-file-endianess/change-file-endianess/byte_swap.tcl b/recipes-bsp/change-file-endianess/change-file-endianess/byte_swap.tcl
index a4e8008f..c6222022 100755
--- a/recipes-bsp/change-file-endianess/change-file-endianess/byte_swap.tcl
+++ b/recipes-bsp/change-file-endianess/change-file-endianess/byte_swap.tcl
@@ -18,12 +18,16 @@ if {$old_rem != 0} {
18 append old_bin y 18 append old_bin y
19 } 19 }
20} 20}
21for {set i 0} {$i<[string length $old_bin]} {incr i $num_b} { 21for {set i 0} {$i<[expr $old_length-8]} {incr i $num_b} {
22 for {set j $num_b} {$j>0} {incr j -1} { 22 for {set j $num_b} {$j>0} {incr j -1} {
23 append new_bin [string index $old_bin [expr $i+($j-1)]] 23 append new_bin [string index $old_bin [expr $i+($j-1)]]
24 } 24 }
25} 25}
26 26
27for {set j 0} {$j<8} {incr j 1} {
28 append new_bin [string index $old_bin [expr $i+$j]]
29}
30
27for {set i 0} {$i<[string length $old_bin]} {incr i $num_b} { 31for {set i 0} {$i<[string length $old_bin]} {incr i $num_b} {
28 set binValue [string range $old_bin [expr $i+0] [expr $i+($num_b-1)]] 32 set binValue [string range $old_bin [expr $i+0] [expr $i+($num_b-1)]]
29 binary scan $binValue H[expr $num_b*2] hexValue 33 binary scan $binValue H[expr $num_b*2] hexValue