This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM1808 based board, kernel 3.17.0, no Micrel phy link

Other Parts Discussed in Thread: AM1808, OMAP-L138

Dear Gentlemen,

fighting to have eth0 interface up and running with this last recent kernel 3.17.0. I am not using actually DT to configure emac, but the old way.

.

static int __init ipam390_config_emac(void)
{
	void __iomem *cfg_chip3_base;
	int ret;
	u32 val;
	struct davinci_soc_info *soc_info = &davinci_soc_info;
	u8 rmii_en = soc_info->emac_pdata->rmii_en;

	cfg_chip3_base = DA8XX_SYSCFG0_VIRT(DA8XX_CFGCHIP3_REG);

	val = __raw_readl(cfg_chip3_base);

	if (rmii_en) {
		val |= BIT(8);
		ret = davinci_cfg_reg_list(ipam390_rmii_pins);
		pr_info("EMAC: RMII PHY configured, MII PHY will not be"
							" functional\n");
	} else {
		val &= ~BIT(8);
		ret = davinci_cfg_reg_list(ipam390_mii_pins);
		pr_info("EMAC: MII PHY configured, RMII PHY will not be"
							" functional\n");
	}

	if (ret)
		pr_warning("da850_evm_init: cpgmac/rmii mux setup failed: %d\n",
				ret);

	/* configure the CFGCHIP3 register for RMII or MII */
	__raw_writel(val, cfg_chip3_base);
	soc_info->emac_pdata->phy_id = DA850_EVM_PHY_ID;

	ret = da8xx_register_emac();
	if (ret)
		pr_warning("da850_evm_init: emac registration failed: %d\n",
				ret);
	return 0;
}
device_initcall(ipam390_config_emac);

Actually, what i get is :

Kernel 3.17.0
net eth0: attached PHY driver [Micrel KSZ8031] (mii_bus:phy_addr=davinci_mdio-0:00, id=221556)

But my micrel hw is KSZ8051 (first strange thing).

I see phy leds up (both lights up) until the first "Sending discover..." message, then both leds die.

UTC
Time zone set
Starting network...
davinci_mdio davinci_mdio.0: resetting idled controller
ipam390_phy_fixup: applying ipam390_phy_fixup
micrel.c: ksz8021_config_init: val=00000202
micrel.c: ksz8021_config_init: val=00000202
micrel.c: enabling 50MHZ input
micrel.c: enabled 50MHZ input
net eth0: attached PHY driver [Micrel KSZ8031] (mii_bus:phy_addr=davinci_mdio-0:00, id=221556)
udhcpc (v1.20.2) started
Sending discover...
davinci_emac.c: emac_adjust_link: entering, phydev->link=0
Sending discover...
Sending discover...
No lease, failing



My system have: ARM AM1808 (OMAP-L138),
- davinci-emac.c
- RMII and MDIO to interface to Micrel KSZ8051
- sourcinf 50MHZ clock from emac RMII

Note: if i take the kernel 3.5.1 micrel.c and replace it to the current, phy link works, but no packets are sent out, as if there is no correct link from emac to phyThere is a TX value, but nothing is really sent.

eth0      Link encap:Ethernet  HWaddr 00:08:E1:03:2A:C5  
          inet addr:192.168.0.100  Bcast:192.168.0.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:38 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:3590 (3.5 KiB)
          Interrupt:33 

Every help is appreciated.

Regards

  • Hi Steven,

    Note: if i take the kernel 3.5.1 micrel.c and replace it to the current, phy link works, but no packets are sent out, as if there is no correct link from emac to phyThere is a TX value, but nothing is really sent.

    Are you meant that you able to enable ethernet in linux3.17 when you have micrel.c file which is taken from linux3.5.1 ?

    If yes, have you compared both the files ?

  • Hi,

    i mainly misunderstood the issue.

    The issue i am experiencing is :

    https://lkml.org/lkml/2013/9/18/259

    Mainly, i have Micrel chip marked KSZ8051(RNL), but the product Id in the
    silicon is KSZ8031 and linux detects it as KSZ8031.
    The attmept to write mdio boot override register kill the Micrel functionality.

    So i just replaced the phy_id code (hardcoded) in the code mdio detecion
    routine.

    I am not giving to the Micrel any external 50Mhz clock, but
    as per default, the Micrel is giving the clock out to the davinci-emac.
    So no fixups are needed for my case.

    But i still have a last issue now: i see link is up 100Mbit, but no
    packets are really sent, and nothing is received.
    Led links are up.

    Time zone set
    Starting network...
    davinci_mdio davinci_mdio.0: resetting idled controller
    net eth0: attached PHY driver [Micrel KSZ8051] (mii_bus:phy_addr=davinci_mdio-0:00, id=221550)
    udhcpc (v1.20.2) started
    Sending discover...
    davinci_emac davinci_emac.1 eth0: Link is Up - 100Mbps/Full - flow control off
    Sending discover...
    Sending discover...
    No lease, failing
    ....


    [root@barix ~]# ifconfig
    eth0      Link encap:Ethernet  HWaddr 00:08:E1:03:2A:C5 
              inet6 addr: fe80::208:e1ff:fe03:2ac5/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:0 errors:0 dropped:0 overruns:0 frame:0
              TX packets:13 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000
              RX bytes:0 (0.0 B)  TX bytes:2258 (2.2 KiB)
              Interrupt:33

    lo        Link encap:Local Loopback 
              inet addr:127.0.0.1  Mask:255.0.0.0
              inet6 addr: ::1/128 Scope:Host
              UP LOOPBACK RUNNING  MTU:65536  Metric:1
              RX packets:0 errors:0 dropped:0 overruns:0 frame:0
              TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:0
              RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

    Packets seems sent but they are not sent at all (checking from WS)
    and no packets are received at the same time.


    Every help is welcome,


    Reagrds


  • ok, network now works, was still setting 50mhz clock to the MIcrel, that i forgot for testing.