Commit Graph

96995 Commits

Author SHA1 Message Date
Adrian Chadd
2bddba6a60 Add methods for the VLAN port set/get routines.
The registers (and perhaps the flags) are different for the AR8327, so
I'll stub those out until they're written.

Tested:

* DB120 - both on-chip AR9340 and AR8327 switches.
2014-02-19 06:35:17 +00:00
Adrian Chadd
ddbc44200a Turn the port init function into a HAL method and initialise it to the
default port init code.

This needs to be overridden for the AR8327.
2014-02-19 06:03:58 +00:00
Adrian Chadd
e765499eed Teach the PHY register path about the different MDIO bus address
for the AR8327.

Tested:

* AR8327, DB120
2014-02-19 06:02:47 +00:00
Adrian Chadd
e3ba3a89ab Add a new method to set up the individual port in question.
The AR8327 requires some different setup code.
2014-02-19 06:01:40 +00:00
Adrian Chadd
df892897a2 Change arswitch_ports_init() to arswitch_port_init(), and teach it to take
a single port to setup.

This may end up later being used as part of some logic to program
the PHY for a single port, rather than having to reinitialise them
all at once.

Tested:

* DB120
2014-02-19 05:35:41 +00:00
Adrian Chadd
0e67bf94fc Add in the AR8327 probe/attach code and switch type.
It detects fine, but (as expected) it won't attach just yet, let alone
pass traffic.

Tested:

* DB120, AR8327 switch
2014-02-19 05:09:47 +00:00
Adrian Chadd
dd843f87d3 Store away the chip version and revision; some AR8327 code depends upon
the chip revision.
2014-02-19 04:30:53 +00:00
Adrian Chadd
26ca36d4ca Add in a flag to control whether the low or high data word of a register access
is latched in first.

The AR8327 apparently requires the low data word be latched in first.

Obtained from:	Linux OpenWRT
2014-02-19 04:23:01 +00:00
Robert Watson
2067168264 Replace Apache-style license on two Makefiles with stock 2-clause BSD;
license, although the former is pretty safe, it wasn't intended to be
used in the version of MIPS boot2/loader upstreamed to FreeBSD.

MFC after:	3 weeks
Sponsored by:	DARPA, AFRL
2014-02-18 23:22:54 +00:00
Robert Watson
4527ee3e06 Commit a first cut at ports of boot2 and loader to 64-bit MIPS, with a
particular interest in (and support for) SRI International and the
University of Cambridge's BERI FPGA soft-core processor.  This includes
micro device drivers for the Altera JTAG UART console, memory-mapped
flash, and the Altera SD Card IP core in both boot2 and loader.  boot2
can be written to the on-board Intel StrataFlash on the DE4 board, and
loader can be placed in StrataFlash or the SD Card.

Plenty of XXX comments, but works quite well locally in practice and I
am using it daily.  Although I had originally ported the ARM version
of boot2, the current version is x86-derived as that proved more
feature-complete.  As we don't currently use partitions on our flash
disks, support for that has been commented out relative to x86, but
would be easy to add back.  FDT support has not yet been hooked up,
although some skeleton parts have been put in place for that.

This may well be a useful starting point for ports to other 32-bit and
64-bit MIPS-ISA systems.

This merge is synchronised to CheriBSD github commit
e41d74fd71, but with some additions of
$FreeBSD.

MFC after:	3 weeks
Sponsored by:	DARPA, AFRAL
2014-02-18 23:18:32 +00:00
Martin Matuska
a93b9a64fe De-virtualize pf_mtag_z [1]
Process V_pf_overloadqueue in vnet context [2]

This fixes two VIMAGE kernel panics and allows to simultaneously run host-pf
and vnet jails. pf inside jails remains broken.

PR:		kern/182964
Submitted by:	glebius@FreeBSD.org [2], myself [1]
Tested by:	rodrigc@FreeBSD.org, myself
MFC after:	2 weeks
2014-02-18 22:17:12 +00:00
Luiz Otavio O Souza
d141f0f512 Remove an unnecessary header.
Reported by:	nwhitehorn
Approved by:	adrian (mentor, implicit)
2014-02-18 21:29:30 +00:00
Jonathan Anderson
53905cf487 Add more __BEGIN_DECLS / __END_DECLS to <sys/capability.h>.
capability.h currently only wraps some of its declarations in __BEGIN_DECLS/__END_DECLS, so cap_enter(), cap_sandboxed(), etc. are usable from C++ code but cap_rights_init(), cap_rights_is_valid() etc. are not. This commit fixes this distinction.

