Commit Graph

51 Commits

Author SHA1 Message Date
imp
8006bd7cc8 Use BUS_PROBE_DEFAULT for pci probe return value 2005-03-05 18:30:12 +00:00
simokawa
89aa4b852b Clear PCIM_CMD_SERRESPEN and PCIM_CMD_PERRESPEN for broken hardware.
Some amd64 laptops fail to boot with these flags.

PR: kern/75482
2005-01-06 07:40:34 +00:00
imp
9bc042de86 Start each of the license/copyright comments with /*-, minor shuffle of lines 2005-01-06 01:43:34 +00:00
simokawa
85a68dbe87 Fix and add deivce ID's.
Obtained from: DragonFly BSD
2004-08-04 12:18:39 +00:00
simokawa
4cf6ca3559 Don't output too many debug messages for bootverbose.
This driver seems to be fairly stable now.
2004-07-20 04:49:44 +00:00
simokawa
0c866d2722 Add some PCI IDs for OHCI chips.
Obtained from: DragonFly BSD
2004-07-17 09:41:20 +00:00
jhb
7b8c8d8c72 Trim a few things from the dmesg output and stick them under bootverbose to
cut down on the clutter including PCI interrupt routing, MTRR, pcibios,
etc.

Discussed with:	USENIX Cabal
2004-07-01 07:46:29 +00:00
imp
75e4980260 Remove the setting of the pci config variables on power state changes.
The bus does this now.
2004-06-28 20:26:21 +00:00
dfr
48702b84c2 Change u_intXX_t to uintXX_t. Change a couple of 'unsigned long's to
uint32_t where appropriate.
2004-05-22 16:14:17 +00:00
simokawa
8ca64ff3af MFp4: FireWire
* all
- s/__FUNCTION__/__func__/.
	Submitted by: Stefan Farfeleder <stefan@fafoe.narf.at>
- Compatibility for RELENG_4 and DragonFly.

* firewire
- Timestamp just before queuing.
- Retry bus probe if it fails.
- Use device_printf() for debug message.
- Invalidiate CROM while update.
- Don't process minimum/invalid CROM.

* sbp
- Add ORB_SHORTAGE flag.
- Add sbp.tags tunable.
- Revive doorbell support. It's not enabled by default.
2004-03-26 23:17:10 +00:00
njl
6bcc4e8616 Convert callers to the new bus_alloc_resource_any(9) API.
Submitted by:	Mark Santcroos <marks@ripe.net>
Reviewed by:	imp, dfr, bde
2004-03-17 17:50:55 +00:00
simokawa
c0a3c934ce Add NEC uPD72873.
Submitted by: Christian Laursen <xi@borderworlds.dk>
2004-01-30 14:30:19 +00:00
simokawa
f1c823d01e Use device_identify and bus_add_child methods to add a firewire
bus on fwohci. This should fix attach failure caused by a race
between firewire and fwochi initialization for the kernel module.
2004-01-30 14:28:11 +00:00
simokawa
97a674e005 * fwohci_pci.c
Improve error message for attach failure.

* sbp_targ.c
	- Add speed in struct sbp_targ_login.
	- Remove unnecessary htonl().
2004-01-23 17:37:09 +00:00
simokawa
1c0b417dbd MFp4:
* firewire
	- Remove pending list.
	- Ignore timeout for the FWXF_START state.
	- Define M_FWMEM for debugging.
	- Comment out DELAY() in fw_asybusy().
	- Improve debugging messages
* sbp
	- Freeze simq while bus reset.
2004-01-05 14:21:18 +00:00
imp
681047fce1 Sometimes cardbus attachments don't attach, so while we track down
this problem put these lines back in.  While they should be
unnecessary, they appear to be sometimes necessary.

Reviewed in concept: dfr
Approved by: re (scottl@)
2003-11-28 05:28:29 +00:00
dfr
ae13306183 Remove explicit cardbus attachments from drivers where this is identical
to the pci attachment. Cardbus is a derived class of pci so all pci
drivers are automatically available for matching against cardbus devices.

Reviewed by: imp
2003-11-03 09:22:18 +00:00
simokawa
f930fc1d8f Fix fwmem_strategy() race in 4-stable. 2003-10-25 15:05:59 +00:00
simokawa
ad0e2ca28e Make this compiled on RELENG_4. 2003-08-22 07:33:20 +00:00
imp
0886a6ee43 Prefer new location of pci include files (which have only been in the
tree for two or more years now), except in a few places where there's
code to be compatible with older versions of FreeBSD.
2003-08-22 05:54:52 +00:00
simokawa
6348676118 - Don't mess with TX queue in fwohci_stop() if we failed to attach the device.
Tested by: wilko

- Detect memory mapping failure of registers by checking OHCI version.

Tested by: KONDOU, Kazuhiro <kazuhiro@alib.jp>
2003-08-04 05:43:02 +00:00
simokawa
155d89913b Clean up include files. 2003-07-18 14:31:16 +00:00
simokawa
8dc2ca5940 Add compatibility for FreeBSD-4. 2003-07-04 14:04:41 +00:00
imp
3c72bf0be1 All current uses of pci_set_powerstate are bogus, at least in theory.
However, they are presently necessary due to bigger bogusness in the
pci bus layer not doing the right thing on suspend/resume or on
initial device probe.  This is exactly the sort of thing that the
BURN_BRIDGES option was invented for.  Mark all of them as
BURN_BRIDGES.  As soon as I have the powerstate stuff properly
integrated into the pci bus code, I intend to remove all these
workarounds.
2003-07-03 14:00:57 +00:00
scottl
2fdb52b864 Mega busdma API commit.
Add two new arguments to bus_dma_tag_create(): lockfunc and lockfuncarg.
Lockfunc allows a driver to provide a function for managing its locking
semantics while using busdma.  At the moment, this is used for the
asynchronous busdma_swi and callback mechanism.  Two lockfunc implementations
are provided: busdma_lock_mutex() performs standard mutex operations on the
mutex that is specified from lockfuncarg.  dftl_lock() is a panic
implementation and is defaulted to when NULL, NULL are passed to
bus_dma_tag_create().  The only time that NULL, NULL should ever be used is
when the driver ensures that bus_dmamap_load() will not be deferred.
Drivers that do not provide their own locking can pass
busdma_lock_mutex,&Giant args in order to preserve the former behaviour.

sparc64 and powerpc do not provide real busdma_swi functions, so this is
largely a noop on those platforms.  The busdma_swi on is64 is not properly
locked yet, so warnings will be emitted on this platform when busdma
callback deferrals happen.

If anyone gets panics or warnings from dflt_lock() being called, please
let me know right away.

Reviewed by:	tmm, gibbs
2003-07-01 15:52:06 +00:00
simokawa
e3146019de Include file clean up. 2003-06-30 06:33:18 +00:00
simokawa
e2c2247a49 Fix several problems related to resume:
- Initialize fc->status to process bus reset correctly after resume.
- Initialize AT ring buffer pointer.
- Requeue stdma to stfree for active IR buffer.
- Stop DMA before suspend for safe.
- Set powerstate after resume.
2003-06-28 11:11:36 +00:00
simokawa
fc9be7bddd - Use fwohci_poll() instead of fwohci_intr() to process the first bus reest.
- Wait 2 cycles before starting the process for fast machines.
2003-06-27 00:27:33 +00:00
simokawa
33806ce9ff Add id for TI's 1394b link chip. 2003-06-04 04:26:14 +00:00
simokawa
2ea336196e Add some IEEE 1394 OHCI chips.
Partially submitted by: Tetsuya Ryuchi <ryuchi@ryuchi.org>
PR: misc/51336
2003-04-24 07:29:52 +00:00
simokawa
543b1c4730 MFp4(simokawa_firewire):
Many internal structure changes for the FireWire driver.

- Compute CRC in CROM parsing.
- Add support for configuration ROM build.
- Simplify dummy buffer handling.
- busdma conversion
- Use swi_taskqueue_giant for -current.  Mark the interrupt routine as MPSAFE.
- AR buffer handling.
	Don't reallocate AR buffer but just recycle it.
	Don't malloc and copy per packet in fwohci_arcv().
	Pass packet to fw_rcv() using iovec.
	Application must prepare receiving buffer in advance.
- Change fw_bind API so that application should pre-allocate xfer structure.
- Add fw_xfer_unload() for recycling struct fw_xfer.
- Add post_busreset hook
- Remove unused 'sub' and 'act_type' in struct fw_xfer.
- Remove npacket from struct fw_bulkxfer.
- Don't call back handlers in fwochi_arcv() if the packet has
	not drained in AT queue
- Make firewire works on big endian platform.
- Use native endian for packet header and remove unnecessary ntohX/htonX.
- Remove FWXFERQ_PACKET mode.  We don't use it anymore.
- Remove unnecessary restriction of FWSTMAXCHUNK.
- Don't set root node for phy config packet if the root node is
	not cycle master capable but set myself for root node.
	We should be the root node after next bus reset.

	Spotted by: Yoshihiro Tabira <tabira@scd.mei.co.jp>
- Improve self id handling

Tested on: i386, sparc64 and i386 with forced bounce buffer
2003-04-17 03:38:03 +00:00
simokawa
7ed28e5500 Safe PCI configuration.
- Clear PCIM_CMD_MWRICEN:
	some chips seem to have problem with write invalidate.
	clearing this bit fixes SBP timeout problem.

Tested by: Michael Reifenberger <Michael.Reifenberger@Plaut.de>

- Set PCIM_CMD_SERRESPEN and PCIM_CMD_PERRESPEN
- Moderate value for latency timer.
2003-03-24 03:47:36 +00:00
simokawa
dc16f81e1d Use pci_get_devid(). 2003-02-18 10:01:44 +00:00
simokawa
83c5760821 Add 'uPD72871/2 IEEE1394 1-Chip OHCI Host Controller'. 2003-02-18 09:46:52 +00:00
simokawa
4e26211649 Protect calling fwohci_intr() with splfw() for 4-stable. 2003-02-15 01:25:39 +00:00
simokawa
793c94c090 Clear the bus reset event flag as soon as possible after
the initialization has completed to start transactions even when
interrupt is disabled during the boot process.
2003-02-14 15:52:32 +00:00
simokawa
0726e3081a Define new malloc type M_FW and use it. 2003-02-01 15:04:33 +00:00
simokawa
ee82f9261b SBP related changes.
- Issue LOGOUT command on detach and shutdown.
- Rename some functions.
2003-01-31 14:11:22 +00:00
simokawa
d7bab8752b Syntax fix in fwohci_pci_suspend(). 2003-01-05 09:12:47 +00:00
simokawa
561561aaa3 - Replace printf() with device_printf().
- Separate fc->dev (i.e. fwohci0) and fc->bdev (i.e. firewire0).
- Remove unused firewirebusreg.h.
- Reduce size of descriptor block for asynchronous transmit and
	check the number of descriptor when copying from mbuf.
- Skip mbuf whose length is zero. NFS seems passing such mbuf and
	some chips generates unrecoverable error.
2003-01-04 10:21:11 +00:00
simokawa
c3ae2e234d - Propagate suspend/resume to child devices.
- Restore pci config registers after resume.
- Reinitialize and start rx buffers after resume.
- Don't reallocate memory in fwohci_db_init() if the dbch is
	already initialized.
- Fix typo.
- Some clean up.
2003-01-04 06:40:57 +00:00
simokawa
9820d0621a Experimental support for suspend/resume, not finished yet. 2003-01-01 08:25:32 +00:00
simokawa
0fe424e08a - Retry phy access when the wait-loop count is exhausted.
- Free allocated memory when detaching.
- Detect contigmalloc failure.
2003-01-01 04:23:54 +00:00
simokawa
951083cc9d Fix and add several device IDs. 2002-12-31 13:43:44 +00:00
simokawa
7f505f2e5f Cosmetic change. s/Firewire/FireWire/. 2002-12-26 06:50:09 +00:00
simokawa
e54f548161 Reduce and improve debug messages.
Approved by: re
2002-12-06 02:17:30 +00:00
simokawa
bb5c72f0d8 Add a prototype for suspend/resume. 2002-11-12 13:46:09 +00:00
simokawa
0dbe6ad5c4 - Let the PCI code try to route interrupt in -current
- Print warning in -stable.
2002-11-06 04:07:05 +00:00
jhb
7265aa15de This file doesn't need opt_bus.h. 2002-10-14 19:11:19 +00:00
ikob
2b19d3fe4c Firewire device support for Apple eMac with PPC kernel.
Contributed by Peter Grehan <grehan@freebsd.org>
2002-09-17 12:50:43 +00:00