IMX6Q RMII interface KSZ8895RQXCA

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

IMX6Q RMII interface KSZ8895RQXCA

3,537 Views
linwangzhao
Contributor II

IMX6Q使用RMII接口与交换机KSZ8895RQXCA相连时,使用GPIO_16作为ENET_REF_CLK。如何配置MX6QDL_PAD_GPIO_16__ENET_REF_CLK的工作模式为输出50Mhz。使用默认的配置时输出的是125Mhz,参考“Hardware Development Guide for i.MX 6Quad, 6Dual, 6DualLite,6Solo Families of Applications Processors”文档中的“11.4.1 Using the GPIO_16 pin to generate the reference clock”,需要将“ Bits 1–0 of CCM_ANALOG_PLL_ENETn control the frequency fed to the Ethernet MAC and should be set to 01b to obtain 50 MHZ”, 如何在设备树中配置CCM_ANALOG_PLL_ENETn 寄存器?使用的内核版本是linux4.1.15,附件为“Hardware Development Guide for i.MX 6Quad, 6Dual, 6DualLite,6Solo Families of Applications Processors”文档。

Labels (1)
0 Kudos
5 Replies

2,248 Views
igorpadykov
NXP Employee
NXP Employee

Translate by Google:

When the IMX6Q is connected to the switch KSZ8895RQXCA using the RMII interface, GPIO_16 is used as ENET_REF_CLK. How to configure the working mode of MX6QDL_PAD_GPIO_16__ENET_REF_CLK to output 50Mhz. When the default configuration is used, 125Mhz is output. Refer to "11.4.1 Using the GPIO_16 pin to generate the reference clock" in the "Hardware Development Guide for i.MX 6Quad, 6Dual, 6DualLite, 6Solo Families of Applications Processors" document. To "Bits 1–0 of CCM_ANALOG_PLL_ENETn control the frequency fed to the Ethernet MAC and should be set to 01b to obtain 50 MHZ", how to configure the CCM_ANALOG_PLL_ENETn register in the device tree? The kernel version used is linux4.1.15 and the attached document is "Hardware Development Guide for i.MX 6Quad, 6Dual, 6DualLite, 6Solo Families of Applications Processors".

--------------------------------------------------

Hi Lee

enet clocks are configured in uboot, not in linux device tree, example can be found in

uboot/board/freescale/mx6slevk/mx6slevk.c, please check function setup_fec()

uboot-imx.git - Freescale i.MX u-boot Tree 

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

2,248 Views
zhangzhencai
Contributor II

你好,最近我们有个项目也在用ksz8895,我们的内核版本和你的是一样的,咨询你几个问题,你们现在怎么样了?能ping通了吗?有没有测试ksz8895的vlan功能?你们有没有用官方的spi驱动?

0 Kudos

2,248 Views
linwangzhao
Contributor II

igorpadykov

Hi igorpadykov,

我现在遇到另外一个问题,IMX6Q通过RMII接口与以太网交换机芯片KSZ8895RQXCA相连,设备树中关于网络的配置如下:

&fec {
      pinctrl-names = "default";
      pinctrl-0 = <&pinctrl_enet>;
      phy-mode = "rmii";
      phy-reset-gpios = <&gpio1 18 0>;
      fsl,magic-packet;
      status = "okay";
      fixed-link {
         speed = <100>;
         full-duplex;
         pause;
      };
};

 

pinctrl_enet: enetgrp {
fsl,pins = <
MX6QDL_PAD_ENET_MDIO__ENET_MDIO            0x1b0b0
MX6QDL_PAD_ENET_MDC__ENET_MDC              0x1b0b0
MX6QDL_PAD_ENET_TX_EN__ENET_TX_EN        0x1b0b0
MX6QDL_PAD_ENET_TXD0__ENET_TX_DATA0     0x1b018
MX6QDL_PAD_ENET_TXD1__ENET_TX_DATA1      0x1b018
MX6QDL_PAD_ENET_RX_ER__ENET_RX_ER        0x1b0b0
MX6QDL_PAD_ENET_RXD0__ENET_RX_DATA0     0x1b018
MX6QDL_PAD_ENET_RXD1__ENET_RX_DATA1     0x1b018
MX6QDL_PAD_GPIO_16__ENET_REF_CLK             0x4001b0a8
MX6QDL_PAD_ENET_CRS_DV__ENET_RX_EN     0x1b0b0
>;
};

 

目前:imx6q(192.168.1.4)无法ping通同一网段内的我的电脑(192.168.1.2),我的电脑也无法ping通imx6q。通过示波器可以看到imx6q上的TX0/TX1/RX0/RX1都有信号,而且MX6QDL_PAD_GPIO_16__ENET_REF_CLK上有50Mhz的信号。在我的电脑端使用Wireshark抓包工具可以看到imx6q发送的数据包,而且此时我的电脑也响应了该数据包,但是imx6q端没有接收到数据包,也可能是接收的是错误的数据包。

1、使用imx6q(192.168.1.4)ping我的电脑(192.168.1.2)的信息如下:

      root@imx6qsabresd:~# ping 192.168.1.2
      PING 192.168.1.2 (192.168.1.2) 56(84) bytes of data.
      From 192.168.1.4 icmp_seq=1 Destination Host Unreachable
      From 192.168.1.4 icmp_seq=2 Destination Host Unreachable
      From 192.168.1.4 icmp_seq=3 Destination Host Unreachable
      From 192.168.1.4 icmp_seq=4 Destination Host Unreachable

 

2、使用 ifconfig eth0命令查看的信息如下:

      root@imx6qsabresd:~# ifconfig eth0
      eth0 Link encap:Ethernet HWaddr 32:34:46:78:9a:dc
      inet addr:192.168.1.4 Bcast:192.168.1.255 Mask:255.255.255.0
      inet6 addr: fe80::3034:46ff:fe78:9adc/64 Scope:Link
      UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
      RX packets:0 errors:2562 dropped:0 overruns:0 frame:2562
      TX packets:573 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000
      RX bytes:0 (0.0 B) TX bytes:311879 (304.5 KiB)

0 Kudos

1,841 Views
wuweile
Contributor I

我也遇到同样的问题。你的问题解决了吗?怎么解决的

 

ENET_REF_CLK 对CPU而言是配置成输入还是输出?

0 Kudos

2,248 Views
linwangzhao
Contributor II

Hi  igorpadykov

     通过这个方法可以产生50Mhz的时钟,但还需要注释掉clk_imx6q.c中第915行:

      /*Set enet_ref clock to 125M to supply for RGMII tx_clk */
     // clk_set_rate(clk[IMX6QDL_CLK_ENET_REF], 125000000);

0 Kudos