NetBSD Problem Report #49270

From hf@spg.tu-darmstadt.de  Fri Oct 10 14:07:00 2014
Return-Path: <hf@spg.tu-darmstadt.de>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id D38BFA665E
	for <gnats-bugs@gnats.NetBSD.org>; Fri, 10 Oct 2014 14:06:59 +0000 (UTC)
Message-Id: <201410101405.s9AE5TAj005710@Hochstuhl.nt.e-technik.tu-darmstadt.de>
Date: Fri, 10 Oct 2014 16:05:29 +0200 (CEST)
From: Hauke Fath <hauke@Espresso.Rhein-Neckar.DE>
Reply-To: Hauke Fath <hauke@Espresso.Rhein-Neckar.DE>
To: gnats-bugs@gnats.NetBSD.org
Cc: Hauke Fath <hauke@Espresso.Rhein-Neckar.DE>
Subject: Samsung NC10 Marvell Yukon ethernet not supported
X-Send-Pr-Version: 3.95

>Number:         49270
>Category:       kern
>Synopsis:       Samsung NC10 Marvell Yukon ethernet not supported
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    jdolecek
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Oct 10 14:10:00 +0000 2014
>Closed-Date:    Sat Jun 16 20:13:37 +0000 2018
>Last-Modified:  Thu Jan 17 17:25:01 +0000 2019
>Originator:     Hauke Fath
>Release:        NetBSD 6.1_STABLE
>Organization:
Technische Universitaet Darmstadt
>Environment:


System: NetBSD 7.0_BETA i386
Architecture: i386
Machine: i386
>Description:

	The Samsung NC10 notebook sports a Marvell Yukon ethernet NIC,
	which is supported by FreeBSD, but not even recognized by
	NetBSD. 

	After adding

Index: if_msk.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/if_msk.c,v
retrieving revision 1.46
diff -u -u -r1.46 if_msk.c
--- if_msk.c	10 Aug 2014 16:44:36 -0000	1.46
+++ if_msk.c	10 Oct 2014 11:02:08 -0000
@@ -165,6 +165,7 @@
 	{ PCI_VENDOR_MARVELL,		PCI_PRODUCT_MARVELL_YUKON_8036 },
 	{ PCI_VENDOR_MARVELL,		PCI_PRODUCT_MARVELL_YUKON_8038 },
 	{ PCI_VENDOR_MARVELL,		PCI_PRODUCT_MARVELL_YUKON_8039 },
+	{ PCI_VENDOR_MARVELL,		PCI_PRODUCT_MARVELL_YUKON_8040 },
 	{ PCI_VENDOR_MARVELL,		PCI_PRODUCT_MARVELL_YUKON_8050 },
 	{ PCI_VENDOR_MARVELL,		PCI_PRODUCT_MARVELL_YUKON_8052 },
 	{ PCI_VENDOR_MARVELL,		PCI_PRODUCT_MARVELL_YUKON_8053 },
@@ -948,6 +949,7 @@
 	case SK_YUKON_EC_U:
 	case SK_YUKON_EC:
 	case SK_YUKON_FE:
+	case SK_YUKON_FE_P:
 		return (1);
 	}

Index: if_skreg.h
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/if_skreg.h,v
retrieving revision 1.14
diff -u -u -r1.14 if_skreg.h
--- if_skreg.h	29 May 2011 13:31:30 -0000	1.14
+++ if_skreg.h	10 Oct 2014 11:02:08 -0000
@@ -390,6 +390,7 @@
 #define SK_YUKON_EC_U		0xB4
 #define SK_YUKON_EC		0xB6
 #define SK_YUKON_FE		0xB7
+#define SK_YUKON_FE_P		0xB8
 #define SK_YUKON_FAMILY(x) ((x) & 0xB0)

 #define SK_IS_GENESIS(sc) \
@@ -397,7 +398,7 @@
 #define SK_IS_YUKON(sc) \
     ((sc)->sk_type >= SK_YUKON && (sc)->sk_type <= SK_YUKON_LP)
 #define SK_IS_YUKON2(sc) \
-    ((sc)->sk_type >= SK_YUKON_XL && (sc)->sk_type <= SK_YUKON_FE)
+    ((sc)->sk_type >= SK_YUKON_XL && (sc)->sk_type <= SK_YUKON_FE_P)

 /* Known revisions in SK_CONFIG */
 #define SK_YUKON_LITE_REV_A0	0x0 /* invented, see test in skc_attach */

the NIC is configured, but not functional - no byte enters the cable.


