aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/ixp2000
diff options
context:
space:
mode:
authorLennert Buytenhek <buytenh@wantstofly.org>2005-11-23 12:49:55 +0100
committerJeff Garzik <jgarzik@pobox.com>2005-12-01 02:25:27 -0500
commitc6e429bdd6f0142558896e29c21a526c1ffdd1f3 (patch)
tree1577129f1762d81b5e54600768289d6ebb270aec /drivers/net/ixp2000
parentdf86550602f320d28fdaeb577c25f9821525bfa0 (diff)
[PATCH] pm3386: implement reset
Implement pm3386 reset. A reset zeroes out the internally stored MAC addresses, so we need to save and reload them by hand. Signed-off-by: Lennert Buytenhek <buytenh@wantstofly.org> Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
Diffstat (limited to 'drivers/net/ixp2000')
-rw-r--r--drivers/net/ixp2000/pm3386.c32
1 files changed, 31 insertions, 1 deletions
diff --git a/drivers/net/ixp2000/pm3386.c b/drivers/net/ixp2000/pm3386.c
index ec70b1d553e..5c7ab756405 100644
--- a/drivers/net/ixp2000/pm3386.c
+++ b/drivers/net/ixp2000/pm3386.c
@@ -89,7 +89,37 @@ static void pm3386_port_reg_write(int port, int _reg, int spacing, u16 value)
void pm3386_reset(void)
{
- /* @@@ Implement me. */
+ u8 mac[3][6];
+
+ /* Save programmed MAC addresses. */
+ pm3386_get_mac(0, mac[0]);
+ pm3386_get_mac(1, mac[1]);
+ pm3386_get_mac(2, mac[2]);
+
+ /* Assert analog and digital reset. */
+ pm3386_reg_write(0, 0x002, 0x0060);
+ pm3386_reg_write(1, 0x002, 0x0060);
+ mdelay(1);
+
+ /* Deassert analog reset. */
+ pm3386_reg_write(0, 0x002, 0x0062);
+ pm3386_reg_write(1, 0x002, 0x0062);
+ mdelay(10);
+
+ /* Deassert digital reset. */
+ pm3386_reg_write(0, 0x002, 0x0063);
+ pm3386_reg_write(1, 0x002, 0x0063);
+ mdelay(10);
+
+ /* Restore programmed MAC addresses. */
+ pm3386_set_mac(0, mac[0]);
+ pm3386_set_mac(1, mac[1]);
+ pm3386_set_mac(2, mac[2]);
+
+ /* Disable carrier on all ports. */
+ pm3386_set_carrier(0, 0);
+ pm3386_set_carrier(1, 0);
+ pm3386_set_carrier(2, 0);
}
static u16 swaph(u16 x)