Project Home
Project Home
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - MDI Interface and emu phy access: (7 Items)
   
MDI Interface and emu phy access  
Hi,
In our mpc8548 target board, MPC’s MII Bus is connected to a PHY and to a Switch. 

The current trunk of mpc85xx network driver contains emu_phy, comment says this emu_phy can be used to configure the 
switch connected at the MII BUS

We are not clear on how to use emu_phy/MDI utility (MII Read/Write) to configure the switch and the PHY 

Kindly help us, give us a pointer

 
Regards
Senthil
 

RE: MDI Interface and emu phy access  
The switch has to be configured via its own firmware. The phy_regs
structure is setup with default information to fake a PHY read
operation.


-----Original Message-----
From: Senthil K [mailto:community-noreply@qnx.com] 
Sent: Friday, November 20, 2009 10:23 AM
To: drivers-networking
Subject: MDI Interface and emu phy access

Hi,
In our mpc8548 target board, MPC's MII Bus is connected to a PHY and to
a Switch. 

The current trunk of mpc85xx network driver contains emu_phy, comment
says this emu_phy can be used to configure the switch connected at the
MII BUS

We are not clear on how to use emu_phy/MDI utility (MII Read/Write) to
configure the switch and the PHY 

Kindly help us, give us a pointer

 
Regards
Senthil
 





_______________________________________________

Networking Drivers
http://community.qnx.com/sf/go/post42315
Re: MDI Interface and emu phy access  
Hi,

we are trying to access the switch via MDI utilities(read/write) functions which has already registered in mpc85xx 
code(mpc85xx_mii_read/write  functions). 

I have attached below sample code, which will access the mpc85xx mdi read/write function. (Registered via 
MDI_Register_Extended  mpc85xx/mii.c).

 Sample Code 
=========
 int mpc85xxphy_attach(struct device *parent, struct device *self, void *aux){


    struct ifnet *ifp = NULL;

    uint16_t  id2,phyid;

    mpc85xx_dev_t   *mpc85xx = NULL;

    int status = 0;

    phyid = 0x00; /* tsec0 = phyid = 0x00 */
 
   /* for getting the mpc85xx device structure */
    ifp = ifunit("tsec0");

    mpc85xx = ifp->if_softc;

   /* Accessing the registered MDI utility read function. */

    id1 = mpc85xx->mdi->Read(mpc85xx, phyid, MDI_PHYID_2);

    printf( "mdi Phy value :[%x]\n",id2);

}

Note :
====
We have an io-pkt entry function which will invoke dev_attach function, in turn invokes our mpc85xxphy_attach function.

While accessing the mpc8xx_mii_read/write function,its getting crashed.

 Error message 
=========
 
# mount -T io-pkt /tmp/devnp-mpc85xx_mii.so

Process 806926 (io-pkt-v4-hc) terminated SIGSEGV code=1 fltno=11 ip=480d1a3c(io-pkt-v4-hc@main+0x7c0) ref=00000000

mount: Can't mount / (type io-pkt)

mount: Possible reason: No such process

#

Can you give suggestions on the following 

1)       Is that any possible to get mpc85xx_dev_t structure other than ifunit function from separate driver. Since we 
are getting crash on accessing mpc85xx mdi structure read/write.

2)       How to access MDI utilities/library (Ex: MDI_FindPhy, MDI_AutoNegotiate) for tsec0 from separate driver. 

3)     emu_phy usage related to switch attached to the MDIO Interface.


Thanks and Regards
K.Senthil.


Re: MDI Interface and emu phy access  
> Process 806926 (io-pkt-v4-hc) terminated SIGSEGV code=1 fltno=11 ip=480d1a3c(io-pkt-v4-hc@main+0x7c0) ref=00000000
>   
Sounds like it's time you fire up the trusty old gdb. :-)

/P
Re: MDI Interface and emu phy access  
Hi ,

we cant able to load the devnp-xx.so via gdb.

If know tell me how to debug the specifcally devnp-xxx.so.

Please tell me the procedures for debuggging drivers(.so files).

Because in gdb we tried mount -T io-pkt /lib/dll/devnp-xx.so,

it throws unknown command in gdb.

Thanks and Regards
K.Senthil

>>>gdb devnp-xxx.so 

Thanks and Regards
K.Senthil
Re: MDI Interface and emu phy access  
On Wed, Nov 25, 2009 at 10:05:06AM -0500, Senthil K wrote:
> Hi ,
> 
> we cant able to load the devnp-xx.so via gdb.
> 
> If know tell me how to debug the specifcally devnp-xxx.so.
> 
> Please tell me the procedures for debuggging drivers(.so files).
> 
> Because in gdb we tried mount -T io-pkt /lib/dll/devnp-xx.so,

Try 'shell  mount -T io-pkt /lib/dll/devnp-xx.so' from
gdb or run the mount command from another shell or
start the driver from the io-pkt command line.

-seanb
Re: MDI Interface and emu phy access  
Senthil K wrote:
> Hi ,
>
> we cant able to load the devnp-xx.so via gdb.
>
> If know tell me how to debug the specifcally devnp-xxx.so.
>
> Please tell me the procedures for debuggging drivers(.so files).
>   
There's really not much special about how to debug in QNX. Please see 
the gdb documentation:
http://www.qnx.com/developers/docs/6.4.1/neutrino/utilities/g/gdb.html
http://www.qnx.com/developers/docs/6.4.1/neutrino/prog/using_gdb.html
There are also several resources on the web about gdb. This is however, 
not a forum for teaching debugging techniques, although I'll try to 
provide some helpful pointers...

Debugging a network driver is really the same as debugging any shared 
library, not much special there.

If you had dumper running while the crash happened you should be able to 
find a core file for io-pkt-v4-hc (where it is located depends on how 
dumper was started, see pidin -p dumper arg).
> Because in gdb we tried mount -T io-pkt /lib/dll/devnp-xx.so,
>   
> it throws unknown command in gdb.
>   

That's because "mount" is not a command in gdb, its a program that's got 
nothing to do with gdb. Please learn about gdb in the above links.

If you want to debug mount, you start 'gdb mount' and inside gdb you 
would use the "run" command.

But you don't want to debug mount, you want to debug the stack which has 
your shared library (in this case a network driver) being loaded into 
it. Mount will make io-pkt dl_open() the driver. Or skip the whole use 
of mount and simply load the driver via the io-pkt command line like 
Sean suggested.

>>>> gdb devnp-xxx.so 
>>>>         
See above links about what command line arguments gdb takes.

Hope this helps!
/P