Commit Graph

24040 Commits

Author SHA1 Message Date
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
Adrian Chadd
54798be082 Implement an API to fetch the default DFS parameters for the given chip.
The only chip this is currently implemented for is the AR5416 HAL family.
A follow-up commit will add AR5212 support.

PR:		kern/170904
2012-08-24 01:29:46 +00:00
Adrian Chadd
e0c214d1bb Bring over some new EEPROM regulatory domain flags.
Obtained from:	Qualcomm Atheros
2012-08-24 01:14:00 +00:00
Adrian Chadd
41466eb9a6 Oops, another copy/paste issue. 2012-08-24 00:54:31 +00:00
Adrian Chadd
85ca341a79 Add ath_hal_get_curmode() - this is used by the Osprey HAL.
Obtained from:	Qualcomm Atheros
2012-08-24 00:52:37 +00:00
Adrian Chadd
9b13447210 Add rfkill HAL accessor methods. 2012-08-24 00:43:10 +00:00
Adrian Chadd
8edfeb1264 Oops, fix copy/paste silliness. 2012-08-24 00:40:01 +00:00
Adrian Chadd
7148a61d16 Add some more capabilities (unused at the present.)
Obtained from:	Qualcomm Atheros
2012-08-24 00:36:47 +00:00
Adrian Chadd
b042e6a3e0 Add the MFP capability to ath_hal_getcapability().
Obtained from:	Qualcomm Atheros
2012-08-24 00:33:25 +00:00
Adrian Chadd
9f24e32b4a Add some more diagnostic codes.
Obtained from:	Qualcomm Atheros
2012-08-24 00:17:39 +00:00
Adrian Chadd
830c1c46f3 Wrap this a little so it's slightly easier on the eyes. 2012-08-24 00:15:26 +00:00
Adrian Chadd
c84b4ebb24 Add some new flags:
* mfp support;
* 4.9ghz support in the HAL;
* device type - specifically, the bus type and whether it's a HB63
  NIC (which requires some subtle chainmask handling differences
  in the AR5416 HAL.)

Obtained from:	Qualcomm Atheros
2012-08-24 00:09:49 +00:00
Warner Losh
6e31adaf33 Fetch the chip select in the bridge driver, like all the other spi
bridges do.
2012-08-23 22:38:37 +00:00
Hans Petter Selasky
a0942dd7b2 Add tunable for XHCI port routing.
MFC after:	1 week
2012-08-23 17:40:20 +00:00
Warner Losh
bb1ef63f08 The check for MAXPHYS doesn't make sense, so remove it.
Report errors indicated by the transport.  If this is too chatty, I'll
throw it behind a debug write.
Remove commented out debugs that are no longer useful.
2012-08-23 04:35:55 +00:00
Adrian Chadd
38c0190699 Add a placeholder and typedefs for MFP (management frame protection.)
Obtained from:	Qualcomm Atheros
2012-08-23 03:37:01 +00:00
Adrian Chadd
353cf342f4 Add some more interrupt handling bits.
Obtained from:	Qualcomm Atheros
2012-08-23 03:25:09 +00:00
Adrian Chadd
a3611b5984 Add AR9380 devid HAL definitions and probe/attach strings.
Obtained from:	Device IDs are from Qualcomm Atheros
2012-08-23 03:03:00 +00:00
Adrian Chadd
168c1a30e8 Add chipset names. 2012-08-23 02:58:06 +00:00