Skip to content

Commit

Permalink
[MIPS] Implement clockevents for R4000-style cp0 count/compare interrupt
Browse files Browse the repository at this point in the history
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
  • Loading branch information
Ralf Baechle committed Oct 11, 2007
1 parent 91a2fcc commit 7bcf771
Show file tree
Hide file tree
Showing 20 changed files with 210 additions and 200 deletions.
7 changes: 7 additions & 0 deletions arch/mips/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,7 @@ config QEMU
select GENERIC_ISA_DMA
select HAVE_STD_PC_SERIAL_PORT
select I8259
select IRQ_CPU
select ISA
select PCSPEAKER
select SWAP_IO_SPACE
Expand Down Expand Up @@ -667,6 +668,10 @@ config GENERIC_CALIBRATE_DELAY
bool
default y

config GENERIC_CLOCKEVENTS
bool
default y

config GENERIC_TIME
bool
default y
Expand Down Expand Up @@ -901,6 +906,8 @@ config BOOT_ELF64

menu "CPU selection"

source "kernel/time/Kconfig"

choice
prompt "CPU type"
default CPU_R4X00
Expand Down
2 changes: 1 addition & 1 deletion arch/mips/au1000/common/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,7 @@ asmlinkage void plat_irq_dispatch(void)
unsigned int pending = read_c0_status() & read_c0_cause() & ST0_IM;

if (pending & CAUSEF_IP7)
ll_timer_interrupt(63);
do_IRQ(63);
else if (pending & CAUSEF_IP2)
intc0_req0_irqdispatch();
else if (pending & CAUSEF_IP3)
Expand Down
1 change: 0 additions & 1 deletion arch/mips/configs/bigsur_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ CONFIG_SIBYTE_SB1xxx_SOC=y
CONFIG_SIBYTE_CFE=y
# CONFIG_SIBYTE_CFE_CONSOLE is not set
# CONFIG_SIBYTE_BUS_WATCHER is not set
# CONFIG_SIBYTE_SB1250_PROF is not set
# CONFIG_SIBYTE_TBPROF is not set
CONFIG_RWSEM_GENERIC_SPINLOCK=y
# CONFIG_ARCH_HAS_ILOG2_U32 is not set
Expand Down
1 change: 0 additions & 1 deletion arch/mips/configs/sb1250-swarm_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ CONFIG_SIBYTE_HAS_LDT=y
CONFIG_SIBYTE_CFE=y
# CONFIG_SIBYTE_CFE_CONSOLE is not set
# CONFIG_SIBYTE_BUS_WATCHER is not set
# CONFIG_SIBYTE_SB1250_PROF is not set
# CONFIG_SIBYTE_TBPROF is not set
CONFIG_RWSEM_GENERIC_SPINLOCK=y
# CONFIG_ARCH_HAS_ILOG2_U32 is not set
Expand Down
3 changes: 3 additions & 0 deletions arch/mips/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <linux/errno.h>
#include <linux/module.h>
#include <linux/sched.h>
#include <linux/tick.h>
#include <linux/kernel.h>
#include <linux/mm.h>
#include <linux/stddef.h>
Expand Down Expand Up @@ -52,6 +53,7 @@ void __noreturn cpu_idle(void)
{
/* endless idle loop with no priority at all */
while (1) {
tick_nohz_stop_sched_tick();
while (!need_resched()) {
#ifdef CONFIG_SMTC_IDLE_HOOK_DEBUG
extern void smtc_idle_loop_hook(void);
Expand All @@ -61,6 +63,7 @@ void __noreturn cpu_idle(void)
if (cpu_wait)
(*cpu_wait)();
}
tick_nohz_restart_sched_tick();
preempt_enable_no_resched();
schedule();
preempt_disable();
Expand Down
2 changes: 2 additions & 0 deletions arch/mips/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
#include <asm/system.h>
#include <asm/mmu_context.h>
#include <asm/smp.h>
#include <asm/time.h>

#ifdef CONFIG_MIPS_MT_SMTC
#include <asm/mipsmtregs.h>
Expand Down Expand Up @@ -70,6 +71,7 @@ asmlinkage __cpuinit void start_secondary(void)
cpu_probe();
cpu_report();
per_cpu_trap_init();
mips_clockevent_init();
prom_init_secondary();

/*
Expand Down
2 changes: 1 addition & 1 deletion arch/mips/kernel/smtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -867,7 +867,7 @@ void ipi_decode(struct smtc_ipi *pipi)
#ifdef CONFIG_SMTC_IDLE_HOOK_DEBUG
clock_hang_reported[dest_copy] = 0;
#endif /* CONFIG_SMTC_IDLE_HOOK_DEBUG */
local_timer_interrupt(0);
local_timer_interrupt(0, NULL);
irq_exit();
break;
case LINUX_SMP_IPI:
Expand Down
Loading

0 comments on commit 7bcf771

Please sign in to comment.