jhb [Mon, 27 Aug 2012 17:24:07 +0000 (17:24 +0000)]
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
rdivacky [Mon, 27 Aug 2012 14:51:26 +0000 (14:51 +0000)]
Dont cast from char* to struct chrp_header* which has a bigger alignment
requirements. Copy it via union instead. Fixes a clang warning about
alignment.
imp [Mon, 27 Aug 2012 04:03:49 +0000 (04:03 +0000)]
Don't puprosely overclock the SD bus to 30MHz, make the user
explicltly enable that. The driver chose to use 60MHz / 2 (30MHz)
most of the time rather than 60MHz / 4 (15MHz) based on the Linux
driver of the time. This pushes the spec a little in order to not
suffer the penalty of running at 15MHz. However, when other bus
masters are active in the system, and the user tries 4-wire mode, the
internal bus arbitration would fail with data loss as a result.
# Comments from PR were reworked to reflect my historical perspective
davidxu [Mon, 27 Aug 2012 03:09:39 +0000 (03:09 +0000)]
In suspend_common(), don't wait for a thread which is in creation, because
pthread_suspend_all_np() may have already suspended its parent thread.
Add locking code in pthread_suspend_all_np() to only allow one thread
to suspend other threads, this eliminates a deadlock where two or more
threads try to suspend each others.
rwatson [Sun, 26 Aug 2012 09:21:59 +0000 (09:21 +0000)]
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.
dim [Sat, 25 Aug 2012 23:08:24 +0000 (23:08 +0000)]
For building libstdc++ and libsupc++, filter out any -stdlib=libc++
option from CXXFLAGS, otherwise these libraries will not build.
Similarly, filter out any -std=xxx options that aren't supported.
rwatson [Sat, 25 Aug 2012 22:35:29 +0000 (22:35 +0000)]
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.
brooks [Sat, 25 Aug 2012 18:08:20 +0000 (18:08 +0000)]
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.
alc [Sat, 25 Aug 2012 16:55:38 +0000 (16:55 +0000)]
Retire PV_TABLE_MOD. When we destroy or write protect a dirty mapping,
we call vm_page_dirty(). Maintaining the PV_TABLE_MOD flag, in addition,
serves no useful purpose.
dim [Sat, 25 Aug 2012 13:15:44 +0000 (13:15 +0000)]
Add libcxxrt's objects (prefixing them with cxxrt_ to avoid collisions)
to libc++.a and libc++_p.a, to make static linking of C++ executables
with libc++ easier. This is similar to the approach used in libstdc++.
rwatson [Sat, 25 Aug 2012 11:30:36 +0000 (11:30 +0000)]
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.
rwatson [Sat, 25 Aug 2012 11:19:20 +0000 (11:19 +0000)]
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.
rwatson [Sat, 25 Aug 2012 11:07:43 +0000 (11:07 +0000)]
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.
rrs [Sat, 25 Aug 2012 09:26:37 +0000 (09:26 +0000)]
This small change takes care of a race condition
that can occur when both sides close at the same time.
If that occurs, without this fix the connection enters
FIN1 on both sides and they will forever send FIN|ACK at
each other until the connection times out. This is because
we stopped processing the FIN|ACK and thus did not advance
the sequence and so never ACK'd each others FIN. This
fix adjusts it so we *do* process the FIN properly and
the race goes away ;-)
rwatson [Sat, 25 Aug 2012 08:31:21 +0000 (08:31 +0000)]
Add preliminary support for the SRI International / University of Cambridge
Bluespec Extensible RISC Implementation (BERI) processor. BERI is a 64-bit
MIPS ISA soft CPU core that can be synthesised to Altera and Xilinx FPGAs,
and is being used for CPU and OS research at several institutions.
rwatson [Sat, 25 Aug 2012 08:09:37 +0000 (08:09 +0000)]
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.
rwatson [Sat, 25 Aug 2012 08:02:46 +0000 (08:02 +0000)]
On MIPS, when printing page fault information for an unexpected exception
type, explicitly print out "unknown" rather than the empty string, and
include the exception type number for ease of debugging.
rwatson [Sat, 25 Aug 2012 07:48:52 +0000 (07:48 +0000)]
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.
bapt [Fri, 24 Aug 2012 21:08:56 +0000 (21:08 +0000)]
- change ALWAYS_ASSUME_YES to ASSUME_ALWAYS_YES for consistency with pkg(8)
- if not on a tty prompt about the missing pkg(8) but default on 'no' except if
ASSUME_ALWAYS_YES is set
jimharris [Fri, 24 Aug 2012 17:08:02 +0000 (17:08 +0000)]
Fix scsi_da's BIO_DELETE->SCSI_UNMAP translation to use correct local
variable when determining various sizes related to SCSI UNMAP block
descriptor lists.
Sponsored by: Intel
Reviewed by: mav
MFC after: 3 days
ru [Fri, 24 Aug 2012 06:55:16 +0000 (06:55 +0000)]
A workaround in r238563 was for makes (notably bmake) without the
internal knowledge that "cd" is a shell's built-in. Such makes
may attempt to exec() "cd" that in turn will fail on systems that
lack the "cd" executable.
adrian [Fri, 24 Aug 2012 00:09:49 +0000 (00:09 +0000)]
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.)
jamie [Thu, 23 Aug 2012 19:39:23 +0000 (19:39 +0000)]
Partially roll back r239601 - keep parameter strings both length-delimited
and null-terminated at the same time, because they're later passed to
libjail as null-terminated. That means I also need to add a nul byte when
comma-combining array parameters.
mm [Thu, 23 Aug 2012 19:32:57 +0000 (19:32 +0000)]
Merge recent vendor changes:
3086 unnecessarily setting DS_FLAG_INCONSISTENT on async destroyed datasets
3090 vdev_reopen() during reguid causes vdev to be treated as corrupt
3102 vdev_uberblock_load() and vdev_validate() may read the wrong label