>How-To-Repeat:

	Install NetBSD on an NC10, find there is no ethernet interface.


>Fix:

	Port the relevant bits from the FreeVSD driver, I guess?

>Release-Note:

>Audit-Trail:
From: "Christos Zoulas" <christos@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/49270 CVS commit: src/sys/dev/pci
Date: Fri, 10 Oct 2014 10:23:06 -0400

 Module Name:	src
 Committed By:	christos
 Date:		Fri Oct 10 14:23:06 UTC 2014

 Modified Files:
 	src/sys/dev/pci: if_msk.c if_skreg.h

 Log Message:
 PR/49270: Hauke Fath: Samsung NC10 Marvell Yukon ethernet not supported


 To generate a diff of this commit:
 cvs rdiff -u -r1.46 -r1.47 src/sys/dev/pci/if_msk.c
 cvs rdiff -u -r1.14 -r1.15 src/sys/dev/pci/if_skreg.h

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: Hauke Fath <hf@spg.tu-darmstadt.de>
To: gnats-bugs@NetBSD.org
Cc: kern-bug-people@NetBSD.org, gnats-admin@NetBSD.org
Subject: Re: kern/49270: Samsung NC10 Marvell Yukon ethernet not supported
Date: Tue, 28 Oct 2014 17:15:41 +0100

 Coming across a few round tuits, I have looked at the openbsd msk(4) 
 code some, which the netbsd msk(4) driver was forked from. Both openbsd 
 and freebsd kernels recognize and fully support the NC10's Marvell NIC.

 I first worked from the openbsd if_msk.c HEAD, and found a lot of 
 unrelated changes (both gratuitous and not) on both sides, so I ended 
 up diffing the forked version and the version they claim supports the 
 yukon2 fe+.

 Unfortunately, all that changed is dhcpcd(8) started flapping the 
 interface. No byte reached the switch. Since I am not really familiar 
 with if_msk*, nor with ethernet drivers in general, this is where I'll 
 drop the ball:

 <https://www2.spg.tu-darmstadt.de/~hf/netbsd/kern-49270.tgz>

 has the diffs, the changed netbsd files, and a debug messages file.

 HTH,
 hauke


 (see also kern/42417)

From: Hauke Fath <hf@spg.tu-darmstadt.de>
To: gnats-bugs@netbsd.org
Cc: kern-bug-people@netbsd.org, gnats-admin@netbsd.org,
        Hauke Fath <hauke@Espresso.Rhein-Neckar.DE>
Subject: Re: kern/49270: Samsung NC10 Marvell Yukon ethernet not supported
Date: Tue, 28 Oct 2014 17:43:41 +0100

 On Tue, 28 Oct 2014 16:25:01 +0000 (UTC), Hauke Fath wrote:
 >  <https://www2.spg.tu-darmstadt.de/~hf/netbsd/kern-49270.tgz>
 >  
 >  has the diffs, the changed netbsd files, and a debug messages file.

 Diffs and logs from -current. Here, msk0 was (ip4) configured manually, 
 not through dhcpcd.

 FTR.

Responsible-Changed-From-To: kern-bug-people->jdolecek
Responsible-Changed-By: jdolecek@NetBSD.org
Responsible-Changed-When: Sat, 16 Jun 2018 16:22:33 +0000
Responsible-Changed-Why:
Claim, I'm looking on the PHY part as part of kern/53301.


