summaryrefslogtreecommitdiff
path: root/utils/hwstub/stub/stmp
diff options
context:
space:
mode:
Diffstat (limited to 'utils/hwstub/stub/stmp')
-rw-r--r--utils/hwstub/stub/stmp/Makefile10
-rw-r--r--utils/hwstub/stub/stmp/target.c15
2 files changed, 23 insertions, 2 deletions
diff --git a/utils/hwstub/stub/stmp/Makefile b/utils/hwstub/stub/stmp/Makefile
index 14e6d0fbba..3ac7e3bbd4 100644
--- a/utils/hwstub/stub/stmp/Makefile
+++ b/utils/hwstub/stub/stmp/Makefile
@@ -5,10 +5,16 @@ CC=arm-elf-eabi-gcc
5LD=arm-elf-eabi-gcc 5LD=arm-elf-eabi-gcc
6AS=arm-elf-eabi-gcc 6AS=arm-elf-eabi-gcc
7OC=arm-elf-eabi-objcopy 7OC=arm-elf-eabi-objcopy
8SBTOELF=$(CURDIR)/../../../imxtools/sbtools/elftosb
8DEFINES= 9DEFINES=
9INCLUDES=-I$(CURDIR) 10INCLUDES=-I$(CURDIR)
10GCCOPTS=-mcpu=arm926ej-s 11GCCOPTS=-mcpu=arm926ej-s
11BUILD_DIR=$(CURDIR)/build/ 12BUILD_DIR=$(CURDIR)/build/
12ROOT_DIR=$(CURDIR)/.. 13ROOT_DIR=$(CURDIR)/..
13 14EXEC=$(BUILD_DIR)/hwstub.sb
14include ../hwstub.make \ No newline at end of file 15
16include ../hwstub.make
17
18$(BUILD_DIR)/hwstub.sb: $(EXEC_BIN)
19 $(call PRINTS,SBTOELF $(@F))
20 $(SILENT)$(SBTOELF) -z -c hwstub.db -o $@ $< \ No newline at end of file
diff --git a/utils/hwstub/stub/stmp/target.c b/utils/hwstub/stub/stmp/target.c
index 390480a71c..9b005063bd 100644
--- a/utils/hwstub/stub/stmp/target.c
+++ b/utils/hwstub/stub/stmp/target.c
@@ -273,3 +273,18 @@ void target_exit(void)
273 return; 273 return;
274 } 274 }
275} 275}
276
277void target_udelay(int us)
278{
279 uint32_t cur = HW_DIGCTL_MICROSECONDS;
280 uint32_t end = cur + us;
281 if(cur < end)
282 while(HW_DIGCTL_MICROSECONDS < end) {}
283 else
284 while(HW_DIGCTL_MICROSECONDS >= cur) {}
285}
286
287void target_mdelay(int ms)
288{
289 return target_udelay(ms * 1000);
290}