Commit Graph

28325 Commits

Author SHA1 Message Date
kib
571ee1f33d MFC r277487:
An update for the i915 GPU driver, which brings the code up to Linux
commit 4d93914ae3db4a897ead4b.

MFC r277959 (by adrian):
Fix backlight for ivybridge based laptops (and whatever else comes through
this codepath.)

MFC r278146:
Do not attach to the unsupported chipsets, unless magic tunable is
frobbed.

MFC r278147, r278148:
Fix sign for the error code returned from the driver-specific code.

MFC r278152:
Do not access gmbus_ports array past its end.

MFC r278159 (by emaste):
Remove duplicate intel_fbc_enabled prototype.
2015-03-23 13:38:33 +00:00
jah
cc715d0ecb MFC r279919: Using parent DMA tag in drm_pci_alloc(). This can allow
drm2 devices to work with Intel DMAR enabled for the system, as long as
DMAR is disabled for the drm2 device.

Reviewed by:	kib (mentor)
2015-03-22 18:32:37 +00:00
mav
3886296967 MFC r279963: Fix SATA Gen3 speed constants. 2015-03-20 08:28:11 +00:00
rwatson
6102a34d38 Merge r263233 from HEAD to stable/10:
Update kernel inclusions of capability.h to use capsicum.h instead; some
  further refinement is required as some device drivers intended to be
  portable over FreeBSD versions rely on __FreeBSD_version to decide whether
  to include capability.h.

Sponsored by:	Google, Inc.
2015-03-19 13:37:36 +00:00
mav
a4ce980fef MFC r279651, r279652, r279657:
Add support for TOPOLOGY feature of virtio block device.

Passing through physical block size/offset from underlying storage allows
guest to manage proper data and I/O alignment to improve performance.
2015-03-19 09:53:00 +00:00
mav
cb8ecb44ad MFC r279642: Reenable VIRTIO_BLK_F_TOPOLOGY feature. 2015-03-19 09:47:57 +00:00
jhb
78e2d91db9 MFC 270516:
i915 driver - enable opregion handle; program CADL.

add opregion handling for drm2 - which exposes some ACPI video configuration
pieces that some Lenovo laptop models use to flesh out which video device
to speak to.  This enables the brightness control in ACPI to work these models.

The CADL bits are also important - it's used to figure out which ACPI
events to hook the brightness buttons into.  It doesn't yet seem to work
for me, but it does for the OP.

PR:		190186, 198551
Submitted by:	Henry Hu <henry.hu.sh@gmail.com>
2015-03-13 18:38:02 +00:00
jhb
b3716d5321 MFC 278292:
Add the device ID for the AMT serial port on my Thinkpad T400.
2015-03-12 15:48:25 +00:00
mav
24b691f711 MFC r271146,271201,271207,271261,271457,272606,277100,277126,278034,279320,
279573:  Sync AHCI driver with HEAD.

Due to code reorganization in r271146 and many previous reordered merges it
is problematic to merge those revisions separately.
2015-03-12 13:40:02 +00:00
mav
19c51041e7 MFC r270833 (by imp):
We were returning 20 bytes as the FIS size to send, but only
initializing 16. Initialize all 20 so we don't send garbage in the
Auxiliary register. The SATA standard mandates a 5 dword length for
the Host to Device FIS.
2015-03-12 13:16:05 +00:00
scottl
565f091b88 MFC r271889, 272799, 272800, 274976
This brings in bus_get_domain() and the related reporting via devinfo,
dmesg, and sysctl.

Obtained from:	adrian, jhb
Sponsored by:	Netflix, Inc.
2015-03-12 07:07:41 +00:00
hselasky
b1144e1390 MFC r279563:
Add quirk for USB 3.0 controllers which don't support 64-bit DMA.
2015-03-06 16:08:10 +00:00
hselasky
dd89b387bb MFC r279544:
Add quirk to disable 64-bit XHCI DMA after r276717.

