internal loopback test for freescale fec driver on i.MX6 platform

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

internal loopback test for freescale fec driver on i.MX6 platform

Jump to solution
3,317 Views
rveer
Contributor II

Hi ,

I have tried to test internal loopback for freescale fec driver on i.MX6 platform for Sabre–sd HW.For that, I have configure the receive control register (ENET_RCR) by setting 0th bit for loop back as below:

/*loopback debug */

tmp = readl(fep->hwp + FEC_R_CNTRL);

printk("loopback =%x \n",tmp); tmp |= 0x5;

writel(tmp, fep->hwp + FEC_R_CNTRL);

printk("loopback enable =%x \n",tmp);

I have added above code in start of xmit function in fec driver .

After doing the above code modification , fec driver is not generated any receive interrupt , so that internal loop back is not working.

what are the required steps to test internal loopback for freescale fec driver on i.MX6 platform?

Regards

Raj

1 Solution
1,896 Views
maheshmahadeva1
NXP Employee
NXP Employee

Look for clk_enable() and clk_disable() in the fec.c file (Linux FEC driver). The ENET module clock is enabled only when the module is active. This is different from the transmit reference clock.

Best regards,

-Mahesh

View solution in original post

9 Replies
1,896 Views
maheshmahadeva1
NXP Employee
NXP Employee

Please take a look at register ENET_MIBC at offset 0x64. Bit 31 of this register should be cleared for the counters to be activated.

Best regards,

-Mahesh

0 Kudos
1,897 Views
maheshmahadeva1
NXP Employee
NXP Employee

Look for clk_enable() and clk_disable() in the fec.c file (Linux FEC driver). The ENET module clock is enabled only when the module is active. This is different from the transmit reference clock.

Best regards,

-Mahesh

1,896 Views
rveer
Contributor II

Hi Mahesh,


We are working on a custom board with Android 4.2.2. We are able to receive ethernet frames to i.MX6 and we are able to get TX interrupts when we send frames. However the ethernet statistics counters all shows zero value. (0x200 to 0x2E0 from ENET base address). We are continuously printing the statistics but all shows zero, even when we are able to receive proper frames. Is there any place where we need to enable statistics event counters separately ? I couldnt find any such bit in the datasheet. Kindly help.


Regards

Raj

0 Kudos
1,896 Views
YixingKong
Senior Contributor IV

Rveer, please click Correct Answer/Helpful Answer if your issue has been resolved.

Thanks,

Yixing

0 Kudos
1,896 Views
rveer
Contributor II

Hi Mahesh,

Now, I can see the Tx and Rx interrupt with your suggested code modification.

here, while i plug-in the network cable in phy port,then only, i can see the rx poll event or interrupt in case internal loopback. Please let me know your comment.

Regards

Raj

0 Kudos
1,896 Views
maheshmahadeva1
NXP Employee
NXP Employee

The clocks to the ENET module might be getting disabled and is enabled as a result of plugging the cable, hence passing the loopback test.

Assuming you are making these changes in the Linux FEC driver, add your changes to a place where clocks are enabled.

Best regards,

-Mahesh

0 Kudos
1,896 Views
rveer
Contributor II

Hi Mahesh,

Thanks a lot for your inputs. As per my understanding, the ethernet Transmit Clock is output from the FEC. But i dont find any code related to that.

1. Could you please help me to find out the related code section?

2. Generally, do switches/phys disable Ethernet clocks when Ethernet cable is not connected ?

Best Regards,

Raj

0 Kudos
1,896 Views
YixingKong
Senior Contributor IV

Rveer, please click Correct Answer/Helpful Answer if your question has been answerd.

Regards,

Yixing

0 Kudos
1,896 Views
maheshmahadeva1
NXP Employee
NXP Employee

Hope the below thread helps with what you are looking for.

How to do Ethernet internal loop back test in IMX6dl?

Best regards,

-Mahesh