Commit Graph

31489 Commits

Author SHA1 Message Date
Adrian Chadd
40424a256a [mx25l] add Winbond w25x64 support.
PR:		https://github.com/freebsd/freebsd/pull/16
Submitted by:	https://github.com/epipenau
2016-05-26 01:19:13 +00:00
Adrian Chadd
72ebcd5db5 [bhnd] Fix release of uninitialized SPROM shadow in chipc detach.
This was triggering a panic on detach; the SPROM shadow is now
maintained by the bhnd_sprom_chipc driver, and should be removed
from chipc.

Submitted by:	Landon Fuller <landonf@landonf.org>
Differential Revision:	https://reviews.freebsd.org/D6548
2016-05-26 00:44:16 +00:00
Adrian Chadd
785df0cb3f [bhnd] Integrate bhnd_chipc's BUS_ADD_CHILD() with a child resource mapping table.
This adds support for automatically configuring bhnd_chipc bus children
with associated resources, using an internal 'hints' table based directly
on Michael Zhilin's chipc resource mapping work.

The bhnd_sprom_chipc driver has been converted to use DEVICE_IDENTIFY()
with the new resource table.

This should be nearly drop-in compatible with the child device drivers
in D6250.

Submitted by:	Landon Fuller <landonf@landonf.org>
Reviewed by:	Michael Zhilin <mizhka@gmail.com>
Differential Revision:	https://reviews.freebsd.org/D6525
2016-05-26 00:43:08 +00:00
Hans Petter Selasky
fa201e28fc Prepare for activation of LinuxKPI module parameters as read-only
tunable SYSCTL's. Linux module parameters are associated with the
module they belong to. FreeBSD does not share this concept of a parent
module. Instead add macros which define the prefix to use for the
module parameters in the LinuxKPI consumers.

While at it convert all "bool" LinuxKPI module parameters to "byte"
type, because we don't have a "bool" type of SYSCTL in FreeBSD.

Sponsored by:	Mellanox Technologies
MFC after:	1 week
2016-05-25 12:03:21 +00:00
Hans Petter Selasky
10aab8b611 Check for signals when locking the USB enumeration thread from
userspace, so that USB applications can be killed if an enumeration
thread should be stuck for various reasons.

MFC after:	1 week
2016-05-25 07:48:36 +00:00
Stanislav Galabov
83cb053574 Align radiotap structures in ral(4)
Currently all radiotap structures in ral(4) are packed, but are not
aligned, which causes ral based devices to crash when one does
'ifconfig wlan0 up' for a wlan interface with a ral wlandev on arches
that care about structure alignment (e.g., MIPS).

Adding an aligned attribute helps fix this problem and ral devices
can be properly brought up.

Reviewed by:	adrian
Sponsored by:	Smartcom - Bulgaria AD
2016-05-25 06:29:23 +00:00
Sepherosa Ziehau
dade2a02e3 hyperv: Preserve required bits when disable Hypercall
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6530
2016-05-25 06:01:47 +00:00
Sepherosa Ziehau
6d6baea80d hyperv/vmbus: Rework SynIC setup and teardown
- Avoid bit fields.
- Fix SINT setup (preserve required bits).

MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6529
2016-05-25 05:53:12 +00:00
Sepherosa Ziehau
c1d5ebc5a4 hyperv/vmbus: Nuke unnecessary MSR read
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6528
2016-05-25 05:45:43 +00:00
Sepherosa Ziehau
8239b2f287 hyperv/vmbus: Pass vmbus softc to vmbus_synic_setup
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6527
2016-05-25 05:37:42 +00:00
Sepherosa Ziehau
c4592280be hyperv/vmbus: Minor style and white space cleanup
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6523
2016-05-25 05:30:48 +00:00
Sepherosa Ziehau
20bce8fa9f hyperv/vmbus: Move two global flags into vmbus softc
And pack them into one flag field.

MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6522
2016-05-25 05:22:35 +00:00
Sepherosa Ziehau
14aa3e8097 hyperv/vmbus: Move vcpuid into vmbus softc per-cpu data
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6521
2016-05-25 05:06:15 +00:00
Sepherosa Ziehau
95a45414a0 hyperv/vmbus: Move event/message taskqueue/task to vmbus softc
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6520
2016-05-25 04:59:20 +00:00
Sepherosa Ziehau
bd5465a441 hyperv/vmbus: Allocate/setup IDT vector after all ISR resources are ready
And release IDT vector before releasing ISR resources on interrupt
teardown path.  We still have some work to do on the interrupt tearing
down path.

MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6519
2016-05-25 03:39:42 +00:00
Sepherosa Ziehau
01ac237df2 hyperv/vmbus: Check hyperv_dmamem_alloc return value
Though it is highly unlikely this function would fail w/ BUS_DMA_WAITOK,
we had better to check its return value; better safe then sorry here.

MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6518
2016-05-25 03:30:56 +00:00
Justin Hibbits
0e9f21dc24 Set the TLB caching properties for portals at attach time.
This was found while reworking the device tree nodes for dtsec to match the
Linux device tree.  Instead of waiting and expecting later code to call
dpaa_portal_map_registers(), do the equivalent immediately upon mapping.
Otherwise, it's possible to access the pages before that function is called, and
hang the CPU.
2016-05-25 01:23:19 +00:00
Adrian Chadd
5ad9ac037d [bhnd] Normalize bhnd(4) device matching API
This unifies handling of core, chip, and board-level device
matching, and adds support for matching device drivers
against the bus attach type (e.g. SoC vs WiFi adapter).

Core-level quirks on Broadcom's chipsets generally are specific
to some combination of chip model, core revision, chip
package (e.g. 12x9 SMT package), SROM revision, etc.

Unifying the match APIs for all three attribute types (core, chip,
board/srom) allows defining a single device quirk table that
matches across all of those attributes.

Submitted by:	Landon Fuller <landonf@landonf.org>
Differential Revision:	 https://reviews.freebsd.org/D6515
2016-05-24 21:20:17 +00:00
Adrian Chadd
b80427f906 [bhnd] fix compilation due to incompatible types
Submitted by:	Michael Zhilin <mizhka@gmail.com>
Differential Revision: https://reviews.freebsd.org/D6532
2016-05-24 15:39:57 +00:00
Edward Tomasz Napierala
09c84055a0 Add kern.icl.iser_offloads sysctl.
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2016-05-24 14:34:36 +00:00
Sean Bruno
6115013663 Reject ioctl commands for FLSHGCHR and FLSHPCHR if the size is greater
than sc->areq.  This is a bounds check to ensure we're not just cramming
arbitrarily sized nonsense into the driver and overflowing the heap.

PR:		209545
Submitted by:	cturt@hardenedbsd.org
MFC after:	2 weeks
2016-05-24 13:57:23 +00:00
Alexander Motin
b72a6f8a8f Re-enable write combining, disabled by default at r295486.
if_ntb(4) strongly benefits from WC, improving throughput from 350Mbit/s
to 8-10Gbit/s on my tests.

MFC after:	1 week
2016-05-24 12:40:03 +00:00
Andrew Rybchenko
131bc376b9 sfxge(4): enable Medford support
Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D6510
2016-05-24 12:20:23 +00:00
Andrew Rybchenko
1baf53ec8d sfxge(4): bump driver version to the closest out-of-tree version
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
2016-05-24 12:19:14 +00:00
Andrew Rybchenko
929c7feb83 sfxge(4): cleanup: update copyright to 2016
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D6509
2016-05-24 12:16:57 +00:00
Andrew Rybchenko
ecaa500c4b sfxge(4): provide option to disable not a local MAC address check
Option EFSYS_OPT_ALLOW_UNCONFIGURED_NIC disables check that the adapter
MAC address is not a local address (beginning 02).

Submitted by:   Laurence Evans <levans at solarflare.com>
Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D6508
2016-05-24 12:15:30 +00:00
Andrew Rybchenko
bdb482bfa0 sfxge(4): be ready to receive events immediately after event queues are created
Submitted by:   Mark Spender <mspender at solarflare.com>
Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D6507
2016-05-24 12:14:19 +00:00
Edward Tomasz Napierala
93fb610fe8 Rename kern.icl.drivers to kern.icl.offloads, for consistency.
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2016-05-24 08:54:41 +00:00
Edward Tomasz Napierala
b891159418 Add mechanism for choosing iSER-capable ICL modules.
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2016-05-24 08:44:45 +00:00
Sepherosa Ziehau
8982969f05 hyperv/vmbus: Free message taskqueue during interrupt teardown
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6506
2016-05-24 07:07:11 +00:00
Sepherosa Ziehau
b28956a456 hyperv/vmbus: Factor out functions for vmbus interrupt set/teardown
This paves way for further cleanup and fix.

MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6505
2016-05-24 06:42:14 +00:00
Sepherosa Ziehau
bcc9e3e995 hyperv/vmbus: Git rid of sc version of pcpu data extraction macro
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6503
2016-05-24 06:10:21 +00:00
Sepherosa Ziehau
0408d8b80a hyperv/vmbus: Use busdma(9) for messages and event flags
And
- Move message and event flags to vmbus_softc per-cpu data.
- Get rid of hv_setup_arg, which serves no purpose now.

MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6502
2016-05-24 06:01:39 +00:00
Sepherosa Ziehau
fc2d20095c hyperv/vmbus: Move SynIC setup/teardown from hyperv file to vmbus file
Avoid unnecessary exposure.

MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6501
2016-05-24 05:51:51 +00:00
Sepherosa Ziehau
5c8e70d86c hyperv/vmbus: Rename local variable and break long lines
No functional changes.

MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6500
2016-05-24 05:43:55 +00:00
Sepherosa Ziehau
d8313c45a6 hyperv/busdma: Take BUS_DMA_ZERO into account
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6499
2016-05-24 05:26:52 +00:00
Sepherosa Ziehau
86931e66f6 hyperv/vmbus: Pass vmbus_softc and curcpu to hv_vmbus_isr()
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6498
2016-05-24 05:18:26 +00:00
Sepherosa Ziehau
a995872175 hyperv/vmbus: Move vmbus interrupt counter into vmbus softc
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6497
2016-05-24 05:06:01 +00:00
Adrian Chadd
40dcddfcca [bwn] begin separating out the attach path from the SIBA specific bits.
* convert phy_getinfo() to take a "gmode" flag, rather than the siba
  TGSHIGH flags and then check for 2GHz.  This should ensure that
  gmode is set correctly even on DUALPHY NICs.
