Commit Graph

34416 Commits

Author SHA1 Message Date
Pedro F. Giffuni
8a97717048 SPDX: fix wrong license ID tag in dev/cesa. 2017-12-28 03:10:57 +00:00
Pedro F. Giffuni
bd9ba70127 SPDX: fix wrong license ID tag in dev/spibus. 2017-12-28 03:04:36 +00:00
Navdeep Parhar
adbb3637ec cxgbe/iw_cxgbe: Fix iWARP over VLANs (catch up with r326169).
Submitted by:	KrishnamRaju ErapaRaju @ Chelsio
Sponsored by:	Chelsio Communications
2017-12-27 22:44:50 +00:00
Eitan Adler
caa7e52f3f kernel: Fix several typos and minor errors
- duplicate words
- typos
- references to old versions of FreeBSD

Reviewed by:	imp, benno
2017-12-27 03:23:21 +00:00
Kyle Evans
198ca831a1 extres/syscon: Commit missing bits from r327106
r327106 introduced kobj to syscon so it can be subclassed and fit in with
the rest of the syscon framework. The diff for syscon.c was misapplied in a
clean tree prior to commit, so bring it back to what was included in the
review and tested. The entire file has basically been rewritten from what
was present prior to the kobj work.

Pointy hat to:	me
2017-12-26 16:38:04 +00:00
Emmanuel Vadot
b6d40d9394 Change the remaining files using my personnal email address to my freebsd one 2017-12-25 22:09:25 +00:00
Alexander Kabaev
151ba7933a Do pass removing some write-only variables from the kernel.
This reduces noise when kernel is compiled by newer GCC versions,
such as one used by external toolchain ports.

