diff options
author | Yoshinori Sato <ysato@users.sourceforge.jp> | 2008-10-16 01:01:17 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-16 14:21:29 -0400 |
commit | 81d423e280d193d351f41eacdb3f82c3bb9610c1 (patch) | |
tree | 37395cbb8104d0a78ae1e2d7d1ca67bff817eeae /arch | |
parent | e0b0f9e4ead2468f84c26332ec42b118e76af572 (diff) |
h8300: update timer handler - misc update
- Update selection
- Update common timer handler
- Add support functions
Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/h8300/Kconfig.cpu | 115 | ||||
-rw-r--r-- | arch/h8300/include/asm/io.h | 34 | ||||
-rw-r--r-- | arch/h8300/kernel/Makefile | 2 | ||||
-rw-r--r-- | arch/h8300/kernel/time.c | 29 |
4 files changed, 97 insertions, 83 deletions
diff --git a/arch/h8300/Kconfig.cpu b/arch/h8300/Kconfig.cpu index 582797db9603..b65dcfe51d9c 100644 --- a/arch/h8300/Kconfig.cpu +++ b/arch/h8300/Kconfig.cpu | |||
@@ -1,5 +1,7 @@ | |||
1 | menu "Processor type and features" | 1 | menu "Processor type and features" |
2 | 2 | ||
3 | source "kernel/time/Kconfig" | ||
4 | |||
3 | choice | 5 | choice |
4 | prompt "H8/300 platform" | 6 | prompt "H8/300 platform" |
5 | default H8300H_GENERIC | 7 | default H8300H_GENERIC |
@@ -11,6 +13,7 @@ config H8300H_GENERIC | |||
11 | 13 | ||
12 | config H8300H_AKI3068NET | 14 | config H8300H_AKI3068NET |
13 | bool "AE-3068/69" | 15 | bool "AE-3068/69" |
16 | select CONFIG_H83068 | ||
14 | help | 17 | help |
15 | AKI-H8/3068F / AKI-H8/3069F Flashmicom LAN Board Support | 18 | AKI-H8/3068F / AKI-H8/3069F Flashmicom LAN Board Support |
16 | More Information. (Japanese Only) | 19 | More Information. (Japanese Only) |
@@ -21,6 +24,7 @@ config H8300H_AKI3068NET | |||
21 | 24 | ||
22 | config H8300H_H8MAX | 25 | config H8300H_H8MAX |
23 | bool "H8MAX" | 26 | bool "H8MAX" |
27 | select CONFIG_H83068 | ||
24 | help | 28 | help |
25 | H8MAX Evaluation Board Support | 29 | H8MAX Evaluation Board Support |
26 | More Information. (Japanese Only) | 30 | More Information. (Japanese Only) |
@@ -28,6 +32,7 @@ config H8300H_H8MAX | |||
28 | 32 | ||
29 | config H8300H_SIM | 33 | config H8300H_SIM |
30 | bool "H8/300H Simulator" | 34 | bool "H8/300H Simulator" |
35 | select CONFIG_H83007 | ||
31 | help | 36 | help |
32 | GDB Simulator Support | 37 | GDB Simulator Support |
33 | More Information. | 38 | More Information. |
@@ -40,6 +45,7 @@ config H8S_GENERIC | |||
40 | 45 | ||
41 | config H8S_EDOSK2674 | 46 | config H8S_EDOSK2674 |
42 | bool "EDOSK-2674" | 47 | bool "EDOSK-2674" |
48 | select CONFIG_H8S2768 | ||
43 | help | 49 | help |
44 | Renesas EDOSK-2674 Evaluation Board Support | 50 | Renesas EDOSK-2674 Evaluation Board Support |
45 | More Information. | 51 | More Information. |
@@ -55,44 +61,37 @@ config H8S_SIM | |||
55 | 61 | ||
56 | endchoice | 62 | endchoice |
57 | 63 | ||
58 | if (H8300H_GENERIC || H8S_GENERIC) | ||
59 | menu "Detail Selection" | ||
60 | if (H8300H_GENERIC) | ||
61 | choice | 64 | choice |
62 | prompt "CPU Selection" | 65 | prompt "CPU Selection" |
63 | 66 | ||
64 | config H83002 | 67 | config H83002 |
65 | bool "H8/3001,3002,3003" | 68 | bool "H8/3001,3002,3003" |
69 | select CPU_H8300H | ||
66 | 70 | ||
67 | config H83007 | 71 | config H83007 |
68 | bool "H8/3006,3007" | 72 | bool "H8/3006,3007" |
73 | select CPU_H8300H | ||
69 | 74 | ||
70 | config H83048 | 75 | config H83048 |
71 | bool "H8/3044,3045,3046,3047,3048,3052" | 76 | bool "H8/3044,3045,3046,3047,3048,3052" |
77 | select CPU_H8300H | ||
72 | 78 | ||
73 | config H83068 | 79 | config H83068 |
74 | bool "H8/3065,3066,3067,3068,3069" | 80 | bool "H8/3065,3066,3067,3068,3069" |
75 | endchoice | 81 | select CPU_H8300H |
76 | endif | ||
77 | |||
78 | if (H8S_GENERIC) | ||
79 | choice | ||
80 | prompt "CPU Selection" | ||
81 | 82 | ||
82 | config H8S2678 | 83 | config H8S2678 |
83 | bool "H8S/2670,2673,2674R,2675,2676" | 84 | bool "H8S/2670,2673,2674R,2675,2676" |
85 | select CPU_H8S | ||
86 | |||
84 | endchoice | 87 | endchoice |
85 | endif | ||
86 | 88 | ||
87 | config CPU_CLOCK | 89 | config CPU_CLOCK |
88 | int "CPU Clock Frequency (/1KHz)" | 90 | int "CPU Clock Frequency (/1KHz)" |
89 | default "20000" | 91 | default "20000" |
90 | help | 92 | help |
91 | CPU Clock Frequency divide to 1000 | 93 | CPU Clock Frequency divide to 1000 |
92 | endmenu | ||
93 | endif | ||
94 | 94 | ||
95 | if (H8300H_GENERIC || H8S_GENERIC || H8300H_SIM || H8S_SIM || H8S_EDOSK2674) | ||
96 | choice | 95 | choice |
97 | prompt "Kernel executes from" | 96 | prompt "Kernel executes from" |
98 | ---help--- | 97 | ---help--- |
@@ -107,75 +106,61 @@ config ROMKERNEL | |||
107 | bool "ROM" | 106 | bool "ROM" |
108 | help | 107 | help |
109 | The kernel will be resident in FLASH/ROM when running. | 108 | The kernel will be resident in FLASH/ROM when running. |
110 | |||
111 | endchoice | 109 | endchoice |
112 | endif | ||
113 | 110 | ||
114 | if (H8300H_AKI3068NET) | ||
115 | config H83068 | ||
116 | bool | ||
117 | default y | ||
118 | 111 | ||
119 | config CPU_CLOCK | 112 | config CPU_H8300H |
120 | int | ||
121 | default "20000" | ||
122 | |||
123 | config RAMKERNEL | ||
124 | bool | 113 | bool |
114 | depends on (H83002 || H83007 || H83048 || H83068) | ||
125 | default y | 115 | default y |
126 | endif | ||
127 | 116 | ||
128 | if (H8300H_H8MAX) | 117 | config CPU_H8S |
129 | config H83068 | ||
130 | bool | 118 | bool |
119 | depends on H8S2678 | ||
131 | default y | 120 | default y |
132 | 121 | ||
133 | config CPU_CLOCK | 122 | choice |
134 | int | 123 | prompt "Timer" |
135 | default 25000 | 124 | config H8300_TIMER8 |
125 | bool "8bit timer (2ch cascade)" | ||
126 | depends on (H83007 || H83068 || H8S2678) | ||
136 | 127 | ||
137 | config RAMKERNEL | 128 | config H8300_TIMER16 |
138 | bool | 129 | bool "16bit timer" |
139 | default y | 130 | depends on (H83007 || H83068) |
140 | endif | ||
141 | 131 | ||
142 | if (H8300H_SIM) | 132 | config H8300_ITU |
143 | config H83007 | 133 | bool "ITU" |
144 | bool | 134 | depends on (H83002 || H83048) |
145 | default y | ||
146 | 135 | ||
147 | config CPU_CLOCK | 136 | config H8300_TPU |
148 | int | 137 | bool "TPU" |
149 | default "16000" | 138 | depends on H8S2678 |
150 | endif | 139 | endchoice |
151 | 140 | ||
152 | if (H8S_EDOSK2674) | 141 | if H8300_TIMER8 |
153 | config H8S2678 | 142 | choice |
154 | bool | 143 | prompt "Timer Channel" |
155 | default y | 144 | config H8300_TIMER8_CH0 |
156 | config CPU_CLOCK | 145 | bool "Channel 0" |
157 | int | 146 | config H8300_TIMER8_CH2 |
158 | default 33000 | 147 | bool "Channel 2" |
148 | depends on CPU_H8300H | ||
149 | endchoice | ||
159 | endif | 150 | endif |
160 | 151 | ||
161 | if (H8S_SIM) | 152 | config H8300_TIMER16_CH |
162 | config H8S2678 | 153 | int "16bit timer channel (0 - 2)" |
163 | bool | 154 | depends on H8300_TIMER16 |
164 | default y | 155 | range 0 2 |
165 | config CPU_CLOCK | ||
166 | int | ||
167 | default 33000 | ||
168 | endif | ||
169 | 156 | ||
170 | config CPU_H8300H | 157 | config H8300_ITU_CH |
171 | bool | 158 | int "ITU channel" |
172 | depends on (H83002 || H83007 || H83048 || H83068) | 159 | depends on H8300_ITU |
173 | default y | ||
174 | 160 | ||
175 | config CPU_H8S | 161 | config H8300_TPU_CH |
176 | bool | 162 | int "TPU channel" |
177 | depends on H8S2678 | 163 | depends on H8300_TPU |
178 | default y | ||
179 | 164 | ||
180 | config PREEMPT | 165 | config PREEMPT |
181 | bool "Preemptible Kernel" | 166 | bool "Preemptible Kernel" |
diff --git a/arch/h8300/include/asm/io.h b/arch/h8300/include/asm/io.h index 26dc6ccd9441..33e842f3284b 100644 --- a/arch/h8300/include/asm/io.h +++ b/arch/h8300/include/asm/io.h | |||
@@ -295,6 +295,40 @@ static __inline__ void ctrl_outl(unsigned long b, unsigned long addr) | |||
295 | *(volatile unsigned long*)addr = b; | 295 | *(volatile unsigned long*)addr = b; |
296 | } | 296 | } |
297 | 297 | ||
298 | static __inline__ void ctrl_bclr(int b, unsigned long addr) | ||
299 | { | ||
300 | if (__builtin_constant_p(b)) | ||
301 | switch (b) { | ||
302 | case 0: __asm__("bclr #0,@%0"::"r"(addr)); break; | ||
303 | case 1: __asm__("bclr #1,@%0"::"r"(addr)); break; | ||
304 | case 2: __asm__("bclr #2,@%0"::"r"(addr)); break; | ||
305 | case 3: __asm__("bclr #3,@%0"::"r"(addr)); break; | ||
306 | case 4: __asm__("bclr #4,@%0"::"r"(addr)); break; | ||
307 | case 5: __asm__("bclr #5,@%0"::"r"(addr)); break; | ||
308 | case 6: __asm__("bclr #6,@%0"::"r"(addr)); break; | ||
309 | case 7: __asm__("bclr #7,@%0"::"r"(addr)); break; | ||
310 | } | ||
311 | else | ||
312 | __asm__("bclr %w0,@%1"::"r"(b), "r"(addr)); | ||
313 | } | ||
314 | |||
315 | static __inline__ void ctrl_bset(int b, unsigned long addr) | ||
316 | { | ||
317 | if (__builtin_constant_p(b)) | ||
318 | switch (b) { | ||
319 | case 0: __asm__("bset #0,@%0"::"r"(addr)); break; | ||
320 | case 1: __asm__("bset #1,@%0"::"r"(addr)); break; | ||
321 | case 2: __asm__("bset #2,@%0"::"r"(addr)); break; | ||
322 | case 3: __asm__("bset #3,@%0"::"r"(addr)); break; | ||
323 | case 4: __asm__("bset #4,@%0"::"r"(addr)); break; | ||
324 | case 5: __asm__("bset #5,@%0"::"r"(addr)); break; | ||
325 | case 6: __asm__("bset #6,@%0"::"r"(addr)); break; | ||
326 | case 7: __asm__("bset #7,@%0"::"r"(addr)); break; | ||
327 | } | ||
328 | else | ||
329 | __asm__("bset %w0,@%1"::"r"(b), "r"(addr)); | ||
330 | } | ||
331 | |||
298 | /* Pages to physical address... */ | 332 | /* Pages to physical address... */ |
299 | #define page_to_phys(page) ((page - mem_map) << PAGE_SHIFT) | 333 | #define page_to_phys(page) ((page - mem_map) << PAGE_SHIFT) |
300 | #define page_to_bus(page) ((page - mem_map) << PAGE_SHIFT) | 334 | #define page_to_bus(page) ((page - mem_map) << PAGE_SHIFT) |
diff --git a/arch/h8300/kernel/Makefile b/arch/h8300/kernel/Makefile index 6c248c3c5c3b..8d4d2a54be9e 100644 --- a/arch/h8300/kernel/Makefile +++ b/arch/h8300/kernel/Makefile | |||
@@ -7,6 +7,6 @@ extra-y := vmlinux.lds | |||
7 | obj-y := process.o traps.o ptrace.o irq.o \ | 7 | obj-y := process.o traps.o ptrace.o irq.o \ |
8 | sys_h8300.o time.o signal.o \ | 8 | sys_h8300.o time.o signal.o \ |
9 | setup.o gpio.o init_task.o syscalls.o \ | 9 | setup.o gpio.o init_task.o syscalls.o \ |
10 | entry.o | 10 | entry.o timer/ |
11 | 11 | ||
12 | obj-$(CONFIG_MODULES) += module.o h8300_ksyms.o | 12 | obj-$(CONFIG_MODULES) += module.o h8300_ksyms.o |
diff --git a/arch/h8300/kernel/time.c b/arch/h8300/kernel/time.c index e37c835e67cf..7f2d6cfbb4b6 100644 --- a/arch/h8300/kernel/time.c +++ b/arch/h8300/kernel/time.c | |||
@@ -27,27 +27,21 @@ | |||
27 | #include <linux/profile.h> | 27 | #include <linux/profile.h> |
28 | 28 | ||
29 | #include <asm/io.h> | 29 | #include <asm/io.h> |
30 | #include <asm/target_time.h> | 30 | #include <asm/timer.h> |
31 | 31 | ||
32 | #define TICK_SIZE (tick_nsec / 1000) | 32 | #define TICK_SIZE (tick_nsec / 1000) |
33 | 33 | ||
34 | /* | 34 | void h8300_timer_tick(void) |
35 | * timer_interrupt() needs to keep up the real-time clock, | ||
36 | * as well as call the "do_timer()" routine every clocktick | ||
37 | */ | ||
38 | static void timer_interrupt(int irq, void *dummy, struct pt_regs * regs) | ||
39 | { | 35 | { |
40 | /* may need to kick the hardware timer */ | 36 | if (current->pid) |
41 | platform_timer_eoi(); | 37 | profile_tick(CPU_PROFILING); |
42 | 38 | write_seqlock(&xtime_lock); | |
43 | do_timer(1); | 39 | do_timer(1); |
44 | #ifndef CONFIG_SMP | 40 | write_sequnlock(&xtime_lock); |
45 | update_process_times(user_mode(regs)); | 41 | update_process_times(user_mode(get_irq_regs())); |
46 | #endif | ||
47 | profile_tick(CPU_PROFILING); | ||
48 | } | 42 | } |
49 | 43 | ||
50 | void time_init(void) | 44 | void __init time_init(void) |
51 | { | 45 | { |
52 | unsigned int year, mon, day, hour, min, sec; | 46 | unsigned int year, mon, day, hour, min, sec; |
53 | 47 | ||
@@ -57,12 +51,13 @@ void time_init(void) | |||
57 | year = 1980; | 51 | year = 1980; |
58 | mon = day = 1; | 52 | mon = day = 1; |
59 | hour = min = sec = 0; | 53 | hour = min = sec = 0; |
60 | platform_gettod (&year, &mon, &day, &hour, &min, &sec); | 54 | #ifdef CONFIG_H8300_GETTOD |
61 | 55 | h8300_gettod (&year, &mon, &day, &hour, &min, &sec); | |
56 | #endif | ||
62 | if ((year += 1900) < 1970) | 57 | if ((year += 1900) < 1970) |
63 | year += 100; | 58 | year += 100; |
64 | xtime.tv_sec = mktime(year, mon, day, hour, min, sec); | 59 | xtime.tv_sec = mktime(year, mon, day, hour, min, sec); |
65 | xtime.tv_nsec = 0; | 60 | xtime.tv_nsec = 0; |
66 | 61 | ||
67 | platform_timer_setup(timer_interrupt); | 62 | h8300_timer_setup(); |
68 | } | 63 | } |