ENET1 functions in U-Boot, NOT in kernel

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

ENET1 functions in U-Boot, NOT in kernel

Jump to solution
1,760 Views
kvb
Contributor III

I'm having issues getting ENET1 to function on a custom board based off of the i.MX6UL dev kit.  The interface works great in u-boot (can retrieve a DHCP address and respond to PING's).  However, I've not had any luck getting it to work in the kernel.

here's my kernel version:

Linux version 4.1.20-01618-g0076509-dirty

Here are my DTS entries for the ethernet device:

  pinctrl_enet1: enet1grp {

  fsl,pins = <

  MX6UL_PAD_ENET1_RX_EN__ENET1_RX_EN    0x1b0b0

  MX6UL_PAD_ENET1_RX_ER__ENET1_RX_ER    0x13030

  MX6UL_PAD_ENET1_RX_DATA0__ENET1_RDATA00 0x1b0b0

  MX6UL_PAD_ENET1_RX_DATA1__ENET1_RDATA01 0x1b0b0

  MX6UL_PAD_ENET1_TX_EN__ENET1_TX_EN    0x1b0b0

  MX6UL_PAD_ENET1_TX_DATA0__ENET1_TDATA00 0x1b0b0

  MX6UL_PAD_ENET1_TX_DATA1__ENET1_TDATA01 0x1b0b0

  MX6UL_PAD_ENET1_TX_CLK__ENET1_REF_CLK1 0x40000011

  MX6UL_PAD_ENET2_RX_DATA0__ENET1_MDIO    0x0A429

  MX6UL_PAD_ENET2_RX_DATA1__ENET1_MDC     0x1b088

  >;

  };

&fec1 {

  pinctrl-names = "default";

  pinctrl-0 = <&pinctrl_enet1>;

  phy-mode = "rmii";

  phy-handle = <&ethphy0>;

  phy-reset-gpios = <&gpio2 15 GPIO_ACTIVE_HIGH>;

  phy-reset-duration = <500>;

  status = "okay";

  mdio {

  #address-cells = <1>;

  #size-cells = <0>;

  ethphy0: ethernet-phy@1 {

  compatible = "ethernet-phy-ieee802.3-c22";

  reg = <1>;

  };

  };

};

When I try to configure the device, eth0, for static address these are the errors I receive:

sh-4.3# ifup eth0 -i etc/network/interfaces_static

run-parts: /etc/network/if-pre-up.d: No such file or directory

ifconfig: SIOCSIFFLAGS: No such device

ifconfig: SIOCSIFFLAGS: No such device

route: SIOCADDRT: Network is unreachable

sh-4.3# ip link set eth0 up

ip: SIOCSIFFLAGS: No such device

Any advice on using only ENET1 on the i.MX6UL?

Thanks in advance.

Labels (2)
Tags (1)
1 Solution
1,021 Views
kvb
Contributor III

Hello gusarambula​,

I should've marked this resolved as I discovered that the issue boiled down to some timing bug in the kernel.  It seems likely that the driver was trying to communicate with the PHY before it was completely out of reset.  This was discovered by adding some kernel debug messages in locations throughout the driver initialization and having a print statement in one particular location suddenly caused everything to work.

The end solution was to add some delay in the PHY reset function after the reset steps were complete (toggling the HW I/O).  All seems to be working now.

View solution in original post

3 Replies
1,021 Views
gusarambula
NXP TechSupport
NXP TechSupport

Hello Kevin VandenBerge,

Have you tried getting eth0 down and then up? You probably did but I would like to confirm as perhaps that is part of the problem. Does static IPs work on u-boot?

It’s odd that it’s working correctly in U-boot but not in kernel, however, have you tried using the NXP BSP Kernel? (4.15)

Regards,

0 Kudos
1,022 Views
kvb
Contributor III

Hello gusarambula​,

I should've marked this resolved as I discovered that the issue boiled down to some timing bug in the kernel.  It seems likely that the driver was trying to communicate with the PHY before it was completely out of reset.  This was discovered by adding some kernel debug messages in locations throughout the driver initialization and having a print statement in one particular location suddenly caused everything to work.

The end solution was to add some delay in the PHY reset function after the reset steps were complete (toggling the HW I/O).  All seems to be working now.

1,021 Views
kvb
Contributor III

I should also add that the LEDs on the Ethernet connector do come on with a cable attached.  The PHY is a Micrel KSZ8081RND.  The UL devkit used 2x KSZ8081RNA to my understanding. 

0 Kudos