Project Home
Project Home
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - LAN91C96 LAN controller driver --> devn-smc9000.so issue : (8 Items)
   
LAN91C96 LAN controller driver --> devn-smc9000.so issue  
Hi,

I am a newbie to QNX network driver. I am trying to run the QNX network driver for LAN91C96 chipset on OMAP 1710 H3 SDP 
board. I am taking the reference driver available with OMAP 5912 BSP which has the same chip and which works correctly 
om OMAP 5912. 

In OMAP 5912 the interrupt line from LAN chip is interfaced to GPIO1 of processor. Hence in the init_intrinfo in startup
 GPIO 1 -Ethernet is set up [rising edge detect] and updating the OMAP_GPIO_DIRECTION and OMAP_GPIO_EDGE_CTRL1 registers
 and GPIO functional clock is done. The  interrupt vector number assigned is 200. This driver devn-smc9000.so works fine
 on that board.

I am trying to run the same network driver on OMAP 1710 with only difference that the LAN controller's (on the debug 
board) interrupt line is mapped to processor through an FPGA.

When I run the driver I can assign IP etc. But pinging does not happen. Board select LED is blinking which means the 
access to the LAN91c96 register space is happening.

I have tried tcpip as well as ttcpip

 "io-net -dsmc9000 ioport=0x04800000,irq=200,mac=0050c2271e63 -p tcpip"
 "io-net -d smc9000 mac=0050c2271e63 -p ttcpip if=en0:192.168.1.147:255.255.255.0 default=192.168.1.1"

I am using the same MAC ID assigned by u-boot initially. And this is specific to the board.Also tried arp -an and i can 
find an incomplete value of the host in the list (These were the suggestions in workaround of of release notes)

"You can check for permanent ARP entries by running the arp -an command and examining the output. The only permanent 
entries listed should be for the IP addresses assigned to your host's interfaces; there shouldn't be any permanent, 
incomplete entries. If you find a permanent entry that isn't for the IP address of an interface on your host, and you 
didn't explicitly create a permanent entry, then you could be encountering this problem. (Ref# 21395)"

Please give your inputs and help me out. Please find the log reports.

Thanks,
Lejin

Please find the logs  1) ls /dev/io-net
			    2) nicinfo
			    3) sloginfo(with some debug statements added by me)
			    4) arm -an
			    5) ifconfig	
			    6) pidin irqs	
			    7) pidin syspage=intrinfo
----------------------
1) # ls /dev/io-net
en0      ip0      ip_en

----------------------
2) nicinfo
SMC9000 Ethernet Controller

  Physical Node ID ........................... 0000FF FF1818
  Current Physical Node ID ................... 0050C2 271E63
  Current Operation Rate ..................... Unknown
  Active Interface Type ...................... UTP
  Maximum Transmittable data Unit ............ 1514
  Maximum Receivable data Unit ............... 1514
  Hardware Interrupt ......................... 0xc8
  I/O Aperture ............................... 0x4800000 - 0x480001f
  Promiscuous Mode ........................... Off
  Multicast Support .......................... Enabled

  Packets Transmitted OK ..................... 0
  Bytes Transmitted OK ....................... 0
  Broadcast Packets Transmitted OK ........... 0
  Multicast Packets Transmitted OK ........... 0

  Packets Received OK ........................ 0
  Bytes Received OK .......................... 0
  Broadcast Packets Received OK .............. 0
  Multicast Packets Received OK .............. 0
  Memory Allocation Failures on Receive ...... 0

  Single Collisions on Transmit .............. 0
  Multiple Collisions on Transmit ............ 0
  Deferred Transmits ......................... 0
  Late Collision on Transmit errors .......... 0
  Transmits aborted (excessive collisions) ... 0
  Transmits aborted (excessive deferrals) .... 0
  Transmit Underruns ......................... 0
  No Carrier on Transmit ..................... 0
  Receive Alignment errors ................... 0
  Received packets with CRC errors ........... 0
  Packets Dropped on receive ................. 0
  Oversized Packets received ................. 0
  Short packets...
