Quantcast
Channel: Processors forum - Recent Threads
Viewing all articles
Browse latest Browse all 17527

AM1808 based board, kernel 3.17.0, no Micrel phy link

$
0
0

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


Viewing all articles
Browse latest Browse all 17527


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>