summaryrefslogtreecommitdiffstats
path: root/sys/dev/pccbb
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2008-08-09 15:55:10 +0000
committerimp <imp@FreeBSD.org>2008-08-09 15:55:10 +0000
commitf29ac4f3c5a4e3953fb279c177e4894b30f4dbee (patch)
treecc2f86493a2840699ab415e4c8b0b5f90b8d98ce /sys/dev/pccbb
parent9db87c45ee3f1cbf9c8e2fb5e4d6623eee8956e0 (diff)
downloadFreeBSD-src-f29ac4f3c5a4e3953fb279c177e4894b30f4dbee.zip
FreeBSD-src-f29ac4f3c5a4e3953fb279c177e4894b30f4dbee.tar.gz
It turns out that checking the first DWORD register is more reliable
on a variety of cards. Adjust the comments accordingly to match the code. Even if the vendor chose 0xffff for the device ID, the vendor ID can't be 0xffff, so the test is still valid from a standards perspective.
Diffstat (limited to 'sys/dev/pccbb')
-rw-r--r--sys/dev/pccbb/pccbb.c32
1 files changed, 17 insertions, 15 deletions
diff --git a/sys/dev/pccbb/pccbb.c b/sys/dev/pccbb/pccbb.c
index cfbbfba..4cf0cb7 100644
--- a/sys/dev/pccbb/pccbb.c
+++ b/sys/dev/pccbb/pccbb.c
@@ -946,19 +946,21 @@ cbb_cardbus_reset(device_t brdev, int on)
*/
if (on && CBB_CARD_PRESENT(cbb_get(sc, CBB_SOCKET_STATE))) {
/*
- * After clearing reset, wait up to 1.1s for the vendor of
- * device 0.0 to become != 0xffff. The PCMCIA PC Card Host
- * System Specification says that when powering up the card,
- * the PCI Spec v2.1 must be followed. In PCI spec v2.2 Table
- * 4-6, Trhfa (Reset High to first Config Access) is at most
- * 2^25 clocks, or just over 1s. Secont 2.2.1 states any card
- * not ready to participate in bus transactions must tristate
- * its outputs. Therefore, any access to its configuration
- * registers must be ignored. In that state, the vendor will
- * read 0xffff. Section 6.2.1 states a vendor id of 0xffff is
- * invalid, so this can never match a real card. Print a
- * warning if it never returns a real id. The PCMCIA PC Card
- * Electrical Spec Section 5.2.7.1 implies only device 0.
+ * After clearing reset, wait up to 1.1s for the first
+ * configuration register (vendor/product) configuration
+ * register of device 0.0 to become != 0xffffffff. The PCMCIA
+ * PC Card Host System Specification says that when powering
+ * up the card, the PCI Spec v2.1 must be followed. In PCI
+ * spec v2.2 Table 4-6, Trhfa (Reset High to first Config
+ * Access) is at most 2^25 clocks, or just over 1s. Secont
+ * 2.2.1 states any card not ready to participate in bus
+ * transactions must tristate its outputs. Therefore, any
+ * access to its configuration registers must be ignored. In
+ * that state, the config reg will read 0xffffffff. Section
+ * 6.2.1 states a vendor id of 0xffff is invalid, so this can
+ * never match a real card. Print a warning if it never
+ * returns a real id. The PCMCIA PC Card Electrical Spec
+ * Section 5.2.7.1 implies only device 0.
*/
PCI_MASK_CONFIG(brdev, CBBR_BRIDGECTRL,
&~CBBM_BRIDGECTRL_RESET, 2);
@@ -966,8 +968,8 @@ cbb_cardbus_reset(device_t brdev, int on)
count = 1100 / 20;
do {
pause("cbbP4", hz * 2 / 100);
- } while (PCIB_READ_CONFIG(brdev, b, 0, 0, PCIR_DEVVENDOR, 2) ==
- 0xfffful && --count >= 0);
+ } while (PCIB_READ_CONFIG(brdev, b, 0, 0, PCIR_DEVVENDOR, 4) ==
+ 0xfffffffful && --count >= 0);
if (count < 0)
device_printf(brdev, "Warning: Bus reset timeout\n");
}
OpenPOWER on IntegriCloud