aboutsummaryrefslogtreecommitdiff
path: root/sys/pccard
Commit message (Collapse)AuthorAgeFilesLines
...
* Patric Gualat tells me that I can't do basic bit math. He's right.Warner Losh2001-09-051-4/+4
| | | | | | | | | | | When either bit 3 or 4 is set, we need to *SET* bit 5, not clear it in the card control register. This makes TI PCI-1030, 1130 and 1131 not work anymore without this fix. MFC: soon Notes: svn path=/head/; revision=83118
* Don't report power interrupts.Warner Losh2001-09-041-2/+0
| | | | Notes: svn path=/head/; revision=83010
* MFS: put debug writes behind boot verbose.Warner Losh2001-09-041-7/+16
| | | | Notes: svn path=/head/; revision=83009
* Make the csc and function interrupts ISA on shutdown. This shouldWarner Losh2001-09-041-1/+13
| | | | | | | | | | help with the hanging problem on reboot. Note: we need to do the other things as well. Also, turn off the bits in the stat change interrupt mask and the cardbus interrupt mask as well in an attempt to shut off all interrupt sources. Notes: svn path=/head/; revision=82997
* Kill init_t type, and minor white space changes to match original -stable ↵Warner Losh2001-09-041-4/+1
| | | | | | | version Notes: svn path=/head/; revision=82932
* Add support for changing the way that ToPIC csc interrupts are routed.Warner Losh2001-09-042-4/+42
| | | | | | | | | | | | # Note: The ToPIC 100 and the ToPIC 97 datasheets are in disagreement # as to if this bit is supposed to be set or cleared to enable INTA routing # so I made my best guess. Also, comments about the various chipsets, including some grumpy ones about how vague the O2micro datasheets are. Notes: svn path=/head/; revision=82931
* Move to using a chip function + function pointers to deal with theWarner Losh2001-09-045-159/+634
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | function and csc interrupt routing path (eg, ISA or PCI) so that we can more easily switch between the two. When we don't have a card ISR, put the function interrupt into ISA mode. This effectively masks the interrupt since it happens once, and not again until we have an ISR. This should help hangs, and might help people that unwisely update the kernel w/o updating pccardd. This is done at mapirq time. Force CL-PD6729/30 to use ISA interrupt routing and maybe even detect the number of pccard slots properly (this is still WIP). We aren't going to support PCI interrupts for this release. A future release should support them, however. Shibata-san's 3.3V fixes are not included. Add a hack which should, in i386, rewrite IRQ 0 cardbus bridges to be IRQ 255, which should cause interrupts to be routed. This is mostly untested since my one tester disappeared after reporting nothing changed. Implement, but do not use, a power method called cardbus. It looked like a great way to get around the 3.3V problem, but it seems that you can only use it to power cardbus cards (I get no CIS when I enable it, so maybe we're programming things bogusly). GC the intr and argp stuff from the slot database. Improve the ToPIC support with the power hacks that Nakagawa-san published in FreeBSD Press and that Hiroyuki Aizu-san ported to -stable. The ToPIC hacks were for 3.3V support in ToPIC 100, but it looks like the '97 also has identical registers, so use them too. Add some #defines for the cardbus power stuff. Finally implement making CSC on the Ricoh chips ISA or PCI. This will allow polling mode to work on vaios, I think. Add some minor debugging. This should likely be cleaned up or put behing a bootverbose. Some of this work, and earlier work, was influanced by Chiharu Shibata-san's power handing patches posted to bsd-nomads:15866. MFC: Soon, if possible. Notes: svn path=/head/; revision=82928
* Values for the Toshiba ToPIC's Function Control Register.Warner Losh2001-09-041-0/+6
| | | | | | | | These were lifted from Nakagawa-san's article in FreeBSD Press, as well as posts from hiroyuki Aizo-san and Chiharu Shibata-san. Notes: svn path=/head/; revision=82921
* Add recognition for ToPIC95BWarner Losh2001-09-031-0/+3
| | | | Notes: svn path=/head/; revision=82858
* Add names for the TI PCI-1210, TI PCI-4410 and TI PCI-4450 parts. I hadWarner Losh2001-08-301-0/+9
| | | | | | | this for a while, and don't know how it didn't make it into the tree. Notes: svn path=/head/; revision=82605
* Note the status of the card, so we don't print inserted lines twice onWarner Losh2001-08-291-0/+3
| | | | | | | boot. Notes: svn path=/head/; revision=82507
* Fix typo in my last commitWarner Losh2001-08-271-1/+1
| | | | Notes: svn path=/head/; revision=82423
* CL-PD6729 and CLPD-6730 chips (the only ones with I/O bars in the pciWarner Losh2001-08-271-5/+4
| | | | | | | | | | | config space that I'm aware of) work. I'm committing this from such a machine. Remove warning about I/O based bridges. Warn users that the PCI routing of interrupts still doesn't work for these cards. Notes: svn path=/head/; revision=82386
* A number of fixes for the TI-1130 and ISA interrupt routing cases:Warner Losh2001-08-271-13/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | o For TI PCI-1130, you need to set bit 5 of register 91 if you want ANY pci interrupts. Then set bits 3 and/or 4 as appropriate. This will fix those people with 1030, 1130 and 1131 in their machines trying to do PCI interrupts. o Fix case where we were trying to automatically fail back to ISA interrupt routing. We were dereferencing a NULL pointer. This was true of ANY chipset. o The bus_setup_intr method needs to be pcic_setup_intr so that "FAST" interrupts fail on PCI case (modems act flakey if we don't force them to fall back to normal interrupts). Also needed so that the proper ISA IRQ can be set in the ExCA register. This fixes the people whose ISA routing was failing[*]. o When we find a generic yenta/pccard bridge, go ahead and print its vendor ID in boot verbose. Machine with theses symptoms and a serial console by: jedgar [*] Looks like my pc98 machine has some interrupt source on IRQ 15 that gave about 30 interrupts per second, which masked this problem on my PC-9821Nr15. Notes: svn path=/head/; revision=82380
* Stop dereferencing 'r' unconditionally. Maybe it is NULL when ISAWarner Losh2001-08-261-6/+5
| | | | | | | mode and using polling mode. Notes: svn path=/head/; revision=82337
* Fix last second typoWarner Losh2001-08-251-1/+1
| | | | Notes: svn path=/head/; revision=82332
* Back out the isa/pci string reporting. It may cause panics.Warner Losh2001-08-251-17/+2
| | | | Notes: svn path=/head/; revision=82331
* The tunable is hw.pcic.irq, but the hw.pcic.override_irq was how it wasWarner Losh2001-08-251-2/+1
| | | | | | | reported in sysctl. Notes: svn path=/head/; revision=82330
* Fix cut-and-paste-o that Nate found. We were setting csc_route twice,Warner Losh2001-08-251-1/+1
| | | | | | | | rather than setting it once and setting func_route when we can't route PCI interrupts. Notes: svn path=/head/; revision=82329
* First cut at getting the ISA routing working. If we can't route a PCIWarner Losh2001-08-251-31/+57
| | | | | | | | | | | | | | interrupt for the CSC interrupt, then we revert to ISA. If we didn't have an interrupt set up with hw.pcic.irq, then do polling. Also, don't complain about ignoring function 1 for any devices except pcic devices. This would normally only show up if someone set hw.pcic.ignore_function_1=1. MFC: as soon as I can test it on some troublesome laptops. Notes: svn path=/head/; revision=82316
* Explain what we're doing in pcic_pci_shutdown a little better. Try toWarner Losh2001-08-241-5/+16
| | | | | | | | | | | | | | | explain the subtle side effects that are going to happen and why we go ahead and ack the interrupt source. This stuff is tricky to get right. Also, emperical tests have shown that doing a shutdown in attach to be ineffectual, so remove it from there. Analysis of the code paths shows that nearly identical writes to these registers happen in later parts of the code. The hanging problem on thinkpads when we change the interrupt routing type is something else. Notes: svn path=/head/; revision=82282
* Move code to shutdown the pcic_pci_shutdown. Call it on systemWarner Losh2001-08-241-13/+25
| | | | | | | | | | | | | | | | shutdown and also before we get going with the device initialization. This may fix the hangs some people are seeing on warmboot. It appears that some machines will reset the cardbus bridge on boot, while others don't. So we turn off the card, and ack the interrupts (which likely is a nop in the shutdown case since we're still fielding interrupts). This should turn off the interrupts. Since I don't have hardware that hangs on reboot, I'm committing this without testing that aspect of the patch (it causes no harm on my Dell). Notes: svn path=/head/; revision=82260
* Two fixes. First, put into place a more generic chipset specificWarner Losh2001-08-241-94/+123
| | | | | | | | | | | initialization structure. Warn the user for those chipsets that aren't yet customized that they might not work. Second, try to power off the slot on attach and ack the interrupts. I don't know, but this might solve the hangs that people will see on Thinkpads if they set hw.pcic.init_routing=1. Notes: svn path=/head/; revision=82259
* Report the interrupt path via the sysctl to userland as a string.Warner Losh2001-08-211-4/+18
| | | | | | | Submitted by: green Notes: svn path=/head/; revision=82099
* Rearrange how we do interrupt routing tweaking. We now haveWarner Losh2001-08-214-34/+45
| | | | | | | | hw.pcic.intr_path {1,2} 1 == ISA, 2 == PCI hw.pcic.init_route Force TI chipset initializations in edge case. Notes: svn path=/head/; revision=82093
* It looks like we're doing the wrong thing by catching the setup_intrWarner Losh2001-08-211-41/+2
| | | | | | | | | | | | | | | | | | | | | request and just calling it when we get a bridge interrupt. The problem is that if other code wants to block hardware interrupts for a little bit with splXXX, those masks aren't updated the way we're doing it. This doesn't matter for -current, but does for -stable. The whole reason that we were catching interrupts was to detect that the card was still there. Ian's fixes however ensure that the card will be there with an interrupt handler, or not there at all. Since the pcic interrupt is at a high priority, this should be OK. This should fix the network related crashes people started seeing in stable after I merged the pcic as a pci device code. Submitted indirectly by: Ian Dowse MFC when: Ian has had a chance to do his torture hang testing. Notes: svn path=/head/; revision=82083
* These appear to be necessary for a pci cardbus card, but not for laptops.Warner Losh2001-08-211-0/+2
| | | | | | | | | | | Ifdef them out until I figure out the right way to configure this. This solves Nate's hangs as well as Anders Andersson's. MCF: Soon. Notes: svn path=/head/; revision=82032
* Improve interlocking for card removal. We now can remove the card inWarner Losh2001-08-193-28/+60
| | | | | | | | | | | | the ISR. We keep track of the card state and don't call the IRS when the card isn't inserted. This helps quite a bit with card ejection problems that Ian was seeing. Submitted by: Ian Dowse MFC upon: re approvel. Notes: svn path=/head/; revision=81909
* There is no tcic driver, so no need to list it here.Warner Losh2001-08-151-1/+0
| | | | Notes: svn path=/head/; revision=81680
* Merge from stable (which seems to have been spammed at some point in current):Warner Losh2001-08-142-3/+12
| | | | | | | | #ifdef the deltap pcic_set_memory_offset argument so that raylink driver works. Notes: svn path=/head/; revision=81653
* Implement PIOCSRESOURCE for mecia like we do for pcic.Warner Losh2001-08-141-1/+37
| | | | Notes: svn path=/head/; revision=81652
* Minor style(9) nits to make code more readableWarner Losh2001-08-141-4/+3
| | | | Notes: svn path=/head/; revision=81650
* Treat min,max of 0,0 for IRQ special. Reject it if we didn't specificallyWarner Losh2001-08-141-3/+26
| | | | | | | | | | | assing an IRQ. Add better comments while I'm here. MFC after: 1 day # Note: That's merging all the -current pci pcic code, not just this one # change for the Aug 15th code freeze. Notes: svn path=/head/; revision=81641
* For TI12xx and newer, clear register 0x84. This is the "Multimedia"Warner Losh2001-08-142-15/+37
| | | | | | | | | | | | | register. It enables Zoom Video. It appears that on at least one card that Monzoon is using sets these bits by default. Nothing works when these bits are set, everything works when they are clear. Add commentary on some of the ti bits. Make code a little clearer. Also remove a call to pcic_pci_pd6729 which was prematurely added in the last commit. Notes: svn path=/head/; revision=81621
* Try to support the Cirrus Logic PD6833 better in pci mode. This isWarner Losh2001-08-142-18/+42
| | | | | | | | | | done from the datasheets since I'm ahving problems with my laptop that has the 6833 in it... Minor rework of TI code. Should be the same as before. Notes: svn path=/head/; revision=81617
* Move ISA interrupt ISR and timeout routines to pcic from pcic_isa soWarner Losh2001-08-103-75/+73
| | | | | | | | that we can use them in the pci code when we have to fall back to ISA interrupt routing. Notes: svn path=/head/; revision=81396
* Type sanity: use uintptr_t * for read_ivar and u_int8_t instead of u_charWarner Losh2001-08-102-3/+3
| | | | Notes: svn path=/head/; revision=81395
* Rearrange the pcic_irq_type enum (and specifically tag the first oneWarner Losh2001-08-101-1/+1
| | | | | | | as being 1) in anticipation of documentation. Notes: svn path=/head/; revision=81394
* Now that we are setting a bit in the PCIC_INT_GEN (0x3) register, weWarner Losh2001-08-051-2/+2
| | | | | | | | | | | | | | can't blindly write zero into it to disable the card. We must preserve this bit. This changes pcic_disable to only clear the bits we know we need to clear on card disable, thus preserving the magic bit for many TI bridges. This appears to have fixed the problems that people are reporting about the system failing to recognize cards being inserted or removed (or both). Greg: This may fix your problem too :-). Notes: svn path=/head/; revision=81153
* Order PCIC_INT_GEN bits large to small, like all other registers.Warner Losh2001-08-051-1/+1
| | | | Notes: svn path=/head/; revision=81152
* TI cardbus bridges, 12xx and newer, have an interesting register. ItWarner Losh2001-08-014-10/+58
| | | | | | | | | | | | | | | | | | is the diagnostics register at offset 0x93. When bit 5 is set in this register, bits 4-7 in ExCA register 0x5 being 0000 are required for pci interrupt routing. When it is clear, then bit 4 of ExCA register 0x3 is used to enable it. The only other issue is that when you route interrupts this way, you must read ExCA register 0x4 in order to clear the interrupt, else you get an interrupt storm. Deal with this requirement by setting things up. It is believed that this won't hurt other chipsets, but other chipsets may require their own work arounds. Notes: svn path=/head/; revision=80941
* bsh and bst are unused in softc, except for setting them. We do use theWarner Losh2001-07-312-6/+4
| | | | | | | bsh and bst in the pcic_slot structures. Notes: svn path=/head/; revision=80738
* Fix typo where I assigned the bus tag and not the bus handled. ItWarner Losh2001-07-311-1/+1
| | | | | | | | | appears that this may be unused, but I'll keep it for the moment. Noticed by: Shizuka Kudo <shizukakudo_99@yahoo.com> Notes: svn path=/head/; revision=80734
* A bunch of interrupt related cleanup.Warner Losh2001-07-313-67/+98
| | | | | | | | | | | | | | | | o Move PIOCSRESOURCE from pccard to pcic so the kernel can give pccardd better hints as to what resources to use. o Implement an undocumented hw.pcic.interrupt_route to allow people that need to do so to route their interrupts in a non-standard way. o Only preallocate a resource in probe if we're routing via pci. o If we aren't routing via pci, then set the irq to use explicitly to defeat the automatic IRQ routing of the pci layer. This, with the pccardd code should be close to what can be committed to -stable. Notes: svn path=/head/; revision=80713
* Move pcic_override_irq from pcic_isa, to pcic.Warner Losh2001-07-313-9/+8
| | | | Notes: svn path=/head/; revision=80712
* Add CLPD6832_BCR_ISA_IRQ definition for ISA routing of interrupts.Warner Losh2001-07-311-3/+3
| | | | | | | Minor commentary tweaking. Notes: svn path=/head/; revision=80711
* Don't use a buffer for the state info from the TI chips. Just printWarner Losh2001-07-301-14/+13
| | | | | | | | it directly. Also, minor style(9) nits near one or two of these sites. Notes: svn path=/head/; revision=80599
* When booted -v (eg bootverbose is non-zero), have pccard report whatWarner Losh2001-07-301-0/+7
| | | | | | | | | | | | resources it is attempting to assign to a child object. This should help people track down mysterious resource allocation problems more easily. # Unfortunately, it is harder to do the conflict check and report which # resource failed if the driver itself doesn't. Notes: svn path=/head/; revision=80570
* #ifdef some 5.0 code with freebsd_version to reduce diffs with stable.Warner Losh2001-07-281-3/+16
| | | | Notes: svn path=/head/; revision=80471
* It is spelled INTR_FAST in current and INTR_TYPE_FAST in stable, so try toWarner Losh2001-07-281-1/+4
| | | | | | | make allowances. Notes: svn path=/head/; revision=80470