AnsweredAssumed Answered

LAN SMSC9218 driver fails in LWIP examples on BF548

Question asked by sachin@eilabs.co.in on Jan 1, 2013
Latest reply on Feb 14, 2013 by CraigG

Hi,

 

I have a strange problem.  My board uses SMSC Lan9218 mapped to ASYNC Bank 0 on BF548.

The  driver LAN9218.c and LAN9218.h is being used as-is except for change as follows

 

////////////////////////

// LAN9128 is memory mapped to async memory bank 0 on EILABS BF548

// 0x20000000 - 0x200000007F

#define SMSC911x_PHYS_ADDR      0x20000000

 

The driver works fine with a standard application framework - I am able to read all PHY registers correctly.  This sample test code is attached -- simpleethernet.c

 

A portion of the printf dump is given below

value at 0 is  0x000003000

          DDR WRITE AND READ OK

           value at 1 is  0x000007809

          DDR WRITE AND READ OK

           value at 2 is  0x000000007

 

Now when I run the example DNS-Client.c code -- In system_init(). the execution continues to remain at the line

printf("Waiting for the link to be established\n");

 

That means, the driver was opened successfully, it got the chip id correctly, but it is unable to move ahead because the PHY register value is 0.

 

Upon single stepping in to the code, we actually find that the PHY register is not at all read. What is happening is that the write operations to the CSR register is producting a MII BUSY status from the PHY which does not go away!

 

This problem is NOT THERE when the same library is used from a NON-LWIP context.   So,. what really is the difference between the LWIP and the standard application framwork in terms of register settings and othe rprocessor settings?  Where can I find these initializations?  and avbove all why does the same Library behave differently by just changing the application framework. 

In the example project you'll see that there is a DDR write and read.   Again this works fine in the simpleethernet project, but when the same code is inserted in to LWIP_sysbootthreadtype.c    it just doesnt work.  PLEAAASE HELP!!

 

Any help is highly appreciated.  Thanks in advance ...

 

Krishna

Outcomes