Changeset 7ebc28cd in rtems


Ignore:
Timestamp:
Nov 19, 2012, 2:24:21 PM (7 years ago)
Author:
Daniel Hellstrom <daniel@…>
Branches:
4.11, master
Children:
4d249b9f
Parents:
b583cc5f
git-author:
Daniel Hellstrom <daniel@…> (11/19/12 14:24:21)
git-committer:
Daniel Hellstrom <daniel@…> (04/16/15 23:10:18)
Message:

GPTIMER: Only probe pending bit on timer0

File:
1 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/sparc/shared/timer/gptimer.c

    rb583cc5f r7ebc28cd  
    178178        struct gptimer_timer *timer;
    179179        union drvmgr_key_value *value;
     180        unsigned char irq_ack_mask;
    180181#if defined(LEON3) && defined(RTEMS_DRVMGR_STARTUP)
    181182        char timer_index[7];
     
    268269        priv->base_freq = priv->base_clk / (priv->regs->scaler_reload + 1);
    269270
     271        /* Stop Timer and probe Pending bit. In newer hardware the
     272         * timer has pending bit is cleared by writing a one to it,
     273         * whereas older versions it is cleared with a zero.
     274         */
     275        priv->regs->timer[0].ctrl = GPTIMER_CTRL_IP;
     276        if ((priv->regs->timer[0].ctrl & GPTIMER_CTRL_IP) != 0)
     277                irq_ack_mask = ~GPTIMER_CTRL_IP;
     278        else
     279                irq_ack_mask = ~0;
     280
    270281        priv->timer_cnt = timer_cnt;
    271282        for (i=0; i<timer_cnt; i++) {
     
    275286                timer->tregs = &regs->timer[(int)timer->tindex];
    276287                timer->tdev.drv = &gptimer_tlib_drv;
    277 
    278                 /* Stop Timer and probe Pending bit. In newer hardware the
    279                  * timer has pending bit is cleared by writing a one to it,
    280                  * whereas older versions it is cleared with a zero.
    281                  */
    282                 timer->tregs->ctrl = GPTIMER_CTRL_IP;
    283                 if ((timer->tregs->ctrl & GPTIMER_CTRL_IP) != 0)
    284                         timer->irq_ack_mask = ~GPTIMER_CTRL_IP;
    285                 else
    286                         timer->irq_ack_mask = ~0;
     288                timer->irq_ack_mask = irq_ack_mask;
    287289
    288290                /* Register Timer at Timer Library */
Note: See TracChangeset for help on using the changeset viewer.