Browse Source

add ls3aserver timer irq process.

Change-Id: I1cd2a0f71d6b029f618681bcdce6399fec2cf358
Signed-off-by: qiaochong <qiaochong@loongson.cn>
master
qiaochong 10 years ago
committed by Chong Qiao
parent
commit
9b4f6e8cf3
  1. 1
      Targets/Bonito3aserver/conf/files.Bonito3aserver
  2. 36
      Targets/Bonito3aserver/dev/irq.c

1
Targets/Bonito3aserver/conf/files.Bonito3aserver

@ -14,6 +14,7 @@ file Targets/Bonito3aserver/pci/sb700_ide.c amd_780e
file Targets/Bonito3aserver/pci/sb700_lpc.c amd_780e
file Targets/Bonito3aserver/pci/sb700_sata.c amd_780e
file Targets/Bonito3aserver/pci/sb700_usb.c amd_780e
file Targets/Bonito3aserver/dev/irq.c timer_irq needs-flag
define localbus { [base = -1 ] }
device localbus

36
Targets/Bonito3aserver/dev/irq.c

@ -0,0 +1,36 @@
#include <pmon.h>
#include <errno.h>
#include <asm/mipsregs.h>
#define ST0_IM 0x0000ff00
#define CAUSEF_IP7 ( 1 << 15)
#define CAUSEF_IP6 ( 1 << 14)
#define CAUSEF_IP5 ( 1 << 13)
#define CAUSEF_IP4 ( 1 << 12)
#define CAUSEF_IP3 ( 1 << 11)
#define CAUSEF_IP2 ( 1 << 10)
void plat_irq_dispatch(struct trapframe *frame)
{
unsigned int cause = read_c0_cause() & ST0_IM;
unsigned int status = read_c0_status() & ST0_IM;
unsigned int pending = cause & status;
if(pending & CAUSEF_IP7)
{
static int cnt=0;
printf("cnt %d\n",cnt++);
write_c0_compare(read_c0_count()+100000000/100);
}
else
{
printf("spurious interrupt\n");
}
}
void init_IRQ()
{
write_c0_compare(100000000/100);
write_c0_count(0);
set_c0_status(0x8001);
}
Loading…
Cancel
Save