AnsweredAssumed Answered

ADSP BF 548 ethernet interrupt issue

Question asked by amar26121993 on Jul 9, 2018

Dear sir 

 

Iam using ADSP BF-548 processor in my project,i need to use LAN 9218i chip ethernet communication in my project, iam configuring Receive status FIDO Level interrupt(RSFL) and i configured for 10DWORDS since IP header and UDP header is around 42 bytes, 10Dwords= 40bytes,but iam not getting any receive interrupt, i tried changing the RSFL level by 4Dwords to 9Dwords yet iam not getting any RX interrupt,if i didnt configure RSFL to 0 iam getting interrupt but here iam getting back to back interrupt,if any sample code for configuring RSFL interrupt please let us know.

The sequence i followed is

 

smsc9218_reg_write(dev, FIFO_INT,9); //RSFL level 9DWORDS=36Bytes
smsc9218_reg_write(dev, INT_EN,(0x00000008)); //(RSFL_INT_EN)
smsc9218_reg_write(dev, INT_CFG, 0x00000100); //IRQ Enable (IRQ_EN) in configuration level

while initializing LAN 9218i chip,is ther any mistake in configuring sequence of RX interrupt.

 

My Ethernet interrupt handler is as follow

//----------------------------------------------------------------------------------------------------------------------------------------------------------

EX_INTERRUPT_HANDLER(ETHERNET_ISR)
{
    unsigned int clear=0,clear1=0;
   clear1=*pPINT2_LATCH;
   *pPINT2_IRQ= clear1;
   ssync();


   clear=smsc9218_reg_read(ETH1_BASE_ADDR, INT_STS );

   smsc9218_reg_write(ETH1_BASE_ADDR, INT_STS ,0x08);//WIC to clear interrupt for 9218 chip side

   smsc9218_reg_write(ETH1_BASE_ADDR, INT_CFG, 0x00000000);
      if(clear & INT_STS_RSFL)
      {
         RecvFrmSmscCmdPort(ETH1_BASE_ADDR);
      }
   smsc9218_reg_write(ETH1_BASE_ADDR, INT_CFG, 0x00000100);

}

//----------------------------------------------------------------------------------------------------------------------------------------------------------

//----------------------------------------------------------------------------------------------------------------------------------------------------------

int RecvFrmSmscCmdPort(unsigned int dev)
{
unsigned int *data = (unsigned int *)&RxData[0];
unsigned int pktlen, tmplen,pktsize;
unsigned int status=0;
unsigned int i=0,ijk=0;

 

      if ((smsc9218_reg_read(dev, RX_FIFO_INF) & RX_FIFO_INF_RXSUSED) >> 16)
      {
         status = smsc9218_reg_read(dev, RX_STATUS_FIFO);
         if (!(status & RX_STS_ES))
         {
               PacketLen = (status & 0x3FFF0000) >>16;
               PacketLen &= 0x07ff;
               pktlen = PacketLen;
               smsc9218_reg_write(dev, RX_CFG,0);
               pktsize = tmplen = (pktlen + 2 + 3 ) / 4;

            while (tmplen--)
            {
                  *data = (pkt_data_pull(dev, RX_DATA_FIFO));
                     data++;
            }

}

     smsc9218_reg_write(dev, RX_CFG,RX_CFG_RX_DUMP);

}

//----------------------------------------------------------------------------------------------------------------------------------------------------------

please check the Interrupt handler code snippet and Ethernet data receiving function and kindly give the feedback at the earliest.

Outcomes