Commit Graph

115 Commits

Author SHA1 Message Date
jmcneill fac3e15af3 Fix typo. 2005-01-27 03:03:33 +00:00
jmcneill 7f3681fe2b Don't restore PCI configuration state if the chip isn't in D0, from
Kentaro A. Kurahone.
2005-01-27 02:58:52 +00:00
jmcneill 27d1abf7f8 Capture PCI configuration state on suspend and restore it on resume, from
Kentaro A. Kurahone.
2005-01-27 02:44:59 +00:00
mycroft ea0b1cb353 Just to be absolutely correct, wait an additional 1ms after the "power cycle"
event, to cover the RESET Width (Tw (RESET)).
2005-01-16 08:56:29 +00:00
mycroft b0345c674e Christos's crappy Libretto 100CT has an extremely long ramp for socket Vcc
(violating the PC Card spec), so... use the "power cycle" socket event to
determine when we've reached Vcc before proceeding, rather than using a fixed
amount of time.  This has the double advantage that it makes the card attach
time even shorter on sane systems -- the minimum is now ~38ms on my i8500
rather than 222ms.

Probably a similar change should be made to pcic, but it was hard enough
figuring out whether it would work with pccbb.  The chip specs suck.

For now, I'm leaving in a couple of additional printf()s in the hope that I
will get some interesting data from them.
2005-01-16 08:51:55 +00:00
mrg 2db238d57d fix a wrong variable name in a debug message. 2004-08-16 16:43:29 +00:00
mycroft 5111abd827 Simplify some manipulation of PCIC_INTR.
Further attempt to mitigate "bad Vcc" errors.
2004-08-16 15:46:37 +00:00
mycroft f0b8d692af Some tweaks, per the PC Card spec:
* Assert RESET before powering off a socket.
* Turn on the output enable bit earlier so the interface actually drives CEn
  and RESET.
* Tighten up the power-on timing a bit.
* Mention the specific timing values named in the spec.

For pccbb, be careful to always power off before zeroing PWRCTL.
2004-08-16 15:40:35 +00:00
mycroft 4ff9d12ea9 Do not attempt to fiddle with the power-control bits in PWRCTL; just read them
back after touching the PCI registers.

This shouldn't be necessary, but somehow the controller detects the need for
VPP2=12V and automatically applies it, and gives us a "bad Vcc" error if we
turn it off accidentally.
2004-08-16 14:48:56 +00:00
mycroft a6f02be621 And the reason we had to call pccbb_power() twice in the enable routine is...
we were writing to PCIC_PWRCTL in between and causing the socket to power off.
D'oh.
2004-08-15 20:19:14 +00:00
mycroft 306522b970 I can't actually use the FORCE register this way. Just try turning the socket
power off.
2004-08-12 13:42:17 +00:00
mycroft 6b8a90b3fe A bunch of random cleanup:
* Like the i82365 code, add a "delay" function that uses tsleep() to wait, and
  use this in the socket enable/disable paths.  This gets rid of the annoying
  system pauses during card insertion and removal.  (There are still some
  issues related to this in various drivers -- notably big delay()s in wi and
  xi.)
* Move the power-change delay out of pccbb_power() and into the PCMCIA backend
  code -- specifically, once in the disable path and once in the enable path.
  We were being pretty schizo about this before.  Make these use tsleep().
  (Note: This should be safe because card insertion/removal is handled by a
  kernel process, not in an interrupt handler.  It works for me with
  DIAGNOSTIC.)
* If we get a "bad Vcc" error, attempt to force the socket to power off, and
  return an error.  If we don't do this, we will get "bad Vcc" errors forever
  and never be able to use another card without rebooting, which is dumb.
  XXX I haven't been able to test this very well, because it doesn't fail for
  me in the first place.  :-)
* Clean up the socket mappings earlier in the enable path.
* Try to be consistent about clearing PWRCTL (which contains OE) before turning
  off power.
2004-08-12 07:15:49 +00:00
mycroft 33ee9cbce7 Oops; fix a compile error. 2004-08-11 01:05:42 +00:00
mycroft 51be90e8ac Be more liberal in torching the old state in the disable and settype routines. 2004-08-11 01:04:40 +00:00
mycroft a23e15bcbe Rather than having a call up from the low-level driver to get the card type,
instead have a call down from the PCMCIA mid-layer to set it.  Use this from
pcmcia_function_enable().  (Currently the policy is the same, but this would
allow for more flexibility in deciding which mode to use.)

Now it is safe to hold the socket enabled during attach, so do that.  Only
one enable/disable cycle to attach a card now!
2004-08-11 00:18:18 +00:00
mycroft a84492326e Rework the power sequencing so that I stop getting unrecoverable "bad Vcc"
errors with PCMCIA cards.