Requested by:	Gary Jennejohn <gljennjohn@gmail.com>
2015-03-05 10:18:03 +00:00
hselasky
559bd2313e MFC r279210:
Add support for the DWC OTG v2 chipset found in the STM32F4 series of
processors. Make sure we pullup the data lines in device mode when we
power on the port.
2015-03-05 10:04:34 +00:00
hselasky
f4065a3aaf MFC r279270:
Add ugen keyword to USB pnpinfo. Remove extra space from existing pnpinfo.

PR:		198015
PR:		198019
PR:		198026
2015-03-05 09:31:36 +00:00
rstone
4d61816598 MFC r265107
Be consistent with the whitespace in the rest of these files.

   X-MFC-With: r264007
2015-03-01 04:28:30 +00:00
rstone
d495e9b4cf MFC r264091
Correct a PCI enumeration bug introduced in r264011

   Ensure that first_func is set to 0 on every iteration of the PCI slot
   enumeration loop after the first.  There is a continue statement that would
   cause first_func to stay at 1 any PCI device where slot 0 has no functions
   until we find a slot that does have a function.  This would cause us to
   not enumerate the first PCI function on the device.

   Credit to markj@ for spotting the bug.

   X-MFC-With: r264011
2015-03-01 04:26:47 +00:00
rstone
0b55a8c80a MFC r264007,r264008,r264009,r264011,r264012,r264013
MFC support for PCI Alternate RID Interpretation.  ARI is an optional PCIe
feature that allows PCI devices to present up to 256 functions on a bus.
This is effectively a prerequisite for PCI SR-IOV support.

r264007:
   Add a method to get the PCI RID for a device.

   Reviewed by:  kib
   MFC after:    2 months
   Sponsored by: Sandvine Inc.

r264008:
   Re-implement the DMAR I/O MMU code in terms of PCI RIDs

   Under the hood the VT-d spec is really implemented in terms of
   PCI RIDs instead of bus/slot/function, even though the spec makes
   pains to convert back to bus/slot/function in examples.  However
   working with bus/slot/function is not correct when PCI ARI is
   in use, so convert to using RIDs in most cases.  bus/slot/function
   will only be used when reporting errors to a user.

   Reviewed by:  kib
   MFC after:    2 months
   Sponsored by: Sandvine Inc.

r264009:
   Re-write bhyve's I/O MMU handling in terms of PCI RID.

   Reviewed by:  neel
   MFC after:    2 months
   Sponsored by: Sandvine Inc.

r264011:
   Add support for PCIe ARI

   PCIe Alternate RID Interpretation (ARI) is an optional feature that
   allows devices to have up to 256 different functions.  It is
   implemented by always setting the PCI slot number to 0 and
   re-purposing the 5 bits used to encode the slot number to instead
   contain the function number.  Combined with the original 3 bits
   allocated for the function number, this allows for 256 functions.

   This is enabled by default, but it's expected to be a no-op on currently
   supported hardware.  It's a prerequisite for supporting PCI SR-IOV, and
   I want the ARI support to go in early to help shake out any bugs in it.
   ARI can be disabled by setting the tunable hw.pci.enable_ari=0.

   Reviewed by:  kib
   MFC after:    2 months
   Sponsored by: Sandvine Inc.

r264012:
   Print status of ARI capability in pciconf -c

   Teach pciconf how to print out the status (enabled/disabled) of the ARI
   capability on PCI Root Complexes and Downstream Ports.

   MFC after:    2 months
   Sponsored by: Sandvine Inc.

r264013:
   Add missing copyright date.

   MFC after:    2 months
2015-03-01 04:22:06 +00:00
hselasky
c3632bcc50 MFC r279233:
Ensure that the XHCI driver will refresh the control endpoint settings
when re-enumerating a FULL speed device. Else the wrong max packet
setting might be used when trying to re-enumerate a FULL speed device.
2015-02-27 12:20:03 +00:00
ken
a5cd9b061e MFC r278964:
The __FreeBSD_version was changed to 1001510 to be appropriate for
stable/10.

