Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id 7082CE008BC; Mon, 2 Feb 2015 22:49:12 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on yocto-www.yoctoproject.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.1 X-Spam-HAM-Report: * -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no * trust * [157.56.110.114 listed in list.dnswl.org] * -0.0 SPF_HELO_PASS SPF: HELO matches SPF record * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1on0114.outbound.protection.outlook.com [157.56.110.114]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id 026DEE0086F for ; Mon, 2 Feb 2015 22:49:06 -0800 (PST) Received: from DM2PR03CA0023.namprd03.prod.outlook.com (10.141.96.22) by BLUPR03MB438.namprd03.prod.outlook.com (10.141.78.149) with Microsoft SMTP Server (TLS) id 15.1.65.19; Tue, 3 Feb 2015 06:49:02 +0000 Received: from BL2FFO11FD053.protection.gbl (2a01:111:f400:7c09::123) by DM2PR03CA0023.outlook.office365.com (2a01:111:e400:2428::22) with Microsoft SMTP Server (TLS) id 15.1.75.20 via Frontend Transport; Tue, 3 Feb 2015 06:49:01 +0000 Received: from az84smr01.freescale.net (192.88.158.2) by BL2FFO11FD053.mail.protection.outlook.com (10.173.161.181) with Microsoft SMTP Server (TLS) id 15.1.75.11 via Frontend Transport; Tue, 3 Feb 2015 06:49:01 +0000 Received: from sun.ap.freescale.net (sun.ap.freescale.net [10.192.208.75]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id t136mvFp027669; Mon, 2 Feb 2015 23:48:58 -0700 From: To: Date: Tue, 3 Feb 2015 14:48:41 +0800 Message-ID: <1422946122-19135-1-git-send-email-b40290@freescale.com> X-Mailer: git-send-email 1.9.2 X-EOPAttributedMessage: 0 Received-SPF: Fail (protection.outlook.com: domain of freescale.com does not designate 192.88.158.2 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.158.2; helo=az84smr01.freescale.net; Authentication-Results: spf=fail (sender IP is 192.88.158.2) smtp.mailfrom=b40290@freescale.com; freescale.mail.onmicrosoft.com; dkim=none (message not signed) header.d=none; X-Forefront-Antispam-Report: CIP:192.88.158.2; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(339900001)(77096005)(50226001)(106466001)(2351001)(229853001)(110136001)(450100001)(77156002)(62966003)(6806004)(48376002)(85426001)(19580405001)(575784001)(87936001)(86152002)(230783001)(50466002)(33646002)(105606002)(86362001)(47776003)(50986999)(46102003)(92566002)(104016003)(36756003); DIR:OUT; SFP:1102; SCL:1; SRVR:BLUPR03MB438; H:az84smr01.freescale.net; FPR:; SPF:Fail; MLV:sfv; LANG:en; MIME-Version: 1.0 X-Microsoft-Antispam: UriScan:; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:;SRVR:BLUPR03MB438; X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004); SRVR:BLUPR03MB438; X-Forefront-PRVS: 0476D4AB88 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:;SRVR:BLUPR03MB438; X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Feb 2015 06:49:01.0133 (UTC) X-MS-Exchange-CrossTenant-Id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=710a03f5-10f6-4d38-9ff4-a80b81da590d; Ip=[192.88.158.2] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR03MB438 Subject: [meta-fsl-arm][PATCH 2/2] rcw: provides the tcl script for endian swap X-BeenThere: meta-freescale@yoctoproject.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Usage and development list for the meta-fsl-* layers List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Feb 2015 06:49:12 -0000 Content-Type: text/plain From: Chunrong Guo Signed-off-by: Chunrong Guo --- 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