summaryrefslogtreecommitdiffstats
path: root/sys/dev/pccbb
Commit message (Collapse)AuthorAgeFilesLines
* It turns out that it is easier to not NULL out pccard and cardbusimp2007-02-151-14/+6
| | | | | | | | device pointers. They don't change as the children device drivers come and go. Rather, check to see if the device is attached where we would have checked ! NULL. This solves many asymmetries in the code that likely could lead to crashes when loading/unloading cbb without one or more of the expected children's driver not present.
* Fix three bugs:imp2007-02-151-6/+25
| | | | | | | | | | o When detaching all children, try really hard to get all the children list before giving up. This is based on an observation by hans petter selasky in his usb p4 branch. o When rescanning devices after a driver is added, abort if we can't get the child list with a message. o when rescanning devices, if the reprobe/attach is successful, save the device for cardbus/pccard.
* Batch of changes:imp2006-08-123-61/+112
| | | | | | | | | | | | | | | | | | | o when turning off the socket for a 16-bit card, write 0 to INTR register rather than just tying to just clear the rest bit. this seems to fix card insert detection after an eject on TI bridges (ricoh bridges work either way, apparently). This is a MFp4. o Cope better with TOPIC95 bridges on powerup. According to NetBSD driver, these bridges don't set POWER_STATE, so cope accordingly in our power code. They also need a little extra time to settle, so do that as well. o It appears that we need to turn on/off one of the clocks to the card when we power up/down that socket on a TOPIC97, also from NetBSD. o TOPIC97 bridges need to specifically enable LV card support. Unconditionally do this in the hopes that all laptops that have these chips support LV voltages (they should, since they are required for CardBus). o TOPIC register name regularization. Registers specific to models of TOPIC are now called out as such. # I need a machine with a TOPIC95 for testing.
* We don't have a ISA specific shutdown routine at this time, so removeimp2006-06-031-1/+0
| | | | | | it. We just moved it to be pci specific, so this was causing compile problems (linking problems, so I didn't notice since I unwisely just built the module).
* Since we turn off the interrupts, we don't need to disestablishimp2006-06-031-13/+0
| | | | our ISR.
* Move shutdown, and pci specific methods into pccbb_pci.c. Many moreimp2006-06-033-74/+67
| | | | are needed still.
* The interrupt routine is pci specific. Move it into pccbb_pci.c.imp2006-06-032-70/+71
|
* Fix a couple printf's to be properly terminated.imp2006-06-031-3/+3
| | | | Use a better name for the cbb thread.
* Succeed for writing bus value... nobody that calls must care :-(imp2006-06-031-1/+1
|
* Zero out the devices when they are deleted. We can access the pointer afterimp2006-06-021-1/+5
| | | | the bus detaches which can lead to core dumps. This is quite rare.
* Export the pribus, secbus and subbus as sysctls for informationimp2006-05-242-20/+31
| | | | purposes only. Additional information may be exported in the future.
* Suspend the children before we turn off card events in hardware. Thisimp2006-05-241-2/+4
| | | | | | | | was done, I believe, to work around some cards having issues in the suspend case. I think that this helped my Sony VAIO TS505 work better when it had certain wireless cards in it and I did a apm -z. I've not tested suspend/resume on other laptops in a long time, so I hope this doesn't cause greif. Please let me know if it does.
* Fix a race when detaching the cbb worker thread. There were a coupleimp2006-05-241-1/+7
| | | | | | of cases where we didn't take out the lock before setting or clearing a bit. This apparently can lead to a race at kldunload time (at least on my Turion64 laptop, never saw it on my Sony Vaio).
* Whitespace nitsimp2006-05-231-3/+3
|
* Since DELAY() was moved, most <machine/clock.h> #includes have beenphk2006-05-162-2/+0
| | | | unnecessary.
* Add missing ~. We want all the INVALID bits to be 0... Let's see if thisimp2006-04-161-1/+1
| | | | helps people with their interrupt storm problem on card eject.
* On some laptops, under very high loads, the socket event register readimp2006-03-301-2/+13
| | | | | | | | | | | | in the ISR doesn't read the actual socket event register, but instead reads garbage (usually 0xffffffff, but other times other things). This totally violates the PCI spec, but happens rarely enough that a workaround is in order. This adds one test when we have a real interrupt to service (which is very rare), and doesn't affect the usualy 'nothing to see here' case at all. Problem reported by many, but sam@ gave me this workaround after diagnosing the problem.
* Add a mask of valid socket eventsimp2006-03-301-19/+20
| | | | While I'm hear, fix define<sp> to be define<tab>.
* For each of the voltages that a card might support, make sure that theimp2006-03-241-4/+4
| | | | | | | | | | socket also supports the voltage. Some XV cards have appeared on the scene (or cards that report they support XV), and in older machines that have sockets that do not support XV, we were bogusly trying to power them at XV rather than at 3.3V. Now, power up the card at the lowest voltage supported by both the card and the socket. MFC After: 3 days
* Detach the children before we delete them. This is a little cleanerimp2006-02-071-10/+18
| | | | | | than just deleting them. Also add comments about why we do this. Given the current behavior of delete_child, I don't think this changes anything. It just feels cleaner.
* Now that TUNABLE_ULONG is in the tree, and has been for a while, use it.imp2006-02-041-3/+3
| | | | This also avoids typepunning.
* Remove extra debugging that crept in with the integration from p4.imp2005-12-311-1/+1
|
* Simplify the opening of the resources for cardbus cards. Before we'dimp2005-12-291-102/+53
| | | | | | | | | | | | try very hard to be perfect. However, these attempts broke down when there were large numbers of resources. We'd not be able to map them all. Instead, accept that we might pass more range to thse subbus than might be optimal be able to compute. However, there's little harm in this and it allows us to pass greater resources through. # it has been suggested that we allocate a fixed amount of resources # on attach and give it out upon request. This might not be a bad idea...
* Ensure that we're aligned at leas tto the size of the resource being requested.imp2005-12-271-0/+21
| | | | When cbb_debug is on, print the windows that we're mapping.
* nitsimp2005-12-271-1/+1
|
* Mollify the whitespace policeimp2005-11-081-27/+27
|
* Shutdown a little better by commenting the shutdown code and acknowledgingimp2005-10-291-4/+9
| | | | any interrupts after we turn off the interrupt mask.
* Shut down the card bus bridge hardware on detach. Before we'd justimp2005-10-291-6/+14
| | | | | | free the resoruces w/o actually turning off the interrupts. This lead to interrupt storms if you were to insert a card after kldunloading the driver.
* Make sure we set bst and bsh in the softc.imp2005-10-191-0/+2
| | | | | This gets us probing, but not attaching to, ISA cards. More work needed since the ISA attach routine is return ENXIO right now :-)
* Merge in WIP from p4 for supporting ISA pccard bridges conforming toimp2005-10-141-17/+43
| | | | | | | | | | | the ExCA spec, and close cousins: o Write an activate routine that works. o merge a couple of items from oldcard before they are lost o write a deactivate routine I suspect we're still a ways away from having this work, but maybe for 6.1/5.5?
* MFP4: More removal of unused stuff.imp2005-10-082-2/+0
|
* MFP4: Changes to hopefully make the new power code work betterimp2005-10-081-3/+3
| | | | | | | | | | | | | | o Rather than just try to turn off EXCA_INTR_RESET, set the entire register to 0. This is slightly faster, and a better hammer. o Move attempted clearing of the output enable (EXCA_PWRCTL_OE) back to after we turn off the power. Modify it to write 0 so that we don't get Bad Vcc messages on TI bridges (untested, but ru@ sent me a similar patch) while at the same time avoiding interrupt storms on Ricoh bridges (tested by me on my Sony). # Many of my observations of 'breakage' for this patch are due to some bug # in the load/unload of cbb.ko unlreated to this change. I'll be investigating # and fixing that bug in the fullness of time.
* MFP4: We no longer use intr_handlers, so remove it.imp2005-10-082-4/+0
|
* MFP4: Note why we do the dance we do for waiting for the thread to die.imp2005-10-081-0/+8
|
* Fix bad compile. Pointy hat to: impimp2005-09-292-2/+2
|
* o Add a bunch of o2micro controller IDsimp2005-09-292-2/+13
| | | | | o Add SMC34C90 to list as well, since I've found enough more data about it since my original research to know it is appropriate for this driver.
* I added the device IDs to the header, but not to the table. Add themimp2005-09-291-0/+9
| | | | | | to the table. MFC After: 3 days
* 'PC Card' instead of other variantsimp2005-09-221-3/+3
|
* This appears to be good for some folks, but really bad for others.imp2005-09-121-1/+0
| | | | Until we know why, back out 1.127.
* Minor improvement for the suspend case for Ricoh based (and others)imp2005-09-081-0/+1
| | | | CardBus bridges.
* o The ricoh bridge needs us to turn off the function interrupts forimp2005-07-171-12/+22
| | | | | | | | | | | | | | | | | 16-bit cards when we're powering them up. Other bridges may have similar issues, so we do this for all of them by setting the interrupt in the PCIC register 3 to be 0 (done always anyway) and turning on the bit in the bridge control register to route these interrupts via the ISA bus (or via the interrupt configured in the PCIC register 3). '0' means disable completely. There's a small chance this may interfere with the o2micro power hacks, but I'll wait for reports to come in from o2micro users. o Expand some of the comments about why we do certain things. # this gets rid of the interrupt storm warnings on my 505TS. I think # that we may need to do something similar on suspend, but I'm unsure # since I don't have a laptop that supports suspened/resume with a # ricoh chipset in it.
* Rename a bit to make it clearer that it enables routing of the functionimp2005-07-172-2/+2
| | | | interrupts to the ISA bus.
* The CD interrupt should only be enabled after we've initialized theimp2005-07-171-10/+38
| | | | | | | | | | | | | | card. Mask it while we're doing power things, as the PC Card standard suggests. Also, poll the POWER_CYCLE bit 10x a second as well as providing a timeout for power cycle interrupt to happen. The Ricoh '475 that I have doesn't seem to generate an interrupt for power at the present time, so the polling is necessary for reasons as yet unknown. This results in an interrupt storm warning that I'm still trying to quantify (the o2micro trick doesn't work to mitigate this storm). At the very least, this should help those users that lost pccards on boot with the prior rev of this code. My VAIO PCG-505TS is now happier, but more investigation is necessary.
* s/_us//imp2005-07-151-1/+1
|
* Move to using tsleeps in the cardbus reset case as well. Thisimp2005-07-151-3/+7
| | | | eliminates the last of the DELAYs in pccbb.
* Omnibus power and interrupt fixes:imp2005-07-143-48/+76
| | | | | | | | | | | | | | | | | | | o Don't busy wait on powerup. Instead, use the power up interrupt to wait for the card to power up. Don't wait when we're turning the card off, since no interrupt happens in that case. o Convert many of the long DELAYs to tsleeps. We do not run before the timer have stared, so DELAY isn't necessary. More DELAYs can likely be eliminated in the future. o When powering up the card, don't do anything if the card is already powered up (before we'd power cycle it). This means that for most cards we power them up once and then never change the power. o On card eject, mask (by clearing) the CD bit. Before we set it, which was wrong. We don't want to see any CD events past the first one since they need to be debounced. With these changes, I can insert/eject 16bit cards without glitching xmms' sound output. Something very important to the development of better pccard drivers :-)
* Not yet ready to burn this, so unmark power stuff.... non-type 0 busses ↵imp2005-06-061-4/+0
| | | | still need to do this
* Since cbb implements the pcib_ interface, it must also implement theimp2005-04-131-0/+10
| | | | | | | | pcib_route_interrupt interface. Since there's only one interrupt pin in the CardBus form factor, everybody gets to share it. Implement cbb_route_interrupt to return the interrupt we have. Suggested by: bms
* Use BUS_PROBE_DEFAULT for pci probe return valueimp2005-03-051-6/+3
|
* Use the standard FreeBSD license for these files.imp2005-01-134-28/+22
| | | | Approved by: imp, jon
OpenPOWER on IntegriCloud