summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorwdenk <wdenk>2003-04-05 00:53:31 +0000
committerwdenk <wdenk>2003-04-05 00:53:31 +0000
commit3e38691e8f7aa0d9b498d76c7279ddec6e4946f3 (patch)
treebec2e661298847dc5bcf9335ef31259686e882e1 /tools
parent36c05a80ecbe3997abd9aa628a68dd6c0bacf681 (diff)
* Patch by Arun Dharankar, 4 Apr 2003:LABEL_2003_04_05_0300
Add IDMA example code (tested on 8260 only) * Add support for Purple Board (MIPS64 5Kc) * Add support for MIPS64 5Kc CPUs * Fix missing setting of "loadaddr" and "bootfile" on ARM and MIPS * Patch by Denis Peter, 04 Apr 2003: - update MIP405-4 board * Patches by Denis Peter, 03 April 2003: - fix PCI IRQs on MPL boards - fix two more un-relocated pointer problems * Fix behaviour of "run" command: - print error message iv variable does not exist - terminate processing of arguments in case of error * Patches by Peter Figuli, 10 Mar 2003 - Add support for BTUART on PXA platform - Add support for WEP EP250 (PXA) board * Fix flash problems on INCA-IP; add tool to allow bruning images to flash using a BDI2000 * Implement fix for I2C Edge Conditions problem for all boards that use the bit-banging driver (common/soft_i2c.c) * Add patches by Robert Schwebel, 31 Mar 2003: - csb226 board: bring in sync with innokom/memsetup.S - csb226 board: fix MDREFR handling - misc doc fixes / extensions - innokom board: cleanup, MDREFR fix in memsetup.S, config update - add BOOT_PROGRESS to armlinux.c
Diffstat (limited to 'tools')
-rw-r--r--tools/Makefile12
-rw-r--r--tools/inca-swap-bytes.c38
2 files changed, 50 insertions, 0 deletions
diff --git a/tools/Makefile b/tools/Makefile
index 41bcc59d16b..35c60b6b519 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -25,6 +25,11 @@ BINS = img2srec$(SFX) mkimage$(SFX) envcrc$(SFX) gen_eth_addr$(SFX) bmp_logo$(SF
OBJS = environment.o img2srec.o mkimage.o crc32.o envcrc.o gen_eth_addr.o bmp_logo.o
+ifeq ($(ARCH),mips)
+BINS += inca-swap-bytes$(SFX)
+OBJS += inca-swap-bytes.o
+endif
+
LOGO_H = $(TOPDIR)/include/bmp_logo.h
ifeq ($(LOGO_BMP),)
@@ -133,6 +138,10 @@ bmp_logo$(SFX): bmp_logo.o
$(CC) $(CFLAGS) $(HOST_LDFLAGS) -o $@ $^
$(STRIP) $@
+inca-swap-bytes$(SFX): inca-swap-bytes.o
+ $(CC) $(CFLAGS) $(HOST_LDFLAGS) -o $@ $^
+ $(STRIP) $@
+
envcrc.o: envcrc.c
$(CC) -g $(CFLAGS) -c $<
@@ -145,6 +154,9 @@ mkimage.o: mkimage.c
gen_eth_addr.o: gen_eth_addr.c
$(CC) -g $(CFLAGS) -c $<
+inca-swap-bytes.o: inca-swap-bytes.c
+ $(CC) -g $(CFLAGS) -c $<
+
subdirs:
@for dir in $(TOOLSUBDIRS) ; do \
$(MAKE) \
diff --git a/tools/inca-swap-bytes.c b/tools/inca-swap-bytes.c
new file mode 100644
index 00000000000..3a6d82d54a0
--- /dev/null
+++ b/tools/inca-swap-bytes.c
@@ -0,0 +1,38 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#ifndef BUFSIZ
+# define BUFSIZ 4096
+#endif
+
+#undef BUFSIZ
+# define BUFSIZ 64
+int main (void)
+{
+ short ibuff[BUFSIZ], obuff[BUFSIZ];
+ int rc, i, len;
+
+ while ((rc = read (0, ibuff, sizeof (ibuff))) > 0) {
+ memset (obuff, 0, sizeof (obuff));
+ for (i = 0; i < (rc + 1) / 2; i++) {
+ obuff[i] = ibuff[i ^ 1];
+ }
+
+ len = (rc + 1) & ~1;
+
+ if (write (1, obuff, len) != len) {
+ perror ("read error");
+ return (EXIT_FAILURE);
+ }
+
+ memset (ibuff, 0, sizeof (ibuff));
+ }
+
+ if (rc < 0) {
+ perror ("read error");
+ return (EXIT_FAILURE);
+ }
+ return (EXIT_SUCCESS);
+}