View Full Message
RE: LAN91C96 LAN controller driver --> devn-smc9000.so issue  
The interrupt not firing is a common problem.  Generally
your driver will not see any received packets if the
interrupt is not firing, even if they are in the hardware
and ready to be drained.  

One kind of grungy way to see if everything else is working 
is to arm a periodic timer (which occurs say 100 times per 
second) and us it to wake your driver up.  If packets start 
to flow (albeit with latency) then you've certainly narrowed 
your problem down to the interrupt.

Anyways, that said, I'm not sure that the interrupt is your
first problem (but it still may be a problem). 

Looking at the logs, I see:

>  5    10     0  Unable to find MII transceiver
>  2    10     0  devn-smc9000: No MII transceiver found!

That's the first problem you need to fix.  Without a PHY,
the driver and nic really can't do very much - they aren't
connected to the signalling media a PHY/MII is found and
configured.

--
aboyd
RE: LAN91C96 LAN controller driver --> devn-smc9000.so issue  
A shot in the dark about the PHY detection stuff:

Take a look at the mii read/write routines, for
the smc9000 driver they are smc9000_mii_read()
and smc9000_mii_write() in mii.c

Possibly they need to be modified for your board -
they are where the "magic" occurs.  Once you 
are capable of correctly reading and writing
the mii registers, the rest of the code should
work (eg detecting the phy_addr).

--
aboyd
Re: RE: LAN91C96 LAN controller driver --> devn-smc9000.so issue  
Thanks Aboyd for your suggestions. 

I shall check it.

Regards,
Lejin
Re: RE: LAN91C96 LAN controller driver --> devn-smc9000.so issue  
Hi Aboyd,

I tried giving the timer interrupt value but the sloginfo remained the same. 

So was checking regarding detection of the PHY chip as per your suggestion. MDI_PHY_Find() function was failing over the
 entire PHY id range but MDI_InitPhy() was successful. 

The command I give is :
io-net -dsmc9000 ioport=0x04800000,irq=200,mac=0050c2271e63,verbose=4 -p tcpip 

Kindly  help me in clarifying following doubts : 

1) How exactly we determine the required ioport for the driver ?

   I am using the reference omap 5912 driver's ioport address, entered from command line (0x04800000) which gets 
assigned as cfg.io_window_base[0] and mmap_device_io mapped to get the iobase as  0x1800000. And all further accessing 
of registers are based on this.

On my board this gives me the following output with PHY chip not detected and chp id wrong.

devn-smc9000: detected 49152 bytes of on-chip RAM
Unable to find MII transceiver
devn-smc9000: No MII transceiver found!

SMC9000
Vendor .............. 0x0
Device .............. 0xf
Revision ............ 0x0
I/O port base ....... 0x4800000
Interrupt ........... 0xc8
MAC address ......... 0050c2 271e63
tcpip starting
Using pseudo random generator.  See "random" option


The same on OMAP 5912 with the same controller chip gives the following and works fine.

devn-smc9000: detected 6144 bytes of on-chip RAM
SMC9000
Vendor .............. 0x0
Device .............. 0x4
Revision ............ 0x9
I/O port base ....... 0x4800000
Interrupt ........... 0xc8
MAC address ......... 000e99 020dd0
tcpip starting
Using pseudo random generator.  See "random" option

And on assigning the IP address or mounting npm-qnet.so, it gives the following output continuously. 

"devn-smc9000: chip has lost its memory, resetting MMU" from the smc9000_lockup_recover().


2) Is interrupt required for any of the initilization or chip reading ?  Since the InterruptAttachEvent() is towards the
 end of 
smc9000_register_device(), is it used by any other functions other than for packet transmitting and recieving?

Could you please give your inputs.

Thanks,
Lejin


RE: RE: LAN91C96 LAN controller driver --> devn-smc9000.so issue  
> MDI_PHY_Find() function was failing over the 
> entire PHY id range 

This is not good.

> 1) How exactly we determine the required ioport 
> for the driver?

That information should really be in the documentation
for the board.

> 2) Is interrupt required for any of the initilization 
> or chip reading ?  