Reviewed by: kib, andrew(sys/arm and sys/arm64), emaste(partial), erj(partial)
Reviewed by: jhb (sys/dev/pci/* sys/kern/vfs_aio.c and sys/kern/kern_synch.c)
Differential Revision: https://reviews.freebsd.org/D10385
2017-12-25 04:48:39 +00:00
Kyle Evans
cd04523f0e Move syscon into extres framework
This should help reduce confusion between syscon/syscons a little bit.
syscon is a resource generally modeled by FDT platforms, and not to be
confused with syscons.
2017-12-23 14:30:44 +00:00
Kyle Evans
4d68f3daa0 syscon: Introduce kobj and split out fdt bits
Allow more flexibility by kobj'ifying syscon and splitting out fdt specific
bits in preparation of a move to the extres framework.

The generic fdt driver has been moved to syscon_generic.c and the fdt
requirement has been removed from the syscon interface, as is common to the
extres framework.

Reviewed by:	strejda
Differential Revision:	https://reviews.freebsd.org/D13521
2017-12-23 14:27:42 +00:00
Warner Losh
5fe4723c70 Create a new ISA_PNP_INFO macro. Use this macro every where we have
ISA PNP card support (replace by hand version in if_ed). Move module
declarations to the end of some files. Fix PCCARD_PNP_INFO to use
nitems(). Remove some stale comments about pc98, turns out the comment
was simply wrong.
2017-12-23 06:49:27 +00:00
Warner Losh
75d0374765 Expand cryptic comment with inforation I've learned in the mean time
about CIS3/CIS4, including studies I've done on my large collection of
PC Cards bought off e-bay over the years since the original entry as
well as conversations I've had at conferences.
2017-12-23 06:11:19 +00:00
Warner Losh
a914e889e3 These drivers have a sentinel at the end of the device list. Exclude
it.
2017-12-23 05:32:20 +00:00
Warner Losh
6efa5583c7 Fix typos from last commit, these should have been #. 2017-12-22 20:48:49 +00:00
Alexander Motin
d171d2f281 Add AHCI/XHCI device IDs found on AMD Ryzen+B350 system.
MFC after:	2 weeks
2017-12-22 20:44:21 +00:00
Navdeep Parhar
f549e3521d cxgbe(4): Do not forward interrupts to queues with freelists. This
leaves the firmware event queue (fwq) as the only queue that can take
interrupts for others.

This simplifies cfg_itype_and_nqueues and queue allocation in the driver
at the cost of a little (never?) used configuration.  It also allows
service_iq to be split into two specialized variants in the future.

MFC after:	2 months
Sponsored by:	Chelsio Communications
2017-12-22 19:10:19 +00:00
Warner Losh
d2064cf030 Use '#' rather than some made up name for fields we want to ignore. 2017-12-22 17:53:27 +00:00
Pedro F. Giffuni
fdac1d623b SPDX: Reverse License ID tags from the lmc driver.
While the BSD-2-Clause license is there, the GPLv2 is also present.
I am unsure of the implications of having both licenses as they are here.

I'll just leave it untagged and open for interpretation.
2017-12-22 17:15:02 +00:00
Warner Losh
a5ec991c27 Need to NULL terminate this list. It worked before by accidental data
in the module following it that terminated the search.
2017-12-22 17:13:54 +00:00
Warner Losh
56f3600c8b PC Card PNP tables are terminated by a NULL sentinel. This shouldn't
be recorded in the linker hints, so subtract one to omit it.
2017-12-22 16:59:50 +00:00
Navdeep Parhar
426b6bd53c cxgbe(4): Read the MFG diags version from the VPD and make it available
in the sysctl MIB.

MFC after:	1 week
Sponsored by:	Chelsio Communications
2017-12-21 15:19:43 +00:00
Eric Joyner
788a123054 ixgbe(4): Fix build error on i386.
Reported by:	markj
2017-12-21 00:35:14 +00:00
Warner Losh
4571c92f4b Simplify the code a bit.
Replace clumsy for(;;) { if (foo) break; ...} with simpler
while (!foo) { ... }.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D13546
2017-12-20 19:14:16 +00:00
Warner Losh
bb0107830d Add device location wiring to the pci bus.
This allows one to specify, for example, that if there's an igb card
in bus 12, slot 0, function 0, it should be assigned igb5. If there
isn't, or there's one in a different slot, normal numbering rules
apply (hinted units are skipped). Adding 'hint.igb.5.at="pci12:0:0"'
or 'hint.igb.5.at="pci0:12:0:0"' to /boot/device.hints will accomplish
this. The double quotes are important.

The kernel only accepts the strings (in shell notation):
	pci$d:$b:$s:$f
and	pci$b:$s:$f
where $d is the pci domain, $b is the pci bus number, $s is the slot
number and $f is the function number. A string compare is done with
the current device to avoid another string parser in the kernel. All
numbers are unsigned decimal without leading zeros.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D13546
2017-12-20 19:14:05 +00:00
Warner Losh
4484c8f5d2 Return domain, bus, slot, and function for the transport settings in
PATH_INQ requests for nvme.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D13546
2017-12-20 19:13:55 +00:00
Ian Lepore
5cf10fb96a Add a new kernel config option, MD_ROOT_READONLY, which forces on the
MD_READONLY flag for the md device automatically instantiated during
kernel init for an mdroot filesystem.

Note that there is specifically and by design no tunable or sysctl
control over this feature.  Without this option, you already have control
over whether the mdroot fs is writeable using vfs.root.mountfrom.options
from loader(8), the root_rw_mount rcvar, and by using "mount -u[rw] /"
or equivelent on the fly.  This option is being added to provide a way
to make the mdroot fs truly immutable before userland code begins running.

Differential Revision:	https://reviews.freebsd.org/D13411
2017-12-20 18:23:22 +00:00
Eric Joyner
c19c7afee3 ixgbe(4): Convert driver to use iflib
Initial update to the ixgbe PF and VF drivers to support the iflib interface.

The PF driver version is bumped to 4.0.0, and the VF driver version is bumped to 2.0.0.

Special thanks to sbruno@ for the support in helping make this conversion happen.

Submitted by:	Jeb Cramer <cramerj@intel.com>, Krzysztof Galazka (Chris) <krzysztof.galazka@intel.com>, Piotr Pietruszewski <piotr.pietruszewski@intel.com>
Reviewed by:	sbruno@, shurd@, #IntelNetworking
Tested by:	Jeffrey Pieper <jeffrey.e.pieper@intel.com>, Sergey Kozlov <kozlov.sergey.404@gmail.com>
Sponsored by:	Limelight Networks, Intel Corporation
Differential Revision:	https://reviews.freebsd.org/D11727
2017-12-20 18:15:06 +00:00
Stephen Hurd
ff46fd16e5 Add log messages for unknown and unhandled phy types
Previously, it silently only supported auto, instead, log a message
indicating why only auto is supported.

Submitted by:	Bhargava Chenna Marreddy <bhargava.marreddy@broadcom.com>
Sponsored by:	Broadcom Limited
Differential Revision:	https://reviews.freebsd.org/D13358
2017-12-19 22:15:46 +00:00
Stephen Hurd
a0b660301a On Link up & down, update media types
It's possible to change the SFP module when link is down, which would
change the available media types.  This is part of D13358.

Submitted by:	Bhargava Chenna Marreddy <bhargava.marreddy@broadcom.com>
Sponsored by:	Broadcom Limited
2017-12-19 22:06:25 +00:00
Stephen Hurd
980da9f2f0 Support short HWRM commands
New Stratus bnxt devices require support for short HWRM commands for VFs
to function.  Enable their use, but only use them if it's both supported
and required... prefer the long HWRM commands when possible.

Submitted by:	Bhargava Chenna Marreddy <bhargava.marreddy@broadcom.com>
Sponsored by:	Broadcom Limited
Differential Revision:	https://reviews.freebsd.org/D13269?id=36180
2017-12-19 21:07:30 +00:00
Stephen Hurd
6a0dc418a6 Don't populate NVRAM sysctls for VFs
Only the PF allows NVRAM interaction on bnxt devices.

Submitted by:	Bhargava Chenna Marreddy <bhargava.marreddy@broadcom.com>
Sponsored by:	Broadcom Limited
2017-12-19 20:32:45 +00:00
Stephen Hurd
78fcf2de93 Add byte swapping in bnxt_cfg_async_cr() request
The firmware is always in little endian, use htole*() for all request fields
larger than one byte.

Submitted by:	Bhargava Chenna Marreddy <bhargava.marreddy@broadcom.com>
Sponsored by:	Broadcom Limited
2017-12-19 18:12:18 +00:00
Stephen Hurd
96fc97c81f Update Matthew Macy contact info
Email address has changed, uses consistent name (Matthew, not Matt)

Reported by:	Matthew Macy <mmacy@mattmacy.io>
Differential Revision:	https://reviews.freebsd.org/D13537
2017-12-19 17:59:00 +00:00
Konstantin Belousov
e44f4f3547 mlx5en: Avoid SFENCe on x86
The IA32 memory model guarantees that all writes are seen in the program
order.  Also, any access to the uncacheable memory flushes the store
buffers.  As the consequence, SFENCE instruction is (almost) never needed,
in particular, it is not needed to ensure the correct order of updates as
seen by a PCIe device.

Use atomic_thread_fence_rel() instead of wb() to only emit compiler barriers
on x86 there.  Other architectures get the right barrier instruction as
well.

Reviewed by:	hselasky
Sponsored by:	Mellanox Technologies
MFC after:	1 week
2017-12-19 14:11:41 +00:00
Conrad Meyer
e054cac74a Implement ACPI CPU support when Processor object is not present
By the ACPI standard (ACPI 5 chapter 8.4 Declaring Processors) Processors
can be implemented in 2 distinct ways:

* Through a Processor object type (which provides P_BLK)
* Through a Device object type

Prior to this change, the FreeBSD driver only supported the former.  AMD
Epyc / Poweredge systems we are testing both implement the latter only.  Add
the missing support.

Because P_BLK is not defined in the device object case, C-states entering
must be completely controlled via _CST methods rather than P_LVL2/3.

John Baldwin points out that ACPI 6.0 formally deprecates the Processor
keyword, so eventually processors will only be enumerated as Device objects.

Submitted by:	attilio
Reviewed by:	jhb, markj, Anton Rang <rang AT acm.org>
Relnotes:	maybe
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D13457
2017-12-19 02:49:11 +00:00
Warner Losh
989c7f0b7c Although we only have one quirk at the moment, guard against the day
we have more than one by checking the actual quirk bit before delaying
the reset.

Noticed by: rpokala@
2017-12-18 20:11:21 +00:00
Warner Losh
ce1ec9c178 When we're disabling the nvme device, some drives have a controller
bug that requires 'hands off' for a period of time (2.3s) before we
check the RDY bit. Sicne this is a very odd quirk for a very limited
selection of drives, do this as a quirk. This prevented a successful
reset of the card when the card wedged.

Also, make sure that we comply with the advice from section 3.1.5 of
the 1.3 spec says that transitioning CC.EN from 0 to 1 when CSTS.RDY
is 1 or transitioning CC.EN from 1 to 0 when CSTS.RDY is 0 "has
undefined results". Short circuit when EN == RDY == desired state.

Finally, fail the reset if the disable fails. This will lead to a
failed device, which is what we want. (note: nda device needs
work for coping with a failed device).

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D13389
2017-12-18 18:38:00 +00:00
Landon J. Fuller
6585f74d30 bhnd(4): Fix the pa0itssit/pa1itssit NVRAM variable type definitions
required by bwn(4); idle TSSI target values are expressed as signed
integers.

Sponsored by:	The FreeBSD Foundation
2017-12-16 05:22:16 +00:00
Landon J. Fuller
80a7c0f53b bhndb(4): Enable addrext support on DMA64 devices, and fix an incorrect DMA
DMA boundary constraint applied in bhndb_dma_tag_create().

Sponsored by:	The FreeBSD Foundation
2017-12-16 04:35:37 +00:00
Landon J. Fuller
6467a17b49 bhnd(4)/bwn(4): Fix a number of small issues reported by Coverity.
- Fix reference of uninitialized error value in bhndb_generic_resume() if
  the dynamic window count is 0.

- Fix incorrect bhnd_pmu(4) UPTME_MASK and PLL0_PC2_WILD_INT_MASK
  constants.

- Variable definitions referenced by our generated SPROM layouts will never
  be NULL, but add explicit asserts to make that clear.

- Add missing variable initialization in bhnd_nvram_sprom_ident().

- Fix leak of driver array in bhnd_erom_probe_driver_classes().

- Fix zero-length memset() in bhndb_pci_eio_init().

- Fix an off-by-one error and potential invalid OOBSEL bit shift operation
  in bcma_dinfo_init_intrs().

- Remove dead code in siba_suspend_hw().

- Fix duplicate call to bhnd_pmu_enable_regulator() in both the enable and
  disable code paths of bhnd_compat_cc_pmu_set_ldoparef().

Reported by:	Coverity
CIDs:		1355194, 1362020, 1362022, 1373114, 1366563, 1373115,
		1381569, 1381579, 1383555, 1383566, 1383571
Sponsored by:	The FreeBSD Foundation
2017-12-15 04:51:47 +00:00
Landon J. Fuller
0bffd21750 Add basic bwn(4) support for the (BCMA-based) BCM43224 and BCM43225.
- Add the BCM4322X D11 core revision and missing BCM43224 PCI device ID to
  our device tables.
- Disable the DMA engine parity check (rather than adding parity support
  to the to-be-replaced bwn(4) DMA implementation).

Currently, N-PHY support in bwn(4) is GPL licensed, and is not included by
default. Until this is replaced with Broadcom's ISC-licensed N-PHY
implementation, bwn(4) must be rebuilt to enable N-PHY support.

To build bwn(4) with N-PHY support, add the following lines to your kernel
configuration file and rebuild the kernel (and modules):

	options BWN_GPL_PHY

To test bwn(4) with a BCM43224/BCM43225 device, install the firmware from
the net/bwn-firmware-kmod port, and place the following lines in
loader.conf(5):

	hw.bwn_pci.preferred="1"

	if_bwn_pci_load="YES
	bwn_v4_ucode_load="YES"
	bwn_v4_n_ucode_load="YES"
	bwn_v4_lp_ucode_load="YES"

Approved by:	adrian (mentor, implicit)
Sponsored by:	The FreeBSD Foundation
2017-12-14 06:45:04 +00:00
Justin Hibbits
b7bdc6a94f Allow bman-portals and qman-portals to attach to simple-bus
Official Linux dts's put the individual portals under a simple-bus, rather
than under a '*-portals' grouping.  This adds a hack to permit that, which
gets us closer to using stock device trees for DPAA-based devices.
2017-12-14 04:41:07 +00:00
Landon J. Fuller
c7f55202d3 bhndb(4): Fix two register window overcommit bugs introduced in r326297:
- The window target must always be updated when stealing a register window.
- Fix missing initialization of bhndb(4) region alloc_flags when
  registering statically mapped port regions (caught by scan-build).

Approved by:	adrian (mentor, implicit)
Sponsored by:	The FreeBSD Foundation
2017-12-14 03:41:12 +00:00
Landon J. Fuller
03362f9a6f bhnd_chipc(4): Correct typo in flag macros that broke clearing of GPIO
pin flags.

Approved by:	adrian (mentor, implicit)
Sponsored by:	The FreeBSD Foundation
2017-12-14 03:12:05 +00:00
Landon J. Fuller
7f1c814bb3 bhnd(4): Add missing enclosing parentheses to the bhnd bus space macros to
avoid precedence bugs.

Approved by:	adrian (mentor, implicit)
Sponsored by:	The FreeBSD Foundation
2017-12-14 03:03:08 +00:00
Landon J. Fuller
566ca880a1 bhnd(4): Include board_devid in the bhnd_board_info structure, and populate
the expected default board_vendor value on MIPS SoCs.

This is required by bwn(4) to differentiate between single-band and
dual-band device variants that otherwise share a common chip ID.

Approved by:	adrian (mentor, implicit)
Sponsored by:	The FreeBSD Foundation
2017-12-14 01:58:05 +00:00
Pedro F. Giffuni
9b10f59a10 SPDX: mostly fixes to previous changes.
Introduce the recently approved BSD-1-Clause and replace 0BSD which
never did fit well our use cases.
2017-12-13 16:13:17 +00:00
Warner Losh
d6f64df912 1k objects on the stack are a bad idea. While it's likely safe in this
context, it's also safe to allocate the memory and free it instead.

Noticed by: Eugene Grosbein's script
2017-12-12 20:22:09 +00:00
Kyle Evans
ce5252c4ba Correct a typo in syscon driver 'modify' logic
Not previously caught because the current consumer (not yet in tree) doesn't
use the 'modify' bits (yet).

Reported by:	rpokala
2017-12-11 22:55:51 +00:00
Kyle Evans
b9f5a3d3c0 Add generic 'syscon' driver
Upstream dts for allwinner will require a syscon driver, since the emac node
coming in 4.15 will be using xref to /soc/syscon for configuring the emac
clock. Add a generic syscon driver to attach to /soc/syscon for use by
if_awg, providing basic read/write functionality to consumers.

syscon driver will also be used by arm64 at least for A64+H5 emac/if_awg.

Written by:	mmel
Reviewed by:	manu
Differential Revision:	https://reviews.freebsd.org/D13295
2017-12-11 18:04:04 +00:00
Ian Lepore
3102bbe940 Do not give up if writing to the chip's control and status registers fails
during startup.  When a brand new chip leaves the factory, it is in a
special power-saving mode that disables most functions on the chip to
save battery power.  The chip is stuck in this mode until the first write
to the time registers, which automatically clears the special power-saving
mode and starts the oscillator.

Also, the day-of-week register in this chip counts 1-7, not 0-6, so write
the values accordingly.

These changes are based on the patch submitted by Brian Scott, but I
elimated warnings since this condition is expected, and added some comments,
and so in general blame me for any mistakes.

PR:		223642
2017-12-10 18:55:42 +00:00