Date: 17 Aug 2000 05:39:51 -0000 From: avatar@brahms.mmlab.cse.yzu.edu.tw To: FreeBSD-gnats-submit@freebsd.org Subject: kern/20670: No PC-CARD Slots; Device Not Configured<Synopsis of the problem (one line)> Message-ID: <20000817053951.477.qmail@brahms.mmlab.cse.yzu.edu.tw>
next in thread | raw e-mail | index | archive | help
>Number: 20670
>Category: kern
>Synopsis: No PC-CARD Slots; Device Not Configured
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: change-request
>Submitter-Id: current-users
>Arrival-Date: Wed Aug 16 22:40:01 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator: Tai-hwa Liang
>Release: FreeBSD 4.1-RELEASE i386
>Organization:
Multimedia Laboratory at Yuan Ze University
>Environment:
FreeBSD 4.1-RELEASE i386
pcic-pci0: <TI PCI-1221 PCI-CardBus Bridge> at device 10.0 on pci0
pcic-pci0: TI12XX PCI Config Reg: [speaker enable][FUNC pci int + CSC serial isa irq]
pcic-pci1: <TI PCI-1221 PCI-CardBus Bridge> at device 10.1 on pci0
pcic-pci1: TI12XX PCI Config Reg: [speaker enable][FUNC pci int + CSC serial isa irq]
pcic0: <VLSI 82C146> at port 0x3e0-0x3e1 on isa0
pcic0: Polling mode
pccard0: <PC Card bus -- kludge version> on pcic0
pccard1: <PC Card bus -- kludge version> on pcic0
>Description:
The PCMCIA card attached on TI-1221 pcic device wouldn't be probed(No
PC-CARD Slots) after returned from Windoze 98.
>How-To-Repeat:
Boot the system into Windoze 98 first, then reboot to FreeBSD.
>Fix:
Following patch was modified from Warner Losh's post on -mobile
(200003150741.AAA81106@harmony.village.org), and was tested on
TI-1221 pcic device with 4.1-RELEASE installed box.
--- pcic_p.c Thu Aug 17 13:26:54 2000
+++ /sys/pci/pcic_p.c Tue Aug 8 14:01:51 2000
@@ -183,6 +183,59 @@
device_printf(dev, "%s\n",buf);
}
+/*
+ * According to the docs for the TI chipset, this will work with any YENTA
+ * conforming card bus bridge.
+ */
+static void
+ti12xx_legacy_init(device_t self)
+{
+ u_long bcr; /* to set interrupts */
+ u_short io_port; /* the io_port to map this slot on */
+
+ /*
+ * First, just to be "safe", we muck with the power registers
+ * to put the chip into D0 power state. But read the power
+ * management capabilities register first and only do it for
+ * version 1 cards.
+ */
+ if ((pci_read_config(self, 0xa2, 2) & 0x7) == 0x1) {
+ pci_write_config(self, 0xa4,
+ pci_read_config(self, 0xa4, 2) & ~0x3, 2);
+ }
+
+ /*
+ * Only set legecay mode on first card. This will have
+ * functions 0 and 1 and will probe as units 0 and 1.
+ */
+ if (device_get_unit(self) > 1)
+ return;
+
+ /*
+ * Set legacy I/O address to 0x3e0. Only need to do this
+ * for first function/unit.
+ */
+ if (device_get_unit(self) != 0) {
+ io_port = PCIC_INDEX_0;
+ pci_write_config(self, CLPD6832_LEGACY_16BIT_IOADDR,
+ io_port & ~PCI_MAP_IO, 4);
+ }
+
+ /*
+ * Set default operating mode (I/O port space, Parity error enable
+ * and busmaster).
+ */
+ pci_write_config(self, PCI_COMMAND_STATUS_REG,
+ pci_read_config(self, PCI_COMMAND_STATUS_REG, 2) | 0x47, 2);
+
+ /*
+ * Enable isa-style IRQ interrupts.
+ */
+ bcr = pci_read_config(self, 0x3e, 2);
+ bcr |= 0x84;
+ pci_write_config(self, 0x3e, bcr, 2);
+}
+
static void
generic_cardbus_attach(device_t dev)
{
@@ -333,14 +386,15 @@
pci_write_config(dev, PCI_COMMAND_STATUS_REG, command, 4);
switch (device_id) {
- case PCI_DEVICE_ID_PCIC_TI1130:
- case PCI_DEVICE_ID_PCIC_TI1131:
case PCI_DEVICE_ID_PCIC_TI1220:
case PCI_DEVICE_ID_PCIC_TI1221:
case PCI_DEVICE_ID_PCIC_TI1250:
case PCI_DEVICE_ID_PCIC_TI1251:
case PCI_DEVICE_ID_PCIC_TI1251B:
case PCI_DEVICE_ID_PCIC_TI1225:
+ ti12xx_legacy_init(dev);
+ case PCI_DEVICE_ID_PCIC_TI1130:
+ case PCI_DEVICE_ID_PCIC_TI1131:
case PCI_DEVICE_ID_PCIC_TI1410:
case PCI_DEVICE_ID_PCIC_TI1420:
case PCI_DEVICE_ID_PCIC_TI1450:
>Release-Note:
>Audit-Trail:
>Unformatted:
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000817053951.477.qmail>