I will followup with a commit to mpr(4) and mps(4) in head to reflect
the stable/10 __FreeBSD_version and merge the change back to stable/10.

  ------------------------------------------------------------------------
  r278964 | ken | 2015-02-18 11:30:19 -0700 (Wed, 18 Feb 2015) | 46 lines

  Make sure that the flags for the XPT_DEV_ADVINFO CCB are initialized
  properly.

  If there is garbage in the flags field, it can sometimes include a
  set CDAI_FLAG_STORE flag, which may cause either an error or
  perhaps result in overwriting the field that was intended to be
  read.

  sys/cam/cam_ccb.h:
  	Add a new flag to the XPT_DEV_ADVINFO CCB, CDAI_FLAG_NONE,
  	that callers can use to set the flags field when no store
  	is desired.

  sys/cam/scsi/scsi_enc_ses.c:
  	In ses_setphyspath_callback(), explicitly set the
  	XPT_DEV_ADVINFO flags to CDAI_FLAG_NONE when fetching the
  	physical path information.  Instead of ORing in the
  	CDAI_FLAG_STORE flag when storing the physical path, set
  	the flags field to CDAI_FLAG_STORE.

  sys/cam/scsi/scsi_sa.c:
  	Set the XPT_DEV_ADVINFO flags field to CDAI_FLAG_NONE when
  	fetching extended inquiry information.

  sys/cam/scsi/scsi_da.c:
  	When storing extended READ CAPACITY information, set the
  	XPT_DEV_ADVINFO flags field to CDAI_FLAG_STORE instead of
  	ORing it into a field that isn't initialized.

  sys/dev/mpr/mpr_sas.c,
  sys/dev/mps/mps_sas.c:
  	When fetching extended READ CAPACITY information, set the
  	XPT_DEV_ADVINFO flags field to CDAI_FLAG_NONE instead of
  	setting it to 0.

  sbin/camcontrol/camcontrol.c:
  	When fetching a device ID, set the XPT_DEV_ADVINFO flags
  	field to CDAI_FLAG_NONE instead of 0.

  sys/sys/param.h:
  	Bump __FreeBSD_version to 1100061 for the new XPT_DEV_ADVINFO
  	CCB flag, CDAI_FLAG_NONE.

  Sponsored by:	Spectra Logic
2015-02-26 20:46:16 +00:00
hselasky
caa67af5b7 MFC r278850:
Handle VBUS error interrupts.

PR:		190471
2015-02-25 12:24:24 +00:00
kib
6485f99c19 MFC r278871:
Array cannot be NULL, remove always true comparision.
2015-02-23 01:17:45 +00:00
kevlo
8984d8aec3 MFC r277481:
Typo: ivalid -> invalid.
2015-02-22 15:28:49 +00:00
kevlo
3d2c9b77bb MFC r278551:
Add preliminary support for the Ralink RT5390 and RT5392 chipsets.
Committed over the D-Link DWA-525 rev A2 on amd64 with WPA.
2015-02-22 15:27:02 +00:00
mav
31fb601bdc MFC r274853:
For both iSCSI initiator and target increase socket buffer sizes before
establishing connection.

This is a workaround for Chelsio TOE driver, that does not update socket
buffer size in hardware after connection established, and unless that is
done beforehand, kernel code will stuck, attempting to send/receive full
PDU at once.
2015-02-19 14:28:47 +00:00
scottl
c30b890b0b MFC r278321
Use direct hardware access for internal requests for KCS and SMIC.  In
particular, updates to the watchdog should no longer sleep.
- Add a new IPMI_IO_LOCK for low-level I/O access.  Use this for
  kcs_polled_request() and smic_polled_request().
- Add a new backend callback "ipmi_driver_request" to handle a driver
  request.  The new callback performs the request sychronously for KCS
  and SMIC.  SSIF still defers the work to the worker thread since the
  worker thread sleeps during request processing anyway.
- Allocate driver requests on the stack rather than using malloc().

Submitted by:	jhb
2015-02-16 22:33:44 +00:00
dchagin
b08e983091 MFC r278379:
Add Neoway WM620 module ID.
2015-02-16 20:58:20 +00:00
emaste
d09137091d Clamp too large hwpmc callchaindepth to maximum
If the depth requested by the user is too large, it's better to provide
the maximum than the smaller default.