I've been using this change for almost a year, but accidentally blew it away
recently, and boy did that suck.
2004-08-06 21:39:47 +00:00
he 20304167d0 Add entries for TI CardBus bridges 1520 and 4520Yenta, as found in
IBM ThinkPad 40p and 41p respectively, so that the CardBus probes and
works on those machines.  Fixes PR#26380.
2004-07-28 15:32:49 +00:00
mycroft 1925108989 If the bus number has not been initialized, do not attach a cardslot, and
output a diagnostic:
pccbbN: secondary bus number uninitialized; try PCIBIOS_BUS_FIXUP
2004-07-22 16:39:51 +00:00
itojun 6123043789 pass string length (= boundary info) to pci_devinfo so that we do not run over
the end of memory region
2004-04-23 21:13:05 +00:00
nakayama 3e7562330f Add some initialization code for TI bridges.
Mostly from FreeBSD, and tested on i386 w/ PCI1250 and sparc64 w/ PCI1410.
2004-03-28 09:49:31 +00:00
christos 778502d669 More unsigned long casts to make this work on ppc. Fix formatting of debug
statements to 0x when there are hex numbers printed.
2003-12-19 19:00:00 +00:00
christos 0ad7f14d46 PR/23802: KIYOHARA Takashi: Bad printf format with CBB_DEBUG. While I am
there, make all printfs consistent 0x%lx and (unsigned long) cast.
2003-12-19 18:16:43 +00:00
briggs 3c06a40b83 Power up the card without OE enabled to avoid letting SanDisks enter
True IDE mode.  Hinted at by Charles Hannum a while back.  This lets
my PCI-Cardbus adapter read SanDisk CF cards much more reliably.

Also bring in a few defines from FreeBSD for some more TI registers and such.
2003-12-10 02:55:48 +00:00
christos 125ccd91b1 Fix uninitialized variable warnings 2003-10-25 18:29:12 +00:00
briggs 3448998b43 Try to deal better with card removal during the card enabling process. 2003-10-23 00:04:03 +00:00
msaitoh 6e3f4b59e8 regard as the card is removed if one of CCD1# and CCD2# is deasserted.
This fixes the porblem that the cbb misses a remove event.
2003-06-19 10:48:58 +00:00
thorpej 452a8fdae2 Rename IPL_IMP -> IPL_VM. 2003-06-16 20:00:56 +00:00
nakayama a8e1b2f5c5 PCI-CardBus bridge support for sparc64:
- add pccbb_attach_hook in pccbbattach for MD initializations.
- omit arithmetics to bus_space_handle_t.
- remove use of IST_LEVEL; not defined on sparc64 and unused.
2003-03-22 06:25:14 +00:00
simonb d9220af5c4 Remove unreachable "break"s after "return"s. 2003-01-20 02:29:56 +00:00
thorpej 72a7af27b0 Use aprint_normal() in cfprint routines. 2003-01-01 00:10:15 +00:00
tsutsui 238efe4697 Replace magic numbers for power management control with PCI_PMCSR* macros.
XXX Should we use pci_get_powerstate() and pci_set_powerstate() in pci.c?
2002-12-23 02:58:36 +00:00
martin f5b121503a Add TI PCI4410 PCI-CardBus Bridge w/ OHCI IEEE 1394,
from FUKAUMI Naoki in PR 18989.
2002-11-09 08:51:14 +00:00
atatat df90f09849 Don't print messages about pccbb_intr_disestablish() unless debugging
is actually enabled.
2002-10-19 18:01:59 +00:00
thorpej b75a007d9f Add trailing ; to CFATTACH_DECL. 2002-10-02 16:51:16 +00:00
onoe 25c18040cf make it compilable with CBB_DEBUG. 2002-10-01 14:30:54 +00:00
haya f7568c1e88 Use LIST in sys/queue. Add some comments. 2002-10-01 09:09:16 +00:00
thorpej 387fc6dc87 Use CFATTACH_DECL(). 2002-09-30 20:37:04 +00:00
thorpej f818766afe Declare all cfattach structures const. 2002-09-27 20:31:45 +00:00
mycroft 5ca56020c7 Patch the CLKRUN enable bit on ToPIC chips. 2002-05-31 13:34:03 +00:00
haya a7937db203 Add comment. 2002-05-31 09:54:52 +00:00
haya cff90ff521 Enforce 10-bit width for I/O addresses of 16-bit PC Cards when I/O
start address is assigned by a driver.
2002-03-05 11:56:33 +00:00
haya 1e4fff76f0 Bug fix: correct chattering suppressor. Card insertion will be
detected properly by this fix.
2002-01-10 10:30:08 +00:00
christos d3d8a33acf change if defined foo to ifdef foo and change a c++ comment into a c comment. 2001-12-24 09:41:34 +00:00
lukem 2565646230 don't need <sys/types.h> when including <sys/param.h> 2001-11-15 09:47:59 +00:00
lukem 9048aaae21 add RCSID 2001-11-13 07:48:40 +00:00
haya 2c903bf2c0 Add PCI power management control. If the power state of a bridge is
not D0 at device attaching or resuming, set the bridge D0 mode.
2001-11-02 03:32:33 +00:00
haya 5f75bfa4ba Move some chip initialise code into pccbb_chipinit() function. 2001-10-17 10:25:51 +00:00
yamt cf2debbc86 force 0x1000 align for memory base before
calling rbus_space_alloc().
resource management may be inconsistent without it.
2001-09-30 06:32:02 +00:00
haya 2228225e5c Add some register definitions for TI PCI12XX and Toshiba ToPIC.
Add ToPIC97 and ToPIC100 chip initialisation routine.
Add more TI PCI12XX chip initialisation.
2001-08-30 09:20:17 +00:00
haya 45e61b5399 Buf fix: use PWAIT priority and do not set PCATCH. 2001-08-24 10:55:53 +00:00