Commit 81d423e2 authored by Yoshinori Sato's avatar Yoshinori Sato Committed by Linus Torvalds

h8300: update timer handler - misc update

- Update selection
- Update common timer handler
- Add support functions
Signed-off-by: default avatarYoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent e0b0f9e4
menu "Processor type and features" menu "Processor type and features"
source "kernel/time/Kconfig"
choice choice
prompt "H8/300 platform" prompt "H8/300 platform"
default H8300H_GENERIC default H8300H_GENERIC
...@@ -11,6 +13,7 @@ config H8300H_GENERIC ...@@ -11,6 +13,7 @@ config H8300H_GENERIC
config H8300H_AKI3068NET config H8300H_AKI3068NET
bool "AE-3068/69" bool "AE-3068/69"
select CONFIG_H83068
help help
AKI-H8/3068F / AKI-H8/3069F Flashmicom LAN Board Support AKI-H8/3068F / AKI-H8/3069F Flashmicom LAN Board Support
More Information. (Japanese Only) More Information. (Japanese Only)
...@@ -21,6 +24,7 @@ config H8300H_AKI3068NET ...@@ -21,6 +24,7 @@ config H8300H_AKI3068NET
config H8300H_H8MAX config H8300H_H8MAX
bool "H8MAX" bool "H8MAX"
select CONFIG_H83068
help help
H8MAX Evaluation Board Support H8MAX Evaluation Board Support
More Information. (Japanese Only) More Information. (Japanese Only)
...@@ -28,6 +32,7 @@ config H8300H_H8MAX ...@@ -28,6 +32,7 @@ config H8300H_H8MAX
config H8300H_SIM config H8300H_SIM
bool "H8/300H Simulator" bool "H8/300H Simulator"
select CONFIG_H83007
help help
GDB Simulator Support GDB Simulator Support
More Information. More Information.
...@@ -40,6 +45,7 @@ config H8S_GENERIC ...@@ -40,6 +45,7 @@ config H8S_GENERIC
config H8S_EDOSK2674 config H8S_EDOSK2674
bool "EDOSK-2674" bool "EDOSK-2674"
select CONFIG_H8S2768
help help
Renesas EDOSK-2674 Evaluation Board Support Renesas EDOSK-2674 Evaluation Board Support
More Information. More Information.
...@@ -55,44 +61,37 @@ config H8S_SIM ...@@ -55,44 +61,37 @@ config H8S_SIM
endchoice endchoice
if (H8300H_GENERIC || H8S_GENERIC)
menu "Detail Selection"
if (H8300H_GENERIC)
choice choice
prompt "CPU Selection" prompt "CPU Selection"
config H83002 config H83002
bool "H8/3001,3002,3003" bool "H8/3001,3002,3003"
select CPU_H8300H
config H83007 config H83007
bool "H8/3006,3007" bool "H8/3006,3007"
select CPU_H8300H
config H83048 config H83048
bool "H8/3044,3045,3046,3047,3048,3052" bool "H8/3044,3045,3046,3047,3048,3052"
select CPU_H8300H
config H83068 config H83068
bool "H8/3065,3066,3067,3068,3069" bool "H8/3065,3066,3067,3068,3069"
endchoice select CPU_H8300H
endif
if (H8S_GENERIC)
choice
prompt "CPU Selection"
config H8S2678 config H8S2678
bool "H8S/2670,2673,2674R,2675,2676" bool "H8S/2670,2673,2674R,2675,2676"
select CPU_H8S
endchoice endchoice
endif
config CPU_CLOCK config CPU_CLOCK
int "CPU Clock Frequency (/1KHz)" int "CPU Clock Frequency (/1KHz)"
default "20000" default "20000"
help help
CPU Clock Frequency divide to 1000 CPU Clock Frequency divide to 1000
endmenu
endif
if (H8300H_GENERIC || H8S_GENERIC || H8300H_SIM || H8S_SIM || H8S_EDOSK2674)
choice choice
prompt "Kernel executes from" prompt "Kernel executes from"
---help--- ---help---
...@@ -107,75 +106,61 @@ config ROMKERNEL ...@@ -107,75 +106,61 @@ config ROMKERNEL
bool "ROM" bool "ROM"
help help
The kernel will be resident in FLASH/ROM when running. The kernel will be resident in FLASH/ROM when running.
endchoice endchoice
endif
if (H8300H_AKI3068NET)
config H83068
bool
default y
config CPU_CLOCK config CPU_H8300H
int
default "20000"
config RAMKERNEL
bool bool
depends on (H83002 || H83007 || H83048 || H83068)
default y default y
endif
if (H8300H_H8MAX) config CPU_H8S
config H83068
bool bool
depends on H8S2678
default y default y
config CPU_CLOCK choice
int prompt "Timer"
default 25000 config H8300_TIMER8
bool "8bit timer (2ch cascade)"
depends on (H83007 || H83068 || H8S2678)
config RAMKERNEL config H8300_TIMER16
bool bool "16bit timer"
default y depends on (H83007 || H83068)
endif
if (H8300H_SIM) config H8300_ITU
config H83007 bool "ITU"
bool depends on (H83002 || H83048)
default y
config CPU_CLOCK config H8300_TPU
int bool "TPU"
default "16000" depends on H8S2678
endif endchoice
if (H8S_EDOSK2674) if H8300_TIMER8
config H8S2678 choice
bool prompt "Timer Channel"
default y config H8300_TIMER8_CH0
config CPU_CLOCK bool "Channel 0"
int config H8300_TIMER8_CH2
default 33000 bool "Channel 2"
depends on CPU_H8300H
endchoice
endif endif
if (H8S_SIM) config H8300_TIMER16_CH
config H8S2678 int "16bit timer channel (0 - 2)"
bool depends on H8300_TIMER16
default y range 0 2
config CPU_CLOCK
int
default 33000
endif
config CPU_H8300H config H8300_ITU_CH
bool int "ITU channel"
depends on (H83002 || H83007 || H83048 || H83068) depends on H8300_ITU
default y
config CPU_H8S config H8300_TPU_CH
bool int "TPU channel"
depends on H8S2678 depends on H8300_TPU
default y
config PREEMPT config PREEMPT
bool "Preemptible Kernel" bool "Preemptible Kernel"
......
...@@ -295,6 +295,40 @@ static __inline__ void ctrl_outl(unsigned long b, unsigned long addr) ...@@ -295,6 +295,40 @@ static __inline__ void ctrl_outl(unsigned long b, unsigned long addr)
*(volatile unsigned long*)addr = b; *(volatile unsigned long*)addr = b;
} }
static __inline__ void ctrl_bclr(int b, unsigned long addr)
{
if (__builtin_constant_p(b))
switch (b) {
case 0: __asm__("bclr #0,@%0"::"r"(addr)); break;
case 1: __asm__("bclr #1,@%0"::"r"(addr)); break;
case 2: __asm__("bclr #2,@%0"::"r"(addr)); break;
case 3: __asm__("bclr #3,@%0"::"r"(addr)); break;
case 4: __asm__("bclr #4,@%0"::"r"(addr)); break;
case 5: __asm__("bclr #5,@%0"::"r"(addr)); break;
case 6: __asm__("bclr #6,@%0"::"r"(addr)); break;
case 7: __asm__("bclr #7,@%0"::"r"(addr)); break;
}
else
__asm__("bclr %w0,@%1"::"r"(b), "r"(addr));
}
static __inline__ void ctrl_bset(int b, unsigned long addr)
{
if (__builtin_constant_p(b))
switch (b) {
case 0: __asm__("bset #0,@%0"::"r"(addr)); break;
case 1: __asm__("bset #1,@%0"::"r"(addr)); break;
case 2: __asm__("bset #2,@%0"::"r"(addr)); break;
case 3: __asm__("bset #3,@%0"::"r"(addr)); break;
case 4: __asm__("bset #4,@%0"::"r"(addr)); break;
case 5: __asm__("bset #5,@%0"::"r"(addr)); break;
case 6: __asm__("bset #6,@%0"::"r"(addr)); break;
case 7: __asm__("bset #7,@%0"::"r"(addr)); break;
}
else
__asm__("bset %w0,@%1"::"r"(b), "r"(addr));
}
/* Pages to physical address... */ /* Pages to physical address... */
#define page_to_phys(page) ((page - mem_map) << PAGE_SHIFT) #define page_to_phys(page) ((page - mem_map) << PAGE_SHIFT)
#define page_to_bus(page) ((page - mem_map) << PAGE_SHIFT) #define page_to_bus(page) ((page - mem_map) << PAGE_SHIFT)
......
...@@ -7,6 +7,6 @@ extra-y := vmlinux.lds ...@@ -7,6 +7,6 @@ extra-y := vmlinux.lds
obj-y := process.o traps.o ptrace.o irq.o \ obj-y := process.o traps.o ptrace.o irq.o \
sys_h8300.o time.o signal.o \ sys_h8300.o time.o signal.o \
setup.o gpio.o init_task.o syscalls.o \ setup.o gpio.o init_task.o syscalls.o \
entry.o entry.o timer/
obj-$(CONFIG_MODULES) += module.o h8300_ksyms.o obj-$(CONFIG_MODULES) += module.o h8300_ksyms.o
...@@ -27,27 +27,21 @@ ...@@ -27,27 +27,21 @@
#include <linux/profile.h> #include <linux/profile.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/target_time.h> #include <asm/timer.h>
#define TICK_SIZE (tick_nsec / 1000) #define TICK_SIZE (tick_nsec / 1000)
/* void h8300_timer_tick(void)
* timer_interrupt() needs to keep up the real-time clock,
* as well as call the "do_timer()" routine every clocktick
*/
static void timer_interrupt(int irq, void *dummy, struct pt_regs * regs)
{ {
/* may need to kick the hardware timer */ if (current->pid)
platform_timer_eoi();
do_timer(1);
#ifndef CONFIG_SMP
update_process_times(user_mode(regs));
#endif
profile_tick(CPU_PROFILING); profile_tick(CPU_PROFILING);
write_seqlock(&xtime_lock);
do_timer(1);
write_sequnlock(&xtime_lock);
update_process_times(user_mode(get_irq_regs()));
} }
void time_init(void) void __init time_init(void)
{ {
unsigned int year, mon, day, hour, min, sec; unsigned int year, mon, day, hour, min, sec;
...@@ -57,12 +51,13 @@ void time_init(void) ...@@ -57,12 +51,13 @@ void time_init(void)
year = 1980; year = 1980;
mon = day = 1; mon = day = 1;
hour = min = sec = 0; hour = min = sec = 0;
platform_gettod (&year, &mon, &day, &hour, &min, &sec); #ifdef CONFIG_H8300_GETTOD
h8300_gettod (&year, &mon, &day, &hour, &min, &sec);
#endif
if ((year += 1900) < 1970) if ((year += 1900) < 1970)
year += 100; year += 100;
xtime.tv_sec = mktime(year, mon, day, hour, min, sec); xtime.tv_sec = mktime(year, mon, day, hour, min, sec);
xtime.tv_nsec = 0; xtime.tv_nsec = 0;
platform_timer_setup(timer_interrupt); h8300_timer_setup();
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment