IMX6Q AR8031 ISSUE NO IPV4 ADDRESS

cancel
Showing results for 
Search instead for 
Did you mean: 

IMX6Q AR8031 ISSUE NO IPV4 ADDRESS

1,350 Views
Contributor II

Hi,

We are facing a problem getting the AR8031 phy to work in a custom imx6 board. The issue is that we can’t get a manual IP address and we also can’t get an IP address from the DHCP server.

a) When trying with a manual IP:

Using FEC device

ARP Retry count exceeded; starting again

ARP Retry count exceeded; starting again

b) with DHCP

=> dhcp

BOOTP broadcast 1

BOOTP broadcast 2

BOOTP broadcast 3

BOOTP broadcast 4

  • Our board settings for u-boot:

--custom board c file (ethernet declarations):

static iomux_v3_cfg_t const enet_pads[] = {

  MX6_PAD_ENET_MDIO__ENET_MDIO | MUX_PAD_CTRL(ENET_PAD_CTRL),

  MX6_PAD_ENET_MDC__ENET_MDC | MUX_PAD_CTRL(ENET_PAD_CTRL),

  MX6_PAD_RGMII_TXC__RGMII_TXC | MUX_PAD_CTRL(ENET_PAD_CTRL),

  MX6_PAD_RGMII_TD0__RGMII_TD0 | MUX_PAD_CTRL(ENET_PAD_CTRL),

  MX6_PAD_RGMII_TD1__RGMII_TD1 | MUX_PAD_CTRL(ENET_PAD_CTRL),

  MX6_PAD_RGMII_TD2__RGMII_TD2 | MUX_PAD_CTRL(ENET_PAD_CTRL),

  MX6_PAD_RGMII_TD3__RGMII_TD3 | MUX_PAD_CTRL(ENET_PAD_CTRL),

  MX6_PAD_RGMII_TX_CTL__RGMII_TX_CTL | MUX_PAD_CTRL(ENET_PAD_CTRL),

  MX6_PAD_ENET_REF_CLK__ENET_TX_CLK | MUX_PAD_CTRL(ENET_PAD_CTRL),

  MX6_PAD_RGMII_RXC__RGMII_RXC | MUX_PAD_CTRL(ENET_PAD_CTRL),

  MX6_PAD_RGMII_RD0__RGMII_RD0 | MUX_PAD_CTRL(ENET_PAD_CTRL),

  MX6_PAD_RGMII_RD1__RGMII_RD1 | MUX_PAD_CTRL(ENET_PAD_CTRL),

  MX6_PAD_RGMII_RD2__RGMII_RD2 | MUX_PAD_CTRL(ENET_PAD_CTRL),

  MX6_PAD_RGMII_RD3__RGMII_RD3 | MUX_PAD_CTRL(ENET_PAD_CTRL),

  MX6_PAD_RGMII_RX_CTL__RGMII_RX_CTL | MUX_PAD_CTRL(ENET_PAD_CTRL),

  /* AR8031 PHY Reset */

  MX6_PAD_SD2_DAT2__GPIO1_IO13 | MUX_PAD_CTRL(NO_PAD_CTRL),

};

static void setup_iomux_enet(void)

{

  imx_iomux_v3_setup_multiple_pads(enet_pads, ARRAY_SIZE(enet_pads));

  /* Reset AR8031 PHY */

  gpio_direction_output(ETH_PHY_RESET, 0);

  udelay(500);

  gpio_set_value(ETH_PHY_RESET, 0);

}

int board_phy_config(struct phy_device *phydev)

{

  mx6_rgmii_rework(phydev);

  if (phydev->drv->config)

  phydev->drv->config(phydev);

  return 0;

}

int mx6_rgmii_rework(struct phy_device *phydev)

{

  unsigned short val;

  /* To enable AR8031 ouput a 125MHz clk from CLK_25M */

  phy_write(phydev, MDIO_DEVAD_NONE, 0xd, 0x7);

  phy_write(phydev, MDIO_DEVAD_NONE, 0xe, 0x8016);

  phy_write(phydev, MDIO_DEVAD_NONE, 0xd, 0x4007);

  phy_write(phydev, MDIO_DEVAD_NONE, 0x09, 0x0000);

  val = phy_read(phydev, MDIO_DEVAD_NONE, 0xe);

  val &= 0xffe3;

  val |= 0x18;

  phy_write(phydev, MDIO_DEVAD_NONE, 0xe, val);

  /* introduce tx clock delay */

  phy_write(phydev, MDIO_DEVAD_NONE, 0x1d, 0x5);

  val = phy_read(phydev, MDIO_DEVAD_NONE, 0x1e);

  val |= 0x0100;

  phy_write(phydev, MDIO_DEVAD_NONE, 0x1e, val);

  return 0;

}

  • in the include/configs file:

#define CONFIG_CMD_PING

#define CONFIG_CMD_DHCP

#define CONFIG_CMD_MII

#define CONFIG_CMD_NET

#define CONFIG_FEC_MXC

#define CONFIG_MII

#define IMX_FEC_BASE ENET_BASE_ADDR

#define CONFIG_FEC_XCV_TYPE RGMII

#define CONFIG_ETHPRIME "FEC"

#define CONFIG_FEC_MXC_PHYADDR 0

#define CONFIG_PHYLIB

#define CONFIG_PHY_ATHEROS

  • We can verify that u-boot is detecting the phy (also reading register values with mii dump):

U-Boot 2015.04-00132-g244c0eb-dirty (Apr 01 2016 - 21:56:49)

CPU:   Freescale i.MX6Q rev1.5 996 MHz (running at 792 MHz)

CPU:   Extended Commercial temperature grade (-20C to 105C) at 51C

Reset cause: WDOG

I2C:   ready

DRAM:  2 GiB

PMIC:  PFUZE100 ID=0x10

Flash: ## Unknown flash on Bank 1 - Size = 0x00000000 = 0 MB

0 Bytes

NAND:  0 MiB

MMC:   FSL_SDHC: 0

In:    serial

Out:   serial

Err:   serial

Net:   FEC [PRIME]

  • u-Boot env settings:

baudrate=115200

boot_fdt=try

bootargs=console=ttymxc3,115200 root=/dev/nfs ip=dhcp nfsroot=:,v3,tcp

bootcmd=mmc dev ${mmcdev};if mmc rescan; then if run loadbootscript; then run bo

otscript; else if run loadimage; then run mmcboot; else run netboot; fi; fi; els

e run netboot; fi

bootdelay=1

bootscript=echo Running bootscript from mmc ...; source

console=ttymxc3

display=mxcfb0:dev=hdmi,1280x720M@60,bpp=32 video=mxcfb1:off video=mxcfb2:off mx

c_hdmi.disable_hdmi_edid=1 consoleblank=0

ethact=FEC

ethaddr=00:19:B8:00:E5:4E

ethprime=FEC

fdt_addr=0x18000000

fdt_file=/boot/imx6q-pixiepro.dtb

fdt_high=0xffffffff

gatewayip=10.1.1.1

get_cmd=dhcp

image=/boot/zImage

initrd_high=0xffffffff

ip=dhcp

ip_dyn=yes

ipaddr=10.1.1.13

netmask=255.0.0.0

loadaddr=0x12000000

loadbootscript=ext4load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};

loadfdt=ext4load mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}

loadimage=ext4load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}

mmcargs=setenv bootargs console=${console},${baudrate} root=${mmcroot} video=${d

isplay}

mmcboot=echo Booting from mmc ...; run mmcargs; if test ${boot_fdt} = yes || tes

t ${boot_fdt} = try; then if run loadfdt; then bootz ${loadaddr} - ${fdt_addr};

else if test ${boot_fdt} = try; then bootz; else echo WARN: Cannot load the DT;

fi; fi; else bootz; fi;

mmcdev=0

mmcpart=2

mmcroot=/dev/mmcblk2p2 rootwait rw rootfstype=ext4

netargs=setenv bootargs console=${console},${baudrate} root=/dev/nfs ip=dhcp nfs

root=${serverip}:${nfsroot},v3,tcp

netboot=echo Booting from net ...; run netargs; if test ${ip_dyn} = yes; then se

tenv get_cmd dhcp; else setenv get_cmd tftp; fi; ${get_cmd} ${image}; if test ${

boot_fdt} = yes || test ${boot_fdt} = try; then if ${get_cmd} ${fdt_addr} ${fdt_

file}; then bootz ${loadaddr} - ${fdt_addr}; else if test ${boot_fdt} = try; the

n bootz; else echo WARN: Cannot load the DT; fi; fi; else bootz; fi;

netmask=255.0.0.0

script=/boot/boot.scr

stderr=serial

stdin=serial

stdout=serial

update_sd_firmware=if test ${ip_dyn} = yes; then setenv get_cmd dhcp; else seten

v get_cmd tftp; fi; if mmc dev ${mmcdev}; then if ${get_cmd} ${update_sd_firmwar

e_filename}; then setexpr fw_sz ${filesize} / 0x200; setexpr fw_sz ${fw_sz} + 1;

mmc write ${loadaddr} 0x2 ${fw_sz}; fi; fi

  • We have also declared the pads on the device tree and we still can’t get an IPV4 address.

wlp1s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500

        inet 10.1.1.194  netmask 255.0.0.0  broadcast 10.255.255.255

        inet6 fe80::82d2:1dff:fe5e:6c8f  prefixlen 64  scopeid 0x20<link>

        inet6 fd00:c0de::82d2:1dff:fe5e:6c8f  prefixlen 64  scopeid 0x0<global>

        ether 80:d2:1d:5e:6c:8f  txqueuelen 1000  (Ethernet)

        RX packets 125  bytes 18145 (17.7 KiB)

        RX errors 0  dropped 0  overruns 0  frame 0

        TX packets 74  bytes 12078 (11.7 KiB)

        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

Part of the schematic:

Ethernet.png

What could be the reason for this problem?

Thanks

Labels (4)
0 Kudos
4 Replies

16 Views
Senior Contributor II

Check the ENET_REF_CLK pin of MX6Q is toggled or not.

0 Kudos

16 Views
NXP TechSupport
NXP TechSupport

In the PHY reset, you set to '0' again after the delay.

Please set to 1 after the delay.

gpio_set_value(ETH_PHY_RESET, 1);

Because the PHY reset GPIO pin is using the SD2_DAT. If still not work, please double check the SD2_DAT2 has been used in other place or not.

0 Kudos

16 Views
Contributor II

Thanks for your help jimmychan.

I changed the PHY reset to 0 after the delay.

Now I have an IP address, but only by disabling auto negotiation and working with the default values (10 Mb/half duplex).

$   ethtool -s eth0 speed 10 duplex half autoneg off

Apprently, ethtool is showing that the phy does not support autonegotation:

Settings for eth0:

        Supported ports: [ TP MII ]

        Supported link modes:   10baseT/Half 10baseT/Full

                                100baseT/Half

        Supported pause frame use: Symmetric

        Supports auto-negotiation: No

        Advertised link modes:  10baseT/Half

        Advertised pause frame use: No

        Advertised auto-negotiation: No

        Link partner advertised link modes:  10baseT/Half 10baseT/Full

                                             100baseT/Half

        Link partner advertised pause frame use: Symmetric

        Link partner advertised auto-negotiation: Yes

        Speed: 10Mb/s

        Duplex: Half

        Port: MII

        PHYAD: 0

        Transceiver: external

        Auto-negotiation: off

        Supports Wake-on: d

        Wake-on: d

        Link detected: yes

Is this problem somehow related to the phy driver?

I'm using the following kernel:

3.14.61-fslc+preempt-g43348b3

Thanks

0 Kudos

16 Views
NXP TechSupport
NXP TechSupport

please try our BSP release..

linux-2.6-imx.git - Freescale i.MX Linux Tree

0 Kudos