MFC of:		r274766
Sponsored by:	The FreeBSD Foundation
2015-02-15 20:55:26 +00:00
marius
637a13c9a0 MFC: r278532
Fix compilation with GCC in the PAE case.
2015-02-15 20:02:29 +00:00
loos
a7a8c39e00 MFC r274670, r274671, r276168:
Moves all the duplicate code to a single function.

Verify for invalid modes and unwanted flags before pass the new flags to
driver.

Make gpio_default_map_gpios() static.  No functional changes.

Improves the GPIO API description a little bit.

gpio_pin_max must return the maximum supported pin number and not the total
number of pins on the system.
2015-02-14 21:16:19 +00:00
loos
fd8cd0a963 MFC r274642, 274643:
Remove unnecessary code.

After r273566, the gpiobus version of bus_print_child() also works on FDT
systems.

Fix gpiobus_child_location_str() to return a real string with the mapped
pins.

Make gpiobus_print_pins() static again.
2015-02-14 21:02:33 +00:00
loos
68f3ed8a8b MFC r274638:
Add basic interrupt management code to gpiobus and ofw_gpiobus.

This is the general support to allow the use of GPIO pins as interrupt
sources for direct gpiobus children.

The use of GPIO pins as generic interrupt sources (for an ethernet driver
for example) will only be possible when arm/intrng is complete.  Then, most
of this code will need to be rewritten, but it works for now, is better
than what we have and will allow further developments.
2015-02-14 20:57:27 +00:00
loos
f2de095d5d MFC r273917, r273926:
Fix the gpiobus locking by using a more sane model where it isn't necessary
hold the gpiobus lock between the gpio calls.

gpiobus_acquire_lock() now accepts a third parameter which tells gpiobus
what to do when the bus is already busy.

When GPIOBUS_WAIT wait is used, the calling thread will be put to sleep
until the bus became free.

With GPIOBUS_DONTWAIT the calling thread will receive EWOULDBLOCK right
away and then it can act upon.

This fixes the gpioiic(4) locking issues that arises when doing multiple
concurrent access on the bus.

Fix the build of non-FDT systems by moving the gpiobusvar.h header outside
the FDT #ifdef.

While here remove a few unused headers.
2015-02-14 20:50:38 +00:00
loos
4bd45a7878 MFC r273566, r273569:
Provide a working GPIOBUS_IVAR() macro for FDT systems.

Move the duplicated code to a single function.

No functional changes.
2015-02-14 20:32:24 +00:00
luigi
d6e510de09 sync the code with the version in head. which the exception of
svn 275358 (M_FLOWID deprecation, only a couple of lines)
which cannot be merged.

if_lem_netmap.h, if_re_netmap.h:
- use the same (commented out) function to update the stat counters
  as in HEAD. This is a no-op here

netmap.c
- merge 274459 (support for private knote lock)
  and minor changes on nm_config and comments

netmap_freebsd.c
- merge 274459 (support for private knote lock)
- merge 274354 (initialize color if passed as argument)

netmap_generic.c
- fix a comment

netmap_kern.h
- revise the lock macros, using sx locks;
  merge 274459 (private knote lock)

netmap_monitor.c
- use full memory barriers

netmap_pipe.c
- use full memory barriers, use length from the correct queue
  (mostly cosmetic, since the queues typically have the same size)
2015-02-14 19:41:26 +00:00
kib
c85a726887 MFC r277643:
Remove Giant from /dev/mem and /dev/kmem.

MFC r277743:
Arm: ensure that _tmppt KVA is used exclusively.
2015-02-14 08:44:12 +00:00
ngie
8483297749 MFC r278364:
r278364:

  Remove kdb_backtrace extern; get the definition for kdb_backtrace from
  <sys/kdb.h> instead

  Fix whitespace in WARN_ON macro definition

  Reviewed by: np
  Differential Revision: https://reviews.freebsd.org/D1799
  Sponsored by: EMC / Isilon Storage Division
