Skip to contentSkip to conversation

h8300 update timer handler - new files

PATCH In review Yoshinori Sato 1 participant 1 message Aug 3, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 h8300 update timer handler - new files

New timer handler files.

arch/h8300/kernel/timer/Makefile new file +6 -0
new file mode 100644
index 0000000..bef0510
@@ -0,0 +1,6 @@
+# h8300 internal timer handler
+
+obj-$(CONFIG_H8300_TIMER8)  := timer8.o
+obj-$(CONFIG_H8300_TIMER16) := timer16.o
+obj-$(CONFIG_H8300_ITU)     := itu.o
+obj-$(CONFIG_H8300_TPU)     := tpu.o
arch/h8300/kernel/timer/itu.c new file +83 -0

83 lines not on this page · raw message

arch/h8300/kernel/timer/timer16.c new file +78 -0

78 lines not on this page · raw message

arch/h8300/kernel/timer/timer8.c new file +103 -0

103 lines not on this page · raw message

arch/h8300/kernel/timer/tpu.c new file +102 -0

102 lines not on this page · raw message

include/asm-h8300/timer.h new file +25 -0
new file mode 100644
index 0000000..b4a8953
@@ -0,0 +1,25 @@
+#ifndef __H8300_TIMER_H
+#define __H8300_TIMER_H
+
+void h8300_timer_tick(void);
+void h8300_timer_setup(void);
+void h8300_gettod(unsigned int *year, unsigned int *mon, unsigned int *day,
+		   unsigned int *hour, unsigned int *min, unsigned int *sec);
+
+#define TIMER_FREQ (CONFIG_CPU_CLOCK*10000) /* Timer input freq. */
+
+#define calc_param(cnt, div, rate, limit)			\
+do {								\
+	cnt = TIMER_FREQ / HZ;					\
+	for (div = 0; div < ARRAY_SIZE(divide_rate); div++) {	\
+		if (rate[div] == 0)				\
+			continue;				\
+		if ((cnt / rate[div]) > limit)			\
+			break;					\
+	}							\
+	if (div == ARRAY_SIZE(divide_rate))			\
+		panic("Timer counter overflow");		\
+	cnt /= divide_rate[div];				\
+} while(0)
+
+#endif
Signature · 2 lines
Yoshinori Sato
<[email protected]>