* Micrel KSZ8031 - phy link missing
@ 2014-10-08 18:28 Angelo Dureghello
0 siblings, 0 replies; 7+ messages in thread
From: Angelo Dureghello @ 2014-10-08 18:28 UTC (permalink / raw)
To: netdev
Dear,
i am trying to figure out why, moving to kernel 3.16.2, i have phy-link
missing.
I have an arm-corex AM1808 (TI OMAPL-138/DAVINCI) cpu based board, using
Micrel KSZ8031.
.....
Bad block table not found for chip 0
Bad block table not found for chip 0
Scanning device for bad blocks
Bad block table written to 0x000007fe0000, version 0x01
Bad block table written to 0x000007fc0000, version 0x01
8 cmdlinepart partitions found on MTD device davinci_nand.0
Creating 8 MTD partitions on "davinci_nand.0":
0x000000000000-0x000000020000 : "u-boot-env"
0x000000020000-0x000000180000 : "u-boot"
0x000000180000-0x0000001a0000 : "bootparms"
0x0000001a0000-0x000000200000 : "factory-info"
EMAC: device MAC address: 00:08:e1:03:2a:c5
GPIO LEDs: old hardware revision detected
0x000000200000-0x000000600000 : "kernel"
0x000000600000-0x000000700000 : "config"
0x000000700000-0x000004300000 : "rootfs"
0x000004300000-0x000007f00000 : "update"
davinci_nand davinci_nand.0: controller rev. 2.5
davinci_mdio davinci_mdio.0: Runtime PM disabled, clock forced on.
davinci_mdio davinci_mdio.0: davinci mdio revision 1.5
davinci_mdio davinci_mdio.0: detected phy mask fffffffc
libphy: davinci_mdio.0: probed
davinci_mdio davinci_mdio.0: phy[0]: device davinci_mdio-0:00, driver
Micrel KSZ8031
davinci_mdio davinci_mdio.0: phy[1]: device davinci_mdio-0:01, driver
Micrel KSZ8031
omap_rtc da830-rtc: rtc core: registered da830-rtc as rtc0
da830-rtc: RTC power up reset detected
da830-rtc: already running
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
TCP: cubic registered
NET: Registered protocol family 17
Key type dns_resolver registered
UBI: attaching mtd6 to ubi0
UBI: scanning is finished
UBI: attached mtd6 (name "rootfs", size 60 MiB) to ubi0
UBI: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
UBI: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
UBI: VID header offset: 2048 (aligned 2048), data offset: 4096
UBI: good PEBs: 480, bad PEBs: 0, corrupted PEBs: 0
UBI: user volume: 1, internal volumes: 1, max. volumes count: 128
UBI: max/mean erase counter: 2/0, WL threshold: 4096, image sequence
number: 1732378828
UBI: available PEBs: 0, total reserved PEBs: 480, PEBs reserved for bad
PEB handling: 20
UBI: background thread "ubi_bgt0d" started, PID 978
davinci_emac davinci_emac.1: Runtime PM disabled, clock forced on.
davinci_emac davinci_emac.1: Runtime PM disabled, clock forced on.
davinci_emac davinci_emac.1: Runtime PM disabled, clock forced on.
input: gpio-keys as /devices/platform/gpio-keys.0/input/input0
omap_rtc da830-rtc: setting system clock to 2014-10-08 18:19:00 UTC
(1412792340)
ALSA device list:
No soundcards found.
UBIFS: background thread "ubifs_bgt0_0" started, PID 988
UBIFS: mounted UBI device 0, volume 0, name "rootfs"
UBIFS: LEB size: 126976 bytes (124 KiB), min./max. I/O unit sizes: 2048
bytes/2048 bytes
UBIFS: FS size: 56504320 bytes (53 MiB, 445 LEBs), journal size 9023488
bytes (8 MiB, 72 LEBs)
UBIFS: reserved for root: 0 bytes (0 KiB)
UBIFS: media format: w4/r0 (latest is w4/r0), UUID
3946B77C-1A15-4675-B537-F22C6CABE24F, small LPT model
VFS: Mounted root (ubifs filesystem) on device 0:13.
devtmpfs: mounted
Freeing unused kernel memory: 140K (c05ad000 - c05d0000)
Please wait: booting...
Populating /dev using udev: udevd[1008]: starting version 182
done
Starting System Watchdog service: done
Mounting configuration partition...
Checking that all configuration is in place...
Done
Starting LED service: done
Setting time zone...
UTC
Time zone set
Starting network...
davinci_mdio davinci_mdio.0: resetting idled controller
net eth0: attached PHY driver [Micrel KSZ8031]
(mii_bus:phy_addr=davinci_mdio-0:00, id=221556)
udhcpc (v1.20.2) started
Sending discover...
Sending discover...
Sending discover...
No lease, failing
Adjusting output audio levels
...
It says no lease. But i verified that even setting a fixed ip, board is
not reachable.
Tracing inside phy.c i don't see the link to come up. Nothing seen on WS.
As far as you know, there can be some bug open for davinci-emac and micrel ?
Many thanks
Angelo
^ permalink raw reply [flat|nested] 7+ messages in thread
* RE: Micrel KSZ8031 - phy link missing
@ 2014-10-09 15:05 Bruno Thomsen
2014-10-10 9:32 ` Angelo Dureghello
0 siblings, 1 reply; 7+ messages in thread
From: Bruno Thomsen @ 2014-10-09 15:05 UTC (permalink / raw)
To: netdev@vger.kernel.org; +Cc: Bruno Thomsen
Hi Angelo,
> It says no lease. But i verified that even setting a fixed ip, board is not reachable.
>
> Tracing inside phy.c i don't see the link to come up. Nothing seen on WS.
>
> As far as you know, there can be some bug open for davinci-emac and micrel ?
This sounds a lot like an issue I have just created and send a patch to fix.
Since I just joined this mail list it might have been eaten by Majordomo :)
[PATCH] phy/micrel: KSZ8031RNL RMII clock reconfiguration bug
Venlig hilsen / Best regards
Kamstrup A/S <http://www.kamstrup.dk>
Bruno Thomsen
Development engineer
Technology
Kamstrup A/S
Industrivej 28
DK-8660 Skanderborg
Tel: +45 89 93 10 00
Fax: +45 89 93 10 01
Dir: +45 89 93 13 94
E-mail: bth@kamstrup.dk
Web: www.kamstrup.dk
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Micrel KSZ8031 - phy link missing
2014-10-09 15:05 Bruno Thomsen
@ 2014-10-10 9:32 ` Angelo Dureghello
2014-10-10 10:31 ` Bruno Thomsen
0 siblings, 1 reply; 7+ messages in thread
From: Angelo Dureghello @ 2014-10-10 9:32 UTC (permalink / raw)
To: netdev, Bruno Thomsen
Dear Bruno,
many thanks,
i still have the issue after patching kernel 3.17.
static int ksz8021_config_init(struct phy_device *phydev)
{
const u16 val = KSZPHY_OMSO_B_CAST_OFF | KSZPHY_OMSO_RMII_OVERRIDE;
int rc;
rc = kszphy_setup_led(phydev, 0x1f, 4);
if (rc)
dev_err(&phydev->dev, "failed to set led mode\n");
/*
* signalled no-link to linux-net community, followed
* see [PATCH] phy/micrel: KSZ8031RNL RMII clock
reconfiguration bug
*/
rc = ksz_config_flags(phydev);
if (rc < 0)
return rc;
rc = phy_write(phydev, MII_KSZPHY_OMSO, val);
return rc < 0 ? rc : 0;
}
I am using RMII in my custom board, don't know if it makes any difference.
Scanning device for bad blocks
Bad block table written to 0x000007fe0000, version 0x01
Bad block table written to 0x000007fc0000, version 0x01
8 cmdlinepart partitions found on MTD device davinci_nand.0
Creating 8 MTD partitions on "davinci_nand.0":
0x000000000000-0x000000020000 : "u-boot-env"
0x000000020000-0x000000180000 : "u-boot"
0x000000180000-0x0000001a0000 : "bootparms"
0x0000001a0000-0x000000200000 : "factory-info"
EMAC: device MAC address: 00:08:e1:03:2a:c5
GPIO LEDs: old hardware revision detected
0x000000200000-0x000000600000 : "kernel"
0x000000600000-0x000000700000 : "config"
0x000000700000-0x000004300000 : "rootfs"
0x000004300000-0x000007f00000 : "update"
davinci_nand davinci_nand.0: controller rev. 2.5
davinci_mdio davinci_mdio.0: Runtime PM disabled, clock forced on.
davinci_mdio davinci_mdio.0: davinci mdio revision 1.5
davinci_mdio davinci_mdio.0: detected phy mask fffffffc
libphy: davinci_mdio.0: probed
davinci_mdio davinci_mdio.0: phy[0]: device davinci_mdio-0:00, driver
Micrel KSZ8031
davinci_mdio davinci_mdio.0: phy[1]: device davinci_mdio-0:01, driver
Micrel KSZ8031
omap_rtc da830-rtc: rtc core: registered da830-rtc as rtc0
......
Starting LED service: done
Setting time zone...
UTC
Time zone set
Starting network...
davinci_mdio davinci_mdio.0: resetting idled controller
net eth0: attached PHY driver [Micrel KSZ8031]
(mii_bus:phy_addr=davinci_mdio-0:00, id=221556)
udhcpc (v1.20.2) started
Sending discover...
Sending discover...
Sending discover...
No lease, failing
.....
Angelo
On 09/10/2014 17:05, Bruno Thomsen wrote:
> [PATCH] phy/micrel: KSZ8031RNL RMII clock reconfiguration bug
^ permalink raw reply [flat|nested] 7+ messages in thread
* RE: Micrel KSZ8031 - phy link missing
2014-10-10 9:32 ` Angelo Dureghello
@ 2014-10-10 10:31 ` Bruno Thomsen
2014-10-10 10:54 ` Angelo Dureghello
0 siblings, 1 reply; 7+ messages in thread
From: Bruno Thomsen @ 2014-10-10 10:31 UTC (permalink / raw)
To: Angelo Dureghello, netdev@vger.kernel.org
Hey
> i still have the issue after patching kernel 3.17.
> ...
> I am using RMII in my custom board, don't know if it makes any difference.
What RMII clock source do you use? MAC, PHY or external?
If your MAC output the RMII clock you need to enable MICREL_PHY_50MHZ_CLK flag in phydev->dev_flags.
Venlig hilsen / Best regards
Kamstrup A/S <http://www.kamstrup.dk>
Bruno Thomsen
Development engineer
Technology
Kamstrup A/S
Industrivej 28
DK-8660 Skanderborg
Tel: +45 89 93 10 00
Fax: +45 89 93 10 01
Dir: +45 89 93 13 94
E-mail: bth@kamstrup.dk
Web: www.kamstrup.dk
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Micrel KSZ8031 - phy link missing
2014-10-10 10:31 ` Bruno Thomsen
@ 2014-10-10 10:54 ` Angelo Dureghello
2014-10-10 11:32 ` Bruno Thomsen
0 siblings, 1 reply; 7+ messages in thread
From: Angelo Dureghello @ 2014-10-10 10:54 UTC (permalink / raw)
To: Bruno Thomsen, netdev@vger.kernel.org
Dear Thomsen,
thanks for the prompt help,
well i am setting up that clock pin in my board.c, as
#define DA850_EVM_PHY_ID "davinci_mdio-0:00"
#define DA850_MII_MDIO_CLKEN_PIN GPIO_TO_PIN(2, 6)
ret = davinci_cfg_reg(DA850_GPIO2_6);
if (ret)
pr_warn("%s:GPIO(2,6) mux setup failed\n", __func__);
ret = gpio_request(DA850_MII_MDIO_CLKEN_PIN, "mdio_clk_en");
if (ret) {
pr_warn("Cannot open GPIO %d\n", DA850_MII_MDIO_CLKEN_PIN);
return ret;
}
/* Enable/Disable MII MDIO clock */
gpio_direction_output(DA850_MII_MDIO_CLKEN_PIN, rmii_en);
Probably it's me that i am doing something illegal, i explain:
I am moving from a 3.5.1 to a 3.17 kernel, but have a special board.c
startup file i cannot convert into DT easily.
So i am booting using old way (board.c).
Now, new kernels have "pinctrl" that probably jump over my gpio setting
later in the boot, is it possible ?
Thanks
Angelo
On 10/10/2014 12:31, Bruno Thomsen wrote:
> Hey
>
>> i still have the issue after patching kernel 3.17.
>> ...
>> I am using RMII in my custom board, don't know if it makes any difference.
> What RMII clock source do you use? MAC, PHY or external?
>
> If your MAC output the RMII clock you need to enable MICREL_PHY_50MHZ_CLK flag in phydev->dev_flags.
>
>
> Venlig hilsen / Best regards
>
> Kamstrup A/S <http://www.kamstrup.dk>
> Bruno Thomsen
> Development engineer
> Technology
>
> Kamstrup A/S
> Industrivej 28
> DK-8660 Skanderborg
> Tel: +45 89 93 10 00
> Fax: +45 89 93 10 01
> Dir: +45 89 93 13 94
> E-mail: bth@kamstrup.dk
> Web: www.kamstrup.dk
^ permalink raw reply [flat|nested] 7+ messages in thread
* RE: Micrel KSZ8031 - phy link missing
2014-10-10 10:54 ` Angelo Dureghello
@ 2014-10-10 11:32 ` Bruno Thomsen
2014-10-10 12:54 ` Angelo Dureghello
0 siblings, 1 reply; 7+ messages in thread
From: Bruno Thomsen @ 2014-10-10 11:32 UTC (permalink / raw)
To: Angelo Dureghello, netdev@vger.kernel.org
Hey again,
> thanks for the prompt help,
> well i am setting up that clock pin in my board.c, as
> ..
>
> Probably it's me that i am doing something illegal, i explain:
>
> I am moving from a 3.5.1 to a 3.17 kernel, but have a special board.c startup file i cannot convert into DT easily.
> So i am booting using old way (board.c).
> Now, new kernels have "pinctrl" that probably jump over my gpio setting later in the boot, is it possible ?
Looks like you just enable clock output from DA850. You also need to setup PHY to accept RMII clock from MAC.
This can be done with something like this...
static int angelo_board_phy_fixup(struct phy_device *phy)
{
phy->dev_flags |= MICREL_PHY_50MHZ_CLK;
return 0;
}
static void __init angelo_board_init(void)
{
phy_register_fixup_for_uid(PHY_ID_KSZ8031, MICREL_PHY_ID_MASK,
angelo_board_phy_fixup);
// Old board init
}
Venlig hilsen / Best regards
Kamstrup A/S <http://www.kamstrup.dk>
Bruno Thomsen
Development engineer
Technology
Kamstrup A/S
Industrivej 28
DK-8660 Skanderborg
Tel: +45 89 93 10 00
Fax: +45 89 93 10 01
Dir: +45 89 93 13 94
E-mail: bth@kamstrup.dk
Web: www.kamstrup.dk
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Micrel KSZ8031 - phy link missing
2014-10-10 11:32 ` Bruno Thomsen
@ 2014-10-10 12:54 ` Angelo Dureghello
0 siblings, 0 replies; 7+ messages in thread
From: Angelo Dureghello @ 2014-10-10 12:54 UTC (permalink / raw)
To: Bruno Thomsen, netdev@vger.kernel.org
Dear Bruno,
i added the fixup, nothing changes.
I am tracing flags at ksz8021_config_ini:
Starting network...
davinci_mdio davinci_mdio.0: resetting idled controller
micrel.c: ksz8021_config_init: flags: 0x00000203
net eth0: attached PHY driver [Micrel KSZ8031]
(mii_bus:phy_addr=davinci_mdio-0:00, id=221556)
udhcpc (v1.20.2) started
Sending discover...
Sending discover...
Sending discover...
No lease, failing
So, MICREL_PHY_50MHZ_CLK seems to be set.
I have the suspect that the clock is not received from the phy.
Unfortunately i can't check
with the scope, the micrel chip is on a hidden part of the board.
From what i remember, when i was trying to init emac/phy by devicetree,
it was working.
[root@barix ~]# cat /sys/class/net/eth0/carrier
0
[root@barix ~]# cat /sys/class/net/eth0/carrier_changes
1
[root@barix ~]#
I realize at this point is my own debugging / issue.
But if you have any idea how to debug this, i can put some traces here
and there.
Still many thanks,
Angelo
On 10/10/2014 13:32, Bruno Thomsen wrote:
> Hey again,
> Looks like you just enable clock output from DA850. You also need to setup PHY to accept RMII clock from MAC.
> This can be done with something like this...
>
> ...
>
>
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2014-10-10 12:54 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-08 18:28 Micrel KSZ8031 - phy link missing Angelo Dureghello
-- strict thread matches above, loose matches on Subject: below --
2014-10-09 15:05 Bruno Thomsen
2014-10-10 9:32 ` Angelo Dureghello
2014-10-10 10:31 ` Bruno Thomsen
2014-10-10 10:54 ` Angelo Dureghello
2014-10-10 11:32 ` Bruno Thomsen
2014-10-10 12:54 ` Angelo Dureghello
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).