* move the siba_powerup() call and the TGSHIGH decoding into a
  call to bwn_is_bus_siba(), and return an error if it's called
  on anything else.  We don't yet do anything else, but when we do..

Tested:

* BCM4322, 11a STA
2016-05-24 04:58:58 +00:00
Adrian Chadd
972459a6ca [bwn] add BCM43225 to the BHND device list.
This is all for the bhnd(4) work in progress.  It's enough to probe/attach
all the bhnd internals, but we're missing OTP support and some cleanup
code.  And, well, all the rest of the bhnd(4) migration.

So no, this won't give you BCM43225 support.  Sorry!
2016-05-24 04:55:00 +00:00
Sean Bruno
bf10f1a085 Update some of the TBD entries in ciss(4) to match what's in the pci
IDS data.

Submitted by:	Dmitry Luhtionov <dmitryluhtionov@gmail.com>
MFC after:	2 weeks
2016-05-24 01:42:21 +00:00
Luiz Otavio O Souza
8ba8cb912b Move the OFW iicbus code to dev/iicbus to stop polluting dev/ofw with
unrelated code.

Discussed with:		nwhitehorn (a long time ago)
2016-05-24 01:33:49 +00:00
Adrian Chadd
a7978cf36d [bwn] add extra debugging for non-SIBA devices.
This is a no-op at the present moment, but will eventually remind me
where the SIBA specific demons lie.

Tested:

* BCM4322, STA mode
2016-05-24 01:20:30 +00:00
Adrian Chadd
f4a3eb0297 [bhnd] Implement pass-through resource management for ChipCommon.
This patchset adds support to bhnd_chipc for sharing SYS_RES_MEMORY
resources with its children, allowing us to hang devices off of
bhnd_chipc that rely on access to a subset of the device register space
that bhnd_chipc itself must also allocate.

We could avoid most of this heavy lifting if RF_SHAREABLE+SYS_RES_MEMORY
wasn't limited to use with allocations at the same size/offset.

As a work-around, I implemented something similar to vga_pci.c, which
implements similar reference counting of of PCI BAR resources for its
children.

With these changes, chipc will use reference counting of SYS_RES_MEMORY
allocation/activation requests, to decide when to allocate/activate/
deactivate/release resources from the parent bhnd(4) bus.

The requesting child device is allocated a new resource from chipc's
rman, pointing to (possibly a subregion of) the refcounted bhnd resources
allocated by chipc.

Other resource types are just passed directly to the parent bhnd bus;
RF_SHAREABLE works just fine with IRQs.

I also lifted the SPROM device code out into a common driver, since this
now allows me to hang simple subclasses off of a common driver off of both
bhndb_pci and bhnd_chipc.

Tested:

* (landonf) Tested against BCM4331 and BCM4312, confirmed that SPROM still
  attaches and can be queried.

Submitted by:	Landon Fuller <landonf@landonf.org>
Reviewed by:	mizkha@gmail.com
Differential Revision:	https://reviews.freebsd.org/D6471
2016-05-24 01:12:19 +00:00
Conrad Meyer
ab7c85b4b9 ntb_hw(4): Only record the first three MSIX vectors
Don't overrun the msix_data array by reading the (unused) link state
interrupt information.

Reported by:	mav (earlier version)
Sponsored by:	EMC / Isilon Storage Division
Differential Revision:	https://reviews.freebsd.org/D6489
2016-05-23 19:46:58 +00:00
Andrew Rybchenko
899466f91e sfxge(4): cleanup: remove unused EFX preempt macros
The EFSYS_PREEMPT_DISABLE() and EFSYS_PREEMPT_ENABLE() macros
were used to ensure correct timing of I2C operations. The APIs
for I2C operations have been removed, so these macros have no
callers.

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
2016-05-23 13:17:37 +00:00
Sepherosa Ziehau
fc4d679fd7 hyperv/vmbus: Move IDT vector to vmbus_softc
Prepare to get rid of the hv_setup_arg.

MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6449
2016-05-23 07:32:34 +00:00
Sepherosa Ziehau
e2468dfeff hyperv/vmbus: Get rid of vmbus_devp
While I'm here, nuke useless print in vmbus_attach().

MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6447
2016-05-23 07:23:19 +00:00
Sepherosa Ziehau
c4b78721e3 hyperv/vmbus: Declare Synic message and event w/ proper types
Avoid ugly casts.

MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6446
2016-05-23 07:14:04 +00:00
Sepherosa Ziehau
ae39ebd8df hyperv: Move Hypercall setup to an early place.
It does not belong to the vmbus.

While I'm here rework the Hypercall setup, e.g. use busdma(9)
and avoid bit fields.

Discussed with:	Jun Su <junsu microsoft com>
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6445
2016-05-23 07:06:53 +00:00