diff options
Diffstat (limited to 'utils/hwstub/stub/stmp')
-rw-r--r-- | utils/hwstub/stub/stmp/Makefile | 10 | ||||
-rw-r--r-- | utils/hwstub/stub/stmp/target.c | 15 |
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 | |||
5 | LD=arm-elf-eabi-gcc | 5 | LD=arm-elf-eabi-gcc |
6 | AS=arm-elf-eabi-gcc | 6 | AS=arm-elf-eabi-gcc |
7 | OC=arm-elf-eabi-objcopy | 7 | OC=arm-elf-eabi-objcopy |
8 | SBTOELF=$(CURDIR)/../../../imxtools/sbtools/elftosb | ||
8 | DEFINES= | 9 | DEFINES= |
9 | INCLUDES=-I$(CURDIR) | 10 | INCLUDES=-I$(CURDIR) |
10 | GCCOPTS=-mcpu=arm926ej-s | 11 | GCCOPTS=-mcpu=arm926ej-s |
11 | BUILD_DIR=$(CURDIR)/build/ | 12 | BUILD_DIR=$(CURDIR)/build/ |
12 | ROOT_DIR=$(CURDIR)/.. | 13 | ROOT_DIR=$(CURDIR)/.. |
13 | 14 | EXEC=$(BUILD_DIR)/hwstub.sb | |
14 | include ../hwstub.make \ No newline at end of file | 15 | |
16 | include ../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 | |||
277 | void 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 | |||
287 | void target_mdelay(int ms) | ||
288 | { | ||
289 | return target_udelay(ms * 1000); | ||
290 | } | ||