diff options
author | Lennert Buytenhek <buytenh@wantstofly.org> | 2005-11-23 06:49:55 -0500 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-12-01 02:25:27 -0500 |
commit | c6e429bdd6f0142558896e29c21a526c1ffdd1f3 (patch) | |
tree | 1577129f1762d81b5e54600768289d6ebb270aec | |
parent | df86550602f320d28fdaeb577c25f9821525bfa0 (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>
-rw-r--r-- | drivers/net/ixp2000/pm3386.c | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/drivers/net/ixp2000/pm3386.c b/drivers/net/ixp2000/pm3386.c index ec70b1d553e3..5c7ab7564053 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) | |||
89 | 89 | ||
90 | void pm3386_reset(void) | 90 | void pm3386_reset(void) |
91 | { | 91 | { |
92 | /* @@@ Implement me. */ | 92 | u8 mac[3][6]; |
93 | |||
94 | /* Save programmed MAC addresses. */ | ||
95 | pm3386_get_mac(0, mac[0]); | ||
96 | pm3386_get_mac(1, mac[1]); | ||
97 | pm3386_get_mac(2, mac[2]); | ||
98 | |||
99 | /* Assert analog and digital reset. */ | ||
100 | pm3386_reg_write(0, 0x002, 0x0060); | ||
101 | pm3386_reg_write(1, 0x002, 0x0060); | ||
102 | mdelay(1); | ||
103 | |||
104 | /* Deassert analog reset. */ | ||
105 | pm3386_reg_write(0, 0x002, 0x0062); | ||
106 | pm3386_reg_write(1, 0x002, 0x0062); | ||
107 | mdelay(10); | ||
108 | |||
109 | /* Deassert digital reset. */ | ||
110 | pm3386_reg_write(0, 0x002, 0x0063); | ||
111 | pm3386_reg_write(1, 0x002, 0x0063); | ||
112 | mdelay(10); | ||
113 | |||
114 | /* Restore programmed MAC addresses. */ | ||
115 | pm3386_set_mac(0, mac[0]); | ||
116 | pm3386_set_mac(1, mac[1]); | ||
117 | pm3386_set_mac(2, mac[2]); | ||
118 | |||
119 | /* Disable carrier on all ports. */ | ||
120 | pm3386_set_carrier(0, 0); | ||
121 | pm3386_set_carrier(1, 0); | ||
122 | pm3386_set_carrier(2, 0); | ||
93 | } | 123 | } |
94 | 124 | ||
95 | static u16 swaph(u16 x) | 125 | static u16 swaph(u16 x) |