summaryrefslogtreecommitdiff
path: root/sys/pccard/pcicvar.h
Commit message (Collapse)AuthorAgeFilesLines
* I don't believe these are used at all, and can be safely removedWarner Losh2006-01-151-126/+0
| | | | Notes: svn path=/head/; revision=154392
* /* -> /*- for license, minor formatting changesWarner Losh2005-01-071-1/+1
| | | | Notes: svn path=/head/; revision=139825
* Add support for writing to mapping high memory for pccard memoryWarner Losh2002-07-201-0/+1
| | | | | | | | | | | | | windows. Right now we only support pci chips that are memory mapped. These are the most common bridges in use today and will help a large majority of the users. I/O mapped PCI chips support this functionality in a different way, as do some of the ISA bridges (but only when mounted on a motherboard). These chips are not supported by this change. Notes: svn path=/head/; revision=100417
* <jkh> "Hey Rocky, watch me eject this pccard outta my laptop!" "What,Warner Losh2001-09-131-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | again? That NEVER works!" "This time for sure!" Minor overhaul of how we do interrupts for the pci interrupt routing case to cope with card ejection better (read: make it not hand on so many cards): o Reintroduce func_intr and func_arg and use the to store the interrupt handler to call. o Create a pcic_pci_func_intr to call the real interrupt handler iff the card hasn't been ejected. o Remove some checks in pcic_setup_intr now that it is used exclusively for isa routed interrupts. o Defer the eject event until later too, but make sure we can't do any client driver ISR calling in the interrum. o Add some simple code to make sure that we don't attach more than one child. This should fix pccardd starting twice problem (ala single user -> multi-user when you started pccardd by hand in SU). MFC: after jkh thinks I've put the crack pipe away. Notes: svn path=/head/; revision=83397
* Move to using a chip function + function pointers to deal with theWarner Losh2001-09-041-8/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Rearrange how we do interrupt routing tweaking. We now haveWarner Losh2001-08-211-3/+3
| | | | | | | | 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
* Improve interlocking for card removal. We now can remove the card inWarner Losh2001-08-191-1/+3
| | | | | | | | | | | | 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
* Merge from stable (which seems to have been spammed at some point in current):Warner Losh2001-08-141-1/+5
| | | | | | | | #ifdef the deltap pcic_set_memory_offset argument so that raylink driver works. Notes: svn path=/head/; revision=81653
* Move ISA interrupt ISR and timeout routines to pcic from pcic_isa soWarner Losh2001-08-101-0/+3
| | | | | | | | 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-101-2/+2
| | | | 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
* bsh and bst are unused in softc, except for setting them. We do use theWarner Losh2001-07-311-2/+0
| | | | | | | bsh and bst in the pcic_slot structures. Notes: svn path=/head/; revision=80738
* Move pcic_override_irq from pcic_isa, to pcic.Warner Losh2001-07-311-0/+1
| | | | Notes: svn path=/head/; revision=80712
* Attempt to fix and document interactions between suspend/resume and pccardcWarner Losh2001-07-271-0/+1
| | | | | | | | | | | | | | | | | | | | | | | power x 0. pccardc power x 0 used to disable the slot. But a suspend/resume would reactivate the pccard. It no longer does that. Now the disabling of the slot is sticy until it is reset with power x 1 or the card is ejected. This seems closer to correct behavior to me. o Process all card state changes the same using pccard_do_stat_change(). o Cleanup disabling the card so that we can preserve the state after the change. Basically, don't set it to empty as often as we do. o On suspend, the new state is "empty" and the laststate is "suspend" o Document state machine with a diagram of states and edges. The edges are labeld to tell the reader what event causes the external state changes. o "machdep.pccard.pcic_resume_reset" may be obsolete now. We always call the bridge driver's resume method on resume now. Otherwise cards won't automatically show up. If it needs to stay, I'll add it back. Notes: svn path=/head/; revision=80438
* Some interrelated interrupt changes.Warner Losh2001-07-011-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Frist, for pci slots, make the setup intr save the requested interrupt vector and arg and return rather than passing it up to our parent. On interrupts, we call this vector iff there's a card in the slot. This should eliminate some of the hangs or "weird" messages that people see when ejecting cards and also help close the race window somewhat. Reading the pci bus one more time for this information is judged to be an acceptible tradeoff since it is very very fast. Cleanup a little how we detect unsupported cards. Only detect unsupported cards (eg cardbus cards) on card insertion (or more pedantically when a card is actually present). This should allow us to change the message in the future to "cardbus card not supported with OLDCARD" :-). Note: We may also consider this for the ISA bus case, but there the reads are much more expensive and the location of the CD pin status lines appears to be less standardized. Also, the ISA management interrupt isn't shared with the card's interrupt. The mutliplex the CSC and function interrupts bit also appears to be non-standard (or at least not imlemented on all bridges). Notes: svn path=/head/; revision=79060
* Move the pcic interrupt from pcic.c to pcic_isa.c. The ISA handlingWarner Losh2001-06-041-1/+3
| | | | | | | | | | | | | | | | | for card change interrupts is different than the pci stuff that's coming soon. Set the management irq in different ways. If pci_parallel interrutp routing, then use the PCI way of getting interrupts. Move polling mode into pcic_isa since when we're routing via pci polling doesn't work because many bridges (systems hang solid). If we're routing interrupts via pci, they can be shared, so flag them as such. Note, this doesn't actually change anything since the pci attachment isn't quite ready to be committed. Notes: svn path=/head/; revision=77673
* Turns out that one bit isn't enough. Introduce two new fieldsWarner Losh2001-05-281-14/+19
| | | | | | | | | | | | | | | | | csc_route and func_route to hold the way that each interrupt is routed. csc is Card Status Change in the datasheets and standard, but is called "Management Interrupt" in FreeBSDese. There are three types of interrupt routing: ISA parallel, PCI parallel and ISA serial (some chipsets support other types as well, but I don't plan on supporting them). When we try to allocate an interrupt, and the type for that interrupt is pci_parallel, allow it to be shared by oring in RF_SHAREABLE to the flags argument. Introduce pcic_alloc_resource to allow this to happen. Notes: svn path=/head/; revision=77293
* Allow a shareable interrupts. Note, the bridge must set this flag orWarner Losh2001-05-271-0/+1
| | | | | | | | | | | the irq will be unshareable, as things are now. More work likely is needed, but this is a good checkpoint. # pcic_pci.c is getting closer :-) Notes: svn path=/head/; revision=77256
* Migrate from unit based to dev base. Don't save unit number, but do saveWarner Losh2001-05-251-10/+12
| | | | | | | | dev. Convert all uses of unit to dev as appropriate. Minor comment fixes to pcic_softc definition. Notes: svn path=/head/; revision=77191
* Add intrack field to each slot. This can be used to acknowledgeWarner Losh2001-05-251-0/+1
| | | | | | | | | | interrupts on other buses. Right now it isn't used, but will be for the pci attachment. # Add copyright by me for this year since I've changed so much. Notes: svn path=/head/; revision=77159
* Use bus_space functions rather than inb/outb.Warner Losh2001-05-241-3/+2
| | | | | | | | | | Add defines for PCIC_INDEX and PCIC_DATA offsets. Change PCIC_INDEX_0 to PCIC_PORT_0 Add define for PCIC_NPORT. Document why the vadem probe works. Notes: svn path=/head/; revision=77113
* Move getb1 and putb1 from pcic_isa.c to pcic.c. Rename them toWarner Losh2001-05-241-0/+2
| | | | | | | | | pcic_{get,put}b_io. There are some pci bridges (the CL-PD6729 and maybe others) that do not have memory mapped registers, so we'll need these in both places. Declare them in pcicvar.h. Notes: svn path=/head/; revision=77109
* Add better support for the Ricoh 5C296 and 5C396 chips. These chipsWarner Losh2001-05-231-0/+1
| | | | | | | | | have a slightly different 3.3V support than the other clones, so compensate as best we can. Note: 3.3V support is untested since I do not have any 3.3V cards that I know of to test it with. Notes: svn path=/head/; revision=77022
* Move allocation of ExCA registers from the base driver into the busWarner Losh2001-05-211-7/+6
| | | | | | | attachment code. Notes: svn path=/head/; revision=76921
* Next step on the road to pci: power taming.Warner Losh2001-05-211-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Work through the various power commands and convert them from a "is this a foo controller or a foo' controller or a foo''' controller" to a cabability based scheme. We have bits in the softc that tell us what kind of power control scheme the controller uses, rather than relying on being able to enumerate them all. Cardbus bridges are numerous, but nearly all implement the i82365sl-DF scheme (well, a few implement cirrus CL-PD67xx, but those were made by Cirrus Logic!). Add a pointer back to the softc in each pcic_slot so we can access these flags. Add comments that talk about the issues here. Also note in passing that there are two differ Vpp schemes in use and that we may need to adjust the code to deal with both of them. Note why it usually works now. We have 5 power management modes right now: KING, AB, DF, PD and VG. AB is for the i82365 stpes A, B and C. DF is for step DF. PD is the cirrus logic extensions for 3.3V while VG is the VADEM extensions for 3.3V. KING is for the IBM KING controller found on some old cards. # I'm looking for one of those old cards or a laptop that has the KING # bridge in it. We have to still cheat and treat the AB parts like the DF parts because pci isn't here yet. As far as I can tell, this is harmless for actual old parts and necessary to work with 3.3V cards in some laptops. This almost eliminates all tests for controller in the code. There are still a few unrelated to power that need taming as well. Notes: svn path=/head/; revision=76918
* Next step towards pcic_pci: the ability to allocate mapped memory in attach.Warner Losh2001-05-211-0/+12
| | | | | | | | | | | | | | | | | | | | | | o Introduce flags word to the softc. This will be used to control various aspects of the driver. Right now there are two bits defined, PCIC_IO_MAPPED and PCIC_MEM_MAPPED. One for ISA cards that are I/O mapped, the other is for PCI cards that are memory mapped. Only the ISA side is implemented with this commit. o Introduce a pcic_dealloc which will cleanly dealloc resources used. Right now it is only supported when called from probe/attach. o Keep track of resources allocated in the pcic_softc. o move pcictimeout_ch to the softc so we can support multiple devices in polling mode. o In ISA probe, set PCIC_IO_MAPPED. o Introduce and compute the slot mask. This will be used later when we expand the number of slots on ISA from 2 to 4. In such a case, we appear to have to use polling mode otherwise we get two different cards trying to drive the same interrupt line. I don't have hardware to test this configuration, so I'll stop here. Notes: svn path=/head/; revision=76917
* Move ISA specific code into pcic_isa. This is the probe routine, theWarner Losh2001-05-191-2/+2
| | | | | | | | get/setb1 routines. Also expose clrb and setb as pcic_{clrb,setb} so we can use it from the probe. pcic_probe is no longer needed. Notes: svn path=/head/; revision=76833
* Separate out isa attachment to its own file. The pci attachment willWarner Losh2001-05-161-0/+68
soon attach directly to pcic rather than the kludge pci-pcic device we have now. In some ways, this is similar to the work PAO3 did to try to support cardbus bridges. In some ways different. This and future commits will be taking from the spirit of many of those changes. pcicvar.h is completely different from the pcicvar.h that appeared in PAO3, but similar in concept. Notes: svn path=/head/; revision=76669