aboutsummaryrefslogtreecommitdiffstats
path: root/package/boot/uboot-layerscape/patches/0093-add-byte_swap.tcl-script-for-uboot-can-run-save-in-q.patch
diff options
context:
space:
mode:
authorYutang Jiang <yutang.jiang@nxp.com>2016-10-29 00:18:23 +0800
committerJohn Crispin <john@phrozen.org>2016-10-31 17:00:10 +0100
commit15a14cf1665ef3d8b5c77cce69b52d131340e3b3 (patch)
treebd544b24bd3e7fc7efc61f80e1755274971c5582 /package/boot/uboot-layerscape/patches/0093-add-byte_swap.tcl-script-for-uboot-can-run-save-in-q.patch
parentc6c731fe311f7da42777ffd31804a4f6aa3f8e19 (diff)
downloadupstream-15a14cf1665ef3d8b5c77cce69b52d131340e3b3.tar.gz
upstream-15a14cf1665ef3d8b5c77cce69b52d131340e3b3.tar.bz2
upstream-15a14cf1665ef3d8b5c77cce69b52d131340e3b3.zip
layerscape: add 64b/32b target for ls1012ardb device
The QorIQ LS1012A processor, optimized for battery-backed or USB-powered, integrates a single ARM Cortex-A53 core with a hardware packet forwarding engine and high-speed interfaces to deliver line-rate networking performance. QorIQ LS1012A Reference Design System (LS1012ARDB) is a high-performance development platform, with a complete debugging environment. The LS1012ARDB board supports the QorIQ LS1012A processor and is optimized to support the high-bandwidth DDR3L memory and a full complement of high-speed SerDes ports. LEDE/OPENWRT will auto strip executable program file while make. So we need select CONFIG_NO_STRIP=y while make menuconfig to avoid the ppfe network fiemware be destroyed, then run make to build ls1012ardb firmware. The fsl-quadspi flash with jffs2 fs is unstable and arise some failed message. This issue have noticed the IP owner for investigate, hope he can solve it earlier. So the ls1012ardb now also provide a xx-firmware.ext4.bin as default firmware, and the uboot bootcmd will run wrtboot_ext4rfs for "rootfstype=ext4" bootargs. Signed-off-by: Yutang Jiang <yutang.jiang@nxp.com>
Diffstat (limited to 'package/boot/uboot-layerscape/patches/0093-add-byte_swap.tcl-script-for-uboot-can-run-save-in-q.patch')
-rw-r--r--package/boot/uboot-layerscape/patches/0093-add-byte_swap.tcl-script-for-uboot-can-run-save-in-q.patch70
1 files changed, 70 insertions, 0 deletions
diff --git a/package/boot/uboot-layerscape/patches/0093-add-byte_swap.tcl-script-for-uboot-can-run-save-in-q.patch b/package/boot/uboot-layerscape/patches/0093-add-byte_swap.tcl-script-for-uboot-can-run-save-in-q.patch
new file mode 100644
index 0000000000..5bcdd81b0c
--- /dev/null
+++ b/package/boot/uboot-layerscape/patches/0093-add-byte_swap.tcl-script-for-uboot-can-run-save-in-q.patch
@@ -0,0 +1,70 @@
+From f13ff4fe020c9018eb5a472b7c8a69a54e45ce29 Mon Sep 17 00:00:00 2001
+From: Yutang Jiang <yutang.jiang@nxp.com>
+Date: Tue, 18 Oct 2016 22:37:17 +0800
+Subject: [PATCH 93/93] add byte_swap.tcl script for uboot can run/save in
+ qspi flash
+
+Signed-off-by: Yutang Jiang <yutang.jiang@nxp.com>
+---
+ Makefile | 1 +
+ byte_swap.tcl | 36 ++++++++++++++++++++++++++++++++++++
+ 2 files changed, 37 insertions(+)
+ create mode 100755 byte_swap.tcl
+
+diff --git a/Makefile b/Makefile
+index 1c2818c..b73375f 100644
+--- a/Makefile
++++ b/Makefile
+@@ -836,6 +836,7 @@ dtbs dts/dt.dtb: checkdtc u-boot
+
+ u-boot-dtb.bin: u-boot.bin dts/dt.dtb FORCE
+ $(call if_changed,cat)
++ tclsh byte_swap.tcl u-boot-dtb.bin u-boot-swap.bin 8
+
+ %.imx: %.bin
+ $(Q)$(MAKE) $(build)=arch/arm/imx-common $@
+diff --git a/byte_swap.tcl b/byte_swap.tcl
+new file mode 100755
+index 0000000..a4e8008
+--- /dev/null
++++ b/byte_swap.tcl
+@@ -0,0 +1,36 @@
++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 {}
++set old_length [string length $old_bin]
++set old_rem [expr $old_length % $num_b]
++if {$old_rem != 0} {
++ for {set i 0} {$i< [expr $num_b - $old_rem]} {incr i 1} {
++ append old_bin y
++ }
++}
++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
+--
+1.7.9.5
+