[tulip] PATCH tulip PHY reset/init
Grant Grundler
grundler@dsl2.external.hp.com
Mon Oct 14 21:03:01 2002
I've tested commited this patch into the parisc linux tree.
(See http://cvs.parisc-linux.org/)
Will this break other non-HP tulip cards?
Or do all the PHYs support a "reset/ready" bit?
thanks,
grant
------- Forwarded Message
Return-Path: parisc-linux-cvs-admin@lists.parisc-linux.org
Delivery-Date: Mon Oct 14 18:26:04 2002
Return-Path: <parisc-linux-cvs-admin@lists.parisc-linux.org>
Delivered-To: grundler@parisc-linux.org
Received: from dsl2.external.hp.com (localhost [127.0.0.1])
by dsl2.external.hp.com (Postfix) with ESMTP
id 9BBA94839; Mon, 14 Oct 2002 18:26:04 -0600 (MDT)
Delivered-To: parisc-linux-cvs@lists.parisc-linux.org
Received: from dsl2.external.hp.com (localhost [127.0.0.1])
by dsl2.external.hp.com (Postfix) with ESMTP id A428F4829
for <parisc-linux-cvs@lists.parisc-linux.org>; Mon, 14 Oct 2002 18:25:13 -0600 (MDT)
To: parisc-linux-cvs@lists.parisc-linux.org
In-Reply-To: Message from grundler@dsl2.external.hp.com (Grant Grundler)
of "Mon, 14 Oct 2002 18:13:44 MDT." <20021015001344.8B0804829@dsl2.external.hp.com>
References: <20021015001344.8B0804829@dsl2.external.hp.com>
From: Grant Grundler <grundler@dsl2.external.hp.com>
Message-Id: <20021015002513.A428F4829@dsl2.external.hp.com>
Subject: [parisc-linux-cvs] PATCH tulip PHY reset/init
Sender: parisc-linux-cvs-admin@lists.parisc-linux.org
Errors-To: parisc-linux-cvs-admin@lists.parisc-linux.org
X-BeenThere: parisc-linux-cvs@lists.parisc-linux.org
X-Mailman-Version: 2.0.11
Precedence: bulk
List-Help: <mailto:parisc-linux-cvs-request@lists.parisc-linux.org?subject=help>
List-Post: <mailto:parisc-linux-cvs@lists.parisc-linux.org>
List-Subscribe: <http://lists.parisc-linux.org/mailman/listinfo/parisc-linux-cvs>,
<mailto:parisc-linux-cvs-request@lists.parisc-linux.org?subject=subscribe>
List-Id: parisc-linux cvs messages <parisc-linux-cvs.lists.parisc-linux.org>
List-Unsubscribe: <http://lists.parisc-linux.org/mailman/listinfo/parisc-linux-cvs>,
<mailto:parisc-linux-cvs-request@lists.parisc-linux.org?subject=unsubscribe>
List-Archive: <http://lists.parisc-linux.org/pipermail/parisc-linux-cvs/>
Date: Mon, 14 Oct 2002 18:25:13 -0600
Grant Grundler wrote:
> Log message:
> 2.5.41-pa1 fix tulip PHY reset/init ( ~= 2.4.19-pa22)
>
> DP83840A.pdf and lxt971d.pdf both require polling the reset bit
> (bit 15) in mdio control register to determine when a reset has
> completed. Then the "init" sequence can be sent.
>
> Don't know if all other PHY's are compatible with this or not.
> HP only used the above two PHY's.
The 2.5 diff is appended.
It should also apply (with fuzz) to kernel.org 2.4.19 tree.
2.4.18-pa22 diff is equivalent but deleted crud I had previously added.
Patch tested on C3000, A500-4X, A500-5X, and A500-6X.
grant
Index: Makefile
===================================================================
RCS file: /var/cvs/linux-2.5/Makefile,v
retrieving revision 1.8
diff -u -p -r1.8 Makefile
- --- Makefile 8 Oct 2002 22:45:56 -0000 1.8
+++ Makefile 15 Oct 2002 00:04:07 -0000
@@ -1,7 +1,7 @@
VERSION = 2
PATCHLEVEL = 5
SUBLEVEL = 41
- -EXTRAVERSION = -pa0
+EXTRAVERSION = -pa1
# *DOCUMENTATION*
# Too see a list of typical targets execute "make help"
Index: drivers/net/tulip/media.c
===================================================================
RCS file: /var/cvs/linux-2.5/drivers/net/tulip/media.c,v
retrieving revision 1.2
diff -u -p -r1.2 media.c
- --- drivers/net/tulip/media.c 18 Jul 2002 16:15:58 -0000 1.2
+++ drivers/net/tulip/media.c 15 Oct 2002 00:04:07 -0000
@@ -271,13 +271,27 @@ void tulip_select_media(struct net_devic
int reset_length = p[2 + init_length];
misc_info = (u16*)(reset_sequence + reset_length);
if (startup) {
+ int timeout = 20; /* 2 ms */
outl(mtable->csr12dir | 0x100, ioaddr + CSR12);
for (i = 0; i < reset_length; i++)
outl(reset_sequence[i], ioaddr + CSR12);
+
+ /* flush posted writes */
+ inl(ioaddr + CSR12);
+ /* Sect 3.10.3 in DP83840A.pdf (p39) */
+ udelay(500);
+
+ /* Section 4.2 in DP83840A.pdf (p43) */
+ while (timeout-- &&
+ (tulip_mdio_read (dev, phy_num, MII_BMCR) & BMCR_RESET))
+ udelay(100);
}
for (i = 0; i < init_length; i++)
outl(init_sequence[i], ioaddr + CSR12);
+
+ inl(ioaddr + CSR12); /* flush posted writes */
}
+
tmp_info = get_u16(&misc_info[1]);
if (tmp_info)
tp->advertising[phy_num] = tmp_info | 1;
_______________________________________________
parisc-linux-cvs mailing list
parisc-linux-cvs@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux-cvs
------- End of Forwarded Message