* [U-Boot-Users] [PATCH] Fix mpc8360emds board hang on second network operation
@ 2008-02-27 2:32 Jerry Van Baren
2008-02-27 16:46 ` Kim Phillips
0 siblings, 1 reply; 2+ messages in thread
From: Jerry Van Baren @ 2008-02-27 2:32 UTC (permalink / raw)
To: u-boot
The changeset that causes my problems is ee62ed32
The original code calls init_phy(dev) followed by phy_change(dev) *once*
during PHY initialization. The part of changeset that appears to cause
my problems is calling phy_change(dev) every time uec_init() is called.
On my mpc8360emds board, without this change the second command that does
a network operation hangs the board (requires a hard reset to recover).
Example failure sequence is two "ping" commands: the first works, the
second hangs the board.
This also speeds up the network initialization and doesn't cause a packet
error on the first TFTP packet.
Signed-off-by: Gerald Van Baren <vanbaren@cideas.com>
---
Kim:
Does this make any sense? Any thoughts why it isn't causing problems
for you? It makes all the difference in the world for me.
One other interesting sequence difference with patch ee62ed32 is that
the ethernet MAC address is set on every uec_init() call. The following
code was inside the "if (uec->the_first_run == 0)" conditional, now it
is outside the conditional and thus run on every uec_init() call.
Functionally, it doesn't seem to matter for me either way, but seems
unnecessary.
+ /* Set up the MAC address */
+ if (dev->enetaddr[0] & 0x01) {
+ printf("%s: MacAddress is multcast address\n",
+ __FUNCTION__);
+ return -1;
+ }
+ uec_set_mac_address(uec, dev->enetaddr);
Best regards,
gvb
P.S. What's the Guiness World Book record for number of words written
to explain moving two lines of code?
drivers/qe/uec.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/qe/uec.c b/drivers/qe/uec.c
index 55f37cb..d447d96 100644
--- a/drivers/qe/uec.c
+++ b/drivers/qe/uec.c
@@ -1163,6 +1163,8 @@ static int uec_init(struct eth_device* dev, bd_t *bd)
return err;
}
+ phy_change(dev);
+
curphy = uec->mii_info->phyinfo;
if (curphy->config_aneg) {
@@ -1201,8 +1203,6 @@ static int uec_init(struct eth_device* dev, bd_t *bd)
return -1;
}
- phy_change(dev);
-
return (uec->mii_info->link ? 0 : -1);
}
--
1.5.4.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [U-Boot-Users] [PATCH] Fix mpc8360emds board hang on second network operation
2008-02-27 2:32 [U-Boot-Users] [PATCH] Fix mpc8360emds board hang on second network operation Jerry Van Baren
@ 2008-02-27 16:46 ` Kim Phillips
0 siblings, 0 replies; 2+ messages in thread
From: Kim Phillips @ 2008-02-27 16:46 UTC (permalink / raw)
To: u-boot
On Tue, 26 Feb 2008 21:32:30 -0500
Jerry Van Baren <gvb.uboot@gmail.com> wrote:
> The changeset that causes my problems is ee62ed32
>
> The original code calls init_phy(dev) followed by phy_change(dev) *once*
> during PHY initialization. The part of changeset that appears to cause
> my problems is calling phy_change(dev) every time uec_init() is called.
phy_change is there so that u-boot will renegotiate the link in case
its state has changed since the last networking command (this was the
original complaint that warranted the ee62ed32 patch, iirc).
> On my mpc8360emds board, without this change the second command that does
> a network operation hangs the board (requires a hard reset to recover).
> Example failure sequence is two "ping" commands: the first works, the
> second hangs the board.
>
> This also speeds up the network initialization and doesn't cause a packet
> error on the first TFTP packet.
>
> Signed-off-by: Gerald Van Baren <vanbaren@cideas.com>
> ---
>
> Kim:
>
> Does this make any sense? Any thoughts why it isn't causing problems
> for you? It makes all the difference in the world for me.
>
> One other interesting sequence difference with patch ee62ed32 is that
> the ethernet MAC address is set on every uec_init() call. The following
> code was inside the "if (uec->the_first_run == 0)" conditional, now it
> is outside the conditional and thus run on every uec_init() call.
> Functionally, it doesn't seem to matter for me either way, but seems
> unnecessary.
>
> + /* Set up the MAC address */
> + if (dev->enetaddr[0] & 0x01) {
> + printf("%s: MacAddress is multcast address\n",
> + __FUNCTION__);
> + return -1;
> + }
> + uec_set_mac_address(uec, dev->enetaddr);
>
this was done in order to be able to re-set eth[1]addr between
networking commands, and have the new eth[1]addr value actually
programmed on the interface.
I've tested 100BT, and experience the same as you. The reason u-boot
doesn't recover is that i is not incremented in genmii_update_link(),
but adding that doesn't resolve the problem. I believe the PHY status
is being incorrectly determined somehow - these PHYs are really
finicky :/.
Kim
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-02-27 16:46 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-27 2:32 [U-Boot-Users] [PATCH] Fix mpc8360emds board hang on second network operation Jerry Van Baren
2008-02-27 16:46 ` Kim Phillips
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.