IMX8MM RMII for dp83848 in Uboot and Linux

cancel
Showing results for 
Search instead for 
Did you mean: 

IMX8MM RMII for dp83848 in Uboot and Linux

216 Views
Contributor IV

Hi,

We have the custom board IMX8MMINI with Ethernet Phy dp83848, How to customize IMX8MM for  RMII for Ethernet Phy dp83848 in Uboot and Linux and we are using  50MHz external oscillator clock for Ethernet Phy dp83848 

uboot fsl-imx8mm-evk.dts

&iomuxc {
    pinctrl-names = "default";
    pinctrl-0 = <&pinctrl_hog_1>;

    imx8mm-evk {
        pinctrl_hog_1: hoggrp-1 {
            fsl,pins = <
                MX8MM_IOMUXC_GPIO1_IO08_GPIO1_IO8        0x19
            >;
        };

        pinctrl_fec1: fec1grp {
            fsl,pins = <
                MX8MM_IOMUXC_ENET_MDC_ENET1_MDC        0x3
                MX8MM_IOMUXC_ENET_MDIO_ENET1_MDIO    0x3
                MX8MM_IOMUXC_ENET_TD3_ENET1_RGMII_TD3    0x1f
                MX8MM_IOMUXC_ENET_TD2_ENET1_RGMII_TD2    0x1f
                MX8MM_IOMUXC_ENET_TD1_ENET1_RGMII_TD1    0x1f
                MX8MM_IOMUXC_ENET_TD0_ENET1_RGMII_TD0    0x1f
                MX8MM_IOMUXC_ENET_RD3_ENET1_RGMII_RD3    0x91
                MX8MM_IOMUXC_ENET_RD2_ENET1_RGMII_RD2    0x91
                MX8MM_IOMUXC_ENET_RD1_ENET1_RGMII_RD1    0x91
                MX8MM_IOMUXC_ENET_RD0_ENET1_RGMII_RD0    0x91
                MX8MM_IOMUXC_ENET_TXC_ENET1_RGMII_TXC    0x1f
                MX8MM_IOMUXC_ENET_RXC_ENET1_RGMII_RXC    0x91
                MX8MM_IOMUXC_ENET_RX_CTL_ENET1_RGMII_RX_CTL    0x91
                MX8MM_IOMUXC_ENET_TX_CTL_ENET1_RGMII_TX_CTL    0x1f
                MX8MM_IOMUXC_SAI2_RXC_GPIO4_IO22    0x19
            >;
        };

&fec1 {
    pinctrl-names = "default";
    pinctrl-0 = <&pinctrl_fec1>;
    phy-mode = rmii; /*"rgmii-id";*/
    phy-handle = <&ethphy0>;
    fsl,magic-packet;
    status = "okay";

    mdio {
        #address-cells = <1>;
        #size-cells = <0>;

        ethphy0: ethernet-phy@0 {
            compatible = "ethernet-phy-ieee802.3-c22";
            reg = <0>;
            at803x,led-act-blind-workaround;
            at803x,eee-okay;
            at803x,vddio-1p8v;
        };
    };
};

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

How to modify 50MHz in imx8mm_evk.c

static int setup_fec(void)
{
    struct iomuxc_gpr_base_regs *const iomuxc_gpr_regs
        = (struct iomuxc_gpr_base_regs *) IOMUXC_GPR_BASE_ADDR;

    setup_iomux_fec();

    /* Use 125M anatop REF_CLK1 for ENET1, not from external */
    clrsetbits_le32(&iomuxc_gpr_regs->gpr[1],
            IOMUXC_GPR_GPR1_GPR_ENET1_TX_CLK_SEL_SHIFT, 0);
    return set_clk_enet(ENET_125MHZ);
}

and are there any other places we need to modify the code. Do help on the same

Regards

Santhosh Kumar S

0 Kudos
5 Replies

22 Views
NXP TechSupport
NXP TechSupport

Hi Santhosh

for rmii one can look at validation board:

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

imx8mm_val.c\imx8mm_val\freescale\board - 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

22 Views
Contributor IV

Hi igor,

I am getting the below error in uboot

Net:   
Error: ethernet@30be0000 address not set.
No ethernet found.

How can we resolve this

Regards

Santhosh

0 Kudos

22 Views
Contributor IV

Hi igor,

I am getting the below error,

Net:   
Error: ethernet@30be0000 address not set.
No ethernet found.

How can we resolve this

Regards

Santhosh

0 Kudos

22 Views
Contributor IV

HI Igor

I am getting the below error  when i tried to do mii info and mii read 0-1 0-6. Do let me know what may be the issue

u-boot=> mii info
NULL device name!
No such device: <NULL>
NULL device name!
No such device: <NULL>
NULL device name!
No such device: <NULL>

u-boot=> u-boot=> mii read 0-1 0-6

NULL device name!
No such device: <NULL>
Error reading from the PHY addr=00 reg=00
NULL device name!
No such device: <NULL>
Error reading from the PHY addr=00 reg=01
NULL device name!
No such device: <NULL>
Error reading from the PHY addr=00 reg=02
NULL device name!
No such device: <NULL>
Error reading from the PHY addr=00 reg=03
NULL device name!
No such device: <NULL>
Error reading from the PHY addr=00 reg=04
NULL device name!
No such device: <NULL>
Error reading from the PHY addr=00 reg=05
NULL device name!
No such device: <NULL>
Error reading from the PHY addr=00 reg=06

NULL device name!
No such device: <NULL>
Error reading from the PHY addr=01 reg=00
NULL device name!
No such device: <NULL>
Error reading from the PHY addr=01 reg=01
NULL device name!
No such device: <NULL>
Error reading from the PHY addr=01 reg=02
NULL device name!
No such device: <NULL>
Error reading from the PHY addr=01 reg=03
NULL device name!
No such device: <NULL>
Error reading from the PHY addr=01 reg=04
NULL device name!
No such device: <NULL>
Error reading from the PHY addr=01 reg=05
NULL device name!
No such device: <NULL>
Error reading from the PHY addr=01 reg=06

0 Kudos

22 Views
Contributor IV

Hi igor,

Thanks i did the changes in the imx8mm_evk.c and imx8mm_evk.h and was able to compile

and also Can you guide me how to enable dp83848 natsemi.c driver in uboot configuration

I will port on the board and test it

Regards

Santhosh

0 Kudos