X-Git-Url: https://git.rohieb.name/openwrt.git/blobdiff_plain/7ed9009bbdf799be5f9f1446c264b8504f483beb..e48f1513b2675cb956582a04d54993398f410c26:/target/linux/brcm-2.4/files/arch/mips/bcm947xx/time.c?ds=sidebyside diff --git a/target/linux/brcm-2.4/files/arch/mips/bcm947xx/time.c b/target/linux/brcm-2.4/files/arch/mips/bcm947xx/time.c index 2cf91f202..95df5a6b2 100644 --- a/target/linux/brcm-2.4/files/arch/mips/bcm947xx/time.c +++ b/target/linux/brcm-2.4/files/arch/mips/bcm947xx/time.c @@ -7,7 +7,6 @@ * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE. * - * $Id: time.c,v 1.1.1.10 2006/02/27 03:42:55 honor Exp $ */ #include #include @@ -23,11 +22,12 @@ #include #include #include -#include #include +#include #include #include #include +#include /* Global SB handle */ extern void *bcm947xx_sbh; @@ -39,13 +39,11 @@ extern spinlock_t bcm947xx_sbh_lock; extern int panic_timeout; static int watchdog = 0; -static u8 *mcr = NULL; void __init bcm947xx_time_init(void) { unsigned int hz; - extifregs_t *eir; /* * Use deterministic values for initial counter interrupt @@ -83,8 +81,13 @@ bcm947xx_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) timer_interrupt(irq, dev_id, regs); /* Set the watchdog timer to reset after the specified number of ms */ - if (watchdog > 0) - sb_watchdog(sbh, WATCHDOG_CLOCK / 1000 * watchdog); + if (watchdog > 0) { + if (sb_chip(sbh) == BCM5354_CHIP_ID) + sb_watchdog(sbh, WATCHDOG_CLOCK_5354 / 1000 * watchdog); + else + sb_watchdog(sbh, WATCHDOG_CLOCK / 1000 * watchdog); + } + } static struct irqaction bcm947xx_timer_irqaction = { @@ -99,6 +102,17 @@ static struct irqaction bcm947xx_timer_irqaction = { void __init bcm947xx_timer_setup(struct irqaction *irq) { + int x; + /* Enable the timer interrupt */ setup_irq(7, &bcm947xx_timer_irqaction); + + sti(); + + for (x=0; x<5; x++) { + unsigned long ticks; + ticks = jiffies; + while (ticks == jiffies) + /* do nothing */; + } }