diff options
Diffstat (limited to 'sys/dev/mii/eephy.c')
-rw-r--r-- | sys/dev/mii/eephy.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/sys/dev/mii/eephy.c b/sys/dev/mii/eephy.c index 19ae3f5f557..85014abd89c 100644 --- a/sys/dev/mii/eephy.c +++ b/sys/dev/mii/eephy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: eephy.c,v 1.46 2008/10/07 20:41:05 kettenis Exp $ */ +/* $OpenBSD: eephy.c,v 1.47 2009/02/22 16:37:55 kettenis Exp $ */ /* * Principal Author: Parag Patel * Copyright (c) 2001 @@ -220,14 +220,20 @@ eephyattach(struct device *parent, struct device *self, void *aux) /* Disable energy detect; only available on some models. */ switch(sc->mii_model) { + case MII_MODEL_MARVELL_E3016: + reg &= ~0x4000; /* XXX */ + break; case MII_MODEL_MARVELL_E1011: case MII_MODEL_MARVELL_E1111: case MII_MODEL_MARVELL_E1112: - /* Disable energy detect. */ reg &= ~E1000_SCR_EN_DETECT_MASK; break; } + /* Enable scrambler if necessary. */ + if (sc->mii_model == MII_MODEL_MARVELL_E3016) + reg &= ~E1000_SCR_SCRAMBLER_DISABLE; + PHY_WRITE(sc, E1000_SCR, reg); /* 25 MHz TX_CLK should always work. */ @@ -235,6 +241,13 @@ eephyattach(struct device *parent, struct device *self, void *aux) reg |= E1000_ESCR_TX_CLK_25; PHY_WRITE(sc, E1000_ESCR, reg); + /* Configure LEDs if they were left unconfigured. */ + if (sc->mii_model == MII_MODEL_MARVELL_E3016 && + PHY_READ(sc, 0x16) == 0) { + reg = (0x0b << 8) | (0x05 << 4) | 0x04; /* XXX */ + PHY_WRITE(sc, 0x16, reg); + } + /* * Do a software reset for these settings to take effect. * Disable autonegotiation, such that all capabilities get |