Commit Graph

24058 Commits

Author SHA1 Message Date
Hans Petter Selasky
aead9631e7 Add required USB AUDIO v2.0 structure definitions.
PR:	misc/171254
2012-09-03 19:17:25 +00:00
Hans Petter Selasky
f83fab0234 Add more DWC OTG register definitions.
Submitted by:	Nick Hudson
2012-09-03 15:22:02 +00:00
Alan Cox
4cc8c59523 Correct an error in gxemul_disk_write(). It was issuing the command to
read from rather than write to the emulated disk.

Reviewed by:	jmallett
2012-09-03 02:32:00 +00:00
Adrian Chadd
be7f7a955b Disable strong signal diversity when enabling radar pulse detection
for the AR5212 era NICs.
2012-09-02 05:01:10 +00:00
Adrian Chadd
11f0fa784e AR5212 radar pulse fixes.
Fix the strong signal diversity capability setting - I had totally
messed up the indentation.

Set the default values to match what's in the .ini for now, rather than
what values I had previously gleaned from places.  This seems to work
quite well for the early AR5212 NICs I have.  Of course, later NICs
have different PHYs and the radar configuration is very card/board
dependent..

Tested:

 * ath1: AR5212 mac 5.3 RF5111 phy 4.1
   ath1: 2GHz radio: 0x0023; 5GHz radio: 0x0017

This detects 1, 5, 25, 50, 75, 100uS pulses reliably (with no interference.)

However, 10uS pulses don't detect reliably. That may be around the
transition between short and long pulses so some further tuning may
improve things.
2012-09-02 04:56:29 +00:00
Adrian Chadd
9c1b997551 Fix the PHY / CRC error bug in the AR5212 HAL, which apparently also pops
up on (at least) the AR5413.

The 30 second summary - if a CRC error frame comes in during PHY error
processing, that CRC bit will be set for all subsequent frames until
a non-CRC error frame is processed.

So to allow for accurate PHY error processing (Radar, and ANI on the AR5212
HAL chips) just tag the frame as being both CRC and PHY - let the driver
decide what to do with it.

PR:		kern/169362
2012-09-01 05:43:30 +00:00
Scott Long
cfc0969ad4 Heavily optimize the case of small RX packets of 160 bytes or less. For
this case, allocate a plain mbuf and copy the frame into it, then send the
copy up the stack, leaving the original mbuf+cluster in place in the
receive ring for immediate re-use.  This saves a trip through 2 of the
3 zones of the compound mbuf allocator, a trip through busdma, and a trip
through the 1 of the 3 mbuf destructors.  For our load at Netflix, this can
lower CPU consumption by as much as 20%.  The copy algorithm is based on
investigative work from Luigi Rizzo earlier in the year.

Reviewed by:	jfv
Obtained from:	Netflix
2012-08-31 10:07:38 +00:00
Scott Long
6aedf62f32 Essentially revert r239912. The amr_periodic function hadn't been armed in
over 10 years and was dead code; the previous revision exposed it as such to
CLANG.  The solution is to cull the whole thing.
2012-08-31 09:42:46 +00:00
Oleksandr Tymoshenko
f70f23cc3e Add PrimeCell UART (PL011) driver
Obtained from:	Semihalf
2012-08-30 20:31:53 +00:00
John Baldwin
ec9a9cf1e0 Attach interrupt handlers during attach instead of during the first time
the interface is brought up.  Without this, the boot time interrupt
round-robin assignment does not think the allocated interrupt resources
are active and leaves them assigned to CPU 0.

While here, add descriptive tags to each interrupt handler when MSI-X
is used.

Reviewed by:	np
MFC after:	1 week
2012-08-30 17:47:39 +00:00
John Baldwin
28435fb7f6 Use callout(9) rather than timeout(9). Note that the periodic timer in
amr(4) is never started, so this should be even more of a NOP than
normal.
2012-08-30 17:37:01 +00:00
Hans Petter Selasky
710764f7c2 Preparations for adding USB HOST mode to the DWC OTG driver.
Merge register file with external one and put all register
definitions in a separate file.

Submitted by:	ray @
2012-08-30 16:19:05 +00:00
Alexander Motin
7d0ec9dd3f Add bunch of ATI HDMI HDA controller IDs.
Submitted by:	Dmitry Luhtionov <dmitryluhtionov@gmail.com>
MFC after:	1 week
2012-08-30 15:47:20 +00:00
Alexander Motin
49a4a59a54 Add IDs for JMicron JMB360/JMB362 AHCI SATA controllers.
MFC after:	1 week
2012-08-30 15:23:59 +00:00
Adrian Chadd
dae1b5d00a Migrate the AR9285 diversity configuration LNA configuration to use
some HAL definitions rather than local definitions.

