4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
22 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
27 * MII overrides for National Semiconductor PHYs.
30 #include <sys/types.h>
32 #include <sys/sunddi.h>
34 #include <sys/miiregs.h>
38 ns83840_reset(phy_handle_t
*ph
)
40 /* first do an ordinary reset */
41 if (phy_reset(ph
) != DDI_SUCCESS
) {
46 * As per INTEL "PRO/100B Adapter Software Technical Reference
47 * Manual", set bit 10 of MII register 23. National
48 * Semiconductor documentation shows this as "reserved, write
49 * to as zero". We also set the "CIM_DIS" bit, also as
50 * requested by the PRO/100B doc, to disable the carrier
51 * integrity monitor. (That should only ever be used by
54 * NetBSD also sets bit 8, without any explanation, so we'll
57 PHY_SET(ph
, MII_VENDOR(7), (1<<10) | (1<<8) | (1<<5));
62 phy_natsemi_probe(phy_handle_t
*ph
)
64 /* We could even look at revA vs revC, etc. but there is no need. */
65 if ((MII_PHY_MFG(ph
->phy_id
) != MII_OUI_NATIONAL_SEMI
) &&
66 (MII_PHY_MFG(ph
->phy_id
) != MII_OUI_NATIONAL_SEMI_2
)) {
69 ph
->phy_vendor
= "National Semiconductor";
71 switch (MII_PHY_MODEL(ph
->phy_id
)) {
72 case MII_MODEL_NATIONAL_SEMI_DP83840
:
73 ph
->phy_model
= "DP83840";
74 ph
->phy_reset
= ns83840_reset
;
77 case MII_MODEL_NATIONAL_SEMI_DP83843
:
78 ph
->phy_model
= "DP83843";
81 case MII_MODEL_NATIONAL_SEMI_DP83847
:
82 ph
->phy_model
= "DP83847";
85 case MII_MODEL_NATIONAL_SEMI_DP83815
:
86 ph
->phy_model
= "DP83815";