Add some code from FreeBSD to make the E1147* work. Still does not autoneg
to GiGE for some reason but it autonegs to 100BaseTX full-duplex.
This commit is contained in:
parent
1bfd0a8b73
commit
113d90b27b
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: makphy.c,v 1.38 2013/12/21 15:20:39 kiyohara Exp $ */
|
||||
/* $NetBSD: makphy.c,v 1.39 2014/05/13 02:11:26 christos Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc.
|
||||
@ -59,7 +59,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: makphy.c,v 1.38 2013/12/21 15:20:39 kiyohara Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: makphy.c,v 1.39 2014/05/13 02:11:26 christos Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
@ -101,11 +101,12 @@ static const struct mii_phydesc makphys[] = {
|
||||
{ MII_OUI_xxMARVELL, MII_MODEL_xxMARVELL_E1011,
|
||||
MII_STR_xxMARVELL_E1011 },
|
||||
|
||||
#if 0
|
||||
/* doesn't work on eg. HP XW9400 */
|
||||
/* XXX: reported not to work on eg. HP XW9400 */
|
||||
{ MII_OUI_xxMARVELL, MII_MODEL_xxMARVELL_E1149,
|
||||
MII_STR_xxMARVELL_E1149 },
|
||||
#endif
|
||||
|
||||
{ MII_OUI_xxMARVELL, MII_MODEL_xxMARVELL_E1149R,
|
||||
MII_STR_xxMARVELL_E1149R },
|
||||
|
||||
{ MII_OUI_xxMARVELL, MII_MODEL_xxMARVELL_E1111,
|
||||
MII_STR_xxMARVELL_E1111 },
|
||||
@ -153,6 +154,7 @@ makphyattach(device_t parent, device_t self, void *aux)
|
||||
aprint_normal(": %s, rev. %d\n", mpd->mpd_name, MII_REV(ma->mii_id2));
|
||||
|
||||
sc->mii_dev = self;
|
||||
sc->mii_mpd_model = MII_MODEL(ma->mii_id2);
|
||||
sc->mii_inst = mii->mii_instance;
|
||||
sc->mii_phy = ma->mii_phyno;
|
||||
sc->mii_funcs = &makphy_funcs;
|
||||
@ -160,6 +162,31 @@ makphyattach(device_t parent, device_t self, void *aux)
|
||||
sc->mii_flags = ma->mii_flags;
|
||||
sc->mii_anegticks = MII_ANEGTICKS;
|
||||
|
||||
switch (sc->mii_mpd_model) {
|
||||
case MII_MODEL_xxMARVELL_E1011:
|
||||
case MII_MODEL_xxMARVELL_E1112:
|
||||
if (PHY_READ(sc, MII_MAKPHY_ESSR) & ESSR_FIBER_LINK)
|
||||
sc->mii_flags |= MIIF_HAVEFIBER;
|
||||
break;
|
||||
case MII_MODEL_xxMARVELL_E1149:
|
||||
case MII_MODEL_xxMARVELL_E1149R:
|
||||
/*
|
||||
* Some 88E1149 PHY's page select is initialized to
|
||||
* point to other bank instead of copper/fiber bank
|
||||
* which in turn resulted in wrong registers were
|
||||
* accessed during PHY operation. It is believed that
|
||||
* page 0 should be used for copper PHY so reinitialize
|
||||
* MII_MAKPHY_EADR to select default copper PHY. If parent
|
||||
* device know the type of PHY(either copper or fiber),
|
||||
* that information should be used to select default
|
||||
* type of PHY.
|
||||
*/
|
||||
PHY_WRITE(sc, MII_MAKPHY_EADR, 0);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
PHY_RESET(sc);
|
||||
|
||||
sc->mii_capabilities =
|
||||
|
Loading…
x
Reference in New Issue
Block a user