Changeset 49cf776e in rtems


Ignore:
Timestamp:
Mar 22, 2016, 2:37:36 PM (3 years ago)
Author:
Daniel Hellstrom <daniel@…>
Branches:
master
Children:
ac7da5bc
Parents:
fad4324d
git-author:
Daniel Hellstrom <daniel@…> (03/22/16 14:37:36)
git-committer:
Daniel Hellstrom <daniel@…> (03/06/17 06:54:55)
Message:

leon, grspw_pkt: added link_ctrl options

Improved the link error handling options. Its now possible to
disable the link on individual link errors/warnings instead of
always on all or none.

Changed name of LINKOPTS_IRQ to LINKOPTS_EIRQ to match Linux
and VxWorks? SpW driver.

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

Legend:

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

    rfad4324d r49cf776e  
    194194#define LINKOPTS_START          0x0002
    195195#define LINKOPTS_AUTOSTART      0x0004
    196 #define LINKOPTS_DIS_ONERR      0x0008
     196#define LINKOPTS_DIS_ONERR      0x0008  /* Disable DMA transmitter on link error
     197                                         * Controls LE bit in DMACTRL register.
     198                                         */
     199#define LINKOPTS_DIS_ON_CE      0x0020000/* Disable Link on Credit error */
     200#define LINKOPTS_DIS_ON_ER      0x0040000/* Disable Link on Escape error */
     201#define LINKOPTS_DIS_ON_DE      0x0080000/* Disable Link on Disconnect error */
     202#define LINKOPTS_DIS_ON_PE      0x0100000/* Disable Link on Parity error */
     203#define LINKOPTS_DIS_ON_WE      0x0400000/* Disable Link on write synchonization
     204                                          * error (GRSPW1 only)
     205                                          */
     206#define LINKOPTS_DIS_ON_EE      0x1000000/* Disable Link on Early EOP/EEP error*/
     207
    197208/*#define LINKOPTS_TICK_OUT_IRQ 0x0100*//* Enable Tick-out IRQ */
    198 #define LINKOPTS_IRQ            0x0200  /* Enable Error Link IRQ */
    199 #define LINKOPTS_MASK           0x020f  /* All above options */
     209#define LINKOPTS_EIRQ           0x0200  /* Enable Error Link IRQ */
     210
     211#define LINKOPTS_MASK           0x15e020f/* All above options */
     212#define LINKOPTS_MASK_DIS_ON    0x15e0000/* All disable link on error options
     213                                          * On a certain error the link disable
     214                                          * bit will be written and the work
     215                                          * task will call dma_stop() for all
     216                                          * channels.
     217                                          */
     218
    200219
    201220/* grspw_tc_ctrl() options */
  • c/src/lib/libbsp/sparc/shared/spw/grspw_pkt.c

    rfad4324d r49cf776e  
    470470        void *icisr_arg;
    471471
    472         /* Disable Link on SpW Link error */
    473         int dis_link_on_err;
     472        /* Bit mask representing events which shall cause link disable. */
     473        unsigned int dis_link_on_err;
    474474
    475475        /* "Core Global" Statistics gathered, not dependent on DMA channel */
     
    773773
    774774                        REG_WRITE(&regs->ctrl, ctrl);
    775                         priv->dis_link_on_err = (*options & LINKOPTS_DIS_ONERR) >> 3;
     775                        /* Store the link disable events for use in
     776                        ISR. The LINKOPTS_DIS_ON_* options are actually the
     777                        corresponding bits in the status register, shifted
     778                        by 16. */
     779                        priv->dis_link_on_err = *options &
     780                                (LINKOPTS_MASK_DIS_ON | LINKOPTS_DIS_ONERR);
    776781                }
    777782                SPIN_UNLOCK_IRQ(&priv->devlock, irqflags);
    778                 *options = (ctrl & GRSPW_LINK_CFG)|(priv->dis_link_on_err << 3);
     783                *options = (ctrl & GRSPW_LINK_CFG) | priv->dis_link_on_err;
    779784        }
    780785}
     
    22692274                GRSPW_DMACTRL_TA | GRSPW_DMACTRL_RA | GRSPW_DMACTRL_RE |
    22702275                (dma->cfg.flags & DMAFLAG_MASK) << GRSPW_DMACTRL_NS_BIT;
    2271         if (dma->core->dis_link_on_err)
     2276        if (dma->core->dis_link_on_err & LINKOPTS_DIS_ONERR)
    22722277                ctrl |= GRSPW_DMACTRL_LE;
    22732278        if (dma->cfg.rx_irq_en_cnt != 0)
     
    25552560                        priv->stats.err_wsync++;
    25562561
    2557                 if (priv->dis_link_on_err) {
     2562                if ((priv->dis_link_on_err >> 16) & stat) {
    25582563                        /* Disable the link, no more transfers are expected
    25592564                         * on any DMA channel.
Note: See TracChangeset for help on using the changeset viewer.