Hugh Brown
|
RE: MDI Interface and emu phy access
|
Hugh Brown
11/20/2009 10:30 AM
post42316
|
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
|
|
|
Senthil K
|
Re: MDI Interface and emu phy access
|
Senthil K
11/25/2009 9:37 AM
post42542
|
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.
|
|
|