From 51d8a45057d47c6d36d5027c8f8d7db7c964f5ff Mon Sep 17 00:00:00 2001 From: Marcin Bukat Date: Wed, 8 Jan 2014 08:50:38 +0100 Subject: adfuload: add atj213x timer0 test program This simple program shows how to setup timer for periodic operation. Interrupts are not used yet and simply pending irq bit is polled and cleared when set. This program supports my understanding of disassm of ADEC_N63.BIN that P_CLK is configured for 7.5MHz and timer clock source is P_CLK directly. Change-Id: Idd6461bf847c763b78b8c324012ec2515f65dd41 --- .../adfuload/test_binary/timer_no_irq/Makefile | 40 ++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 utils/atj2137/adfuload/test_binary/timer_no_irq/Makefile (limited to 'utils/atj2137/adfuload/test_binary/timer_no_irq/Makefile') diff --git a/utils/atj2137/adfuload/test_binary/timer_no_irq/Makefile b/utils/atj2137/adfuload/test_binary/timer_no_irq/Makefile new file mode 100644 index 0000000000..f3bd76686b --- /dev/null +++ b/utils/atj2137/adfuload/test_binary/timer_no_irq/Makefile @@ -0,0 +1,40 @@ + +TARGET = test_timer_noirq + +TOOLCHAIN = mipsel-elf- + +CC = $(TOOLCHAIN)gcc +CPP = $(TOOLCHAIN)cpp +LD = $(TOOLCHAIN)gcc +AS = $(TOOLCHAIN)as +OBJCOPY = $(TOOLCHAIN)objcopy +OBJDUMP = $(TOOLCHAIN)objdump + +CFLAGS = -Wundef -march=4kec -nostdlib -Os -c + +OBJS = crt0.o test_timer_noirq.o +LDSCRIPT= test.lds + +LDFLAGS = -Wundef -march=4kec -T$(LDSCRIPT) -nostartfiles \ + -nostdlib -Xlinker -Map=$(TARGET).map + +all : $(TARGET).bin + ls -ls $(TARGET).bin + +%.o : %.c + $(CC) $(CPPFLAGS) $(CFLAGS) $(INCDIRS) $< -o $@ + +%.o : %.S + $(CC) $(CFLAGS) -c $< -o $@ + +$(TARGET).elf : $(OBJS) + $(LD) $(LDFLAGS) $(OBJS) $(LIBDIRS) $(LIBS) -o $(TARGET).elf + +$(TARGET).bin : $(TARGET).elf + $(OBJCOPY) -O binary $(TARGET).elf $(TARGET).bin + +clean : + rm -f $(OBJS) + rm -f $(TARGET).elf + rm -f $(TARGET).bin + rm -f $(TARGET).map -- cgit v1.2.3