Commit Graph

99356 Commits

Author SHA1 Message Date
hselasky
bb0a5fd29c MFC r259023 and r259095:
Improve the XHCI command timeout recovery handling code.
Fix some typos while at it.
2013-12-19 07:13:59 +00:00
truckman
f4127526eb MFC r258363:
Add alternate ID for Novatel MiFi 2200 CDMA, which is used by my
Virgin Mobile branded device.  It needs the U3GINIT_SCSIEJECT quirk.
2013-12-19 05:36:06 +00:00
glebius
a70f2adf57 Merge r256868,257276-257277,257515,257913 from head. These are fixes
required to make Xen buтldable w/o INET.

Sponsored by:	Nginx, Inc.
2013-12-18 05:20:53 +00:00
kib
2c4d831850 MFC DMAR busdma implementation.
MFC r257251:
Import the driver for VT-d DMAR hardware.  Implement the busdma(9) using DMARs.

MFC r257512:
Add support for queued invalidation.

MFC miscellaneous follow-ups to r257251.

MFC r257266:
Remove redundand assignment to error variable and check for its value.

MFC r257308:
Remove redundand declaration.

MFC r257511:
Return BUS_PROBE_NOWILDCARD from the DMAR probe method.

MFC r257860,r257896,r257900,r257902,r257903 (by dim):
Fixes for gcc compilation.
2013-12-17 13:49:35 +00:00
kib
3219a81518 MFC r257230:
Add a virtual table for the busdma methods on x86, to allow different
busdma implementations to coexist.
2013-12-17 13:39:50 +00:00
kib
5a15f697f5 MFC r257228:
Add bus_dmamap_load_ma() function to load map with the array of
vm_pages.
2013-12-17 13:38:21 +00:00
kib
3e0674d807 MFC r257541:
Fix several issues with the busdma(9) KPI use in the e1000 drivers.
2013-12-17 13:18:41 +00:00
kib
293c11687e MFC r258088:
Add check for buflen overflow by comparing the buflen with both offset
and resid.

MFC r258397:
Redo r258088 to avoid relying on signed arithmetic overflow.
2013-12-17 13:10:28 +00:00
kib
758e3a9934 MFC r258039:
Avoid overflow for the page counts.

MFC r258365:
Revert back to use int for the page counts.
Rearrange the checks to correctly handle overflowing address arithmetic.
2013-12-17 09:21:56 +00:00
asomers
34ade72d5f MFC r258311
opensolaris/uts/common/dtrace/fasttrap.c
        Fix several problems that can cause panics on kldload and kldunload.

        * kproc_create(fasttrap_pid_cleanup_cb, ...) gets called before
          fasttrap_provs.fth_table gets allocated.  This can lead to a panic
          on module load, because fasttrap_pid_cleanup_cb references
          fasttrap_provs.fth_table.  Move kproc_create down after the point
          that fasttrap_provs.fth_table gets allocated, and modify the error
          handling accordingly.

        * dtrace_fasttrap_{fork,exec,exit} weren't getting NULLed until
          after fasttrap_provs.fth_table got freed.  That caused panics on
          module unload because fasttrap_exec_exit calls
          fasttrap_provider_retire, which references
          fasttrap_provs.fth_table.  NULL those function pointers earlier.

        * There wasn't any code to destroy the
          fasttrap_{tpoints,provs,procs}.fth_table mutexes on module unload,
          leading to a resource leak when WITNESS is enabled.  Destroy those
          mutexes during fasttrap_unload().

Sponsored by:	Spectra Logic Corporation
2013-12-16 19:59:34 +00:00
nwhitehorn
d72da1522e MFC r258819,258928:
Add new sysctl, kern.supported_archs, containing the list of FreeBSD
MACHINE_ARCH values whose binaries this kernel can run. This patch provides
a feature requested for implementing pkgng ABI identifiers in a robust
way.

The list is designed to indicate whether, say, an i386 package can be run on
the current system. If kern.supported_abis contains "i386", then the answer
is yes. Otherwise, the answer is no.

At the moment, this only supports MACHINE_ARCH and MACHINE_ARCH32. As we
gain support for more interesting combinations, this needs to become more
flexible, possibily through the sysent framework, along with the
hw.machine_arch emulation immediately preceding this code in kern_mib.c.

