Commit Graph

24021 Commits

Author SHA1 Message Date
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
Hans Petter Selasky
6623910e4a Add new USB device ID.
Submitted by:	Dmitry Luhtionov
MFC after:	1 week
2012-08-22 18:30:13 +00:00
Jim Harris
3e0a9f1ff2 Fix/add support for SCSI UNMAP to ATA DSM translation.
This addresses kernel panic observed when sending SCSI UNMAP
commands to SATA disks attached to isci(4).

1) Flesh out callback routines to allocate/free buffers needed for
   translating SCSI UNMAP data to ATA DSM data.
2) Add controller-level pool for storing buffers previously allocated
   for UNMAP translation, to lessen chance of no buffer available
   under memory pressure.
3) Ensure driver properly handles case where buffer pool is empty
   and contigmalloc returns NULL.

Sponsored by: Intel
Reported by: Maksim Yevmenkin <max at netflix dot com>
Discussed with:  scottl
MFC after: 3 days
2012-08-21 22:28:14 +00:00
Navdeep Parhar
87a74dd6e3 Deal with the case where a syncache entry added by the TOE driver is
evicted from the syncache but a later syncache_expand succeeds because
of syncookies.  The TOE driver has to resort to more direct means to
install its hooks in the socket in this case.
2012-08-21 22:23:17 +00:00
Hans Petter Selasky
a451c791cc Style. 2012-08-21 20:18:01 +00:00
Hans Petter Selasky
b7d049b789 Fix USB drivers for KB920X target.
Add missing clock settings.
VBUS GPIO IRQ is still missing (TODO).
2012-08-21 20:10:59 +00:00
Navdeep Parhar
f9796f4373 Avoid a NULL pointer dereference. 2012-08-21 19:45:19 +00:00
Navdeep Parhar
36fd646e38 Cannot hold a mutex around vm_fault_quick_hold_pages, so don't. Tweak
some comments while here.
2012-08-21 19:39:09 +00:00
Navdeep Parhar
c91bcaaab5 Minor cleanup: use bitwise ops instead of pointless wrappers around
setbit/clrbit.
2012-08-21 18:30:16 +00:00
Navdeep Parhar
06fd9875aa Correctly handle the case where an inp has already been dropped by the time
the TOE driver reports that an active open failed.  toe_connect_failed is
supposed to handle this but it should be provided the inpcb instead of the
tcpcb which may no longer be around.
2012-08-21 18:09:33 +00:00
Hiroki Sato
f8e8af9cf2 Add s35390a_rtc(4) driver for Seiko Instruments S-35390A RTC.
Submitted by:	Yusuke Tanaka
2012-08-21 17:31:10 +00:00
Adrian Chadd
208be709c4 Initialise an uninitialised variable.
GCC on -9 didn't pick this up; clang did.

Submitted by:	David Wolfskill
2012-08-21 16:44:25 +00:00
Matt Jacob
662daadde0 Remove dependence on MAXPHYS.
MFC after:	1 month
2012-08-21 16:18:11 +00:00
Adrian Chadd
79b5235666 Fix a build issue when ATH_DEBUG isn't defined - just initialise and use
qnum.
2012-08-20 18:57:41 +00:00
Adrian Chadd
0f8423a27a Wrap debugging in #ifdef ATH_DEBUG 2012-08-20 15:30:26 +00:00
Adrian Chadd
4aa8818b55 Flesh out some initial EDMA TX FIFO fill, complete and refill routines.
Note: This is totally sub-optimal and a work in progress.

* Support filling an empty FIFO TXQ with frames from the ath_buf queue
  in the ath_txq list.  However, since there's (currently) no clean, easy
  way to separate the frames that are in the FIFO versus just waiting,
  the code waits for the FIFO to be totally empty before it attempts to
  queue more.  This is highly sub-optimal but is enough to get the ball
  rolling.

* A _lot_ of the code assumes that the TX status is filled out in the
  struct ath_buf bf_status field.  So for now, memcpy() the completion over.

* None of the TX drain / reset routines will attempt to complete completed
  frames before draining, so it can't be used for 802.11n TX aggregation.
  (This won't work anyway, as the aggregation TX descriptor API hasn't
  yet been converted; and that'll happen in some future commits.)

* Fix an issue where the FIFO counter wasn't being incremented, leading
  to the queue logic just plain not working.

* HAL_EIO means "descriptor wasn't valid", versus "not finished, don't
  continue." So don't stop processing descriptors when HAL_EIO is hit.

* Don't service frame completion from the beacon queue.  It isn't currently
  fully setup like a real queue and the first attempt at accessing the
  queue lock will panic the kernel.

Tested:

* AR9380, STA mode

This commit is brought to you by said AR9380 in STA mode.
2012-08-20 06:11:04 +00:00
Adrian Chadd
42083b3d66 Advance the descriptor pointer by sc->sc_tx_desclen bytes, rather than
sizeof(struct ath_desc).  This isn't correct for EDMA TX descriptors.

This popped up during iperf tests. Ping tests never created frames that
had enough segments to overflow into a second descriptor.  However,
an iperf TCP test would do that after a few seconds; the second descriptor
would almost always certainly have garbage.

Tested:

* AR9380, STA mode
* AR9280, STA mode (802.11n TX, legacy TX)
2012-08-20 06:02:09 +00:00
Adrian Chadd
bd68600c99 Make sure all of the buffers are printed, rather than (n-1). 2012-08-20 05:47:07 +00:00
Andreas Tobler
9c3fbfbd6a Add a new sound driver for PowerMacs, found here on my Quad G5.
It allows simple playback and volume control like the other Mac drivers,
not more.
2012-08-19 19:40:33 +00:00
Andreas Tobler
a894f6a0d4 Add a new temperature driver for certain PowerMacs. Found here on my Quad G5. 2012-08-19 19:37:14 +00:00