Nope!  In the last 25 years, I have never seen hardware
that required a functioning interrupt to read and write
registers  :-)

Inevitably what happens when the interrupt doesn't fire
is that you don't receive any packets, but you will be
able to transmit at least a few packets.

--
aboyd
Re: RE: RE: LAN91C96 LAN controller driver --> devn-smc9000.so issue  
Hi Aboyd,

Thanks for your inputs.

I was able to run the driver on QNX with the the ioport adress which I got by running Linux networok driver on the same 
board. Please find the log below. Hence the "devn-smc9000: No MII transceiver found!
" is solved. Please find the log :

devn-smc9000: detected 26624 bytes of on-chip RAM
devn-smc9000: chip has lost its memory, resetting MMU
SMC9000
Vendor .............. 0x0
Device .............. 0x1
Revision ............ 0x0
I/O port base ....... 0x1a020000
Interrupt ........... 0xc8
MAC address ......... 0050c2 271e63
tcpip starting
Using pseudo random generator.  See "random" option

Could you please give me any suggestions on the following :

1) On assigning IP address or while running qnet protocol  I get the error "devn-smc9000: chip has lost its memory, 
resetting MMU". This is from the smc9000_lockup_recover() which runs on receiving the housekeeping timer pulse. 

//****code snippet****
case SMC_TIMER_PULSE: /* Housekeeping timer */
    if (!dev->asleep) {
           pthread_mutex_lock(&dev->mutex);
           if ((dev->tx_alloc || dev->num_tx_free == 0)	                                      && !dev->did_tx) {
                      smc9000_lockup_recover(dev);
	      smc9000_send(dev);
         }
******************//

Log :

npm-qnet(L4): qnet_birth(): qnet_init() - calling
npm-qnet(L4): en_ionet_rx_ctrl(): new interface: en0: index 0 cell 0 endpt 0 iface 0 mac addr 00:50:C2:27:1E:63
npm-qnet(QOS): nd_change_notify(): Node Up:   nd 0 localhost.net.intra
npm-qnet(L4): qnet_birth(): qnet_init() - complete: 0
npm-qnet(L4): lr_verify_my_name_and_domain(): hostname of localhost is not unique
npm-qnet(L4): lr_verify_my_name_and_domain(): manufactured hostname EA271e63
npm-qnet(L4): lr_verify_my_name_and_domain(): starting resolution of our hostname EA271e63.net.intra to ensure unique
devn-smc9000: MMU BUSY bit won't clear! (/root/omap_1710/src/hardware/devn/smc9000/transmit.c, line 32, mmucr= 81)
npm-qnet(L4): lr_verify_my_name_and_domain(): qnet going online

devn-smc9000: chip has lost its memory, resetting MMU
devn-smc9000: chip has lost its memory, resetting MMU

2) Could you please let me  know whether the networking core source available at /trunk/sys/lib/libdrvr/  is for io-net 
or for io-pkt. Does it matter taking this source to check MDI_FindPhy() functions etc and debugging when I am using io-
net. I wanted to understand the code in libdrvr library.

Thanks,
Lejin
RE: RE: RE: LAN91C96 LAN controller driver --> devn-smc9000.so issue  
> io-port address ... "devn-smc9000: No MII transceiver found!" 
> is solved. 

Good!  It sounds like at least you have correct register
access by the driver now.

> error "devn-smc9000: chip has lost its memory, resetting MMU"

Shot in the dark: the interrupt isn't firing.  You can
check this by looking at the "nicinfo" output - if the
rxd packet counter is zero, that's another indicator or
a non-firing interrupt.  Like the io-port, you probably
need to specify the correct value for your board, to the
driver.

> whether the networking core source available at
> /trunk/sys/lib/libdrvr/ is for io-net or for io-pkt. 

Both, really.  That code hasn't changed in a looong
time - a copy of it was taken from the io-net source
tree, for the self-contained io-pkt source tree.  So
yes, you can look at the io-pkt libdrvr source to figure 
out what's going on with the io-net driver.  Heck, you
can probably recompile it with debug stuff, and link
that into your io-net driver if you want to.

--
aboyd