The original source (ath9k) pulled this stuff from the QCA driver and
removed the HAL_* prefix.  I'm just restoring the correct order of things.

Obtained from:	Qualcomm Atheros
2012-08-30 06:55:47 +00:00
Jim Harris
a099c5cca0 Do not call sati_check_data_io() for SATI_UNMAP sequences.
This routine is intended only for commands such as INQUIRY where
the controller may fill out a smaller amount of data than allocated
by the host.

The end result of this bug was that isci(4) would report non-zero
resid for successful SCSI_UNMAP commands.

Sponsored by:	Intel
MFC after:	3 days
2012-08-30 00:43:14 +00:00
Adrian Chadd
fb20fd244e There's no nede to allocate a DMA map just before calling bus_dmamem_alloc().
In fact, bus_dmamem_alloc() happily NULLs the dmat pointer passed in,
before replacing it with its own.

This fixes a MIPS crash when kldload'ing if_ath/if_ath_pci -
bus_dmamap_destroy() was passed in a NULL dmat pointer and was doing
all kinds of very bad things.

Reviewed by:	scottl
2012-08-29 16:58:51 +00:00
Adrian Chadd
28bb46617d Set the HAL combined antenna diversity capability if the AR9285
EEPROM settings allow it.
2012-08-29 04:11:00 +00:00
Adrian Chadd
46e2649633 Add a new capability bit - whether the hardware supports AR9285 style
combined diversity.
2012-08-29 04:09:54 +00:00
Adrian Chadd
d6af4e0f06 Add AR5413 radar parameters and strong signal diversity capability.
This is a re-implementation based on the reference carrier code
for the AR5413.

Tested:
 * Pulse detection for AR5212 and AR5413, to ensure the
   correct behaviour for both chips

PR:		kern/170904
Obtained from:	Qualcomm Atheros
2012-08-29 03:58:13 +00:00
Adrian Chadd
0146ef1ae2 Add a (temporarily located) definition. 2012-08-29 03:50:59 +00:00
Adrian Chadd
21cb20bb94 Remove - not needed. 2012-08-29 00:53:58 +00:00
Adrian Chadd
b5c5592d2b Remove extra debugging - there's no longer any need. 2012-08-29 00:53:41 +00:00
Adrian Chadd
8a1e4fa08b Add a new flash part - 4MB SPI flash from Winbond. 2012-08-28 22:17:22 +00:00
Adrian Chadd
bb1bf7ed0a Only print the descriptor contents!
Found by:	magical CLANG build environments

Submitted by:	Sevan <venture37@gmail.com>
2012-08-27 23:27:41 +00:00
Adrian Chadd
a1d97d2e9d Don't grab an unreferenced pointer to the VAP bss node. 2012-08-27 23:18:41 +00:00
Adrian Chadd
f6fd8c7af8 Improve the sample rate logging. 2012-08-27 20:30:07 +00:00
Adrian Chadd
5b0c1ea0c9 Ensure that all firstep values are available in ANI.
The comparison assumes maxFirstepLevel is a count, rather than a maximum
value.  The array is 3 entries in size however 'maxFirstepLevel' is 2.

This bug also exists in the AR5212 HAL.
2012-08-27 20:10:38 +00:00
Adrian Chadd
810f2a9cbc Fix the debugging output to correctly log CCK errors. 2012-08-27 20:03:08 +00:00
John Baldwin
6b5b57ae9f Rework the DMA handling in ida(4) and add locking to make this driver
MPSAFE.
- Preallocate a full set of QCBs during attach rather than allocating new
  ones on demand to avoid allocations in the I/O path.
- Remove the explicit bus space tag/handle and use bus_*() on the
  relevant 'struct resource' instead.
- Defer logical drive probing to an intrhook.
- Fix ida_detach() to detach and delete child devices (logical drives).
- Update the DMA handling to support EINPROGRESS by moving the work to
  submit a mapped request into the bus_dma callback routine as well as
  add support for freezing the queue when EINPROGRESS is encountered.

Tested by:	Marco Steinbach  coco executive-computing de
2012-08-27 17:24:07 +00:00
Robert Watson
7b957f4fe7 Add terasic_de4led, a led(4) driver for the on-board 8-element LED on the
Terasic DE-4 board.  Allow LED configuration to be set using loader
tunables, not just from userspace, and preconfigure LED 8 as a kernel
heartbeat.  For now, this is a Nexus-attached, BERI-only driver, but it
could be used with other hard and soft cores on Altera FPGAs as well, in
principle.

