diff options
author | wdenk <wdenk> | 2003-12-06 19:49:23 +0000 |
---|---|---|
committer | wdenk <wdenk> | 2003-12-06 19:49:23 +0000 |
commit | a8c7c708a9e0051c6358718c53572a4681eaa22b (patch) | |
tree | b560561c91725eb2f86289da61ee676787419e37 /cpu/ppc4xx/interrupts.c | |
parent | fa1399ed127c8be507bf182dc7d8d61a54938d79 (diff) | |
download | u-boot-midas-a8c7c708a9e0051c6358718c53572a4681eaa22b.tar.gz u-boot-midas-a8c7c708a9e0051c6358718c53572a4681eaa22b.tar.bz2 u-boot-midas-a8c7c708a9e0051c6358718c53572a4681eaa22b.zip |
* Patch by Gleb Natapov, 19 Sep 2003:
Move most of the timer interrupt related PPC code to ppc_lib/interrupts.c
* Patch by Anders Larsen, 17 Sep 2003:
Bring ARM memory layout in sync with the documentation:
stack and malloc-heap are now located _below_ the U-Boot code
Diffstat (limited to 'cpu/ppc4xx/interrupts.c')
-rw-r--r-- | cpu/ppc4xx/interrupts.c | 95 |
1 files changed, 7 insertions, 88 deletions
diff --git a/cpu/ppc4xx/interrupts.c b/cpu/ppc4xx/interrupts.c index b6a956c152..1a9ae9d7d1 100644 --- a/cpu/ppc4xx/interrupts.c +++ b/cpu/ppc4xx/interrupts.c @@ -35,10 +35,6 @@ /****************************************************************************/ -unsigned decrementer_count; /* count value for 1e6/HZ microseconds */ - -/****************************************************************************/ - /* * CPM interrupt vector functions. */ @@ -57,20 +53,6 @@ void uic1_interrupt( void * parms); /* UIC1 handler */ #endif /****************************************************************************/ - -static __inline__ unsigned long get_msr(void) -{ - unsigned long msr; - - asm volatile("mfmsr %0" : "=r" (msr) :); - return msr; -} - -static __inline__ void set_msr(unsigned long msr) -{ - asm volatile("mtmsr %0" : : "r" (msr)); -} - #if defined(CONFIG_440) /* SPRN changed in 440 */ @@ -81,21 +63,6 @@ static __inline__ void set_evpr(unsigned long val) #else /* !defined(CONFIG_440) */ -static __inline__ unsigned long get_dec(void) -{ - unsigned long val; - - asm volatile("mfdec %0" : "=r" (val) :); - return val; -} - - -static __inline__ void set_dec(unsigned long val) -{ - asm volatile("mtdec %0" : : "r" (val)); -} - - static __inline__ void set_pit(unsigned long val) { asm volatile("mtpit %0" : : "r" (val)); @@ -114,29 +81,18 @@ static __inline__ void set_evpr(unsigned long val) } #endif /* defined(CONFIG_440 */ - -void enable_interrupts (void) -{ - set_msr (get_msr() | MSR_EE); -} - -/* returns flag if MSR_EE was set before */ -int disable_interrupts (void) -{ - ulong msr = get_msr(); - set_msr (msr & ~MSR_EE); - return ((msr & MSR_EE) != 0); -} - /****************************************************************************/ -int interrupt_init(void) +int interrupt_init_cpu (unsigned *decrementer_count) { DECLARE_GLOBAL_DATA_PTR; int vec; unsigned long val; + /* decrementer is automatically reloaded */ + *decrementer_count = 0; + /* * Mark all irqs as free */ @@ -194,10 +150,6 @@ int interrupt_init(void) irq_install_handler(VECNUM_UIC1NC, uic1_interrupt, 0); irq_install_handler(VECNUM_UIC1C, uic1_interrupt, 0); #endif - /* - * Enable external interrupts (including PIT) - */ - set_msr (get_msr() | MSR_EE); return (0); } @@ -362,47 +314,14 @@ irq_free_handler(int vec) /****************************************************************************/ - -volatile ulong timestamp = 0; - -/* - * timer_interrupt - gets called when the decrementer overflows, - * with interrupts disabled. - * Trivial implementation - no need to be really accurate. - */ -void timer_interrupt(struct pt_regs *regs) -{ -#if 0 - printf ("*** Timer Interrupt *** "); -#endif - timestamp++; - -#if defined(CONFIG_WATCHDOG) - if ((timestamp % 1000) == 0) - reset_4xx_watchdog(); -#endif /* CONFIG_WATCHDOG */ -} - -/****************************************************************************/ - -void reset_timer (void) -{ - timestamp = 0; -} - -ulong get_timer (ulong base) -{ - return (timestamp - base); -} - -void set_timer (ulong t) +void timer_interrupt_cpu (struct pt_regs *regs) { - timestamp = t; + /* nothing to do here */ + return; } /****************************************************************************/ - #if (CONFIG_COMMANDS & CFG_CMD_IRQ) /******************************************************************************* |