* [U-Boot-Users] AT91RM9200 Timer 0 Interrupt never gets generated.
@ 2007-08-23 14:31 Balajee Premraj
2007-08-23 15:05 ` Andreas Schweigstill
0 siblings, 1 reply; 2+ messages in thread
From: Balajee Premraj @ 2007-08-23 14:31 UTC (permalink / raw)
To: u-boot
Hi all,
I am trying to enable the timer 0 interrupt for the AT91RM9200EK
reference board.
Although the timer keeps running, its not generating interrupt, I
enabled all the timer0 interrupts to ensure at least I get some
interrupts being generated, but basically my interrupt routine never
gets called.
I verified the status of the registers
aic_svr17 ---> Register contains the correct address of the irq
function.(verifed through system.map file)
aic_imr = 0x00020000 ---> The timer-0 interrupt is enabled.
tc0_imr = 0xff ---> all timer interrupts are enabled.
pmc_pcsr: 0x01022000 ---> corresponding peripheral clock is enabled.
But the IRQ function never gets called.
(I use another test routine to read the counter value, the counter value
is always zero)
Thanks,Balajee
#ifdef CONFIG_TIMER_INTERRUPTS
static void get_timer_irq(void);
#endif
int interrupt_init (void)
{
unsigned short value;
tmr = AT91C_BASE_TC0;
/* enables TC1.0 clock */
*AT91C_PMC_PCER = 1 << AT91C_ID_TC0; /* enable clock */
*AT91C_TCB0_BCR = 0;
*AT91C_TCB0_BMR = AT91C_TCB_TC0XC0S_NONE |
AT91C_TCB_TC1XC1S_NONE | AT91C_TCB_TC2XC2S_NONE;
tmr->TC_CCR = AT91C_TC_CLKDIS;
#define AT91C_TC_CMR_CPCTRG (1 << 14)
/* set to MCLK/2 and restart the timer when the vlaue in TC_RC
is reached */
tmr->TC_CMR = AT91C_TC_TIMER_DIV1_CLOCK | AT91C_TC_CMR_CPCTRG;
#ifdef CONFIG_TIMER_INTERRUPTS
/* Clear status */
value = tmr->TC_SR ;
AT91PS_AIC pAic = AT91C_BASE_AIC;
/* Disable the timer interrupt */
pAic->AIC_IDCR = 1 << AT91C_ID_TC0;
/* Program SVR and SMR */
pAic->AIC_SVR[AT91C_ID_TC0] = (unsigned int) &get_timer_irq;
pAic->AIC_SMR[AT91C_ID_TC0] =
AT91C_AIC_SRCTYPE_INT_LEVEL_SENSITIVE |AT91C_AIC_PRIOR_HIGHEST;
/* Clear any pending Interrupts */
pAic->AIC_ICCR = 1 << AT91C_ID_TC0;
/* Enable Interrupt on the timer control register */
tmr->TC_IER = 0xFF;
#else
tmr->TC_IDR = ~0ul;
#endif
tmr->TC_RC = TIMER_LOAD_VAL;
lastinc = 0;
tmr->TC_CCR = AT91C_TC_SWTRG | AT91C_TC_CLKEN;
timestamp = 0;
#ifdef CONFIG_TIMER_INTERRUPTS
/* Enable interrupt */
pAic->AIC_IECR = 1 << AT91C_ID_TC0;
#endif
return (0);
}
#ifdef CONFIG_TIMER_INTERRUPTS
static void get_timer_irq(void)
{
AT91PS_AIC pAic = AT91C_BASE_AIC;
unsigned short value;
counter++;
/* Clear status */
value = tmr->TC_SR ;
/* clear all interrupts */
pAic->AIC_ICCR = 1 << AT91C_ID_TC0;
pAic->AIC_EOICR = 0;
}
#endif
^ permalink raw reply [flat|nested] 2+ messages in thread
* [U-Boot-Users] AT91RM9200 Timer 0 Interrupt never gets generated.
2007-08-23 14:31 [U-Boot-Users] AT91RM9200 Timer 0 Interrupt never gets generated Balajee Premraj
@ 2007-08-23 15:05 ` Andreas Schweigstill
0 siblings, 0 replies; 2+ messages in thread
From: Andreas Schweigstill @ 2007-08-23 15:05 UTC (permalink / raw)
To: u-boot
Hello!
Balajee Premraj schrieb:
> But the IRQ function never gets called.
It isn't called because you didn't enable interrupts for the
ARM *core*; you only enabled interrupts on the AT91 peripherals
and AIC. Why haven't you read the ARM ARM or similar literature
before?
With best regards
Andreas Schweigstill
--
Dipl.-Phys. Andreas Schweigstill
Schweigstill IT | Embedded Systems
Schauenburgerstra?e 116, D-24118 Kiel, Germany
Phone: (+49) 431 5606-435, Fax: (+49) 431 5606-436
Mobile: (+49) 171 6921973, Web: http://www.schweigstill.de/
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-08-23 15:05 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-23 14:31 [U-Boot-Users] AT91RM9200 Timer 0 Interrupt never gets generated Balajee Premraj
2007-08-23 15:05 ` Andreas Schweigstill
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox