Changeset f00fee8e in rtems


Ignore:
Timestamp:
May 24, 2012, 3:23:37 PM (8 years ago)
Author:
Daniel Hellstrom <daniel@…>
Branches:
4.11, master
Children:
16d6e42
Parents:
e9378fa
git-author:
Daniel Hellstrom <daniel@…> (05/24/12 15:23:37)
git-committer:
Daniel Hellstrom <daniel@…> (04/16/15 23:10:17)
Message:

GRTM: fixed bug where transmitter start loop was optimized away

File:
1 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/sparc/shared/tmtc/grtm.c

    re9378fa rf00fee8e  
    762762        int i;
    763763        struct grtm_ioc_config *cfg = &pDev->config;
    764         volatile unsigned int *txrdy_reg;
    765         unsigned int txrdy_mask;
     764        unsigned int txrdy;
    766765
    767766        /* Clear Descriptors */
     
    819818        }
    820819
    821         /* Location of TXRDY Bit is different for different revisions */
    822         if ( pDev->subrev == 0 ) {
    823                 txrdy_reg = &regs->dma_ctrl;
    824                 txrdy_mask = GRTM_REV0_DMA_CTRL_TXRDY;
    825         } else {
    826                 txrdy_reg = &regs->dma_status;
    827                 txrdy_mask = GRTM_REV1_DMA_STS_TXRDY;
    828         }
    829 
    830820        /* Check transmitter startup OK */
    831         i=0;
    832         while( !(READ_REG(txrdy_reg) & txrdy_mask) && (i<1000000) ){
    833                 i++;
    834         }
    835         if ( !(READ_REG(txrdy_reg) & txrdy_mask) ){
     821        i = 1000000;
     822        do {
     823                /* Location of TXRDY Bit is different for different revisions */
     824                if ( pDev->subrev == 0 ) {
     825                        txrdy = READ_REG(&regs->dma_ctrl) &
     826                                GRTM_REV0_DMA_CTRL_TXRDY;
     827                } else {
     828                        txrdy = READ_REG(&regs->dma_status) &
     829                                GRTM_REV1_DMA_STS_TXRDY;
     830                }
     831                if (txrdy != 0)
     832                        break;
     833
     834                asm volatile ("nop"::);
     835        } while ( --i > 0 );
     836        if ( i == 0 ) {
    836837                /* Reset Failed */
    837838                DBG("GRTM: start: Reseting transmitter failed (%d)\n",i);
Note: See TracChangeset for help on using the changeset viewer.