Commit Graph

26 Commits

Author SHA1 Message Date
Bjoern A. Zeeb
27caa49f0b After r264897 restore the ability to add bootoptions from FDT for
platforms which do not use loaders or kernels that want to hardcode
options or for FDT passed in by loader.

Also fix a build issue by putting the kmdp variable accessed back under
the #ifdef FDT;  we may wish to revisit decision in which case more
code needs changing.

Submitted by:	brooks
2014-04-29 07:48:07 +00:00
Brooks Davis
e13aabb24f Fix beri_simplebus probing. It's not allowed to have two modules on the
same bus with the same name.

Tweak the description so it's clear the BERI version attached.

Sponsored by:	DARPA, AFRL
2014-04-24 23:28:09 +00:00
Brooks Davis
2ef3c88e4b Merge from CheriBSD:
commit 003649d962
Author: Robert N. M. Watson <robert.watson@cl.cam.ac.uk>
Date:   Wed Feb 5 18:32:09 2014 +0000

    Teach the FreeBSD/beri boot to "auto-detect" whether argument 4 (a3) is a
    memory size of pointer to a struct bootinfo * by looking at its value and
    seeing whether it is pointer-like.  If a pointer, assume it's a bootinfo
    and extract memsize from it instead; otherwise, use it as memsize directly.
    This allows kernels to support bootinfo being passed by loader (and boot2)
    while still supporting older Miniboot setups.

commit f7045af9a1
Author: Robert N. M. Watson <robert.watson@cl.cam.ac.uk>
Date:   Thu Feb 6 13:45:34 2014 +0000

    When the module metadata pointer is available from loader, use it in the
    kernel.

commit 52e0e1ff2c
Author: Robert N. M. Watson <robert.watson@cl.cam.ac.uk>
Date:   Thu Feb 6 19:57:48 2014 +0000

    In the BERI kernel boot code, extract 'boothowto' (which includes boot flags
    such as '-s') and 'envp' from passed module data.  Booting to single-user
    mode using boot flags now works.

Sponsored by:	DARPA, AFRL
2014-04-24 22:28:53 +00:00
Bjoern A. Zeeb
0ef79eac83 Based on xlp_machdep.c and completed the list of options based on
boot/mips/beri/loader/metadata.c allow FDT configuration to set
command line options.
This leads to an interesting quesiton of future interactions with loader.
However for configurations without loader this allows bootverbose or boot
single user to be set by compiling a new kernel, which is good enough for
testing and debugging.

Reviewed by:	rwatson
MFC after:	1 week
2014-04-17 13:02:59 +00:00
Bjoern A. Zeeb
4a9af7d53f Add the initial version of if_nf10bmac(4), a driver to support an
NetFPGA-10G Embedded CPU Ethernet Core.

The current version operates on a simple PIO based interface connected
to a NetFPGA-10G port.

To avoid confusion: this driver operates on a CPU running on the FPGA,
e.g. BERI/mips, and is not suited for the PCI host interface.

MFC after:	1 week
Relnotes:	yes
Sponsored by:	DARPA/AFRL
2014-04-17 12:33:26 +00:00
Nathan Whitehorn
65d08437ef Move Open Firmware device root on PowerPC, ARM, and MIPS systems to
a sub-node of nexus (ofwbus) rather than direct attach under nexus. This
fixes FDT on x86 and will make coexistence with ACPI on ARM systems easier.
SPARC is unchanged.

Reviewed by:	imp, ian
2014-02-05 14:44:22 +00:00
Ian Lepore
add35ed5b8 Follow r261352 by updating all drivers which are children of simplebus
to check the status property in their probe routines.

Simplebus used to only instantiate its children whose status="okay"
but that was improper behavior, fixed in r261352.  Now that it doesn't
check anymore and probes all its children; the children all have to
do the check because really only the children know how to properly
interpret their status property strings.

Right now all existing drivers only understand "okay" versus something-
that's-not-okay, so they all use the new ofw_bus_status_okay() helper.
2014-02-02 19:17:28 +00:00
Nathan Whitehorn
06763f5e55 Provide a simpler and more standards-compliant simplebus implementation to
get the Routerboard 800 up and running with the vendor device tree. This
does not implement some BERI-specific features (which hopefully won't be
necessary soon), so move the old code to mips/beri, with a higher attach
priority when built, until MIPS interrupt domain support is rearranged.
2014-02-01 17:41:54 +00:00
Bjoern A. Zeeb
369f2ddcb8 Use correct value pointing to previously selected FDT DTB.
Reviewed by:	brooks
Sponsored by:	DARPA, AFRL
MFC after:	1 week
2013-12-12 17:48:33 +00:00
Brooks Davis
9baa380649 Remove a bit of debugging output that slipped into r256911.
MFC after:	3 days
Sponsored by:	DARPA/AFRL
2013-10-22 21:13:02 +00:00
Brooks Davis
f66834b69a MFP4:
Change 228019 by bz@bz_zenith on 2013/04/23 13:55:30

	Add kernel side support for large TLB on BERI/CHERI.
	Modelled similar to NLM

