/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* MII overrides for Marvell PHYs.
*/
#include "miipriv.h"
/* 88E3016 */
/* LED control page 3, 88E1116, 88E1149 */
#define MV_LED_PSEL_LED0(x) (x << 0)
static int
{
int rv;
reg |= MV_PSC_AUTO_MDIX;
reg |= MV_PSC_LPNP;
/* enable class A driver for Yukon FE+ A0. */
/* LED2 = ACT blink, LED1 = LINK), LED0 = SPEED */
/* calibration, values not documented */
/* Normal BMCR reset now */
return (rv);
}
static int
{
int rv;
/*
* The PHY apparently needs a soft reset, but supposedly
* retains most of the other critical state.
*/
reg |= MII_CONTROL_RESET;
reg &= ~(MV_PSC_AUTO_MDIX);
reg |= MV_PSC_LPNP;
return (rv);
}
static int
{
int rv;
reg &= ~MV_PSC_POL_REVERSE;
return (rv);
}
static int
{
int rv;
/* make sure that this PHY uses page 0 (copper) */
/* Disable energy detect mode */
reg &= ~MV_PSC_EN_DETECT_MASK;
reg &= ~MV_PSC_POL_REVERSE;
/*
* Fix for signal amplitude in 10BASE-T, undocumented.
* This is from the Marvell reference source code.
*/
/*
* EC_U: IEEE A/B 1000BASE-T symmetry failure
*
* EC_U is rev 0, Ultra 2 is rev 1 (at least the
* unit I have), so we trigger on revid.
*/
}
/* page 3 is led control */
/*
* Weird... undocumented logic in the Intel e1000g driver.
* I'm not sure what these values really do.
*/
return (rv);
}
static int
{
/* make sure that this PHY uses page 0 (copper) */
reg &= ~MV_PSC_POWER_DOWN;
/* Disable energy detect mode */
reg &= ~MV_PSC_EN_DETECT_MASK;
reg &= ~MV_PSC_POL_REVERSE;
/* page 3 is led control */
}
static int
{
/* Disable energy detect mode */
reg &= ~MV_PSC_EN_DETECT_MASK;
reg &= ~MV_PSC_POL_REVERSE;
}
static int
{
/* Disable energy detect mode */
reg &= ~MV_PSC_EN_DETECT_MASK;
reg &= ~MV_PSC_POL_REVERSE;
/* force TX CLOCK to 25 MHz */
}
static int
{
/* interface indicates fiber */
/* Go into locked 1000BASE-X mode */
reg &= ~MV_PSC_MODE_MASK;
} else {
/* Disable energy detect mode */
reg &= ~MV_PSC_EN_DETECT_MASK;
reg &= ~MV_PSC_POL_REVERSE;
}
}
static int
{
/* interface indicates fiber */
} else {
reg &= ~MV_PSC_AUTO_X_MODE;
reg &= ~MV_PSC_POL_REVERSE;
}
/* force TX CLOCK to 25 MHz */
}
static int
{
reg &= ~MV_PSC_AUTO_X_MODE;
reg &= ~MV_PSC_POL_REVERSE;
/* Normal BMCR reset now */
}
static int
{
int rv;
/*
* If not autonegotiating, then we need to reset the PHY according to
* Marvell. I don't think this is according to the spec. Apparently
* the register states are not lost during this.
*/
}
return (rv);
}
{
case MII_OUI_MARVELL:
break;
break;
break;
break;
break;
break;
break;
break;
break;
break;
default:
/* Unknown PHY model */
return (B_FALSE);
}
break;
default:
return (B_FALSE);
}
return (B_TRUE);
}