Changeset ac7da5bc in rtems


Ignore:
Timestamp:
Mar 22, 2016, 2:51:13 PM (3 years ago)
Author:
Daniel Hellstrom <daniel@…>
Branches:
master
Children:
57e1f4c3
Parents:
49cf776e
git-author:
Daniel Hellstrom <daniel@…> (03/22/16 14:51:13)
git-committer:
Daniel Hellstrom <daniel@…> (03/06/17 06:54:55)
Message:

leon, grspw_pkt: Manual handling of link status events

Added functionality for manual handling of link status events,
configurable via grspw_link_ctrl.

Added statistics counter for disconnect error.

Location:
c/src/lib/libbsp/sparc/shared
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/sparc/shared/include/grspw_pkt.h

    r49cf776e rac7da5bc  
    185185        int err_addr;
    186186        int err_parity;
     187        int err_disconnect;
    187188        int err_escape;
    188189        int err_wsync; /* only in GRSPW1 */
     
    217218                                          */
    218219
     220#define LINKSTS_CE              0x002   /* Credit error */
     221#define LINKSTS_ER              0x004   /* Escape error */
     222#define LINKSTS_DE              0x008   /* Disconnect error */
     223#define LINKSTS_PE              0x010   /* Parity error */
     224#define LINKSTS_WE              0x040   /* Write synchonization error (GRSPW1 only) */
     225#define LINKSTS_IA              0x080   /* Invalid address */
     226#define LINKSTS_EE              0x100   /* Early EOP/EEP */
     227#define LINKSTS_MASK            0x1de
     228
    219229
    220230/* grspw_tc_ctrl() options */
     
    326336 *  bits 15..8 : Clock Div During Startup (all link states except run-state)
    327337 */
    328 extern void grspw_link_ctrl(void *d, int *options, int *clkdiv);
     338extern void grspw_link_ctrl(void *d, int *options, int *stscfg, int *clkdiv);
    329339/* Read the current value of the status register */
    330340extern unsigned int grspw_link_status(void *d);
  • c/src/lib/libbsp/sparc/shared/spw/grspw_pkt.c

    r49cf776e rac7da5bc  
    473473        unsigned int dis_link_on_err;
    474474
     475        /* Bit mask for link status bits to clear by ISR */
     476        unsigned int stscfg;
     477
    475478        /* "Core Global" Statistics gathered, not dependent on DMA channel */
    476479        struct grspw_core_stats stats;
     
    539542        priv->icisr = NULL;
    540543        priv->icisr_arg = NULL;
     544        priv->stscfg = LINKSTS_MASK;
    541545
    542546        grspw_stats_clr(priv);
     
    746750
    747751/* options and clkdiv [in/out]: set to -1 to only read current config */
    748 void grspw_link_ctrl(void *d, int *options, int *clkdiv)
     752void grspw_link_ctrl(void *d, int *options, int *stscfg, int *clkdiv)
    749753{
    750754        struct grspw_priv *priv = d;
     
    782786                SPIN_UNLOCK_IRQ(&priv->devlock, irqflags);
    783787                *options = (ctrl & GRSPW_LINK_CFG) | priv->dis_link_on_err;
     788        }
     789        if (stscfg) {
     790                if (*stscfg != -1) {
     791                        priv->stscfg = *stscfg & LINKSTS_MASK;
     792                }
     793                *stscfg = priv->stscfg;
    784794        }
    785795}
     
    24952505        /* Get Status from Hardware */
    24962506        stat = REG_READ(&priv->regs->status);
    2497         stat_clrmsk = stat & (GRSPW_STS_TO | GRSPW_STAT_ERROR);
     2507        stat_clrmsk = stat & (GRSPW_STS_TO | GRSPW_STAT_ERROR) & priv->stscfg;
    24982508
    24992509        /* Make sure to put the timecode handling first in order to get the
     
    25502560                if (stat & GRSPW_STS_PE)
    25512561                        priv->stats.err_parity++;
     2562
     2563                if (stat & GRSPW_STS_DE)
     2564                        priv->stats.err_disconnect++;
    25522565
    25532566                if (stat & GRSPW_STS_ER)
Note: See TracChangeset for help on using the changeset viewer.