Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 31 Aug 2006 01:06:49 +0800
From:      LI Xin <delphij@delphij.net>
To:        freebsd-current@freebsd.org
Subject:   bge(4) on BCM 5752 A02 panic due to media autoselect
Message-ID:  <44F5C5A9.30605@delphij.net>

next in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enig5E2B94627565C3050F2C49E6
Content-Type: multipart/mixed; boundary="------------030809030602070801010603"

This is a multi-part message in MIME format.
--------------030809030602070801010603
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Hi, folks,

Recently one of my colleagues found that BCM 5752 A02 on Dell Latitude
D820 would get "panic: invalid ife->ifm_data (0xa) in mii_phy_setmedia".
 After some investigation I have found that removing BCMR_ANEG from
mii_capabilities in ukphy.c would work around the problem, and it turns
out that without explicitly specifying media type, the code will finally
get to pass the "intentionally invalid index" to mii_phy_setmedia and
trigger an assertion fail.

I have not tested the situation in -STABLE yet, but it was said to work
there, though.  Is there anyone can shed some light to me about how to
debug the issue?  Thanks in advance!

PS. During the debugging I have found that the attached patch can make
"bge0: firmware handshake timeout" issue disappear from the said chip.
Because I do not have Broadcom specification at hand I would like to see
if there is someone to give appropriate review for it.

Cheers,
--=20
Xin LI <delphij@delphij.net>	http://www.delphij.net/
FreeBSD - The Power to Serve!

--------------030809030602070801010603
Content-Type: text/plain; x-mac-type="0"; x-mac-creator="0";
	name="patch-bge-firmware-handshake-timeout"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline;
 filename="patch-bge-firmware-handshake-timeout"

Index: if_bge.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /home/ncvs/src/sys/dev/bge/if_bge.c,v
retrieving revision 1.140
diff -u -r1.140 if_bge.c
--- if_bge.c	24 Aug 2006 14:41:16 -0000	1.140
+++ if_bge.c	29 Aug 2006 06:20:44 -0000
@@ -2313,6 +2313,13 @@
 	    BGE_PCIMISCCTL_INDIRECT_ACCESS|BGE_PCIMISCCTL_MASK_PCI_INTR|
 	BGE_HIF_SWAP_OPTIONS|BGE_PCIMISCCTL_PCISTATE_RW, 4);
=20
+	/* XXX: Broadcom Linux driver. */
+	if (sc->bge_asicrev =3D=3D BGE_ASICREV_BCM5752 ||
+	    sc->bge_asicrev =3D=3D BGE_ASICREV_BCM5755 ||
+	    sc->bge_asicrev =3D=3D BGE_ASICREV_BCM5787) {
+		CSR_WRITE_4(sc, BGE_FASTBOOT_PC, 0x0);
+	}
+
 	reset =3D BGE_MISCCFG_RESET_CORE_CLOCKS|(65<<1);
=20
 	/* XXX: Broadcom Linux driver. */
Index: if_bgereg.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /home/ncvs/src/sys/dev/bge/if_bgereg.h,v
retrieving revision 1.52
diff -u -r1.52 if_bgereg.h
--- if_bgereg.h	23 Aug 2006 11:32:54 -0000	1.52
+++ if_bgereg.h	29 Aug 2006 06:32:31 -0000
@@ -1656,6 +1656,7 @@
 #define BGE_EE_CTL			0x6840
 #define BGE_MDI_CTL			0x6844
 #define BGE_EE_DELAY			0x6848
+#define BGE_FASTBOOT_PC			0x6894
=20
 /* Mode control register */
 #define BGE_MODECTL_INT_SNDCOAL_ONLY	0x00000001

--------------030809030602070801010603--

--------------enig5E2B94627565C3050F2C49E6
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFE9cWqOfuToMruuMARAxZ8AKCMS1hedr7ya6EVVBKtxMo9jkBumgCfQv8r
gg3dbtr027q5nWVMgHbgEFw=
=IGaD
-----END PGP SIGNATURE-----

--------------enig5E2B94627565C3050F2C49E6--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?44F5C5A9.30605>