how to use rmii with 50MHz clk from phy?

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

how to use rmii with 50MHz clk from phy?

748 Views
changbaoma
Contributor III

The mx6ull evk board use rmii 50MHz clk from MAC to phy. But in our hardware design use rmii with 50MHz clk from phy. i change u-boot/board/freescale/mx6ullevk/mx6ullevk.c

eg. FEC1(ENET2). 

static iomux_v3_cfg_t const fec2_pads[] = {
MX6_PAD_GPIO1_IO06__ENET2_MDIO | MUX_PAD_CTRL(MDIO_PAD_CTRL),
MX6_PAD_GPIO1_IO07__ENET2_MDC | MUX_PAD_CTRL(ENET_PAD_CTRL),

MX6_PAD_ENET2_TX_DATA0__ENET2_TDATA00 | MUX_PAD_CTRL(ENET_PAD_CTRL),
MX6_PAD_ENET2_TX_DATA1__ENET2_TDATA01 | MUX_PAD_CTRL(ENET_PAD_CTRL),
-MX6_PAD_ENET2_TX_CLK__ENET2_REF_CLK2 | MUX_PAD_CTRL(ENET_CLK_PAD_CTRL),
+MX6_PAD_ENET2_TX_CLK__ENET2_TX_CLK | MUX_PAD_CTRL(ENET_CLK_PAD_CTRL),
MX6_PAD_ENET2_TX_EN__ENET2_TX_EN | MUX_PAD_CTRL(ENET_PAD_CTRL),

MX6_PAD_ENET2_RX_DATA0__ENET2_RDATA00 | MUX_PAD_CTRL(ENET_PAD_CTRL),
MX6_PAD_ENET2_RX_DATA1__ENET2_RDATA01 | MUX_PAD_CTRL(ENET_PAD_CTRL),
MX6_PAD_ENET2_RX_EN__ENET2_RX_EN | MUX_PAD_CTRL(ENET_PAD_CTRL),
MX6_PAD_ENET2_RX_ER__ENET2_RX_ER | MUX_PAD_CTRL(ENET_PAD_CTRL),
};

and

static int setup_fec(int fec_id)
{
        struct iomuxc *const iomuxc_regs = (struct iomuxc *)IOMUXC_BASE_ADDR;
        int ret;

        if (fec_id == 0) {

                   ....

         } else {
                   /*
                  * Use 50M anatop loopback REF_CLK2 for ENET2,
                  * clear gpr1[14], set gpr1[18].
                  */

-                  clrsetbits_le32(&iomuxc_regs->gpr[1], IOMUX_GPR1_FEC2_MASK,
-                                                  IOMUX_GPR1_FEC2_CLOCK_MUX1_SEL_MASK);

-

+                  /* clk from phy, set gpr1[14], clear gpr1[18] */
+                  clrsetbits_le32(&iomuxc_regs->gpr[1], IOMUX_GPR1_FEC2_MASK,
+                  IOMUX_GPR1_FEC2_CLOCK_MUX2_SEL_MASK);

       }

...

}

But i can't make FEC1 work in u-boot.

May i miss something?

Labels (1)
0 Kudos
2 Replies

667 Views
igorpadykov
NXP Employee
NXP Employee

Hi changbao

please check signal with oscilloscope, also

what uboot release used in the case, one can try latest from

source.codeaurora.org/external/imx/linux-imx  repository

mx6ullevk.c\mx6ullevk\freescale\board - uboot-imx - i.MX U-Boot 

check CONFIG_FEC_ENET_DEV

mx6ullevk.h\configs\include - uboot-imx - i.MX U-Boot 

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

0 Kudos

667 Views
changbaoma
Contributor III

Yes, I can see 50MHz clk signal  from PHY to imx6ull pad  ENET2_TX_CLK with oscilloscope.

The u-boot version i use is uboot-imx-imx_v2016.03_4.1.15_2.0.0_ga.

can you tell me in the latest u-boot which borad use rmii with 50MHz clk forn Phy to Mac?

0 Kudos