openwrtv3/package/boot/uboot-layerscape/patches/0093-add-byte_swap.tcl-script-for-uboot-can-run-save-in-q.patch
Yutang Jiang 15a14cf166 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>
2016-10-31 17:00:10 +01:00

70 lines
2 KiB
Diff

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