diff options
author | Imre Kaloz <kaloz@openwrt.org> | 2011-01-27 12:51:25 +0000 |
---|---|---|
committer | Imre Kaloz <kaloz@openwrt.org> | 2011-01-27 12:51:25 +0000 |
commit | 0f325459eae511f5f413b4e12af576214a30320c (patch) | |
tree | 682d14f882b81b6e936d4528cca719397b4f0164 /target/linux/leon/patches/022-greth_avoid_bad_speed_duplex.patch | |
parent | a361eab890a4c5143d556e08d7e775c5175bad86 (diff) | |
download | master-31e0f0ae-0f325459eae511f5f413b4e12af576214a30320c.tar.gz master-31e0f0ae-0f325459eae511f5f413b4e12af576214a30320c.tar.bz2 master-31e0f0ae-0f325459eae511f5f413b4e12af576214a30320c.zip |
add preliminary LEON support
SVN-Revision: 25139
Diffstat (limited to 'target/linux/leon/patches/022-greth_avoid_bad_speed_duplex.patch')
-rw-r--r-- | target/linux/leon/patches/022-greth_avoid_bad_speed_duplex.patch | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/target/linux/leon/patches/022-greth_avoid_bad_speed_duplex.patch b/target/linux/leon/patches/022-greth_avoid_bad_speed_duplex.patch new file mode 100644 index 0000000000..e8253640dc --- /dev/null +++ b/target/linux/leon/patches/022-greth_avoid_bad_speed_duplex.patch @@ -0,0 +1,50 @@ +From c2e963057ca5635d6e5387623c3ad0c0b3123754 Mon Sep 17 00:00:00 2001 +From: Daniel Hellstrom <daniel@gaisler.com> +Date: Wed, 1 Dec 2010 10:28:37 +0100 +Subject: [PATCH] GRETH: avoid writing bad speed/duplex when setting transfer mode + +Signed-off-by: Daniel Hellstrom <daniel@gaisler.com> +--- + drivers/net/greth.c | 19 ++++++++----------- + 1 files changed, 8 insertions(+), 11 deletions(-) + +--- a/drivers/net/greth.c ++++ b/drivers/net/greth.c +@@ -1236,29 +1236,26 @@ static void greth_link_change(struct net + struct greth_private *greth = netdev_priv(dev); + struct phy_device *phydev = greth->phy; + unsigned long flags; +- + int status_change = 0; ++ u32 ctrl; + + spin_lock_irqsave(&greth->devlock, flags); + + if (phydev->link) { + + if ((greth->speed != phydev->speed) || (greth->duplex != phydev->duplex)) { +- +- GRETH_REGANDIN(greth->regs->control, +- ~(GRETH_CTRL_FD | GRETH_CTRL_SP | GRETH_CTRL_GB)); ++ ctrl = GRETH_REGLOAD(greth->regs->control) & ++ ~(GRETH_CTRL_FD | GRETH_CTRL_SP | GRETH_CTRL_GB); + + if (phydev->duplex) +- GRETH_REGORIN(greth->regs->control, GRETH_CTRL_FD); +- +- if (phydev->speed == SPEED_100) { +- +- GRETH_REGORIN(greth->regs->control, GRETH_CTRL_SP); +- } ++ ctrl |= GRETH_CTRL_FD; + ++ if (phydev->speed == SPEED_100) ++ ctrl |= GRETH_CTRL_SP; + else if (phydev->speed == SPEED_1000) +- GRETH_REGORIN(greth->regs->control, GRETH_CTRL_GB); ++ ctrl |= GRETH_CTRL_GB; + ++ GRETH_REGSAVE(greth->regs->control, ctrl); + greth->speed = phydev->speed; + greth->duplex = phydev->duplex; + status_change = 1; |