aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/isp/isp_sbus.c
Commit message (Collapse)AuthorAgeFilesLines
* MFC r315908: Unify initiator and target DMA setup and command sending.Alexander Motin2017-04-241-18/+17
| | | | | | | The code is so alike that it is pointless to keep it separate. Notes: svn path=/stable/10/; revision=317366
* MFC r315682, r315683: Remove some dead code left after r246713.Alexander Motin2017-04-021-8/+1
| | | | Notes: svn path=/stable/10/; revision=316409
* MFC r315677: Clean/unify some macro usage.Alexander Motin2017-04-021-10/+13
| | | | Notes: svn path=/stable/10/; revision=316403
* MFC r315579, r315670: Add initial support for multiple MSI-X vectors.Alexander Motin2017-04-021-11/+11
| | | | | | | | | | For 24xx and above use 2 vectors (default and response queue). For 26xx and above use 3 vectors (default, response and ATIO queues). Due to global lock interrupt hardlers never run simultaneously now, but at least this allows to save one regitster read per interrupt. Notes: svn path=/stable/10/; revision=316399
* MFC r315307: Refactor interrupt handling.Alexander Motin2017-03-291-12/+20
| | | | | | | | | | | | | Instead of single isp_intr() function doing all possible magic, introduce four different functions to handle mailbox operation completions, async events, response and ATIO queues. The goal is to isolate different code paths to make code more readable, and to make easier support for multiple interrupt vectors. Even oldest hardware in many cases can identify what code path it should run on interrupt. Contemporary hardware can assign them to different interrupt vectors. Notes: svn path=/stable/10/; revision=316146
* MFC r315234: Improvements around attach, reset and detach.Alexander Motin2017-03-281-82/+72
| | | | | | | | | | This change fixes DMA resource leak on driver unload. Also it removes DMA resources allocation for hardcoded number of requests before fetching the real number from firmware. Also it prepares ground for more flexible IRQs allocation according to firmware capabilities. Notes: svn path=/stable/10/; revision=316087
* MFC r299849 (by trasz):Alexander Motin2017-03-281-11/+0
| | | | | | | Remove NULL checks after M_WAITOK allocations from isp(4). Notes: svn path=/stable/10/; revision=316085
* MFC r292764: Split DMA buffers for request, response and ATIO queues.Alexander Motin2015-12-301-51/+69
| | | | Notes: svn path=/stable/10/; revision=292929
* MFC r291654, r291727, r291821, r291872, r292034, r292041, r292249, r292042:Alexander Motin2015-12-221-9/+7
| | | | | | | Add initial support for 16Gbps FC QLogic chips. Notes: svn path=/stable/10/; revision=292598
* MFC r291221: Remove "disable" hint, which duplicates system-wide "disabled".Alexander Motin2015-11-301-13/+0
| | | | Notes: svn path=/stable/10/; revision=291530
* MFC r291188: Rip off target mode support for parallel SCSI QLogic adapters.Alexander Motin2015-11-301-1/+2
| | | | | | | | | | Hacks to enable target mode there complicated code, while didn't really work. And for outdated hardware fixing it is not really interesting. Initiator mode tested with Qlogic 1080 adapter is still working fine. Notes: svn path=/stable/10/; revision=291528
* MFC r289930: Formalize/unify chip (re-)inits.Alexander Motin2015-11-131-6/+1
| | | | Notes: svn path=/stable/10/; revision=290794
* MFC r289812, r289852: Some polishing and unification in ISR code.Alexander Motin2015-11-131-5/+4
| | | | Notes: svn path=/stable/10/; revision=290785
* Reform the busdma API so that new types may be added without modifyingKonstantin Belousov2013-02-121-39/+11
| | | | | | | | | | | | | | | | | | | | | | | | every architecture's busdma_machdep.c. It is done by unifying the bus_dmamap_load_buffer() routines so that they may be called from MI code. The MD busdma is then given a chance to do any final processing in the complete() callback. The cam changes unify the bus_dmamap_load* handling in cam drivers. The arm and mips implementations are updated to track virtual addresses for sync(). Previously this was done in a type specific way. Now it is done in a generic way by recording the list of virtuals in the map. Submitted by: jeff (sponsored by EMC/Isilon) Reviewed by: kan (previous version), scottl, mjacob (isp(4), no objections for target mode changes) Discussed with: ian (arm changes) Tested by: marius (sparc64), mips (jmallet), isci(4) on x86 (jharris), amd64 (Fabian Keil <freebsd-listen@fabiankeil.de>) Notes: svn path=/head/; revision=246713
* Don't allow for more than one segment for the control space sinceMatt Jacob2012-11-021-3/+2
| | | | | | | | | | we're not set up to deal with that. X-MFC: 242479 MFC after: 1 week Notes: svn path=/head/; revision=242480
* Remove dependence on MAXPHYS.Matt Jacob2012-08-211-1/+1
| | | | | | | MFC after: 1 month Notes: svn path=/head/; revision=239502
* Add detach logic to SBus variant.Matt Jacob2012-08-041-33/+59
| | | | | | | | Obtained from: Marius MFC after: 1 month Notes: svn path=/head/; revision=239023
* Grr.!$()!$$ I missed checking this in even though I *did* runMatt Jacob2012-07-291-1/+1
| | | | | | | | | | | | | a tinderbox myself and caught the error. Change to isp_send_cmd needs a final ecmd argument. Sponsored by: Spectralogic MFC after: 1 month X-MFC: 238869 Notes: svn path=/head/; revision=238887
* Adding missing dependancies for loading hptiop(4), hptmv(4) and isp(4) as ↵Eitan Adler2012-06-011-0/+2
| | | | | | | | | | | | | | | modules. PR: kern/166239 Submitted by: Pavel Timofeev <timp87@gmail.com> Discussed on: -stable, -scsi Reviewed by: scottl No objection from: mjacob Approved by: cperciva MFC after: 3 days Notes: svn path=/head/; revision=236379
* - Use the correct DMA tag/map pair for synchronize the FC scratch area.Marius Strobl2011-02-141-2/+2
| | | | | | | | | | | | | | - Allocate coherent DMA memory for the request/response queue area and and the FC scratch area. These changes allow isp(4) to work properly on sparc64 with usage of the IOMMU streaming buffers enabled. Approved by: mjacob MFC after: 2 weeks Notes: svn path=/head/; revision=218691
* On sparc64 obtain the initiator ID from the Open Firmware device treeMarius Strobl2010-05-031-5/+3
| | | | | | | | | in order to match what the PROM built-in driver uses. Approved by: mjacob Notes: svn path=/head/; revision=207579
* Put gone device timer into a structure tag that can hold more than 32 ↵Matt Jacob2010-03-171-1/+1
| | | | | | | | | | | | | seconds. Oops. Untangle some of the confusion about what role means when it's in the FCPARAM/SDPARAM or isp_fc/isp_spi structures. This fixed a problem about seeing targets appear if you've turned off autologin and find them, or rather don't, via camcontrol rescan. MFC after: 1 month Notes: svn path=/head/; revision=205236
* Redo how commands handles are created and managed and implement sequenceMatt Jacob2010-02-031-2/+6
| | | | | | | | | | | | | | | numbers and handle types in rational way. This will better protect from (unwittingly) dealing with stale handles/commands. Fix the watchdog timeout code to better protect itself from mistakes. If we run an abort on a putatively timed out command, the command may in fact get completed, so check to make sure the command we're timing it out is still around. If the abort succeeds, btw, the command should get returned via a different path. Notes: svn path=/head/; revision=203444
* Unbreak SBus cards which have been broken (apparently) for a while.Matt Jacob2009-11-021-18/+8
| | | | | | | | | | | | | Most of the pieces came from Marius- correct settings for channels and resource management. The one piece missing was that you cannot for SBus cards replace 32 bit operations with A64 operations- not supported. Submitted by: marius MFC after: 3 days Notes: svn path=/head/; revision=198822
* Add 8Gb support (isp_2500). Fix a fair number of configuration andMatt Jacob2009-08-011-177/+71
| | | | | | | | | | | | | | | | | | | | | | | | firmware loading bugs. Target mode support has received some serious attention to make it more usable and stable. Some backward compatible additions to CAM have been made that make target mode async events easier to deal with have also been put into place. Further refinement and better support for NP-IV (N-port Virtualization) is now in place. Code for release prior to RELENG_7 has been stripped away for code clarity. Sponsored by: Copan Systems Reviewed by: scottl, ken, jung-uk kim Approved by: re Notes: svn path=/head/; revision=196008
* Add missing locking for SBus controllers.Scott Long2007-11-051-0/+5
| | | | Notes: svn path=/head/; revision=173359
* Bad merge.Matt Jacob2007-05-111-1/+1
| | | | Notes: svn path=/head/; revision=169472
* Fix pointy-hat problem with BUS_DMA_ROOTARG macro that caused problems for ↵Matt Jacob2007-05-111-2/+2
| | | | | | | | | | | sparc64. Candidate for immediate MFC. Noticed by: Everyone-maxim contacted. Notes: svn path=/head/; revision=169459
* Make this an MP safe driver but also still be multi-release.Matt Jacob2007-05-051-81/+46
| | | | | | | | | | | Seems to work on RELENG_4 through -current and also on sparc64 now. There may still be some issues with the auto attach/detach code to sort out. MFC after: 3 days Notes: svn path=/head/; revision=169292
* Temporarily desupport simultaneous target and initiator mode.Matt Jacob2007-04-021-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | When the linux port changes were imported which split the target command list to be separate from the initiator command list and the handle format changed to encode a type in the handle the implications to the function isp_handle_index (which only the NetBSD/OpenBSD/FreeBSD ports use) were overlooked. The fault is twofold: first, the index into the DMA maps in isp_pci is wrong because a target command handle with the type bit left in place caused a bad index (and panic) into dma map. Secondly, the assumption of the array of DMA maps in either PCS or SBUS attachment structures is that there is a linear mapping between handle index and DMA map index. This can no longer be true if there are overlapping index spaces for initiator mode and target mode commands. These changes bandaid around the problem by forcing us to not have simultaneous dual roles and doing the appropriate masking to make sure things are indexed correctly. A longer term fix is being devloped. Notes: svn path=/head/; revision=168240
* Don't derference a pointer before setting it.Matt Jacob2007-03-281-2/+2
| | | | | | | | | Very Pointy Dunce Cap T o: me. Submitted by: Marcel MFC after: 3 days Notes: svn path=/head/; revision=167992
* Move bus_space_tag and bus_space_handle register accessMatt Jacob2007-03-131-8/+6
| | | | | | | | | | | | | tokens into the common isp_osinfo structure instead of being in bus specific structures. This allows us to implement a SYNC_REG MEMORYBARRIER call (using bus_space_barrier) and also reduce the amount of bus specific wrapper structure usages in isp_pci && isp_sbus. MFC after: 3 days Notes: svn path=/head/; revision=167501
* Redo previous newbus related change to be kinder toMatt Jacob2007-02-231-1/+1
| | | | | | | multi-release support. Notes: svn path=/head/; revision=166935
* o break newbus api: add a new argument of type driver_filter_t toPaolo Pisati2007-02-231-1/+1
| | | | | | | | | | | | | | | | bus_setup_intr() o add an int return code to all fast handlers o retire INTR_FAST/IH_FAST For more info: http://docs.freebsd.org/cgi/getmsg.cgi?fetch=465712+0+current/freebsd-current Reviewed by: many Approved by: re@ Notes: svn path=/head/; revision=166901
* Clean up some of the various platform and release specific dma tagMatt Jacob2007-01-231-22/+4
| | | | | | | | | | stuff so it is centralized in isp_freebsd.h. Take out PCI posting flushed in qla2100/2200 register reads except for 2100s. Notes: svn path=/head/; revision=166177
* Change the remainder of the drivers for DMA'ing devices enabled in theMarius Strobl2007-01-211-2/+14
| | | | | | | | | | | sparc64 GENERIC and the sound device drivers known working on sparc64 to use bus_get_dma_tag() to obtain the parent DMA tag so we can get rid of the sparc64_root_dma_tag kludge eventually. Except for ath(4), sk(4), stge(4) and ti(4) these changes are runtime tested (unless I booted up the wrong kernels again...). Notes: svn path=/head/; revision=166165
* Implement ISP_RESET0 for PCI and SBUS attachments- isp_reset hasMatt Jacob2006-12-161-1/+8
| | | | | | | | been modified to call ISP_RESET0 if it fails to do a reset. This gives us a chance to disable interrupts. Notes: svn path=/head/; revision=165269
* Remove dependency on ispfw and firmware as modules.Matt Jacob2006-12-101-3/+1
| | | | | | | | | | | | | | | | | | | | Either they're there early and the ispfw sets have registered themselves, or they're not. The module dependency stuff isn't quite what we want anyway. If the user doesn't want the load placed on system memory by loading the firmware, they don't specify it to be loaded (either by being linked in or via being a module to be loaded and then hooked in with firmware(9)). It doesn't then make sense to then override what they want by pulling it in anyway. This might be able to work if we were able to pull in just exactly what we needed for the card we have- but that's an optimization left for the future. Notes: svn path=/head/; revision=165061
* Add 4Gb (24XX) support and lay the foundation for a lot of new stuff.Matt Jacob2006-11-021-56/+47
| | | | Notes: svn path=/head/; revision=163899
* More ispfwfunc definitions funnies which break pre-7.0 builds.Matt Jacob2006-09-011-1/+0
| | | | Notes: svn path=/head/; revision=161794
* Some rearrangement of headers to minimize diffs with outside ofMatt Jacob2006-07-161-3/+4
| | | | | | | | | | | FreeBSD repository and to clean up the license header so as to not pollute the license with file function. Zero all mailbox structures prior to use (just in case). Change the outgoing mailbox count for INIT_FIRMWARE to be correct. Notes: svn path=/head/; revision=160410
* Convert isp(4) and ispfw(4) to use firmware(9) to manage firmwareMatt Jacob2006-07-091-2/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | loading for the QLogic cards. Because isp(4) exists before the root is mounted, it's not really possible for us to use the kernel's linker to load modules directly from disk- that's really too bad. However, the this is still a net win in in that the firmware has been split up on a per chip (and in some cases, functionality) basis, so the amount of stuff loaded *can* be substantially less than the 1.5MB of firmware images that ispfw now manages. That is, each specific f/w set is now also built as a module. For example, QLogic 2322 f/w is built as isp_2322.ko and Initiator/Target 1080 firmware is built as isp_1080_it.ko. For compatibility purposes (i.e., to perturb folks the least), we also still build all of the firmware as one ispfw.ko module. This allows us to let 'ispfw_LOAD' keep on working in existing loader.conf files. If you now want to strip this down to just the firmware for your h/w, you can then change loader.conf to load the f/w you specifically want. We also still allow for ispfw to be statically built (e.g., for PAE and sparc64). Future changes will look at f/w unloading and also role switching that then uses the kernel linker to load different ips f/w sets. MFC after: 2 months Notes: svn path=/head/; revision=160212
* Some more gratuitous format and name changes.Matt Jacob2006-04-211-23/+23
| | | | | | | | | | Pull in some target mode changes from a private branch. Pull in some more RELENG_4 compilation changes. A lot of lines changed, but not much content change yet. Notes: svn path=/head/; revision=157943
* a) clean up some declaration stuff (i.e., make more modern with respectMatt Jacob2006-02-151-20/+20
| | | | | | | | | | | | | | | | | | to getting rid u_int for uint and so on). b) Turn back on 64 bit DAC support. Cheeze it a bit in that we have two DMA callback functions- one when we have bus_addr_t > 4 bits in width and the other which should be normal. Even Cheezier in that we turn off setting up DMA maps to be BUS_SPACE_MAXADDR if we're in ISP_TARGET_MODE. More work on this in a week or so. c) Tested under amd64 and 1MB DFLTPHYS, sparc64, i386 (PAE, but insufficient memory to really test > 4GB). LINT check under amd64. MFC after: 1 month Notes: svn path=/head/; revision=155704
* - Don't shift the clock frequency in MHz left by 8 before assigning itMarius Strobl2006-02-031-11/+7
| | | | | | | | | | | | | | | | | to sbus_mdvec.dv_clock as sbus_mdvec.dv_clock is meant to be specified in MHz. While this was a bug it shouldn't have affected FreeBSD/sparc64 as sbus_mdvec.dv_clock is used to limit the clock rate of chips when a machine isn't able to support them at maximum speed which isn't the case for sun4u machines. - Remove the code that checks whether the clock frequency returned by sbus_get_clockfreq() is 0 and falls back to 25MHz if it is as that's already done in sbus(4). Approved by: mjacob MFC after: 3 days Notes: svn path=/head/; revision=155251
* First of several commits as this driver is dusted off and maybe broughtMatt Jacob2006-01-231-1/+2
| | | | | | | | | | | | | | | | | | | | | up to date. Principle changes for this reelase is to support 2K Port Login firmware. This allows us to support the 2322 (and 2422 4Gb) cards which only come with the 2K Port Login firmware. The 2322 should now work- but we don't have firmware sets for it in ispfw (as the change to load 2K Port Login f/w hasn't been made- that f/w is so big it has to be loaded in more than one chunk). Other changes are the beginnings of cleaning up some long standing target mode issues. The next changes here will incorporate a lot of bug fixes from others. Finally, some copyright cleanup and attempts to make the parts of the driver that are FreeBSD specific start conforming more to FreeBSD style. MFC after: 1 month Notes: svn path=/head/; revision=154704
* - Introduce an ofw_bus kobj-interface for retrieving the OFW node and aMarius Strobl2004-08-121-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | subset ("compatible", "device_type", "model" and "name") of the standard properties in drivers for devices on Open Firmware supported busses. The standard properties "reg", "interrupts" und "address" are not covered by this interface because they are only of interest in the respective bridge code. There's a remaining standard property "status" which is unclear how to support properly but which also isn't used in FreeBSD at present. This ofw_bus kobj-interface allows to replace the various (ebus_get_node(), ofw_pci_get_node(), etc.) and partially inconsistent (central_get_type() vs. sbus_get_device_type(), etc.) existing IVAR ones with a common one. This in turn allows to simplify and remove code-duplication in drivers for devices that can hang off of more than one OFW supported bus. - Convert the sparc64 Central, EBus, FHC, PCI and SBus bus drivers and the drivers for their children to use the ofw_bus kobj-interface. The IVAR- interfaces of the Central, EBus and FHC are entirely replaced by this. The PCI bus driver used its own kobj-interface and now also uses the ofw_bus one. The IVARs special to the SBus, e.g. for retrieving the burst size, remain. Beware: this causes an ABI-breakage for modules of drivers which used the IVAR-interfaces, i.e. esp(4), hme(4), isp(4) and uart(4), which need to be recompiled. The style-inconsistencies introduced in some of the bus drivers will be fixed by tmm@ in a generic clean-up of the respective drivers later (he requested to add the changes in the "new" style). - Convert the powerpc MacIO bus driver and the drivers for its children to use the ofw_bus kobj-interface. This invloves removing the IVARs related to the "reg" property which were unused and a leftover from the NetBSD origini of the code. There's no ABI-breakage caused by this because none of these driver are currently built as modules. There are other powerpc bus drivers which can be converted to the ofw_bus kobj-interface, e.g. the PCI bus driver, which should be done together with converting powerpc to use the OFW PCI code from sparc64. - Make the SBus and FHC front-end of zs(4) and the sparc64 eeprom(4) take advantage of the ofw_bus kobj-interface and simplify them a bit. Reviewed by: grehan, tmm Approved by: re (scottl) Discussed with: tmm Tested with: Sun AX1105, AXe, Ultra 2, Ultra 60; PPC cross-build on i386 Notes: svn path=/head/; revision=133589
* Add missing <sys/module.h> includes currently relying on nested includePoul-Henning Kamp2004-06-031-0/+1
| | | | | | | in <sys/kernel.h> Notes: svn path=/head/; revision=130026
* Correct the boundary parameter to the bus_dma_tag_create() calls (it wasThomas Moestl2004-03-231-2/+2
| | | | | | | | | | (1 << 24) - 2 instead of 1 << 24, which it was obviously intended to be). This fixes SBus isp(4)s on sparc64 machines. Report and testing: Marius Strobl <marius@alchemy.franken.de> Notes: svn path=/head/; revision=127346
* Convert callers to the new bus_alloc_resource_any(9) API.Nate Lawson2004-03-171-3/+3
| | | | | | | | Submitted by: Mark Santcroos <marks@ripe.net> Reviewed by: imp, dfr, bde Notes: svn path=/head/; revision=127135