summaryrefslogtreecommitdiffstats
path: root/sys/dev
Commit message (Collapse)AuthorAgeFilesLines
* The r48589 promised to remove implicit inclusion of if_var.h soon. Prepareglebius2013-10-26171-0/+223
| | | | | | | | to this event, adding if_var.h to files that do need it. Also, include all includes that now are included due to implicit pollution via if_var.h Sponsored by: Netflix Sponsored by: Nginx, Inc.
* Move includes from if_bcereg.h to .c files.glebius2013-10-262-45/+48
|
* Wait for DesignWare UART transfers completion before accessing line controlzbb2013-10-262-1/+26
| | | | | | | | | | | | | When using DW UART with BUSY detection it is necessary to wait until all serial transfers are finished before manipulating the line control. LCR will not be affected when UART is busy. In addition, if Divisor Latch Access Bit is being set in order to modify UART divisors: 1. We will get BUSY interrupt if interrupts are enabled. 2. Because LCR will not be affected the THR and (even worse) IER contents will be corrupted. This will lead to console hang. Approved by: cognet (mentor)
* Switch to using ofw_bus_search_compatible() table-driven compat lookup.ian2013-10-261-23/+42
| | | | Add compat strings for Freescale Vybrid family SoCs.
* machine/pmap.h is included by vm/pmap.h, so is redundant here. Thanks tonwhitehorn2013-10-261-1/+0
| | | | Alan Cox for pointing this out.
* Fix build after r257111 by including headers with definition of pmap_kextract().nwhitehorn2013-10-261-0/+4
|
* add 0x8b, lifted from Linux iwlegacy/commands.hadrian2013-10-261-0/+1
| | | | | | | This is "STA invalid". I saw it during some 4965 testing (kern/183260) and I still have no idea what is causing it. Obtained from: Linux drivers/net/wireless/iwlegacy
* Begin fleshing out a knob to enable/disable bluetooth coexistence.adrian2013-10-252-2/+38
| | | | | | | | | | | | Some firmware versions seem to get very unhappy if they're sent btcoex commands when they don't actually have bluetooth hardware in them. So, disable sending them those commands. Tested: * 5100 (which has bluetooth, no problems) * 4965 (which doesn't have bluetooth, but didn't seem to crash) * 6200 (no bluetooth, seems to get unhappy being sent bluetooth commands.)
* Temporarily disable multi-rate retry (link quality) and eliminate rateadrian2013-10-251-25/+70
| | | | | | | | | | | | | | | | | | | | | | index lookups. * My recent(ish) change to iwn(4) and the net80211 rate control API to support 11n rates broke the link quality table use. So, until I or someone else decides to fix it, let's just disable it for now. * Teach iwn_tx_data_raw() to use the iwn_rate_to_plcp() function. * Eliminate two uses of the net80211 rate index lookup functions - they are only for legacy rates and they're not needed here. This fixes some invalid looking rate control TX issues that showed up on my 4965 but it doesn't fix the two TX hangs I've noticed. Those look like DMA related issues. Tested: * 4965, STA mode * 5100, STA mode
* Add id for GTM661W.n_hibma2013-10-252-0/+2
|
* Add a helper routine to search for a compat string in a table thatian2013-10-252-0/+30
| | | | | | | | associates compat strings with arbitrary values that mean something to the driver. This is handy for drivers that support several variations of similar hardware and need to know which one matched. Reviewed by: imp, jmg, nwhitehorn
* Remove all the instances of '#undef DEBUG' from kernel.loos2013-10-252-5/+0
| | | | | Suggested by: rpaulo Approved by: adrian (mentor)
* Make sure to get the right node when looking up #interrupt-cells.nwhitehorn2013-10-251-2/+2
|
* Use common OFW root code to set up fdtbus. This is an almost purelynwhitehorn2013-10-251-553/+9
| | | | | | | | negative diff that should improve reliability somewhat. There should be no differences in behavior -- please report any that crop up. This has been tested on ARM and PPC systems. Tested by: ray
* Test UARTs physical address instead of virtual.ray2013-10-251-1/+7
|
* Remove some of the code required for supporting ssm(4) on SPARC in favornwhitehorn2013-10-241-21/+12
| | | | | of a more PowerPC/FDT-focused design. Whenever SPARC64 is integrated into this rework, this should be (trivially) revisited.
* Make pci_get_dma_tag() non-static. Since the function is onlykib2013-10-242-1/+1
| | | | | | | | | referenced by pointer, making it non-static should not have even the negligible impact on the existing code. Reviewed by: jhb Sponsored by: The FreeBSD Foundation MFC after: 1 week
* Add some definitions for the bits in root control and status PCIe capkib2013-10-241-0/+9
| | | | | | | | registers. Reviewed by: jhb Sponsored by: The FreeBSD Foundation MFC after: 1 week
* Move the PCI_DMA_BOUNDARY definition into the pcivar.h.kib2013-10-242-4/+9
| | | | | | Reviewed by: jhb Sponsored by: The FreeBSD Foundation MFC after: 1 week
* Add an OFW SPI compatible bus. Fix the spibus probe to returnloos2013-10-243-2/+197
| | | | | | | | | BUS_PROBE_GENERIC and not BUS_PROBE_SPECIFIC (0) so the OFW SPI bus can attach when enabled. Export the spibus devclass_t and driver_t declarations. Submitted by: ray Approved by: adrian (mentor)
* Don't spin with mutex hold when there is not enough room in the send sockettrasz2013-10-241-14/+12
| | | | | | | | | | buffer. While here, make the code flow somewhat nicer. Thanks to mav@ for tracking it down. Tested by: mav MFC after: 3 days Sponsored by: FreeBSD Foundation
* Do not map IRQs twice. This fixes PowerPC/FDT systems with multiple PICs,nwhitehorn2013-10-241-3/+2
| | | | | which would try to treat the previously-mapped interrupts from fdt_decode_intr() as interrupt line numbers on the same parent PIC.
* interrupt-parent and #interrupt-cells are written to the tree usingnwhitehorn2013-10-241-2/+2
| | | | encode-int.
* Fix crossed fingers output. Only comment changed.ray2013-10-241-1/+1
|
* Break out the debug code into a new include file in preparation foradrian2013-10-242-74/+103
| | | | some more iwn work.
* Add #ifdef wrapper around definitions so they aren't included multipleadrian2013-10-241-0/+4
| | | | times.
* Factor out MI portions of the PowerPC nexus device into /sys/dev/ofw. Thenwhitehorn2013-10-232-0/+552
| | | | sparc64 driver will be modified to use this shortly.
* Update driver to version 10.0.664.0.delphij2013-10-238-241/+639
| | | | | | | Many thanks to Emulex for their continued support of FreeBSD. Submitted by: Venkata Duvvuru <VenkatKumar.Duvvuru Emulex Com> MFC after: 3 day
* Add two new interfaces to ofw_bus:nwhitehorn2013-10-232-0/+58
| | | | | | | | | | | | | | | | | | | | | | | - ofw_bus_map_intr() Maps an (iparent, IRQ) tuple to a system-global interrupt number in some platform dependent way. This is meant to be implemented as a replacement for [FDT_]MAP_IRQ() that is an MI interface that knows about the bus hierarchy. - ofw_bus_config_intr() Configures an interrupt (previously mapped) based on firmware sense flags. This replaces manual interpretation of the sense field in bus drivers and will, in a follow-up, allow that interpretation to be redirected to the PIC drivers where it belongs. This will eventually replace the tables in /sys/dev/fdt/fdt_ARCH.c The PowerPC/AIM code has been converted to use these globally, with an implementation in terms of MAP_IRQ() and powerpc_config_intr(), assuming OpenPIC, at the bus root in nexus(4). The ofw_bus_config_intr() will shortly be integrated into pic_if.m and bounced through nexus into the PIC tree. FDT integration will happen significantly later due to larger testing requirements. This patch in general also lays the groundwork for the removal of /sys/dev/fdt/fdt_ARCH.c and machine/fdt.h.
* Remove OF_instance_to_package() hack for FDT and replace with use of thenwhitehorn2013-10-234-22/+8
| | | | | generic OF_xref_phandle() API universally. Also replace some related explicit uses of fdt32_to_cpu() with OF_getencprop() calls.
* Make all Open Firmware internal interfaces endian-safe by using the newnwhitehorn2013-10-234-24/+22
| | | | | OF_getencprop() API. This removes one explicit endianness conversion in ofw_iicbus.c.
* Fix the RT2860_TX_SW_CFG2 init value on older revisions of RT3070 chip.kevlo2013-10-231-1/+1
|
* Fix build.andreast2013-10-231-2/+2
|
* A few other common cases for encode-int decoding: OF_getencprop_alloc()nwhitehorn2013-10-222-0/+35
| | | | | | | | | and OF_searchencprop(). I thought about using the element size parameter to OF_getprop_alloc() to do endian-switching automatically, but it breaks use with structs and a *lot* of FDT code (which can hopefully be moved to these new APIs). MFC after: 2 weeks
* Add a new function (OF_getencprop()) that undoes the transformation appliednwhitehorn2013-10-222-0/+18
| | | | | | by encode-int. Specifically, it takes a set of 32-bit cell values and changes them to host byte order. Most non-string instances of OF_getprop() should be using this function, which is a no-op on big-endian platforms.
* Mask out non-address bits in the mac address register, for properian2013-10-221-2/+1
| | | | | | detection of an all-zeroes address. Also remove a misplaced return. Reviewed by: br@
* MFP4: 223121 (PIC portion), 225861, 227822, 229692 (PIC only), 229693,brooks2013-10-221-0/+19
| | | | | | | | | | | | | | | | | | 230523, 1123614 Implement a driver for Robert Norton's PIC as an FDT interrupt controller. Devices whose interrupt-parent property points to a beripic device will have their interrupt allocation, activation , and setup operations routed through the IC rather than down the traditional bus hierarchy. This driver largely abstracts the underlying CPU away allowing the PIC to be implemented on CPU's other than BERI. Due to insufficient abstractions a small amount of MIPS specific code is currently required in fdt_mips.c and to implement counters. MFC after: 3 days Sponsored by: DARPA/AFRL
* Set BUS_PROBE_NOWILDCARD on this attachment as a stopgap. Unconditionallynwhitehorn2013-10-221-2/+13
| | | | | poking at registers in unknown devices is not the best probe mechanism. This should be reverted and a better solution found later.
* Allow lots of interrupts (useful on multi-domain platforms) and do notnwhitehorn2013-10-221-4/+2
| | | | set device_quiet() on all devices attached under nexus(4).
* Standards-conformance and code deduplication:nwhitehorn2013-10-223-14/+21
| | | | | | | | | | - Use bus reference phandles in place of FDT offsets as IRQ domain keys - Unify the identical macio/fdt/mambo OpenPIC drivers into one - Be more forgiving (following ePAPR) about what we need from the device tree to identify an OpenPIC - Correctly map all IRQs into an interrupt domain - Set IRQ_*_CONFORM for interrupts on an unknown PIC type instead of failing attachment for that device.
* Fix memory and references leak due to unfreed path.mav2013-10-221-1/+3
| | | | Coverity CID: 1109815
* Fix memory and references leak due to unfreed path.mav2013-10-221-1/+3
| | | | Coverity CID: 1109817
* Merge GEOM direct dispatch changes from the projects/camlock branch.mav2013-10-221-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When safety requirements are met, it allows to avoid passing I/O requests to GEOM g_up/g_down thread, executing them directly in the caller context. That allows to avoid CPU bottlenecks in g_up/g_down threads, plus avoid several context switches per I/O. The defined now safety requirements are: - caller should not hold any locks and should be reenterable; - callee should not depend on GEOM dual-threaded concurency semantics; - on the way down, if request is unmapped while callee doesn't support it, the context should be sleepable; - kernel thread stack usage should be below 50%. To keep compatibility with GEOM classes not meeting above requirements new provider and consumer flags added: - G_CF_DIRECT_SEND -- consumer code meets caller requirements (request); - G_CF_DIRECT_RECEIVE -- consumer code meets callee requirements (done); - G_PF_DIRECT_SEND -- provider code meets caller requirements (done); - G_PF_DIRECT_RECEIVE -- provider code meets callee requirements (request). Capable GEOM class can set them, allowing direct dispatch in cases where it is safe. If any of requirements are not met, request is queued to g_up or g_down thread same as before. Such GEOM classes were reviewed and updated to support direct dispatch: CONCAT, DEV, DISK, GATE, MD, MIRROR, MULTIPATH, NOP, PART, RAID, STRIPE, VFS, ZERO, ZFS::VDEV, ZFS::ZVOL, all classes based on g_slice KPI (LABEL, MAP, FLASHMAP, etc). To declare direct completion capability disk(9) KPI got new flag equivalent to G_PF_DIRECT_SEND -- DISKFLAG_DIRECT_COMPLETION. da(4) and ada(4) disk drivers got it set now thanks to earlier CAM locking work. This change more then twice increases peak block storage performance on systems with manu CPUs, together with earlier CAM locking changes reaching more then 1 million IOPS (512 byte raw reads from 16 SATA SSDs on 4 HBAs to 256 user-level threads). Sponsored by: iXsystems, Inc. MFC after: 2 months
* Return standards-compliant code from OF_nextprop() with FDT when nonwhitehorn2013-10-221-1/+1
| | | | properties remain on this node.
* Make netback compile without INET support in the kernel.bz2013-10-221-1/+1
| | | | | | | | This shuld have been a problem since r230587. Not exactly sure why it was not detected the last weeks with the tinderbox. I would assume r255744 is what started to cause it. MFC after: 1 week
* Remove the isf(4) driver. It was created by accident and is subset ofbrooks2013-10-214-1079/+0
| | | | | | | | the cfi(4) driver. It remained in the tree longer than would be ideal due to the time required to bring cfi(4) to feature parity. Sponsored by: DARPA/AFRL MFC after: 3 days
* MFP4: 223121 (FDT infrastructure portion)brooks2013-10-214-9/+392
| | | | | | | | | | Implement support for interrupt-parent nodes in simplebus. The current implementation requires that device declarations have an interrupt-parent node and that it point to a device that has registered itself as a interrupt controller in fdt_ic_list_head and implements the fdt_ic interface. Sponsored by: DARPA/AFRL
* Reset function on SandyBridge holds the gt_lock for the whole durationkib2013-10-211-1/+1
| | | | | | | | | | | | | | already. Also, according to the specs, GDRST register is not in the power well, so the forcewake for reset status read is excessive for this reason. Use plain register read for waiting of the reset completion notification, to avoid gt_lock recursion. Linux upstream did the similar change, but their code was already restructured. Reported by: ray Sponsored by: The FreeBSD Foundation MFC after: 1 week
* Merge CAM locking changes from the projects/camlock branch to radicallymav2013-10-216-58/+124
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | reduce lock congestion and improve SMP scalability of the SCSI/ATA stack, preparing the ground for the coming next GEOM direct dispatch support. Replace big per-SIM locks with bunch of smaller ones: - per-LUN locks to protect device and peripheral drivers state; - per-target locks to protect list of LUNs on target; - per-bus locks to protect reference counting; - per-send queue locks to protect queue of CCBs to be sent; - per-done queue locks to protect queue of completed CCBs; - remaining per-SIM locks now protect only HBA driver internals. While holding LUN lock it is allowed (while not recommended for performance reasons) to take SIM lock. The opposite acquisition order is forbidden. All the other locks are leaf locks, that can be taken anywhere, but should not be cascaded. Many functions, such as: xpt_action(), xpt_done(), xpt_async(), xpt_create_path(), etc. are no longer require (but allow) SIM lock to be held. To keep compatibility and solve cases where SIM lock can't be dropped, all xpt_async() calls in addition to xpt_done() calls are queued to completion threads for async processing in clean environment without SIM lock held. Instead of single CAM SWI thread, used for commands completion processing before, use multiple (depending on number of CPUs) threads. Load balanced between them using "hash" of the device B:T:L address. HBA drivers that can drop SIM lock during completion processing and have sufficient number of completion threads to efficiently scale to multiple CPUs can use new function xpt_done_direct() to avoid extra context switch. Make ahci(4) driver to use this mechanism depending on hardware setup. Sponsored by: iXsystems, Inc. MFC after: 2 months
* Move and rename dwc otg driver to moreganbold2013-10-211-0/+211
| | | | | | | | generic one as it appears to work for rk3188 SoC based board too. No objections from: hselasky@ Reviewed by: ray@
OpenPOWER on IntegriCloud