Sponsored by:	DARPA, AFRL
2012-08-26 09:21:59 +00:00
Adrian Chadd
222d73f11d Move this magic check to only occur if no eeprom data is given.
Tested on:

	* AP99 (AR7241+AR9287)
2012-08-26 04:26:49 +00:00
Adrian Chadd
e12a307eff Add EEPROM data hooks for the AR9287.
Tested:
	* AP99 Reference board (AR7241 + AR9287)
2012-08-26 04:26:25 +00:00
Oleksandr Tymoshenko
e1f04cd024 Piggyback MIPS changes and add ARM syscons support for devices with
framebuffer

While here - sort #if defined() order alphabetically
2012-08-25 23:59:31 +00:00
Alexander Motin
cf977ac20a Return "locally assigned" Enclosure Logical Identifier instead of 8 zero
bytes. Zeroes there are incorrect and tend to cause false device ID matches.
2012-08-25 23:01:57 +00:00
Robert Watson
ec5bd1da7d Add terasic_mtl(4), a device driver for the Terasic Multi-Touch LCD,
used with Terasic's DE-4 and other similar FPGA boards.  This display
is 800x480 and includes a capacitive touch screen, multi-touch
gesture recognition, etc.  This device driver depends on a Cambridge-
provided IP core that allows the MTL device to be hooked up to the
Altera Avalon SoC bus, and also provides a VGA-like text frame buffer.

Although it is compiled as a single device driver, it actually
implements a number of different device nodes exporting various
aspects of this multi-function device to userspace:

- Simple memory-mapped driver for the MTL 24-bit pixel frame buffer.
- Simple memory-mapped driver for the MTL control register set.
- Simple memory-mapped driver for the MTL text frame buffer.
- syscons attachment for the MTL text frame buffer.

This driver attaches directly to Nexus as is common for SoC device
drivers, and for the time being is considered BERI-specific, although
in principle it might be used with other hard and soft cores on
Altera FPGAs.

Control registers, including touchscreen input, are simply memory
mapped; in the future it would be desirable to hook up a more
conventional device node that can stream events, support kqueue(2)/
poll(2)/select(2), etc.

This is the first use of syscons on MIPS, as far as I can tell, and
there are some loose ends, such as an inability to use the hardware
cursor.  More fundamentally, it appears that syscons(4) assumes that
either a host is PC-like (i386, amd64) *or* it must be using a
graphical frame buffer.  While the MTL supports a graphical frame
buffer, using the text frame buffer is preferable for console use.
Fixing this issue in syscons(4) requires non-trivial changes, as the
text frame buffer support assumes that direct memory access can be
done to the text frame buffer without using bus accessor methods,
which is not the case on MIPS.  As a workaround for this, we instead
double-buffer and pretend to be a graphical frame buffer exposing
text accessor methods, leading to some quirks in syscons behaviour.

Sponsored by:	DARPA, AFRL
2012-08-25 22:35:29 +00:00
Oleksandr Tymoshenko
c36ad1ffa3 Do not swap byte order if we assign default value for intr_cells 2012-08-25 20:18:12 +00:00
Brooks Davis
087d31736a Add isf(4), a driver for the Intel StrataFlash family of NOR flash parts.
The driver attempts to support all documented parts, but has only been
tested with the 512Mbit part on the Terasic DE4 FPGA board.  It should be
trivial to adapt the driver's attach routine to other embedded boards
using with any parts in the family.

Also import isfctl(8) which can be used to erase sections of the flash.

Sponsored by:	DARPA, AFRL
2012-08-25 18:08:20 +00:00
Robert Watson
697a77c1c4 Add altera_jtag_uart(4), a device driver for Altera's JTAG UART soft core,
which presents a UART-like interface over the Avalon bus that can be
addressed over JTAG.  This IP core proves extremely useful, allowing us to
connect trivially to the FreeBSD console over JTAG for FPGA-embedded hard
and soft cores.  As interrupts are optionally configured for this soft
core, we support both interrupt-driven and polled modes of operation,
which must be selected using device.hints.  UART instances appear in /dev
as ttyu0, ttyu1, etc.

However, it also contains a number of quirks, which make it difficult to
tell when JTAG is connected, and some buffering issues.  We work around
these as best we can, using various heuristics.

While the majority of this device driver is not only not BERI-specific,
but also not MIPS-specific, for now add its defines in the BERI files
list, as the console-level parts are aware of where the first JTAG UART
is mapped on Avalon, and contain MIPS-specific address translation, to
use before Newbus and device.hints are available.