Approved by:	rwatson (mentor)
MFC after:	1 week
Sponsored by:	DARPA, AFRL
2014-02-18 14:54:56 +00:00
Gleb Smirnoff
ec0ad11ed2 Fix incorrect assertions. 2014-02-18 14:21:26 +00:00
Luigi Rizzo
89e3fd5247 two small changes:
- intercept FIONBIO and FIOASYNC ioctls on netmap file descriptors.
  libpcap calls them to set non blocking I/O on the file descriptor,
  for netmap this is a no-op because there is no read/write,
  but not intercepting would cause fcntl() to return -1
- rate limit and put under netmap.verbose some messages that occur
  when threads use concurrently the same file descriptor.
2014-02-18 04:27:41 +00:00
John Baldwin
a0efd3fb34 A first pass at adding support for injecting hardware exceptions for
emulated instructions.
- Add helper routines to inject interrupt information for a hardware
  exception from the VM exit callback routines.
- Use the new routines to inject GP and UD exceptions for invalid
  operations when emulating the xsetbv instruction.
- Don't directly manipulate the entry interrupt info when a user event
  is injected.  Instead, store the event info in the vmx state and
  only apply it during a VM entry if a hardware exception or NMI is
  not already pending.
- While here, use HANDLED/UNHANDLED instead of 1/0 in a couple of
  routines.

Reviewed by:	neel
2014-02-18 03:07:36 +00:00
Craig Rodrigues
458a36d594 In ue_attach_post_task(), initialize curvnet to vnet0 before calling if_attach().
Before this patch, curvnet was NULL.
When the VIMAGE kernel option is enabled, this eliminates
kernel panics when USB ethernet devices are plugged in.

PR: 183835
Submitted by: Hiroo Oono <hiroo.ono at gmail dot com>
2014-02-18 01:20:26 +00:00
Neel Natu
294d0d88fc Handle writes to the SELF_IPI MSR by the guest when the vlapic is configured
in x2apic mode. Reads to this MSR are currently ignored but should cause a
general proctection exception to be injected into the vcpu.

All accesses to the corresponding offset in xAPIC mode are ignored.

Also, do not panic the host if there is mismatch between the trigger mode
programmed in the TMR and the actual interrupt being delivered. Instead the
anomaly is logged to aid debugging and to prevent a misbehaving guest from
panicking the host.
2014-02-17 23:07:16 +00:00
Neel Natu
9c43cd07ec Use spinlocks to lock accesses to the vioapic.
This is necessary because if the vlapic is configured in x2apic mode the
vioapic_process_eoi() function is called inside the critical section
established by vm_run().
2014-02-17 22:57:51 +00:00
Hans Petter Selasky
e4dfeb5bb1 Our quirk table is almost full. Add some room for more quirks.
MFC after:	1 week
2014-02-17 20:30:29 +00:00
Hans Petter Selasky
860fe6b9fb Adjust USB quirk.
MFC after:	1 week
Submitted by:	Volodymyr Kostyrko <arcade@b1t.name>
2014-02-17 20:26:13 +00:00
Dimitry Andric
ea7f47f524 In sys/dev/usb/controller/uss820dci.c, similar to r261977, fix a warning
about uss820dci_odevd being unused, by adding it to the part that
handles getting descriptors.

