Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 26582
b: refs/heads/master
c: 8ec9345
h: refs/heads/master
v: v3
  • Loading branch information
Jens Osterkamp authored and Stephen Hemminger committed May 8, 2006
1 parent d5c2a9b commit c4e5dcb
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b636d17a3bee8ba988e78e4bc8262f0dc3fad8ab
refs/heads/master: 8ec93459655a3618dedec6360bb28d63f0010ef6
10 changes: 1 addition & 9 deletions trunk/drivers/net/spider_net.c
Original file line number Diff line number Diff line change
Expand Up @@ -1794,15 +1794,7 @@ spider_net_setup_phy(struct spider_net_card *card)
if (phy->def->ops->setup_forced)
phy->def->ops->setup_forced(phy, SPEED_1000, DUPLEX_FULL);

/* the following two writes could be moved to sungem_phy.c */
/* enable fiber mode */
spider_net_write_phy(card->netdev, 1, MII_NCONFIG, 0x9020);
/* LEDs active in both modes, autosense prio = fiber */
spider_net_write_phy(card->netdev, 1, MII_NCONFIG, 0x945f);

/* switch off fibre autoneg */
spider_net_write_phy(card->netdev, 1, MII_NCONFIG, 0xfc01);
spider_net_write_phy(card->netdev, 1, 0x0b, 0x0004);
phy->def->ops->enable_fiber(phy);

phy->def->ops->read_link(phy);
pr_info("Found %s with %i Mbps, %s-duplex.\n", phy->def->name,
Expand Down
45 changes: 45 additions & 0 deletions trunk/drivers/net/sungem_phy.c
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,30 @@ static int bcm5421_init(struct mii_phy* phy)
return 0;
}

static int bcm5421_enable_fiber(struct mii_phy* phy)
{
/* enable fiber mode */
phy_write(phy, MII_NCONFIG, 0x9020);
/* LEDs active in both modes, autosense prio = fiber */
phy_write(phy, MII_NCONFIG, 0x945f);

/* switch off fibre autoneg */
phy_write(phy, MII_NCONFIG, 0xfc01);
phy_write(phy, 0x0b, 0x0004);

return 0;
}

static int bcm5461_enable_fiber(struct mii_phy* phy)
{
phy_write(phy, MII_NCONFIG, 0xfc0c);
phy_write(phy, MII_BMCR, 0x4140);
phy_write(phy, MII_NCONFIG, 0xfc0b);
phy_write(phy, MII_BMCR, 0x0140);

return 0;
}

static int bcm54xx_setup_aneg(struct mii_phy *phy, u32 advertise)
{
u16 ctl, adv;
Expand Down Expand Up @@ -762,6 +786,7 @@ static struct mii_phy_ops bcm5421_phy_ops = {
.setup_forced = bcm54xx_setup_forced,
.poll_link = genmii_poll_link,
.read_link = bcm54xx_read_link,
.enable_fiber = bcm5421_enable_fiber,
};

static struct mii_phy_def bcm5421_phy_def = {
Expand Down Expand Up @@ -792,6 +817,25 @@ static struct mii_phy_def bcm5421k2_phy_def = {
.ops = &bcm5421k2_phy_ops
};

static struct mii_phy_ops bcm5461_phy_ops = {
.init = bcm5421_init,
.suspend = generic_suspend,
.setup_aneg = bcm54xx_setup_aneg,
.setup_forced = bcm54xx_setup_forced,
.poll_link = genmii_poll_link,
.read_link = bcm54xx_read_link,
.enable_fiber = bcm5461_enable_fiber,
};

static struct mii_phy_def bcm5461_phy_def = {
.phy_id = 0x002060c0,
.phy_id_mask = 0xfffffff0,
.name = "BCM5461",
.features = MII_GBIT_FEATURES,
.magic_aneg = 1,
.ops = &bcm5461_phy_ops
};

/* Broadcom BCM 5462 built-in Vesta */
static struct mii_phy_ops bcm5462V_phy_ops = {
.init = bcm5421_init,
Expand Down Expand Up @@ -857,6 +901,7 @@ static struct mii_phy_def* mii_phy_table[] = {
&bcm5411_phy_def,
&bcm5421_phy_def,
&bcm5421k2_phy_def,
&bcm5461_phy_def,
&bcm5462V_phy_def,
&marvell_phy_def,
&genmii_phy_def,
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/net/sungem_phy.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ struct mii_phy_ops
int (*setup_forced)(struct mii_phy *phy, int speed, int fd);
int (*poll_link)(struct mii_phy *phy);
int (*read_link)(struct mii_phy *phy);
int (*enable_fiber)(struct mii_phy *phy);
};

/* Structure used to statically define an mii/gii based PHY */
Expand Down

0 comments on commit c4e5dcb

Please sign in to comment.