forked from Imagelibrary/rtems
GRTM: fixed bug where transmitter start loop was optimized away
This commit is contained in:
@@ -761,8 +761,7 @@ static int grtm_start(struct grtm_priv *pDev)
|
|||||||
struct grtm_regs *regs = pDev->regs;
|
struct grtm_regs *regs = pDev->regs;
|
||||||
int i;
|
int i;
|
||||||
struct grtm_ioc_config *cfg = &pDev->config;
|
struct grtm_ioc_config *cfg = &pDev->config;
|
||||||
volatile unsigned int *txrdy_reg;
|
unsigned int txrdy;
|
||||||
unsigned int txrdy_mask;
|
|
||||||
|
|
||||||
/* Clear Descriptors */
|
/* Clear Descriptors */
|
||||||
memset(pDev->bds,0,0x400);
|
memset(pDev->bds,0,0x400);
|
||||||
@@ -818,21 +817,23 @@ static int grtm_start(struct grtm_priv *pDev)
|
|||||||
i--;
|
i--;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Location of TXRDY Bit is different for different revisions */
|
|
||||||
if ( pDev->subrev == 0 ) {
|
|
||||||
txrdy_reg = ®s->dma_ctrl;
|
|
||||||
txrdy_mask = GRTM_REV0_DMA_CTRL_TXRDY;
|
|
||||||
} else {
|
|
||||||
txrdy_reg = ®s->dma_status;
|
|
||||||
txrdy_mask = GRTM_REV1_DMA_STS_TXRDY;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Check transmitter startup OK */
|
/* Check transmitter startup OK */
|
||||||
i=0;
|
i = 1000000;
|
||||||
while( !(READ_REG(txrdy_reg) & txrdy_mask) && (i<1000000) ){
|
do {
|
||||||
i++;
|
/* Location of TXRDY Bit is different for different revisions */
|
||||||
}
|
if ( pDev->subrev == 0 ) {
|
||||||
if ( !(READ_REG(txrdy_reg) & txrdy_mask) ){
|
txrdy = READ_REG(®s->dma_ctrl) &
|
||||||
|
GRTM_REV0_DMA_CTRL_TXRDY;
|
||||||
|
} else {
|
||||||
|
txrdy = READ_REG(®s->dma_status) &
|
||||||
|
GRTM_REV1_DMA_STS_TXRDY;
|
||||||
|
}
|
||||||
|
if (txrdy != 0)
|
||||||
|
break;
|
||||||
|
|
||||||
|
asm volatile ("nop"::);
|
||||||
|
} while ( --i > 0 );
|
||||||
|
if ( i == 0 ) {
|
||||||
/* Reset Failed */
|
/* Reset Failed */
|
||||||
DBG("GRTM: start: Reseting transmitter failed (%d)\n",i);
|
DBG("GRTM: start: Reseting transmitter failed (%d)\n",i);
|
||||||
return RTEMS_IO_ERROR;
|
return RTEMS_IO_ERROR;
|
||||||
|
|||||||
Reference in New Issue
Block a user