ACCESS PHY REGISTERS THROUGH MDIO

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

ACCESS PHY REGISTERS THROUGH MDIO

2,005 Views
adityamehta
Contributor II

How can we access PHY Registers using MDIO?

 

Can anyone help please.

 

Thank you,

Aditya

Labels (1)
9 Replies

1,403 Views
Carlos_Mendoza
NXP Employee
NXP Employee

Hi Aditya,

Could you tell us which MCU and IDE version are you using?

Thanks in advance!

Best Regards,
Carlos Mendoza
Technical Support Engineer

1,403 Views
adityamehta
Contributor II

Hey Carlos,

I am using Mravell 88E6095. I am using ARM9 processor.

I have found a way to access PHY Registers through MDIO.

But, in that i need to Page register 800.

And i do not understand how do i do that.

can you please help if you know.

Thank you for your response.

Regards,

Aditya.

0 Kudos

1,403 Views
Carlos_Mendoza
NXP Employee
NXP Employee

Hi Aditya,

 

Thanks for your response. Are you using CodeWarrior as development platform? Could you tell us the part number of your ARM9 processor?

 

Thanks in advance!

 

Best Regards,
Carlos Mendoza
Technical Support Engineer

0 Kudos

1,403 Views
adityamehta
Contributor II

Hello Carlos,

No I am not using code warrior.

I came to know new thing that is, I need to set the Page 3 using port 22.

And then change the phy register 16 bit 7:4 to 0000

and bit 3:0 to 0001

But i dont know how should i do that.

Regards,

Aditya.

0 Kudos

1,403 Views
Carlos_Mendoza
NXP Employee
NXP Employee

Hi Aditya,

 

I'm not sure this is the correct forum for your question...

 

Best Regards,
Carlos Mendoza
Technical Support Engineer

0 Kudos

1,403 Views
adityamehta
Contributor II

Hello Carlos,

My aim is to turn on the Gigabit Led.

The link status for that port is on, But Led does not come on.

the only way i can change it, is through PHY registers.

I am new to this and i know i am not to my best knowlledge.

So please help

0 Kudos

1,403 Views
Carlos_Mendoza
NXP Employee
NXP Employee

Hi Aditya,

 

I would recommend you to contact this part manufacturer and/or your distributor for details on it's initialization and operation.

 

Best Regards,
Carlos Mendoza
Technical Support Engineer

0 Kudos

1,403 Views
adityamehta
Contributor II

Hello Carlos,

Thank you it really helped me.

One and last thing now.

static int proc_phy_registers_show(struct seq_file *seq, void *offset){
struct mv88e6131_port_proc_data *proc_data;
struct dsa_switch *ds;
u8 port;
int i;
u16 reg;

JBXSW_TRC("proc_phy_registers_show\n");
proc_data = seq->private;
ds = proc_data->ds;
port = proc_data->port;

JBXSW_DBG("Dumping Phy Registers for port %d\n", port);
REG_WRITE(REG_GLOBAL, 0x04, 0x0000);
if(port < 8){
for(i=0; i<0x1f; i++){
reg = REG_READ(port, i);
seq_printf(seq, "Reg %2.2x: %4.4x\n", i, reg);
}
}else{
int j;
for(j=0; j < 3; j++){
REG_WRITE(port, 22, j);
reg = REG_READ(port, 22);
seq_printf(seq, "Page: %d\n", reg);
for(i=0; i<0x10; i++){
reg = REG_READ(port, i);
seq_printf(seq, "\tReg %2.2x: %4.4x\n", i, reg);
if(j == 1 && i == 8)
break;
if(j == 2 && i == 0)
break;

}
}

REG_WRITE(port, 22, 2);
reg = REG_READ(port, 22);
seq_printf(seq, "Page: %d\n", reg);
reg = REG_READ(port, 16);
seq_printf(seq, "\tReg %2.2x: %4.4x\n", 22, reg);
}
REG_WRITE(REG_GLOBAL, 0x04, 0x4400);
return 0;
}

This the part i need to change.

Port 22 is in decimal, if you convert to hexadecimal it is 0x16.

Thats is the phy register i need to modify.

Instead of page 2 i need to access page 3 and write 0x80ff to register 16.

Would you be able to help me here.

Regards,

Aditya.

0 Kudos

1,403 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hello Aditya,

I agree with the suggestion from Carlos.

You use Mravell 88E6095 which is not NXP product, nor SW from NXP either. Thus we are afraid we can't provide you professional support. I suggest you contact Marvell instead:

Marvell Technology Group Ltd. 

If you use any question on NXP product, please feel free to contact us, we will try whatever we can to assist you.

Thanks for your understanding.


Have a great day,
Jennie Zhang

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos