From owner-freebsd-bugs Wed Aug 16 22:40: 9 2000 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id B71E337B99A for ; Wed, 16 Aug 2000 22:40:02 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id WAA81807; Wed, 16 Aug 2000 22:40:01 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from brahms.mmlab.cse.yzu.edu.tw (54.c189.ethome.net.tw [202.178.189.54]) by hub.freebsd.org (Postfix) with SMTP id C1DFA37B99A for ; Wed, 16 Aug 2000 22:39:50 -0700 (PDT) (envelope-from avatar@brahms.mmlab.cse.yzu.edu.tw) Received: (qmail 478 invoked by uid 1000); 17 Aug 2000 05:39:51 -0000 Message-Id: <20000817053951.477.qmail@brahms.mmlab.cse.yzu.edu.tw> Date: 17 Aug 2000 05:39:51 -0000 From: avatar@brahms.mmlab.cse.yzu.edu.tw Reply-To: avatar@brahms.mmlab.cse.yzu.edu.tw To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: kern/20670: No PC-CARD Slots; Device Not Configured Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >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: at device 10.0 on pci0 pcic-pci0: TI12XX PCI Config Reg: [speaker enable][FUNC pci int + CSC serial isa irq] pcic-pci1: at device 10.1 on pci0 pcic-pci1: TI12XX PCI Config Reg: [speaker enable][FUNC pci int + CSC serial isa irq] pcic0: at port 0x3e0-0x3e1 on isa0 pcic0: Polling mode pccard0: on pcic0 pccard1: 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