kern/52980: [patch] dc(4) driver fails to init Intel 21143 Cardbus
NIC
David Burns
david.burns at dugeem.net
Fri Jun 6 02:50:18 PDT 2003
The following reply was made to PR kern/52980; it has been noted by GNATS.
From: David Burns <david.burns at dugeem.net>
To: freebsd-gnats-submit at FreeBSD.org, david.burns at dugeem.net
Cc:
Subject: Re: kern/52980: [patch] dc(4) driver fails to init Intel 21143 Cardbus
NIC
Date: Fri, 06 Jun 2003 19:43:00 +1000
This is a multi-part message in MIME format.
--------------090801070000020202080409
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
---- /var/log/messages extract ----
[...]
Jun 4 00:19:52 kernel: cbb0: <TI1131 PCI-CardBus Bridge> mem
0xcc000-0xccfff at device 4.0 on pci0
Jun 4 00:19:52 kernel: cardbus0: <CardBus bus> on cbb0
Jun 4 00:19:52 kernel: pccard0: <16-bit PCCard bus> on cbb0
Jun 4 00:19:52 kernel: pci_cfgintr: 0:4 INTA routed to irq 11
Jun 4 00:19:52 kernel: cbb1: <TI1131 PCI-CardBus Bridge> mem
0xcd000-0xcdfff at device 4.1 on pci0
Jun 4 00:19:52 kernel: cardbus1: <CardBus bus> on cbb1
Jun 4 00:19:52 kernel: pccard1: <16-bit PCCard bus> on cbb1
Jun 4 00:19:52 kernel: pci_cfgintr: 0:4 INTB routed to irq 11
[...]
Jun 4 00:19:52 kernel: dc0: <Intel 21143 10/100BaseTX> port
0x1000-0x107f mem 0x88000000-0x8800007f irq 11 at device 0.0 on cardbus0
Jun 4 00:19:52 kernel: dc0: Ethernet address: 00:00:00:00:00:00
Jun 4 00:19:52 kernel: miibus0: <MII bus> on dc0
Jun 4 00:19:52 kernel: dcphy0: <Intel 21143 NWAY media interface> on
miibus0
Jun 4 00:19:52 kernel: dcphy0: 10baseT, 10baseT-FDX, 100baseTX,
100baseTX-FDX, auto
[...]
--- end extract ----
--------------090801070000020202080409
Content-Type: text/plain;
name="if_dcreg.h-diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="if_dcreg.h-diff"
--- if_dcreg.h-v1.32 Wed Jun 4 16:59:16 2003
+++ if_dcreg.h Thu Jun 5 22:12:50 2003
@@ -78,6 +78,8 @@
#define DC_TYPE_PNIC 0xA /* 82c168/82c169 PNIC I */
#define DC_TYPE_XIRCOM 0xB /* Xircom X3201 */
#define DC_TYPE_CONEXANT 0xC /* Conexant LANfinity RS7112 */
+#define DC_TYPE_21143_CB 0xD /* Intel 21143 Cardbus */
+ /* eg Xircom CBE 10/100 */
#define DC_IS_MACRONIX(x) \
(x->dc_type == DC_TYPE_98713 || \
@@ -88,7 +90,10 @@
(x->dc_type == DC_TYPE_AL981 || \
x->dc_type == DC_TYPE_AN985)
-#define DC_IS_INTEL(x) (x->dc_type == DC_TYPE_21143)
+#define DC_IS_INTEL(x) \
+ (x->dc_type == DC_TYPE_21143 || \
+ x->dc_type == DC_TYPE_21143_CB)
+
#define DC_IS_ASIX(x) (x->dc_type == DC_TYPE_ASIX)
#define DC_IS_COMET(x) (x->dc_type == DC_TYPE_AL981)
#define DC_IS_CENTAUR(x) (x->dc_type == DC_TYPE_AN985)
@@ -97,6 +102,7 @@
#define DC_IS_PNIC(x) (x->dc_type == DC_TYPE_PNIC)
#define DC_IS_XIRCOM(x) (x->dc_type == DC_TYPE_XIRCOM)
#define DC_IS_CONEXANT(x) (x->dc_type == DC_TYPE_CONEXANT)
+#define DC_IS_INTEL_CB(x) (x->dc_type == DC_TYPE_21143_CB)
/* MII/symbol mode port types */
#define DC_PMODE_MII 0x1
--------------090801070000020202080409
Content-Type: text/plain;
name="if_dc.c-diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="if_dc.c-diff"
--- if_dc.c-v1.108 Wed Jun 4 16:59:01 2003
+++ if_dc.c Thu Jun 5 23:38:32 2003
@@ -1984,7 +1984,10 @@
switch(sc->dc_info->dc_did) {
case DC_DEVICEID_21143:
- sc->dc_type = DC_TYPE_21143;
+ if (!pci_read_config(dev, DC_PCI_CCIS, 4))
+ sc->dc_type = DC_TYPE_21143;
+ else
+ sc->dc_type = DC_TYPE_21143_CB;
sc->dc_flags |= DC_TX_POLL|DC_TX_USE_TX_INTR;
sc->dc_flags |= DC_REDUCED_MII_POLL;
/* Save EEPROM contents so we can parse them later. */
@@ -2161,6 +2164,7 @@
case DC_TYPE_CONEXANT:
bcopy(sc->dc_srom + DC_CONEXANT_EE_NODEADDR, &eaddr, 6);
break;
+ case DC_TYPE_21143_CB:
case DC_TYPE_XIRCOM:
/* The MAC comes from the CIS */
mac = pci_get_ether(dev);
@@ -2240,7 +2244,8 @@
* LEDs, and twiddling these bits has adverse effects
* on them. (I.e. you suddenly can't get a link.)
*/
- if (pci_read_config(dev, DC_PCI_CSID, 4) != 0x80281033)
+ if (!DC_IS_INTEL_CB(sc) &&
+ pci_read_config(dev, DC_PCI_CSID, 4) != 0x80281033)
sc->dc_flags |= DC_TULIP_LEDS;
error = 0;
}
@@ -2250,15 +2255,17 @@
goto fail;
}
- if (DC_IS_XIRCOM(sc)) {
+ if (DC_IS_INTEL_CB(sc) || DC_IS_XIRCOM(sc)) {
/*
* setup General Purpose Port mode and data so the tulip
* can talk to the MII.
+ * Also enable the activity LED
*/
- CSR_WRITE_4(sc, DC_SIAGP, DC_SIAGP_WRITE_EN | DC_SIAGP_INT1_EN |
+ CSR_WRITE_4(sc, DC_SIAGP, DC_SIAGP_WRITE_EN | DC_SIAGP_INT1_EN | DC_SIAGP_LED1 |
DC_SIAGP_MD_GP2_OUTPUT | DC_SIAGP_MD_GP0_OUTPUT);
DELAY(10);
CSR_WRITE_4(sc, DC_SIAGP, DC_SIAGP_INT1_EN |
+ DC_SIAGP_LED1 |
DC_SIAGP_MD_GP2_OUTPUT | DC_SIAGP_MD_GP0_OUTPUT);
DELAY(10);
}
@@ -3390,15 +3397,18 @@
DC_SETBIT(sc, DC_MX_MAGICPACKET, DC_MX_MAGIC_98715);
}
- if (DC_IS_XIRCOM(sc)) {
+ if (DC_IS_INTEL_CB(sc) || DC_IS_XIRCOM(sc)) {
/*
* setup General Purpose Port mode and data so the tulip
* can talk to the MII.
+ * Also enable the activity LED
*/
CSR_WRITE_4(sc, DC_SIAGP, DC_SIAGP_WRITE_EN | DC_SIAGP_INT1_EN |
+ DC_SIAGP_LED1 |
DC_SIAGP_MD_GP2_OUTPUT | DC_SIAGP_MD_GP0_OUTPUT);
DELAY(10);
CSR_WRITE_4(sc, DC_SIAGP, DC_SIAGP_INT1_EN |
+ DC_SIAGP_LED1 |
DC_SIAGP_MD_GP2_OUTPUT | DC_SIAGP_MD_GP0_OUTPUT);
DELAY(10);
}
--------------090801070000020202080409--
More information about the freebsd-bugs
mailing list