MFC after:	3 days
Sponsored by:	DAPRA/AFRL
2013-10-22 21:08:25 +00:00
Brooks Davis
fdd228fcd6 MFP4: 223121 (PIC portion), 225861, 227822, 229692 (PIC only), 229693,
230523, 1123614

Implement a driver for Robert Norton's PIC as an FDT interrupt
controller. Devices whose interrupt-parent property points to a beripic
device will have their interrupt allocation, activation , and setup
operations routed through the IC rather than down the traditional bus
hierarchy.

This driver largely abstracts the underlying CPU away allowing the
PIC to be implemented on CPU's other than BERI. Due to insufficient
abstractions a small amount of MIPS specific code is currently required
in fdt_mips.c and to implement counters.

MFC after:	3 days
Sponsored by:	DARPA/AFRL
2013-10-22 15:29:59 +00:00
Brooks Davis
f570e9e145 MFP4: 221483, 221567, 221568, 221670, 221677, 221678, 221800, 221801,
221804, 221805, 222004, 222006, 222055, 222820, 1135077, 1135118, 1136259

Add atse(4), a driver for the Altera Triple Speed Ethernet MegaCore.

The current driver support gigabit Ethernet speeds only and works with
the MegaCore only in the internal FIFO configuration in the soon to be
open sourced BERI CPU configuration.

Submitted by:	bz
MFC after:	3 days
Sponsored by:	DARPA/AFRL
2013-10-18 20:44:19 +00:00
Brooks Davis
224d11f577 MFP4:
Change 227630 by bz@bz_zenith on 2013/04/12 08:50:27

	Implement soft reset setting sr in sr and just in case loop
	endlessly afterwards.

MFC after:	3 days
Sponsored by:	DARPA/AFRL
2013-10-18 15:40:37 +00:00
Attilio Rao
590f9303e5 Merge from vmobj-rwlock branch:
Remove unused inclusion of vm/vm_pager.h and vm/vnode_pager.h.

Sponsored by:	EMC / Isilon storage division
Tested by:	pho
Reviewed by:	alc
2013-02-26 01:00:11 +00:00
Robert Watson
1aef4ac1bc Partially merge Perforce changeset 219938 to head:
Write FDT attachment for the Terasic MTL (multitouch LCD) driver.
  Exploit the fact that FDT allows multiple memory ranges to be
  assigned to a device, giving us a cleaner description than
  device.hints does.

Portions of this changeset that remove mtl from BERI device.hints and
add to DTS will be merged separately.

Sponsored by:	DARPA, AFRL
2013-01-13 16:27:56 +00:00
Robert Watson
c4b4976dee Merge Perforce changeset 219922 to head:
Update nexus parts in copied DE4LED attachment to use FDT.

Sponsored by:	DARPA, AFRL
2013-01-13 15:12:35 +00:00
Robert Watson
100bfa3f87 Merge Perforce changeset 219918 to head:
Naive first cut at an FDT bus attachment for the Altera JTAG UART.

Sponsored by:	DARPA, AFRL
2013-01-13 15:08:17 +00:00
Robert Watson
4d19b97f11 Merge Perforce change @219948 to head:
Add code so that the BERI boot process can ask the kernel linker for
  DTB blobs that may have been left for it by the boot loader, as done
  on PowerPC and ARM.  This will require both a more mature boot
  loader, and more mature boot loader argument passing mechanism,
  than currently supported on BERI.

Sponsored by:	DARPA, AFRL
2013-01-12 13:20:21 +00:00
Robert Watson
f73faab74b Merge Perforce change @219935 to head:
Initialise Openfirmware/FDT code earlier in the FreeBSD/beri boot,
  so that the results will be available for configuring the console
  UART (eventually).

  Suggested by:   thompsa

Sponsored by:	DARPA, AFRL
2013-01-12 12:34:59 +00:00
Robert Watson
d8c7c88283 Merge @219932 from Perforce:
FDT headers can't be included if the kernel is compiled without
  FDT support, due to dependence on generated kobj headers.  BERI
  supports both FDT and non-FDT kernels.

  Spotted by:	bz
2013-01-01 19:42:06 +00:00
Robert Watson
9eb71e68fe If FDT is compiled into a FreeBSD/beri kernel, initialise OpenFirmware.
Sponsored by:	DARPA, AFRL
2012-12-31 11:06:37 +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
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
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
c9790125b5 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.

Sponsored by:   DARPA, AFRL
2012-08-25 08:31:21 +00:00