summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--rbutil/mkamsboot/Makefile56
-rw-r--r--rbutil/mkamsboot/README10
-rw-r--r--rbutil/mkamsboot/extract_fw.c (renamed from utils/AMS/hacking/extract_fw.c)0
-rw-r--r--rbutil/mkamsboot/mkamsboot.c (renamed from utils/AMS/hacking/mkamsboot.c)0
-rw-r--r--rbutil/mkamsboot/nrv2e_d8.S (renamed from utils/AMS/hacking/nrv2e_d8.S)0
-rw-r--r--rbutil/mkamsboot/test.S (renamed from utils/AMS/hacking/test.S)0
-rw-r--r--utils/AMS/hacking/Makefile56
-rw-r--r--utils/AMS/hacking/README9
8 files changed, 68 insertions, 63 deletions
diff --git a/rbutil/mkamsboot/Makefile b/rbutil/mkamsboot/Makefile
new file mode 100644
index 0000000000..4040c716b5
--- /dev/null
+++ b/rbutil/mkamsboot/Makefile
@@ -0,0 +1,56 @@
+# Change INFILE to point to your original firmware file
+INFILE=$(HOME)/FW/AMS/CLIP/m300a-1.1.17A.bin
+
+# OUTFILE is the file you copy to your device's root and rename to
+# (e.g.) m300a.bin
+OUTFILE=patched.bin
+
+# The uclpack command
+UCLPACK=../../tools/uclpack
+
+all: $(OUTFILE)
+
+mkamsboot: mkamsboot.c
+ gcc -o mkamsboot -W -Wall mkamsboot.c
+
+extract_fw: extract_fw.c
+ gcc -o extract_fw -W -Wall extract_fw.c
+
+# Rules for our test ARM application - assemble, link, then extract
+# the binary code
+
+test.o: test.S
+ arm-elf-as -o test.o test.S
+
+test.elf: test.o
+ arm-elf-ld -e 0 -Ttext=0 -o test.elf test.o
+
+test.bin: test.elf
+ arm-elf-objcopy -O binary test.elf test.bin
+
+# Rules for the ucl unpack function - this is inserted in the padding at
+# the end of the original firmware block
+nrv2e_d8.o: nrv2e_d8.S
+ arm-elf-gcc -DPURE_THUMB -c -o nrv2e_d8.o nrv2e_d8.S
+
+# NOTE: this function has no absolute references, so the link address (-e)
+# is irrelevant. We just link at address 0.
+nrv2e_d8.elf: nrv2e_d8.o
+ arm-elf-ld -e 0 -Ttext=0 -o nrv2e_d8.elf nrv2e_d8.o
+
+nrv2e_d8.bin: nrv2e_d8.elf
+ arm-elf-objcopy -O binary nrv2e_d8.elf nrv2e_d8.bin
+
+firmware_block.ucl: firmware_block.bin
+ $(UCLPACK) --best --2e firmware_block.bin firmware_block.ucl
+
+firmware_block.bin: $(INFILE) extract_fw
+ ./extract_fw $(INFILE) firmware_block.bin
+
+$(OUTFILE): mkamsboot firmware_block.ucl test.bin nrv2e_d8.bin $(INFILE)
+ ./mkamsboot $(INFILE) firmware_block.ucl test.bin nrv2e_d8.bin $(OUTFILE)
+
+clean:
+ rm -fr amsinfo mkamsboot test.o test.elf test.bin extract_fw \
+ nrv2e_d8.o nrv2e_d8.elf nrv2e_d8.bin firmware_block.bin \
+ firmware_block.ucl $(OUTFILE) *~
diff --git a/rbutil/mkamsboot/README b/rbutil/mkamsboot/README
new file mode 100644
index 0000000000..bf9ea698a2
--- /dev/null
+++ b/rbutil/mkamsboot/README
@@ -0,0 +1,10 @@
+mkamsboot
+---------
+
+A tool to inject some code (contained in test.S) into a firmware file.
+
+Edit the INFILE variable in the Makefile to point to the original
+firmware file you want to patch, edit "test.S" appropriately, and then
+type "make".
+
+
diff --git a/utils/AMS/hacking/extract_fw.c b/rbutil/mkamsboot/extract_fw.c
index e91d1f8de1..e91d1f8de1 100644
--- a/utils/AMS/hacking/extract_fw.c
+++ b/rbutil/mkamsboot/extract_fw.c
diff --git a/utils/AMS/hacking/mkamsboot.c b/rbutil/mkamsboot/mkamsboot.c
index 52ead58b69..52ead58b69 100644
--- a/utils/AMS/hacking/mkamsboot.c
+++ b/rbutil/mkamsboot/mkamsboot.c
diff --git a/utils/AMS/hacking/nrv2e_d8.S b/rbutil/mkamsboot/nrv2e_d8.S
index 89cb76dead..89cb76dead 100644
--- a/utils/AMS/hacking/nrv2e_d8.S
+++ b/rbutil/mkamsboot/nrv2e_d8.S
diff --git a/utils/AMS/hacking/test.S b/rbutil/mkamsboot/test.S
index a4757b44ce..a4757b44ce 100644
--- a/utils/AMS/hacking/test.S
+++ b/rbutil/mkamsboot/test.S
diff --git a/utils/AMS/hacking/Makefile b/utils/AMS/hacking/Makefile
index 8f48d611c8..1a297bc3ab 100644
--- a/utils/AMS/hacking/Makefile
+++ b/utils/AMS/hacking/Makefile
@@ -1,59 +1,7 @@
-# Change INFILE to point to your original firmware file
-INFILE=$(HOME)/FW/AMS/CLIP/m300a-1.1.17A.bin
-
-# OUTFILE is the file you copy to your device's root and rename to
-# (e.g.) m300a.bin
-OUTFILE=patched.bin
-
-# The uclpack command
-UCLPACK=../../../tools/uclpack
-
-all: amsinfo $(OUTFILE)
+all: amsinfo
amsinfo: amsinfo.c
gcc -o amsinfo -W -Wall amsinfo.c
-mkamsboot: mkamsboot.c
- gcc -o mkamsboot -W -Wall mkamsboot.c
-
-extract_fw: extract_fw.c
- gcc -o extract_fw -W -Wall extract_fw.c
-
-# Rules for our test ARM application - assemble, link, then extract
-# the binary code
-
-test.o: test.S
- arm-elf-as -o test.o test.S
-
-test.elf: test.o
- arm-elf-ld -e 0 -Ttext=0 -o test.elf test.o
-
-test.bin: test.elf
- arm-elf-objcopy -O binary test.elf test.bin
-
-# Rules for the ucl unpack function - this is inserted in the padding at
-# the end of the original firmware block
-nrv2e_d8.o: nrv2e_d8.S
- arm-elf-gcc -DPURE_THUMB -c -o nrv2e_d8.o nrv2e_d8.S
-
-# NOTE: this function has no absolute references, so the link address (-e)
-# is irrelevant. We just link at address 0.
-nrv2e_d8.elf: nrv2e_d8.o
- arm-elf-ld -e 0 -Ttext=0 -o nrv2e_d8.elf nrv2e_d8.o
-
-nrv2e_d8.bin: nrv2e_d8.elf
- arm-elf-objcopy -O binary nrv2e_d8.elf nrv2e_d8.bin
-
-firmware_block.ucl: firmware_block.bin
- $(UCLPACK) --best --2e firmware_block.bin firmware_block.ucl
-
-firmware_block.bin: $(INFILE) extract_fw
- ./extract_fw $(INFILE) firmware_block.bin
-
-$(OUTFILE): mkamsboot firmware_block.ucl test.bin nrv2e_d8.bin $(INFILE)
- ./mkamsboot $(INFILE) firmware_block.ucl test.bin nrv2e_d8.bin $(OUTFILE)
-
clean:
- rm -fr amsinfo mkamsboot test.o test.elf test.bin extract_fw \
- nrv2e_d8.o nrv2e_d8.elf nrv2e_d8.bin firmware_block.bin \
- firmware_block.ucl $(OUTFILE) *~
+ rm -fr amsinfo
diff --git a/utils/AMS/hacking/README b/utils/AMS/hacking/README
index ce16f954cd..59bb27ebae 100644
--- a/utils/AMS/hacking/README
+++ b/utils/AMS/hacking/README
@@ -5,12 +5,3 @@ This directory contains the following tools related to the Sansa V2
A tool that dumps information from an AMS firmware file.
-2) mkamsboot
-
-A tool to inject some code (contained in test.S) into a firmware file.
-
-Edit the INFILE variable in the Makefile to point to the original
-firmware file you want to patch, edit "test.S" appropriately, and then
-type "make".
-
-