Using ENET1_REF_CLK_25M on IMX6UL

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

Using ENET1_REF_CLK_25M on IMX6UL

Jump to solution
2,490 Views
andrewparlane2
Contributor III

We have a custom board with a IMX6UL. The IMX is connected to a generic PHY using RMII.

ENET1_TX_CLK is configured as ENET1_REF_CLK1, and should be an output from the PHY at 25MHz (I think).

ENET2_RX_EN is configured as ENET1_REF_CLK_25M and should be an output from the IMX to the PHY at 25MHz.

I'm using u-boot ATM, and have the following code:

static iomux_v3_cfg_t const fec1_pads[] = {
   ...

   MX6_PAD_ENET1_TX_CLK__ENET1_REF_CLK1 | MUX_PAD_CTRL(ENET_CLK_PAD_CTRL),
   MX6_PAD_ENET2_RX_EN__ENET1_REF_CLK_25M | MUX_PAD_CTRL(ENET_CLK_PAD_CTRL),
   ...
};

int board_eth_init(bd_t *bis)
{
   imx_iomux_v3_setup_multiple_pads(fec1_pads, ARRAY_SIZE(fec1_pads));

   ...

}

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

// Use ENET1_TX_CLK as an input
// Set GRP1[13] - ENET1_CLK_SEL - get ENET1 Tx clk from ENET1_TX_CLK pin
// clear GPR1[17] - ENET1_TX_CLK_DIR - output driver is disabled
clrsetbits_le32(&iomuxc_regs->gpr[1], IOMUX_GPR1_FEC1_MASK,
IOMUX_GPR1_FEC1_CLOCK_MUX2_SEL_MASK);

ret = enable_fec_anatop_clock(0, ENET_25MHZ);
if (ret)
{
printf("Failed to enable clock\n");
return ret;
}

enable_enet_clk(1);

return 0;
}

Unfortunately there appears to be nothing outputted on the REF_CLK_25M signal.

I can't see much in the TRM on how to enable this. As far as I can tell just muxing the ENET2_RX_EN as ENET1_REF_CLK_25M should be enough. There's no reference to clock gating or anything else that I can find.

Any ideas?

Thanks,

Andrew

Labels (1)
Tags (2)
0 Kudos
Reply
1 Solution
2,003 Views
andrewparlane2
Contributor III

Hi Igor,

I had the muxing set OK.

The problem was the BM_ANADIG_PLL_ENET_REF_25M_ENABLE bit in the pll_enet register.

Andrew

View solution in original post

0 Kudos
Reply
2 Replies
2,003 Views
igorpadykov
NXP Employee
NXP Employee

Hi Andrew

for muxing ENET2_RX_EN as ENET1_REF_CLK_25M one can use

register IOMUXC_SW_MUX_CTL_PAD_ENET2_RX_EN described in

sect.30.5.55 SW_MUX_CTL_PAD_ENET2_RX_EN SW MUX Control
Register (IOMUXC_SW_MUX_CTL_PAD_ENET2_RX_EN) i.MX6UL Reference Manual

http://www.nxp.com/docs/en/reference-manual/IMX6ULRM.pdf

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

0 Kudos
Reply
2,004 Views
andrewparlane2
Contributor III

Hi Igor,

I had the muxing set OK.

The problem was the BM_ANADIG_PLL_ENET_REF_25M_ENABLE bit in the pll_enet register.

Andrew

0 Kudos
Reply