From: "Jaromir Dolecek" <jdolecek@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/49270 CVS commit: src/sys/dev/mii
Date: Sat, 16 Jun 2018 17:44:53 +0000

 Module Name:	src
 Committed By:	jdolecek
 Date:		Sat Jun 16 17:44:53 UTC 2018

 Modified Files:
 	src/sys/dev/mii: makphy.c
 Added Files:
 	src/sys/dev/mii: e1000phyreg.h
 Removed Files:
 	src/sys/dev/mii: makphyreg.h

 Log Message:
 switch to using OpenBSD eehpy(4) code to drive maphy(4), synchronizing support
 for several special PHY conditions, particularly:
 - Properly re-initialise the PHY upon resume
 - Store next page in the Link Partner Next Page register for compatibility
   with 802.3ab on 88E3016 PHYs.  Fixes some autonegotiation problems on msk(4)
 - Make 88E3016 actually work
 - Make sure page 0 is selected when we initialize the PHY.  Fixes problems
   with the eephy(4) that attaches to nfe(4) on machines like the Sun Ultra 40.
   (we had condition for this, now the page 0 is selected for any PHY type)
 - Disable fiber/copper auto-selection on the 88E1111 if it is in RGMII mode, to
   work around the fact that the onboard PHYs attached to nfe(4) on the Sun
   X4100 M2 have fiber/copper auto-selection enabled even though the interfaces
   are clearly copper-only

 make sure to also add appropriate licenses, since basically nothing
 really significant remains out of previous code

 use FreeBSD <dev/mii/e1000reg.h> for register definitions as a base instead
 of OpenBSD <dev/mii/eephyreg.h>, since it has some extra definitions for some
 3016 bits, but add the several extra bits from OpenBSD needed by the code;
 removed no longed used <dev/mii/makphyreg.h>

 tested with PHY 88E1111, there no particular change observed - the
 link status works as it did before, just now it does media nego
 even before the interface is up

 should however fix 88E3016 support and hence PR kern/49270 and PR kern/53301


 To generate a diff of this commit:
 cvs rdiff -u -r0 -r1.1 src/sys/dev/mii/e1000phyreg.h
 cvs rdiff -u -r1.43 -r1.44 src/sys/dev/mii/makphy.c
 cvs rdiff -u -r1.6 -r0 src/sys/dev/mii/makphyreg.h

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->feedback
State-Changed-By: jdolecek@NetBSD.org
State-Changed-When: Sat, 16 Jun 2018 17:49:23 +0000
State-Changed-Why:
Can you please confirm if the makphy.c rev. 1.44 fixes this?


From: Hauke Fath <hauke@Espresso.Rhein-Neckar.DE>
To: gnats-bugs@NetBSD.org
Cc: jdolecek@NetBSD.org, gnats-admin@NetBSD.org, jdolecek@NetBSD.org
Subject: Re: kern/49270 (Samsung NC10 Marvell Yukon ethernet not supported)
Date: Sat, 16 Jun 2018 22:01:04 +0200

 On Sat, 16 Jun 2018 17:49:23 +0000 (UTC), jdolecek@NetBSD.org wrote:
 > Can you please confirm if the makphy.c rev. 1.44 fixes this?

 It does, the interface now works like a breeze!

 Only thing is I get a lot of 

 [ 196.5997671] msk0 jumbo allocation failed -- packet dropped!

 which may be because of building with

 options         MSK_DEBUG=1

State-Changed-From-To: feedback->closed
State-Changed-By: jdolecek@NetBSD.org
State-Changed-When: Sat, 16 Jun 2018 20:13:37 +0000
State-Changed-Why:
Confirmed fixed. Thanks for report.


From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/49270 CVS commit: [netbsd-8] src/sys/dev/mii
Date: Thu, 17 Jan 2019 17:23:03 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Thu Jan 17 17:23:03 UTC 2019

 Modified Files:
 	src/sys/dev/mii [netbsd-8]: makphy.c makphyreg.h miidevs

 Log Message:
 Pull up the following (requested by msaitoh in ticket #1164):

 	sys/dev/mii/miidevs			1.128, 1.132 (patch)
 	sys/dev/mii/makphy.c			1.43-1.51
 	sys/dev/mii/makphyreg.h 		1.7-1.9

 - miidevs: Add E1000 with model id 0x0006, it exists according to
   OpenBSD rename E1000 model 0x0000 to E1000_0 for consistency.
 - Match 88E1112, 88E1118, 88E1512, 88E3082 and G65G.
 - Match 88E3016 and add some 88E3016 specific code. Fixes part of
   PR kern/49270 and PR kern/53301.
 - Make sure page 0 is selected when we initialize the PHY. Fixes
   problems with the eephy(4) that attaches to nfe(4) on machines like
   the Sun Ultra 40. (we had condition for this, now the page 0 is
   selected for any PHY type)
 - If autonegotiation is not enabled, we need a software reset for the
   settings to take effect in makphy_service().
 - Don't set PSCR_CRS_ON_TX on newer. Those chips have no this bit.
 - Control BMCR_PDOWN for IFM_NONE. Some chips still don't work as
   expected. It would be required to modify PSCR and/or other register.
 - Set mii_media_active correctly on non-autonego mode.
 - Remove obsolete comment.
 - Whitespace fix.


 To generate a diff of this commit:
 cvs rdiff -u -r1.42 -r1.42.8.1 src/sys/dev/mii/makphy.c
 cvs rdiff -u -r1.6 -r1.6.20.1 src/sys/dev/mii/makphyreg.h
 cvs rdiff -u -r1.125.6.3 -r1.125.6.4 src/sys/dev/mii/miidevs

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.43 2018/01/16 07:36:43 maya Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2017 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.