Sponsored by:	DARPA, AFRL
2012-08-25 11:30:36 +00:00
Robert Watson
d432e92a84 Add a device driver for the Altera University Program SD Card IP Core,
which can be synthesised in Altera FPGAs.  An altera_sdcardc device
probes during the boot, and /dev/altera_sdcard devices come and go as
inserted and removed.  The device driver attaches directly to the
Nexus, as is common for system-on-chip device drivers.

This IP core suffers a number of significant limitations, including a
lack of interrupt-driven I/O -- we must implement timer-driven polling,
only CSD 0 cards (up to 2G) are supported, there are serious memory
access issues that require the driver to verify writes to memory-mapped
buffers, undocumented alignment requirements, and erroneous error
returns.  The driver must therefore work quite hard, despite a fairly
simple hardware-software interface.  The IP core also supports at most
one outstanding I/O at a time, so is not a speed demon.

However, with the above workarounds, and subject to performance
problems, it works quite reliably in practice, and we can use it for
read-write mounts of root file systems, etc.

Sponsored by:	DARPA, AFRL
2012-08-25 11:19:20 +00:00
Robert Watson
cf8248866d Add altera_avgen(4), a generic device driver to be used by hard and soft
CPU cores on Altera FPGAs.  The device driver allows memory-mapped devices
on Altera's Avalon SoC bus to be exported to userspace via device nodes.
device.hints directories dictate device name, permissible access methods,
physical address and length, and I/O alignment.  Devices can be accessed
using read(2)/write(2), but also memory mapped in userspace using mmap(2).

Devices attach directly to the Nexus, as is common for embedded device
drivers; in the future something more mature might be desirable.  There is
currently no facility to support directing device-originated interrupts to
userspace.

In the future, this device driver may be renamed to socgen(4), as it can
in principle also be used with other system-on-chip (SoC) busses, such as
Axi on ASICs and FPGAs.  However, we have only tested it on Avalon busses
with memory-mapped ROMs, frame buffers, etc.

Sponsored by:	DARPA, AFRL
2012-08-25 11:07:43 +00:00
Robert Watson
8122a592ee Provide basic glue to allow syscons to be used on MIPS, modelled
on PowerPC support.  This was clearly not something syscons was
designed to do (very specific assumptions about the nature of VGA
consoles on PCs), but fortunately others have long since blazed
the way on making it work regardless of that.

Sponsored by:	DARPA, AFRL
2012-08-25 08:09:37 +00:00
Robert Watson
b03d880eea In the gxemul console, check the RB_SERIAL boot flag, and change the
relative priority of the gxemul console in line with its role as a
"seiral console".  This allows it to override video console drivers
that might otherwise take precdence, subject to that boot flag.

Sponsored by:	DARPA, AFRL
2012-08-25 07:48:52 +00:00
Robert Watson
a06584ab56 Rename the gxemul console device to "ttyu0" to match the expectations of
the default MIPS /etc/ttys.

Sponsored by:	DARPA, AFRL
2012-08-25 07:47:12 +00:00
Jim Harris
c588600407 Clear freeze bit before calling xpt_release_devq.
This ensures that any ccbs which immediately start during the call to
xpt_release_devq see an accurate picture of the frozen_lun_mask.

Sponsored by:	Intel
MFC after:	3 days
2012-08-24 22:04:16 +00:00
Adrian Chadd
b7005313dd Remove the hard-coded AR5416-series parameters and instead use the
DFS parameters fetched from the HAL.

Check whether the specific chipset supports RADAR reporting before
enabling DFS; or some of the (unset) DFS methods may fail.

Tested:

* AR5210 (correctly didn't enable radar PHY reporting)
* AR5212 (correctly enabled radar PHY reporting w/ the correct default
  parameters.)

TODO:

* Now that I have this capability check in place, I could remove the
  (empty) DFS methods from AR5210/AR5211.
* Test on AR5416, AR9160, AR9280.

PR:		kern/170904
2012-08-24 17:39:57 +00:00
Adrian Chadd
51816abcd0 Correctly handle the "pe_enabled" flag - both when configuring DFS and
fetching the current DFS configuration.

PR:		kern/170904
2012-08-24 17:37:51 +00:00
Adrian Chadd
7d6b932c44 Add an accessor macro for getting access to the default DFS parameters.
PR:		kern/170904
2012-08-24 17:37:12 +00:00
Adrian Chadd
217ad7d2a5 Add default values for the NumTxMaps capability. 2012-08-24 07:35:18 +00:00
Adrian Chadd
47152caed8 Add the method to fetch the default DFS parameters for the AR5212 PHY.
I need to check whether new parameters were added for the AR5413 NIC.

PR:		kern/170904
2012-08-24 07:32:35 +00:00