Commit Graph

406 Commits

Author SHA1 Message Date
Bruce Evans
039b360dac Garbage collect options AVM_A1_PCI, AVM_A1_PCMCIA, DEBUG_LINUX, DEV_APM,
GUS_DMA, GUS_DMA2, GUS_IRQ, OLTR_NO_BULLSEYE_MAC, OLTR_NO_HAWKEYE_MAC,
OLTR_NO_TMS_MAC and PCIC_RESUME_RESET.
2002-02-15 10:19:39 +00:00
Warner Losh
296596145c The datasheet for the 6710/6722 says that you must use one method to
detect 3.3V cards for the 6710 and another method for the 6722.  This
latter method is also how the 6729/6730 is supposed to detect 3.3V
cards.  This method works great on my Fujitsu Stylistic 500.  Sadly,
it appears that not all laptop makers are as detail oriented as the
folks that made the Stylistic.  IBM Thinkpad 701C and AST Asentia 810N
both hang hard when the 6729 method is used, but at least the thinkpad
works when the 6710 method is used.  The failure mode appears to be any
access to the memory that we've mapped the CIS in causes the machine to
hang until you eject the card.  The Thinkpad, at least, works with this
change, and it doesn't break my Stylistic.

MFC after: 4 days
2002-01-14 14:10:13 +00:00
Warner Losh
4854d67b1c Add recognition of the Omega 83C094 PCI <-> PCMCIA bridge chip set.
MFC after: 5 days
2002-01-14 13:50:45 +00:00
Mike Smith
1ea155bafa Avoid doubly defining machdep.pccard 2002-01-08 19:35:27 +00:00
Warner Losh
751a23649d Better error message when cardtype is not recognized 2001-11-13 06:46:19 +00:00
Warner Losh
807d989e82 Use d_thread_t (the new ugly compatibility hack) rather than the old
uglier compatibility hack (#define thread proc).
2001-11-12 05:35:27 +00:00
Warner Losh
99b8465544 Introduce the concept of "default" voltage. Have pccard layer use this
value (-1) in lue of 50 (which assumes a 5.0V card).  The rest of the
pccard system doesn't detect the proper voltage for the card, so we have
to do it on powerup.  Many (all?) 3.3V cards can tolerate 5.0V for reading
the CIS, but may fail to operate properly when so powered.

Idea from: Chiharu Shibata-san <chi@bd.mbn.or.jp> in bsd-nomads:15867
2001-11-11 06:58:43 +00:00
Warner Losh
b668d9a14a Do not assume that a I/O based bridge is a 6729. Intel made a funky chip
that I have the datasheet on the way for that also does this.
2001-11-11 06:55:15 +00:00
Warner Losh
93da209126 o Try to do 3.3V support better for the 6722 and 6729/30.
o Bite the bullet and create controller types for the 6729 and also for
  the 673x.  Rename the 672x to 6722.
o Define minimal extended register info (just register 0xa for reading VS[12]).

# I think the last version may have broken 673x controllers, but this should
# fix them.

Tested on the 6722, but not the 6729.

Ideas from: Chiharu Shibata-san's article in bsd-nomads:15866
2001-11-09 07:33:54 +00:00
Warner Losh
3761b249c9 Fix the 3.3V support for Cirrus Logic CL-PD6710. This appears to work
on my CL-PD6722, but won't work on the CL-PD6729.  The latter two need
more sophisticated detection of 3.3V cards than I'm up to at the
moment.  Also, only a few of the ISA chipsets that support 3.3V will
likely work at the moment.

It appears that for 3.3V cards we must detect them and adjust the
pwr.vcc value from 50 to 33.  Give a strong hint to automatically
power up the card for PD_POWER cards.

This makes my SMC 2602W (the 3.3V version of the 2632W) work on my
Fujitsu Stylistic 500.

SMC 3.3V card donated by: Ryan Losh
Thanks to: bsd-nomads for reviews of past 3.3V code
2001-11-09 06:26:57 +00:00
Warner Losh
cb2445bdb4 Better error messages for the cases where device_add_child fails. We
should also whine if the old pccardd is used, but that's a little
harder than it sounds.

This also has the effect of fixing a typo that was in the last
version I committed.
2001-11-02 21:26:07 +00:00
Mike Silbersack
5e0deac346 Remove an extra " that crept into a string. 2001-11-02 21:11:36 +00:00
Warner Losh
bcf8b176bb Print a warning when device_add_child returns NULL. This used to be
impossible at this point, but now it apparently is.  Grump.

Submitted by: OGAWA Takaya <t-ogawa@triaez.kaisei.org>
2001-11-02 17:31:01 +00:00
Warner Losh
d1cf40403a Restore the main BAR for the bridge on resume. Some machines don't save
this accross suspend/resume events and this was causing the dreaded false
positive hit on my "static bug" test.

Note: the PCI bus code should do this for us.
Note2: We don't do the same for I/O based pci devices since it is
more code and doesn't appear to be necessary.

Submitted by: Toshiyuki Kawashima-san <tos@fa2.so-net.ne.jp>
Obtained from: bsd-nomads:16012
2001-10-30 15:31:49 +00:00
Warner Losh
516fdf9478 Add a tunable (hw.pcic.boot_deactivated) which will boot the system
with the pccards deactivated.  This can work around some problems in
pccard system, but is also for people that want to explicitly turn on
cards after boot rather that at boot.

MFC after: 7 days
Submitted by: iwasaki-san
Reviewed by: ume-san, shiba-san
2001-10-23 07:04:03 +00:00
Warner Losh
e5ee3605a9 Print 4 per line. To do this, we test against i % 16 == 0 rather than i % 4
since that's always true for this loop.
2001-10-17 05:33:51 +00:00
Warner Losh
b79e6caffe ToPIC fixes. scale back what we do for functional interrupts because
it appears to break at least the ToPIC 100.

Submitted by: Mark Santcroos <marks@ripe.net>
2001-10-17 05:20:56 +00:00
Warner Losh
7549e3fe46 takashi shibagaki-san posted a similar patch to nomads. It seems that
more laptops work w/o the shutdown code than with it on reboot.  So
let's disable it for a while.
2001-10-11 05:41:27 +00:00
Warner Losh
f3bfc73757 Use the NetBSD init code for the TOPIC parts as a more complete basis
for initializing the parts.  Since I don't have any of these parts in
any of my working laptops, I'm committing this to allow people to test
it.  Will MFC when I receive reports of it working.
2001-10-11 05:37:32 +00:00
Warner Losh
2d45d0504c Fix, I think, The second slot problem with Cirrus Logic PD6729/30 parts:
o Move initialization of the slot bst and bsh to inside the for loop.
o move sc there as well.
o Remove debug printf that prints the ID of the first slot twice.
o Use the sp for the relevant slot in getb, rather than for the 0th slot.
2001-09-21 06:45:35 +00:00
Warner Losh
89f43a1aa9 Ian Dowse had closed the race a little more in card ejection events.
Maybe this will also fix the suprious eject events that we're seeing?
2001-09-16 06:12:16 +00:00
Warner Losh
7cf44afd1a <jkh> "Hey Rocky, watch me eject this pccard outta my laptop!" "What,
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.
2001-09-13 08:26:55 +00:00
Warner Losh
e85f8fa723 Even better compatibility with 4.x. #define thread proc, since for
this file, that's a reasonable workaround.  Also, include sys/proc.h
for 4.x.
2001-09-13 03:08:19 +00:00
Warner Losh
93e5ab438a Better way to do compatibility between the two versions. 2001-09-13 02:12:14 +00:00
Warner Losh
9b7ae9d25f Fix KSE breakage to this file:
Make it compile again on 4.x.
2001-09-13 01:55:23 +00:00
Julian Elischer
b40ce4165d KSE Milestone 2
Note ALL MODULES MUST BE RECOMPILED
make the kernel aware that there are smaller units of scheduling than the
process. (but only allow one thread per process at this time).
This is functionally equivalent to teh previousl -current except
that there is a thread associated with each process.

Sorry john! (your next MFC will be a doosie!)

Reviewed by: peter@freebsd.org, dillon@freebsd.org

X-MFC after:    ha ha ha ha
2001-09-12 08:38:13 +00:00
Warner Losh
ee148a7240 Call pcic_teardown_intr to make sure that we disestablish the
interrupt for the card.

This seems to fix hangs on my machine.

MFC: pending re approval.
2001-09-12 05:57:31 +00:00
Warner Losh
b8769414cd When booting verbose, print the config space for this device. This
will help debugging problem systems as it will reduce the number of
commands the user needs to type and send me the output of.
2001-09-09 17:42:58 +00:00
Warner Losh
76051d5c6d If flags were specified for the device, print them in the probe
message.  Some scsi devices have rather elaberate flags, and it is
hard to know which ones were specified in pccard.conf when debug
information only includes the dmesg.
2001-09-09 17:28:02 +00:00
Warner Losh
588cfa1095 Don't panic when we don't know the exact chip that is being used.
Also, add support for the following parts:
	O2micro 6912/6972, 6922, 6933
	Cirrus Logic PD6834
	TI PCI-1260 and PCI-1421
MFC: Soon
2001-09-06 20:55:25 +00:00
Warner Losh
98435cf714 Patric Gualat tells me that I can't do basic bit math. He's right.
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
2001-09-05 22:26:14 +00:00
Warner Losh
0b19e7ccab Don't report power interrupts. 2001-09-04 20:10:23 +00:00
Warner Losh
5f34898eb2 MFS: put debug writes behind boot verbose. 2001-09-04 20:08:33 +00:00
Warner Losh
a23c775553 Make the csc and function interrupts ISA on shutdown. This should
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.
2001-09-04 17:46:31 +00:00
Warner Losh
d8b10a2b0e Kill init_t type, and minor white space changes to match original -stable version 2001-09-04 05:57:00 +00:00
Warner Losh
1ead03c2ba Add support for changing the way that ToPIC csc interrupts are routed.
# 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.
2001-09-04 05:50:08 +00:00
Warner Losh
592823383b Move to using a chip function + function pointers to deal with the
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.
2001-09-04 04:47:58 +00:00
Warner Losh
6f44e24e14 Values for the Toshiba ToPIC's Function Control Register.
These were lifted from Nakagawa-san's article in FreeBSD Press, as
well as posts from hiroyuki Aizo-san and Chiharu Shibata-san.
2001-09-04 04:30:04 +00:00
Warner Losh
5d98f538d8 Add recognition for ToPIC95B 2001-09-03 08:20:52 +00:00
Warner Losh
f99a696093 Add names for the TI PCI-1210, TI PCI-4410 and TI PCI-4450 parts. I had
this for a while, and don't know how it didn't make it into the tree.
2001-08-30 22:48:47 +00:00
Warner Losh
51af6062b4 Note the status of the card, so we don't print inserted lines twice on
boot.
2001-08-29 15:54:12 +00:00
Warner Losh
a828573f43 Fix typo in my last commit 2001-08-27 15:18:26 +00:00
Warner Losh
fb141a4c6c CL-PD6729 and CLPD-6730 chips (the only ones with I/O bars in the pci
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.
2001-08-27 01:59:57 +00:00
Warner Losh
afd9750bfd A number of fixes for the TI-1130 and ISA interrupt routing cases:
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.
2001-08-27 01:00:27 +00:00
Warner Losh
f711f84740 Stop dereferencing 'r' unconditionally. Maybe it is NULL when ISA
mode and using polling mode.
2001-08-26 04:05:07 +00:00
Warner Losh
826fac3f15 Fix last second typo 2001-08-25 22:53:47 +00:00
Warner Losh
1fa93154aa Back out the isa/pci string reporting. It may cause panics. 2001-08-25 22:45:45 +00:00
Warner Losh
c98c9548b1 The tunable is hw.pcic.irq, but the hw.pcic.override_irq was how it was
reported in sysctl.
2001-08-25 22:39:44 +00:00
Warner Losh
5cb1fce026 Fix cut-and-paste-o that Nate found. We were setting csc_route twice,
rather than setting it once and setting func_route when we can't route
PCI interrupts.
2001-08-25 22:04:00 +00:00
Warner Losh
0b370908b2 First cut at getting the ISA routing working. If we can't route a PCI
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.
2001-08-25 06:40:00 +00:00