Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id 572A2E008CC; 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.111.137 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-bn1bon0137.outbound.protection.outlook.com [157.56.111.137]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id 187E4E008A6 for ; Mon, 2 Feb 2015 22:49:05 -0800 (PST) Received: from CO2PR03CA0029.namprd03.prod.outlook.com (10.141.194.156) by BY1PR0301MB1192.namprd03.prod.outlook.com (25.160.195.150) with Microsoft SMTP Server (TLS) id 15.1.75.20; Tue, 3 Feb 2015 06:49:03 +0000 Received: from BY2FFO11FD003.protection.gbl (2a01:111:f400:7c0c::132) by CO2PR03CA0029.outlook.office365.com (2a01:111:e400:1414::28) with Microsoft SMTP Server (TLS) id 15.1.87.13 via Frontend Transport; Tue, 3 Feb 2015 06:49:02 +0000 Received: from az84smr01.freescale.net (192.88.158.2) by BY2FFO11FD003.mail.protection.outlook.com (10.1.14.125) with Microsoft SMTP Server (TLS) id 15.1.87.10 via Frontend Transport; Tue, 3 Feb 2015 06:49:02 +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 t136mvFq027669; Mon, 2 Feb 2015 23:49:00 -0700 From: To: Date: Tue, 3 Feb 2015 14:48:42 +0800 Message-ID: <1422946122-19135-2-git-send-email-b40290@freescale.com> X-Mailer: git-send-email 1.9.2 In-Reply-To: <1422946122-19135-1-git-send-email-b40290@freescale.com> References: <1422946122-19135-1-git-send-email-b40290@freescale.com> 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)(46102003)(87936001)(48376002)(33646002)(86152002)(6806004)(50986999)(47776003)(76176999)(19580405001)(104016003)(85426001)(86362001)(50466002)(92566002)(230783001)(50226001)(106466001)(36756003)(110136001)(77156002)(77096005)(229853001)(62966003)(2351001)(2950100001)(450100001)(105606002); DIR:OUT; SFP:1102; SCL:1; SRVR:BY1PR0301MB1192; 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:BY1PR0301MB1192; X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004); SRVR:BY1PR0301MB1192; X-Forefront-PRVS: 0476D4AB88 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:; SRVR:BY1PR0301MB1192; X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Feb 2015 06:49:02.1678 (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: BY1PR0301MB1192 Subject: [meta-fsl-arm][PATCH 1/2] u-boot-ls1: u-boot-ls1: 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 --- .../u-boot/u-boot-ls1-tools-native_2013.10.bb | 16 ------------ recipes-bsp/u-boot/u-boot-ls1.inc | 4 ++- recipes-bsp/u-boot/u-boot-ls1/byte_swap.tcl | 29 ++++++++++++++++++++++ recipes-bsp/u-boot/u-boot-ls1_2014.07.bb | 4 +-- 4 files changed, 34 insertions(+), 19 deletions(-) delete mode 100644 recipes-bsp/u-boot/u-boot-ls1-tools-native_2013.10.bb create mode 100755 recipes-bsp/u-boot/u-boot-ls1/byte_swap.tcl diff --git a/recipes-bsp/u-boot/u-boot-ls1-tools-native_2013.10.bb b/recipes-bsp/u-boot/u-boot-ls1-tools-native_2013.10.bb deleted file mode 100644 index 09cf1f7..0000000 --- a/recipes-bsp/u-boot/u-boot-ls1-tools-native_2013.10.bb +++ /dev/null @@ -1,16 +0,0 @@ -require u-boot-ls1.inc - -SRC_URI = "git://git.freescale.com/layerscape/ls1021a/u-boot.git;branch=LS1-dev" -SRCREV = "50d684801cd05ed6b77d52d1ca9ed00fefeac469" - -RDEPENDS += "tcl-native" - -inherit native - -do_configure[noexec] = "1" -do_compile[noexec] = "1" - -do_install () { - install -d ${D}/${bindir} - install -m 755 ${S}/byte_swap.tcl ${D}/${bindir} -} diff --git a/recipes-bsp/u-boot/u-boot-ls1.inc b/recipes-bsp/u-boot/u-boot-ls1.inc index ccd37c6..5712549 100644 --- a/recipes-bsp/u-boot/u-boot-ls1.inc +++ b/recipes-bsp/u-boot/u-boot-ls1.inc @@ -9,7 +9,9 @@ LIC_FILES_CHKSUM = " \ " SRCBRANCH = "sdk-v1.7.x" -SRC_URI = "git://git.freescale.com/ppc/sdk/u-boot.git;branch=${SRCBRANCH}" +SRC_URI = "git://git.freescale.com/ppc/sdk/u-boot.git;branch=${SRCBRANCH} \ + file://byte_swap.tcl \ +" SRCREV = "659b6a23a8b1f3026200bc6352dbacef53f4dcb1" LOCALVERSION ?= "-${SRCBRANCH}" diff --git a/recipes-bsp/u-boot/u-boot-ls1/byte_swap.tcl b/recipes-bsp/u-boot/u-boot-ls1/byte_swap.tcl new file mode 100755 index 0000000..aca956b --- /dev/null +++ b/recipes-bsp/u-boot/u-boot-ls1/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/u-boot/u-boot-ls1_2014.07.bb b/recipes-bsp/u-boot/u-boot-ls1_2014.07.bb index 7b4fb58..9a1aec2 100644 --- a/recipes-bsp/u-boot/u-boot-ls1_2014.07.bb +++ b/recipes-bsp/u-boot/u-boot-ls1_2014.07.bb @@ -4,12 +4,12 @@ inherit fsl-u-boot-localversion LOCALVERSION ?= "-${SRCBRANCH}" -DEPENDS += "u-boot-ls1-tools-native" +DEPENDS += "tcl-native" PROVIDES += "u-boot" do_compile_append () { case "${UBOOT_MACHINE}" in - *spi*) tclsh ${STAGING_BINDIR_NATIVE}/byte_swap.tcl ${S}/u-boot.bin ${S}/u-boot.swap.bin 8 + *spi*) tclsh ../byte_swap.tcl ${S}/u-boot.bin ${S}/u-boot.swap.bin 8 mv ${S}/u-boot.swap.bin ${S}/u-boot.bin;; *sdcard*) mv ${S}/u-boot-with-spl-pbl.bin ${S}/u-boot.bin;; esac -- 1.9.2