diff options
| author | Zhenhua Luo <zhenhua.luo@nxp.com> | 2016-12-20 20:19:03 +0800 |
|---|---|---|
| committer | Otavio Salvador <otavio@ossystems.com.br> | 2017-01-11 10:53:43 -0200 |
| commit | d89725b366b7494b56c97f35bf3c45bd4bfcb776 (patch) | |
| tree | 7fa7c0f8d3ca8138649899c5bce310acfe0eda9f | |
| parent | 9bbf7ca14ebe7987aa950c3ab5c860d4af884254 (diff) | |
| download | meta-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>
| -rw-r--r-- | recipes-bsp/change-file-endianess/change-file-endianess.bb | 13 | ||||
| -rwxr-xr-x | recipes-bsp/change-file-endianess/change-file-endianess/byte_swap.tcl | 6 |
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 2ad8c5882..ff1828bc2 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" | |||
| 3 | LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \ | 3 | LIC_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 | |||
| 7 | SRC_URI = "file://byte_swap.tcl" | 6 | SRC_URI = "file://byte_swap.tcl" |
| 8 | 7 | ||
| 9 | RDEPENDS += "tcl-native" | 8 | RDEPENDS += "tcl-native" |
| 10 | 9 | ||
| 11 | inherit native | 10 | inherit native deploy |
| 12 | 11 | ||
| 13 | S = "${WORKDIR}" | 12 | S = "${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 | ||
| 22 | do_deploy () { | ||
| 23 | : | ||
| 24 | } | ||
| 25 | |||
| 26 | do_deploy_class-native () { | ||
| 27 | install -d ${DEPLOYDIR} | ||
| 28 | cp -f ${STAGING_BINDIR_NATIVE}/byte_swap.tcl ${DEPLOYDIR}/ | ||
| 29 | } | ||
| 30 | addtask deploy before do_build after do_populate_sysroot | ||
| 31 | |||
| 23 | BBCLASSEXTEND = "native nativesdk" | 32 | BBCLASSEXTEND = "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 a4e8008f1..c62220228 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 | } |
| 21 | for {set i 0} {$i<[string length $old_bin]} {incr i $num_b} { | 21 | for {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 | ||
| 27 | for {set j 0} {$j<8} {incr j 1} { | ||
| 28 | append new_bin [string index $old_bin [expr $i+$j]] | ||
| 29 | } | ||
| 30 | |||
| 27 | for {set i 0} {$i<[string length $old_bin]} {incr i $num_b} { | 31 | for {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 |