2015-02-14 06:58:32 +00:00
ian
a24130faeb MFC r277655, r277989: Reimplement fdt_clock_register_provider() correctly. 2015-02-13 23:37:11 +00:00
ian
56013bbc63 MFC r277454, r277460, r277465, r277466, r277467, r277469, r277470, r277471,
r277472, r277473, r277474, r277475, r277476, r277477, r277478, r277479,
    r277480, r277512, r277516:

  Add inline implementations of arm bus_space_read/write_N().

  Revise the arm bus_space implementation to avoid dereferencing the tag on
  every operation to retrieve the bs_cookie value almost nothing actually uses.

  Use the explicit member initializer style to init the bus_space struct.

  Use arm/bus_space-v6.c for all armv6 systems

  Consolidate many identical implementations of bus_space to a single
  common tag and implementation shared by armv4 and armv6.

  Micro-optimize the new arm inline bus_space implementation by grouping all
  the data the inline functions access together at the start of the bus_space
  struct so that they all fit in a single cache line.
2015-02-13 22:32:02 +00:00
ian
b137f825dc MFC r272103: Move s3c2xx0 into the samsung directory. 2015-02-13 22:08:19 +00:00
ian
0d83b78040 MFC r277306, r277307, r277346:
Add defines for SDHCI 3.0 controllers.

  Add a new SDHCI quirk, SDHCI_QUIRK_DONT_SET_HISPD_BIT.

  Save the command-and-flags value into shadow register when it is written.
2015-02-13 20:38:39 +00:00
ian
3e6b663e1f MFC r277027:
Handle the possibility that SDHCI_PLATFORM_START_TRANSFER() can fail.
2015-02-13 18:13:42 +00:00
ian
432a94e7fe MFC r277026: Rate-limit error logging to 5 lines per second. 2015-02-13 18:12:30 +00:00
hselasky
baa2d40228 MFC r278503:
Revert r274918 and make a better solution. Poll the synchronisation
endpoint less frequently to make the sample rate adjustment more
accurate. This should resolve problems with the DN32-USB module for
Midas audio systems and possibly other similar products from Klark
Teknik.
2015-02-13 07:51:15 +00:00
hselasky
5bf9aa9b6f MFC r278477:
Fix DMA address casts.
2015-02-13 07:48:54 +00:00
jhb
39fe100d12 MFC 277710:
Pass a valid Dx state variable to PCIB_POWER_FOR_SLEEP() in pcib_resume()
instead of NULL.
2015-02-12 17:58:02 +00:00
dim
22fe1f6542 MFC r278004:
Constify a number of accesses in drm2's radeon drivers to avoid
-Wcast-qual warnings.  No functional change.

Reviewed by:	dumbbell
Differential Revision: https://reviews.freebsd.org/D1727

MFC r278438:

After r278004 was committed, Bruce Evans noted that the casts were
actually completely unnecessary, here:

https://lists.freebsd.org/pipermail/svn-src-all/2015-February/098478.html

Remove the casts, and just assign &xxx_io_mc_regs[0][0] directly.

Reviewed by:	dumbbell
Differential Revision: https://reviews.freebsd.org/D1748
2015-02-12 07:21:22 +00:00
ian
4b6f93ca03 MFC r276162: Don't assume required FDT properties are present. 2015-02-12 00:35:58 +00:00
ian
4830d3556d MFC r275779, r275963, r276101, r276161, r276297:
Move ofw_cpu.c to sys/dev/ofw so that it can be used by other
  architectures.

  Add driver for CPU frequency/voltage control on the Raspberry Pi.

  On initialization, do not use bcm_mbox_intr() to read the pending messages.
  This fixes the hang that happens on boot while initializing the cpufreq on
  Raspberry Pi.
2015-02-12 00:25:33 +00:00
marius
38c1f41175 MFC: r276469
- Switching the mode of Ricoh R5CE823 to SD2.0 causes their PCI device ID
  to change to 0xe822, which may be persistent across reboots and, thus,
  confuse other OSes. Therefore, restore the original mode and frequency
  setting on detach and shutdown.
- Report Ricoh R5CE822 as such.
- According to Linux, Ricoh R5CE822 also need SDHCI_QUIRK_LOWER_FREQUENCY.
- Nuke an unused softc member.
2015-02-10 21:44:28 +00:00