Reviewed by:	imp
2013-12-16 15:00:06 +00:00
hselasky
607fc1b0bd MFC r256718, r257410 and r257411:
- Fix RF registers for RT3070.
- Initialize BBP68 to improve RX sensitivity.
- Add RT2860_BCN_OFFSET1 and RT2860_MAX_LEN_CFG register initialization to
match with the vendor driver. While here, remove unused RT2860_DEF_MAC
definition.
2013-12-16 09:48:08 +00:00
hselasky
4d2c5784a5 MFC r238274, r246752, r256720, r256721, r256722, r256955, r257409
r257429, r257435, r257712, r257732, r257743, r257748, r257955
 r257957, r257958, r258082, r258641, r258643, r258732, r258733,
 r258840, r258919, r258921, r259029, r259030, r259031, r259032 and r259046:

- Add support for the MediaTek/Ralink RT5370/RT5372 chipset.
- Various minor USB WLAN fixes and improvements.

PR:     usb/182936
2013-12-16 08:10:38 +00:00
delphij
a12532878e MFC r258950:
Enable Hyper-V support in i386 GENERIC.
2013-12-16 06:41:31 +00:00
bjk
638d19cdfc MFC r259286,259424,259425:
Apply patch from upstream Heimdal for encoding fix

  RFC 4402 specifies the implementation of the gss_pseudo_random()
  function for the krb5 mechanism (and the C bindings therein).
  The implementation uses a PRF+ function that concatenates the output
  of individual krb5 pseudo-random operations produced with a counter
  and seed.  The original implementation of this function in Heimdal
  incorrectly encoded the counter as a little-endian integer, but the
  RFC specifies the counter encoding as big-endian.  The implementation
  initializes the counter to zero, so the first block of output (16 octets,
  for the modern AES enctypes 17 and 18) is unchanged.  (RFC 4402 specifies
  that the counter should begin at 1, but both existing implementations
  begin with zero and it looks like the standard will be re-issued, with
  test vectors, to begin at zero.)

  This is upstream's commit f85652af868e64811f2b32b815d4198e7f9017f6,
  from 13 October, 2013:
  % Fix krb5's gss_pseudo_random() (n is big-endian)
  %
  % The first enctype RFC3961 prf output length's bytes are correct because
  % the little- and big-endian representations of unsigned zero are the
  % same.  The second block of output was wrong because the counter was not
  % being encoded as big-endian.
  %
  % This change could break applications.  But those applications would not
  % have been interoperating with other implementations anyways (in
  % particular: MIT's).

Bump __FreeBSD_version accordingly and add a note in UPDATING.

Approved by:	hrs (mentor, src committer)
2013-12-16 02:04:28 +00:00
ae
1277739e09 MFC r257987:
Initialize prot variable.

  PR:		177417
2013-12-14 04:24:32 +00:00
ae
a210965c36 MFC r257965:
Add missing line breaks.

  PR:		181900
2013-12-14 04:16:27 +00:00
ian
38c5c4197f MFC r259212, r259220:
Fix one race and one fence post error. When the TX buffer was
  completely full, we'd not complete any of the mbufs due to the fence
  post error (this creates a large leak). When this is fixed, we still
  leak, but at a much smaller rate due to a race between ateintr and
  atestart_locked as well as an asymmetry where atestart_locked is
  called from elsewhere.  Ensure that we free in-flight packets that
  have completed there as well. Also remove needless check for NULL on
  mb, checked earlier in the loop and simplify a redundant if.
2013-12-14 01:35:57 +00:00
ian
6af39cbc39 MFC r259038, r259039:
Bump the maximum VM space from 3 * memory size to a fixed
  256MB. That's all we have room for since we map the hardware registers
  starting at 0xd0000000. This allows my 64MB AT91SAM9G20 to boot again
  after the unmmaped I/O changes were MFC'd at r251897. Other
  subplatforms may need similar treatment.

  Although not strictly required to boot a 64MB board, bump
  vm_max_virtual_address to be KERNVIRTADDR + 256MB. This allows some
  future shock protection since the KVA requirements have gone up since
  the unmapped changes have gone in, as well as preventing us from
  overlapping with the hardware devices, which we map at 0xd0000000,
  which we'd hit with anything more than 85MB...
2013-12-14 01:34:24 +00:00
ian
47bb9f823b MFC r258828:
Add a nand flash controller driver for Atmel at91 family.  Tested only
  on at91rm9200 so far.
2013-12-14 01:15:26 +00:00
ian
cbcef6d7b5 MFC r258820: Add definitions for the PIO pins found on recent AT91 SoCs. 2013-12-14 01:14:38 +00:00
ian
b37938a4e4 MFC r258392, r258412:
Call cpu_setup() immediately after the page tables are installed.  This
  enables data cache and other chip-specific features.  It was previously
  done via an early SYSINIT, but it was being done after pmap and vm setup,
  and those setups need to use mutexes.  On some modern ARM platforms,
  the ldrex/strex instructions that implement mutexes require the data cache
  to be enabled.

  Call cpu_setup() from the initarm() routine on platforms that don't use
  the common FDT-aware initarm() in arm/machdep.c.
2013-12-14 01:12:13 +00:00
ian
1185e66967 MFC r258393:
Add USB_HOST_ALIGN=64; the cache line size on the am335x is 64 bytes.
2013-12-14 00:59:40 +00:00
ian
c3017e9225 MFC r258356:
Bugfixes... the host capabilties from FDT data are stored in host.caps, not
  host.host_ocr, examine the correct field when setting up the hardware.  Also,
  the offset for the capabilties register should be 0x140, not 0x240.
2013-12-14 00:58:13 +00:00
ian
af5e386ba3 MFC r258240:
In the data abort handler, don't panic if kdb is available and says it
  handled the condition.
2013-12-14 00:57:05 +00:00
ian
c6dcd8817f MFC r258740:
Look up a nand chip by id in the static table before trying to obtain
  ONFI parameters.  This allows a static table entry to provide valid data
  for chips known to provide invalid ONFI data.
2013-12-14 00:55:34 +00:00
ian
8b635cded3 MFC r257892, r258196, r258197, r258199, r258200, r258201, r258202:
Add ONFI signature check.

  Add Micron chip found in Freescale Vybrid Family Phytec COSMIC board.

  The vendor specified field is 88 bytes, not 8 bytes.

  Update the onfi_params struct to ONFI revision 3.2 (06 12 2013).

  Search for and validate the ONFI params as specified in the standard.

  ONFI parameters are little-endian, hence we must take care to convert them
  to native endianness.  We must also pay attention to unaligned accesses.

  Rework the routine that returns a pointer to the table of software ECC
  byte positions within the OOB area to support chips with unusual OOB
  sizes such as 218 or 224 bytes.
2013-12-14 00:54:05 +00:00
ian
2c66a0246a MFC r257924:
Apparently with "const uint32_t foo = 0x60;" gcc doesn't consider 'foo'
  to be a constant integer suitable for use in a case label, so use #defines.
2013-12-14 00:23:43 +00:00
ian
f1d49f684d MFC r257669, r257672, r257673, r257676, r257678:
Call initarm_lastaddr() later in the init sequence, after establishing
  static device mappings, rather than as the first of the initializations
  that a platform can hook into.  This allows a platform to allocate KVA
  from the top of the address space downwards for things like static device
  mapping, and return the final "last usable address" result after that and
  other early init work is done.

  Because some platforms were doing work in initarm_lastaddr() that needs to
  be done early, add a new initarm_early_init() routine and move the early
  init code to that routine on those platforms.

  Make PTE_DEVICE a synonym for PTE_NOCACHE on armv4, to make it easier to
  share the same code on both architectures.

  Add new helper routines for arm static device mapping.  The new code
  allocates kva space from the top down for the device mappings and builds
  entries in an internal table which is automatically used later by
  arm_devmap_bootstrap().  The platform code just calls the new
  arm_devmap_add_entry() function as many times as it needs to (up to 32
  entries allowed; most platforms use 2 or 3 at most).

  Remove imx local devmap code and use the essentially identical common
  code that got moved from imx_machdep.c to arm/devmap.c.
2013-12-14 00:16:08 +00:00
ian
eae48ec05e MFC r257648, r257649, r257660:
Begin reducing code duplication in arm pmap.c and pmap-v6.c by factoring
  out common code related to mapping device memory into a new devmap.c file.

  Remove the growing duplication of code that used pmap_devmap_find_pa() and
  then did some math with the returned results to generate a virtual address,
  and likewise in reverse to get a physical address.  Now there are a pair
  of functions, arm_devmap_vtop() and arm_devmap_ptov(), to do that.  The
  bus_space_map() implementations are rewritten in terms of these.

  Move remaining code and data related to static device mapping into the
  new devmap.[ch] files.  Emphasize the MD nature of these things by using
  the prefix arm_devmap_ on the function and type names (already a few of
  these things found their way into MI code, hopefully it will be harder to
  do by accident in the future).
2013-12-13 23:56:53 +00:00
ian
689fd5c390 MFC r257639:
Remove the duplicated implementations of some bus_space functions and use
  the essentially identical generic implementations instead.  The generic
  implementations differ only in the spelling of a couple variable names
  and some formatting differences.
2013-12-13 23:07:22 +00:00
ian
55d93a867d MFC r257603, r257604:
Rename WANDBOARD-COMMON to WANDBOARD.common and adjust the configs that
  include it accordingly.  The build machinery for universe and tinderbox
  tries to build every kernel config whose name begins and ends with [A-Z0-9]
  and the common include file that has most of the options isn't buildable
  by itself, so the new lowercase .common will avoid building it.
2013-12-13 22:52:59 +00:00
ian
4c517a4890 MFC r257595: Comments and style(9) only, no functional changes. 2013-12-13 22:51:09 +00:00
ian
bf69534180 MFC r257561:
Bugfix:  the attach routine needs to use the same table of fdt compat
  strings that the probe routine used.
2013-12-13 22:50:12 +00:00
ian
a10cf699d1 MFC r257557: Add a missing register definition. 2013-12-13 22:49:18 +00:00
ian
cee3a0f503 MFC r257556:
Arrange for uart_cpu_fdt's probe() routine to use the same table of compat
  strings as uart_bus_fdt's probe().
2013-12-13 22:48:01 +00:00
ian
2b338fd3cf MFC r257518, r257519:
TI sdhci driver improvements, mostly related to fdt data...

  Use the published compatible strings (our own invention, "ti,mmchs" is
  still accepted as well, for now).

  Don't blindly turn on 8-bit bus mode, because even though the controller
  supports it, the board has to be wired appropriately as well.  Use the
  published property (bus-width=<n>) and honor all the valid values (1,4,8).

  The eMMC device on a Beaglebone Black is wired for 8-bit, update the dts.

  The mmchs controller can inherently do both 1.8v and 3.0v on the first
  device and 1.8v only on other devices, unless an external transceiver is
  used.  Set the voltage automatically for the first device and honor
  the published fdt property (ti,dualvolt) for other devices.
2013-12-13 22:46:10 +00:00
ian
ec4b958426 MFC r257483, r257486, r257489:
Add the Soc- / machine-dependent parts of imx6 support.
  Add dts source for imx6 SoCs and for Wandboard boards.
  Add kernel config for Wandboard.
2013-12-13 22:41:57 +00:00
ian
c48d670c8a MFC r257476, r257478:
Revamp the SoC identity numbering scheme to be more in line with the way
  Freescale numbers the chips in the ID registers.

  Add definitions for the register and data that describes the SoC type.
2013-12-13 22:30:21 +00:00
ian
3a53055ae2 MFC r257454: Add sdhci driver glue for imx family SoCs. 2013-12-13 22:28:19 +00:00
ian
3e4a60e997 MFC r257453: Add stubbed-out imx6 support for clocks and power management. 2013-12-13 22:27:26 +00:00
ian
bbdd01b151 MFC r257452: Add support for the USB PHY on imx6 SoCs. 2013-12-13 22:26:10 +00:00
ian
59d4157d7f MFC r257419:
Do not EOI an interrupt until the point after the filter handlers / before
  threaded handlers.
2013-12-13 22:24:00 +00:00
ian
0c80ffaa7f MFC r257418:
Don't iterate through the bits of the pending interrupt register if the
  whole register is zero.  Most of the registers will be zero most of the time.
2013-12-13 22:22:54 +00:00
ian
806c36728f MFC r257413:
Reset the timer interrupt status register at the top rather than bottom of
  the interrupt handler.  If the event callback starts a new short timeout,
  the timer can fire before returning from the event callback, and clearing
  the interrupt status after that loses the interrupt and hangs until the
  counter wraps.  Fixing all of this removes the need for the do-nothing
  loop at the top of the handler which really just waited for the counter to
  roll over and reach the one-shot count again.

  Also add a missing return(0) in the periodic timer start case.
2013-12-13 22:21:49 +00:00
ian
26cb2d5903 MFC r257407:
Expand the list of compatible devices this driver works with.  Increase
  the target frequency from 1 to 10 MHz because these SoCs are plenty fast
  enough to benefit from the extra event timer resolution.
2013-12-13 22:21:04 +00:00
ian
52408050e1 MFC r257393:
Rework the imx ehci driver so that it's four separate ehci units rather
  than one unit with four busses attached to it.  This allows us to use
  existing fdt data which describes separate devices with separate resources.
  It also allows any combination of the units to be en/disabled in the
  board dts files.

  Adjust our dts code to match what's used by linux and u-boot now that
  we're structured to do so.
2013-12-13 22:19:21 +00:00
ian
a551aaa6fa MFC r257390: Add a vendor entry for Freescale Semiconductor. 2013-12-13 22:15:24 +00:00
ian
378834fde5 MFC r257383, r257384:
Add some bare-bones support for enabling usb and usbphy clocks.

Add a "no-op" USB PHY driver for imx-family SoCs.
2013-12-13 22:12:37 +00:00
ian
7de85345e2 MFC r257258, r257265: Include headers (if_var.h and others) where needed.
The change that triggered the need for this on head was r257244.  That
hasn't been MFC'd yet, but there's no harm in paving the way for it with
this MFC.
2013-12-13 22:08:31 +00:00