From a8c7c708a9e0051c6358718c53572a4681eaa22b Mon Sep 17 00:00:00 2001 From: wdenk Date: Sat, 6 Dec 2003 19:49:23 +0000 Subject: * 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 --- cpu/ppc4xx/405gp_enet.c | 2 +- cpu/ppc4xx/interrupts.c | 95 ++++--------------------------------------------- 2 files changed, 8 insertions(+), 89 deletions(-) (limited to 'cpu/ppc4xx') diff --git a/cpu/ppc4xx/405gp_enet.c b/cpu/ppc4xx/405gp_enet.c index c222c719e8..a9c7cfe050 100644 --- a/cpu/ppc4xx/405gp_enet.c +++ b/cpu/ppc4xx/405gp_enet.c @@ -159,7 +159,7 @@ static int tx_i_index = 0; /* Transmit Interrupt Queue Index */ static int tx_u_index = 0; /* Transmit User Queue Index */ static int tx_run[NUM_TX_BUFF]; /* Transmit Running Queue */ -#undef INFO_405_ENET 1 +#undef INFO_405_ENET #ifdef INFO_405_ENET static int packetSent = 0; static int packetReceived = 0; 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) /******************************************************************************* -- cgit v1.2.3