Reported by:	loos
Reviewed by:	hselasky
MFC after:	3 days
2014-02-17 20:08:11 +00:00
Ian Lepore
4af6e44409 Give the fdt helper routines static linkage since no global definition
of them is provided anywhere.  (gcc was nice enough to warn about this,
clang didn't for some reason.)
2014-02-17 20:04:57 +00:00
Eitan Adler
b7d6c6b5e1 pcm(4): Permit non-root users to change default unit
Discussed with:	mav
2014-02-17 15:33:21 +00:00
Gleb Smirnoff
044ae9dbef Add my copyright to flowtable. 2014-02-17 12:07:17 +00:00
Gleb Smirnoff
47c8550576 Whitespace. 2014-02-17 12:02:44 +00:00
Gleb Smirnoff
5ec03c2bff Bring copyright notice to standard style. 2014-02-17 12:01:50 +00:00
Gleb Smirnoff
0ff96b4f55 o Remove at compile time the HASH_ALL code, that was never
tested and is unfinished. However, I've tested my version,
  it works okay. As before it is unfinished: timeout aren't
  driven by TCP session state. To enable the HASH_ALL mode,
  one needs in kernel config:

	options FLOWTABLE_HASH_ALL

o Reduce the alignment on flentry to 64 bytes. Without
  the FLOWTABLE_HASH_ALL option, twice less memory would
  be consumed by flows.
o API to ip_output()/ip6_output() got even more thin: 1 liner.
o Remove unused unions. Simply use fle->f_key[].
o Merge all IPv4 code into flowtable_lookup_ipv4(), and do same
  flowtable_lookup_ipv6(). Stop copying data to on stack
  sockaddr structures, simply use key[] on stack.
o Move code from flowtable_lookup_common() that actually works
  on insertion into flowtable_insert().

Sponsored by:	Netflix
Sponsored by:	Nginx, Inc.
2014-02-17 11:50:56 +00:00
John Hay
f37fafddd6 Make it possible to use the env kernel config file option for AVILA
and CAMBRIA boards that does not use loader to load the kernel. This
is basically how it was done for i386. This way tunables can also be
set. For example in config file:

env "/conf/AVILA.env"

And in AVILA.env:

vfs.unmapped_buf_allowed=0

MFC after:	2 weeks
2014-02-17 11:05:57 +00:00
Adrian Chadd
7307fbd10b The MDIO control register for the AR8327 has a different address to
previous chipsets.

Obtained from:	AR8327 datasheet
2014-02-17 05:54:24 +00:00
Adrian Chadd
1ee69b7d79 Add mmd declaration. 2014-02-17 05:51:37 +00:00
Adrian Chadd
7e1a619d03 Implement PHY bus MMD writes for arswitch.
This is used by the AR8327 PHY setup path.

Obtained from:	OpenWRT
2014-02-17 02:24:58 +00:00
Bryan Drewery
70f82cfbaf Fix M_FILEDESC leak in fdgrowtable() introduced in r244510.
fdgrowtable() now only reallocates fd_map when necessary.

This fixes fdgrowtable() to use the same logic as fdescfree() for
when to free the fd_map. The logic in fdescfree() is intended to
not free the initial static allocation, however the fd_map grows
at a slower rate than the table does. The table is intended to hold
20 fd, but its initial map has many more slots than 20.  The slot
sizing causes NDSLOTS(20) through NDSLOTS(63) to be 1 which matches
NDSLOTS(20), so fdescfree() was assuming that the fd_map was still
the initial allocation and not freeing it.

This partially reverts r244510 by reintroducing some of the logic
it removed in fdgrowtable().

Reviewed by:	mjg
Approved by:	bapt (mentor)
MFC after:	2 weeks
2014-02-17 00:00:39 +00:00
Bryan Drewery
88812f91aa Remove redundant memcpy of fd_ofiles in fdgrowtable() added in r247602
Discussed with:	mjg
Approved by:	bapt (mentor)
MFC after:	2 weeks
2014-02-16 23:10:46 +00:00
Dimitry Andric
ea4e0ab0cc After r261980, the local ptr variable in xbox_init() is no longer used,
breaking the LINT build.

Pointy hat to:	brueffer
2014-02-16 22:48:36 +00:00
Dimitry Andric
f785676f2a Upgrade our copy of llvm/clang to 3.4 release. This version supports
all of the features in the current working draft of the upcoming C++
standard, provisionally named C++1y.

The code generator's performance is greatly increased, and the loop
auto-vectorizer is now enabled at -Os and -O2 in addition to -O3.  The
PowerPC backend has made several major improvements to code generation
quality and compile time, and the X86, SPARC, ARM32, Aarch64 and SystemZ
backends have all seen major feature work.

Release notes for llvm and clang can be found here:
<http://llvm.org/releases/3.4/docs/ReleaseNotes.html>
<http://llvm.org/releases/3.4/tools/clang/docs/ReleaseNotes.html>

MFC after:	1 month
2014-02-16 19:44:07 +00:00
Ruslan Bukin
0beadc3c1c - Decrease buffer size.
- Handle eDMA interrupt on running channel only.
2014-02-16 19:21:44 +00:00
Ian Lepore
a6873fd141 After a timeout, reset the controller using SDHCI_RESET_CMD|SDHCI_RESET_DATA
rather than SDHCI_RESET_ALL; the latter turns off clocks and power, removing
any possibility of recovering from the error.

Also, double the timeout to 2 seconds.  Despite what the SD spec says about
all transactions completing in 250ms or less, I have a card which sometimes
takes more than a second to complete a write.
2014-02-16 17:22:49 +00:00
Ruslan Bukin
586a16c431 Add driver for Synchronous Audio Interface (SAI).
SAI supports full-duplex serial interfaces with frame
synchronization such as I2S, AC97, TDM, and codec/DSP
interfaces.
2014-02-16 16:49:54 +00:00
Hans Petter Selasky
77bea00c5e Add new PCI ID for hardware which needs port routing for USB 3.0.
PR:		usb/186811
MFC after:	1 week
Submitted by:	Philipp Maechler <philipp.maechler@mamo.li>
2014-02-16 14:37:23 +00:00
Christian Brueffer
5aabe0d7b8 Remove an nve(4)-specific workaround from the xbox port. nfe(4) doesn't
need it.

Reviewed by:	ed
2014-02-16 14:35:19 +00:00
Dimitry Andric
bc28228951 In sys/dev/usb/controller/musb_otg.c, fix a warning about musbotg_odevd
being unused, by adding it to the part that handles getting descriptors.

Reviewed by:	hselasky
MFC after:	3 days
2014-02-16 12:41:57 +00:00
Christian Brueffer
7f47cbd3ce Retire the nve(4) driver; nfe(4) has been the default driver for NVIDIA
nForce MCP adapters for a long time.

Yays:	jhb, remko, yongari
Nays:	none on the current and stable lists
2014-02-16 12:22:43 +00:00
Ian Lepore
a41679c945 Catch up with last-second name change. 2014-02-16 03:34:07 +00:00
Ian Lepore
49624653d5 Oops, remove some dregs of debugging. 2014-02-16 03:30:22 +00:00
Ian Lepore
f3639674b5 Make it possible to access the ocotp registers before the ocotp device
is attached, by establishing a temporary mapping of the registers when
necessary.  This is a temporary measure to keep progress moving; in the
long run we need better control over the order in which devices attach
(better than "the order they appear in the fdt dts source").
2014-02-16 03:09:39 +00:00
Ian Lepore
731ff010b9 Add a helper routine to depth-search the device tree for a node with a
matching 'compatible' property.  This probably has a short half-life (as
do most of the fdt_ functions), but it helps solve some near-term needs
until we work out the larger problems of device instantiation order
versus the order of things in the fdt data.
2014-02-16 03:00:59 +00:00
Ian Lepore
b6e466340b Sweep up a couple crumbs left over from the imx6->fsl renaming. 2014-02-15 21:59:00 +00:00
Ian Lepore
350badf9db It turns out Freescale cleverly made the ocotp device compatible across
several different families of SoCs, so move it to the freescale directory
and prefix everything with fsl rather than imx6.
2014-02-15 21:21:57 +00:00
Ian Lepore
e64f01a94a Add timeout logic to sdhci, separate from the timeouts done by the hardware.
If the hardware is not in a good state (like maybe clocks aren't running
because of a configuration glitch) its timeout clock may also not work
correctly, and the next command sent will hang that thread forever.  The
thread in question is usually the one and only thread (at init time) or
a bio queue worker thread whose lockup will eventually lead to the whole
system locking up when it runs out of buffers.

No sd card command should take longer than 250ms.  This new code establishes
a 1-second timeout to allow plenty of safety margin over that.
2014-02-15 20:45:53 +00:00