Commit Graph

97056 Commits

Author SHA1 Message Date
Robert Watson
5af5d53deb Build 64-bit ELF support into little-endian 64-bit MIPS boot-loader
fragments; while this won't actually be used for anything (yet), it
doesn't hurt to ensure it is exposed to the tinderbox.

Requested by:	imp, jmallett
MFC after:	3 weeks
2014-02-24 18:44:03 +00:00
Luiz Otavio O Souza
b85b1bbd0f Enable the second and the third I2C controllers on Beaglebone-black.
The first I2C controller is only used to manage the on-board devices (PMIC
and HDMI framer) and its bus is not exposed on the expasion headers.

With this change the following pins on the P9 expansion headers are now
reserved as I2C pins:

 Pin 17 - I2C1 SCL
 Pin 18 - I2C1 SDA
 Pin 19 - I2C2 SCL
 Pin 20 - I2C2 SDA

The I2C2 is the bus that should be used to read the contents of cape
eeproms.

Approved by:	adrian (mentor, implicit)
2014-02-24 12:45:03 +00:00
Hans Petter Selasky
266ffc1f40 Update ATP driver:
- Add support for emulating a mouse wheel, Z-axis.

Submitted by:	Rohit Grover <rgrover1@gmail.com>
MFC after:	2 weeks
2014-02-24 10:44:42 +00:00
Adrian Chadd
9ab21e32fb Add in port0/port6 configuration as part of the platform data code path.
It's still hardcoded (for db120) but it is now hardcoded in all the
same place (ie, the pdata path.)  The port config/status code now checks
port0/port6 as appropriate to configure things.

Tested:

* Qualcomm Atheros DB120, AR8327 switch.
2014-02-24 05:55:00 +00:00
Adrian Chadd
2e3fd37d45 Add the AR8327 bits to the DB120 config file.
There's plenty of hints that I haven't yet fleshed out and are hardcoded
in arswitch_8327.c.  They're listed here (from OpenWRT) for completeness.

This is enough to get the thing up, running and pinging.

Note that the mdiobus for the on-switch switch changes - the AR8327
probes first, which exposes mdio1, and thus the arge1 mdiobus will probe
and attach as mdio2.  That is what the AR9344 on-chip switch has to
attach to.

Tested:

* Qualcomm Atheros DB120
2014-02-24 04:48:46 +00:00
Adrian Chadd
482d268d49 Link the AR8327 to the build. 2014-02-24 04:47:27 +00:00
Adrian Chadd
7330dd0bb4 Add initial AR8327 support.
This is (almost!) enough to actually probe, attach, configure a default
port group and do some basic work.  It's also totally hard-coded for
the Qualcomm Atheros DB120 board - it doesn't yet have any of the code
from OpenWRT which parses extra configuration data to know how to program
the switch.  The LED stuff is also missing.

But, it's enough to facilitate board, PHY, switch and VLAN bringup,
so I am committing it now.

Tested:

* Qualcomm Atheros DB120

Obtained from:	OpenWRT
2014-02-24 04:47:16 +00:00
Adrian Chadd
6dcbabd7d6 Methodize the arswitch VLAN routines.
These differ per chipset family in subtle and evil ways.

It becomes very noticable on the AR8327 where the layout is just plain
wrong.
2014-02-24 04:44:28 +00:00
Adrian Chadd
570c21252c * Ensure enough ports/phys are available for both the AR8327 and previous
switches.

* Add some new VLAN HAL methods that will be used by the VLAN configuration
  code.  The AR933x and later switches use slightly different register
  layouts (even though the driver currently doesn't support it.)
2014-02-24 04:43:23 +00:00
Ian Lepore
1f22526981 Add the bits needed to run SMP on imx6.
The 'option SMP' isn't added to the kernel config yet; people wanting to
test this have to opt-in for now.
2014-02-24 03:51:31 +00:00
Ian Lepore
1cf228d34b Invalidate caches immediately upon entry to init_secondary(). Also set
the Bufferable bit in the PDE entries of the secondary processor startup
pagetables.

The caches really need to be invalidated even earlier than this, but this
is a big step in the right direction.  The invalidate needs to happen
before the MMU is enabled, which means it has to be called from asm code
that's running with physical addressing.  Fixing that will be handled in
a future change.
2014-02-24 03:47:39 +00:00
Adrian Chadd
49f79cfd5f Track and expose the latest statistics from the firmware.
Tested:

* Intel Centrino 6205
2014-02-24 02:37:04 +00:00
Adrian Chadd
892ebbbd84 Reserve a bit for statistics debugging. I'll hopefully use it soon. 2014-02-24 02:13:20 +00:00
Ian Lepore
4b7fcd31e1 Add a new cache maintenance function, idcache_inv_all, to the table, and
implementations for each of the chips we support.  Most chips up through
armv6 can use the armv4 implementation which has a single coprocessor
opcode for this operation.  The rather more complex armv7 implementation
comes from netbsd.
2014-02-24 01:41:58 +00:00
Ian Lepore
02ba95fe77 Add an ident line. 2014-02-24 01:17:23 +00:00
Hans Petter Selasky
37247d72eb Update ATP driver:
- Support for double-tap and drag.
- Support for 2-finger horizontal scrolling which translates to page-back/forward events.
- Single finger tap is equivalent to a left-button press.
- Two-finger taps are mapped to the right-button click.
- Three fingers are mapped to middle button.
- Add sysctl to disable single finger tapping.
- Fix for multiple open of /dev/atp0
- Enhanced support for the Fountain/Geyser family by adding Geyser4.
- Update manual page.

Submitted by:	Rohit Grover <rgrover1@gmail.com>
MFC after:	2 weeks
2014-02-23 23:36:32 +00:00
Adrian Chadd
2e9afe9597 Fix a typo. 2014-02-23 23:13:53 +00:00
Ian Lepore
08616fa793 Actually set the proper bit to indicate TTB shared memory.
Submitted by:	Juergan Weiss
2014-02-23 23:06:50 +00:00
Ian Lepore
b7c1fc50a4 If the L2 cache type is PIPT, pass a physical address for a flush.
While this is technically more correct, I don't think it much matters,
because the only thing in the tree that calls cpu_flush_dcache() is md(4)
and I'm > 99% sure it's bogus that it does so; md has no ability to do
anything that can perturb data cache coherency.
2014-02-23 22:52:48 +00:00
Ian Lepore
aab6f7ed9a Move the declaration for mpentry() into a header file instead of pasting
it into a bunch of different .c files.  Remove declarations for the unused
mptramp() function from everywhere except AramadaXP (and I think it's
really not used there either, because the code that references it appears
to be insanely does-nothing in nature).
2014-02-23 22:35:18 +00:00
Ian Lepore
a75a785aef Eliminate an unused-var warning by wrapping #if 0 around some tables of
values that were probably entered "for completeness" from a datasheet, and
for all I know may be useful/necessary some day.
2014-02-23 22:29:59 +00:00
Robert Watson
d4b64c8983 Build the BERI boot loader on 64-bit MIPS (but not 32-bit MIPS). While
these binaries aren't immediately useful on other MIPSes, still build them
as part of mips64 world in order to expose them to tinderbox.

MFC after:	3 weeks
Sponsored by:	DARPA, AFRL
2014-02-23 22:20:52 +00:00
Robert Watson
56df0f7694 When building FDT on MIPS, use softfloat.
MFC after:	3 weeks
Sponsored by:	DARPA, AFRL
2014-02-23 22:12:25 +00:00
Robert Watson
347d368c80 On mips64, built 64-bit ELF support.
MFC after:	3 weeks
Sponsored by:	DARPA, AFRL
2014-02-23 22:11:26 +00:00
Robert Watson
02f21ea80b Give mips64 its own ficl configuration that sizes pointers/etc suitably for
a 64-bit architecture, rather than trying to share the 32-bit MIPS ficl
configuration.

When building ficl on MIPS, don't conflate 32-bit and 64-bit ISAs -- unlike
x86, we don't want a 32-bit loader on a 64-bit CPU.  Use quite conservative
code generation -- e.g., softfloat, no GOT, etc -- suitable for early boot.

MFC after:	3 weeks
Sponsored by:	DARPA, AFRL
2014-02-23 22:10:25 +00:00
Adrian Chadd
d31cb7480b Fix indentation. 2014-02-23 21:43:15 +00:00
Ian Lepore
d39e0a0f50 Fix a typo _IMX51_TZICRREG_H_ -> _IMX51_TZICREG_H_ (extra R) 2014-02-23 21:13:04 +00:00
Hiren Panchasara
92389b2759 PicoStation M2HP presents reg domain 0x2a which is not found in atheros or linux
reference code. Add this workaround for now.

Reviewed by:	adrian
2014-02-23 18:07:17 +00:00
Ian Lepore
b6028530bd Don't force bootverbose on anymore, it can be set from ubldr now. 2014-02-23 01:49:01 +00:00
Ian Lepore
bcab32ab01 Create a generic IMX6 kernel config. This is based on the existing
WANDBOARD.common config, but with the freescale-specific optons and devices
all together at the bottom now.  In addition to reformatting and shuffling
lines around, two new options are added because they're now known to work,
VFP and FREEBSD_BOOT_LOADER.

This config does not include any static DTB, it requires that u-boot
provide a DTB (or a custom kernel config can compile one in).

This will supercede all the existing WANDBOARD* configs, but those will
be left around for a while to help people transition their customized
configs to include this new one instead.
2014-02-23 01:48:07 +00:00
Ian Lepore
9780433dcd Add the FREEBSD_BOOT_LOADER option so that a loaded DTB passed in from
ubldr will actually get used.
2014-02-23 01:37:29 +00:00
Craig Rodrigues
47a79fadc6 Remove KASSERT from in6p_lookup_mcast_ifp().
When the devel/jenkins port, version 1.551 was started,
the kernel would panic if INVARIANTS was enabled in the kernel config.

Suggested by: bms
2014-02-23 01:27:22 +00:00
Ian Lepore
abe4be7dfd Add a feature for automatically finding and loading a dtb file by name.
The name is taken from the u-boot env vars fdtfile or fdt_file.  If the
name isn't fully-qualified a search is done in module_path locations.

The search order for a usable dtb in fdt_setup_fdtp() is now

 - A dtb loaded with an explicit "load -t dtb" command.
 - A dtb already loaded into memory somehow[*] and pointed to by fdt_to_load.
 - A dtb in the memory pointed to by the u-boot env vars fdtaddr or fdt_addr.
 - A file named by the u-boot env vars fdtfile or fdt_file.
 - A static dtb compiled into the kernel.

* Presumably by some arch-specific command or code.
2014-02-22 22:18:20 +00:00
Pedro F. Giffuni
67da48a15b ext2fs: fully enable ext4 read-only support.
The ext4 developers tend to tag Ext4-specific flags as
"incompatible" even when such features are not relevant for
read-only support.  This is a consequence of the process
though which this filesystem is implemented without design
and the fact that some new features are not extensible to
ext2/3.

Organize the features according to what we support and sort
them so that we can now read-only mount filesystems with
some features that may be found in newly formatted ext4 fs.

Submitted by:	Zheng Liu
Reviewed by:	pfg
MFC after:	5 days
2014-02-22 22:07:16 +00:00
Ian Lepore
84207cf3b0 Change file_loadraw() from static to public. Change the order of its
arguments from type,filename to filename,type to be consistant with other
public file_whatever() functions, and change it to return a pointer to
the preloaded_file struct describing the file.  Adjust existing callers.
2014-02-22 22:03:26 +00:00
Gleb Smirnoff
4a2dd8d4fb Improve logging of send errors, reporting error code and interface.
Reduce code duplication between INET and INET6.

Tested by:	Lytochkin Boris <lytboris gmail.com>
2014-02-22 19:20:40 +00:00
Ian Lepore
d000dd2f86 Change fdt_setup_fdtp() from "guess then fail" to more probe-like behavior.
The old code basically said it was going to use some particular blob
without knowing whether it could successfully do so, then it would invoke
the function to do that and return its status.  If it failed, you were
done, even if other blobs might be available.  Now the code attempts to use
some particular blob and if that succeeds it says so and returns success,
otherwise it moves on to try another potential blob.

One specific problem this solves is when u-boot sets an fdtaddr variable
to point to some memory address, then doesn't actually load a blob at
that address.  Now the header check will fail, and the code will move
on to the fallback dtb compiled into the kernel (if any).
2014-02-22 19:10:58 +00:00
Alan Cox
f438547338 When the kernel is running in a virtual machine, it cannot rely upon the
processor family to determine if the workaround for AMD Family 10h Erratum
383 should be enabled.  To enable virtual machine migration among a
heterogeneous collection of physical machines, the hypervisor may have
been configured to report an older processor family with a reduced feature
set.  Effectively, the reported processor family and its features are like
a "least common denominator" for the collection of machines.

Therefore, when the kernel is running in a virtual machine, instead of
relying upon the processor family, we now test for features that prove
that the underlying processor is not affected by the erratum.  (The
features that we test for are unlikely to ever be emulated in software
on an affected physical processor.)

PR:		186061
Tested by:	Simon Matter
Discussed with:	jhb, neel
MFC after:	2 weeks
2014-02-22 18:53:42 +00:00
Ian Lepore
324b64f7ac Allow the ubldr boot device to be choosen by a u-boot environment variable.
If a "loaderdev=<device>" env variable is set and the named device
exists, it is used.  If the device doesn't exist, fall back to the
historic "probe" loop that prefers disk devices over network devices.

If the env var is not set, preserve the historic behavior of using the
first working disk device provided by u-boot, or a network device if no
functional disk device is found and a network device exists.

The old probe loop is reworked so that it checks all bootable devices
provided by u-boot rather than taking an early-out on the first device
found.  This results in the cosmetic change of listing all potential boot
devices for the user, but the behavior of which device it chooses is the
same as it has always been.
2014-02-22 17:51:10 +00:00
Peter Grehan
cf087c12c2 ZFS boot support for bhyveload.
Modelled after the i386 zfsloader. However, with no
2nd stage zfsboot to search for a bootable dataset,
attempt a ZFS boot if there is more than one ZFS
dataset found during the disk probe.

sys/boot/userboot/zfs
 - build the ZFS boot library

sys/boot/userboot/userboot/
 conf.c
  - Add the ZFS pool and filesystem tables
 devicename.c
  - correctly format ZFS devices
 main.c
  - increase the size of the libstand malloc pool
  to account for the increased usage from ZFS buffers
  - probe for a ZFS dataset, and if one is
  found, attempt to boot from it.

usr.sbin/bhyveload/bhyveload.c
 - allow multiple invocations of the '-d' option
 to specify multiple disks e.g. a raidz set.
 Up to 32 disks are supported.

Tested with various combinations of GPT, MBR, single
and multiple disks, RAID-Z, mirrors.

Reviewed by:	neel
Discussed with:	avg
Tested by:	Michael Dexter and others
MFC after:	3 weeks
2014-02-22 07:18:06 +00:00
Mark Johnston
33db01542c 1452 DTrace buffer autoscaling should be less violent
illumos/illumos-gate@6fb4854bed

This fixes the tst.resize1.d and tst.resize2.d DTrace tests, which have
been failing since r261122 since they were causing dtrace(1) to attempt to
allocate and use large amounts of memory, and get killed by the OOM killer
as a result.

MFC after:	1 month
2014-02-22 05:18:55 +00:00
Mark Johnston
dc0f030e51 Define the KM_NORMALPRI flag for kmem_alloc(), as it is used in some
upstream DTrace code. It indicates that the kernel memory allocator need not
attempt to satisfy non-blocking allocations in low-memory conditions. This
has no direct equivalent in the malloc(9) flags, so it is just defined to 0
for now.
2014-02-22 05:13:35 +00:00
Bryan Drewery
63d8fe5531 Fix style of comment blocks.
Reported by:	peter
Approved by:	bapt (mentor, implicit)
X-MFC with:	r262006
2014-02-22 04:28:49 +00:00
Ian Lepore
7c674742cb Look for both fdtaddr and fdt_addr env var names. Grepping the u-boot
source shows that board vendors seem to be about evenly split on this.

This commit is a trivial change to note that while the previous change
was supposed to be whitespace only, this functional change also crept in.
The added lines were:

  /* Board vendors use both fdtaddr and fdt_addr names.  Grrrr. */

  if (s == NULL)
	s = ub_env_get("fdt_addr");
2014-02-22 03:36:45 +00:00
Ian Lepore
f5658746ab Fix the strange 2-space indentation that appears only in this one function. 2014-02-22 03:29:53 +00:00
Mark Johnston
9e9ea73715 Print a backtrace if the SDT(9) stub gets called so that there's at least
some hope of figuring out how it happened.

Suggested by:	rstone
MFC after:	1 week
2014-02-22 01:41:45 +00:00
Mateusz Guzik
1f9e8f8ad9 Fix a race between kern_proc_{o,}filedesc_out and fdescfree leading
to use-after-free.

fdescfree proceeds to free file pointers once fd_refcnt reaches 0, but
kern_proc_{o,}filedesc_out only checked for hold count.

MFC after:	3 days
2014-02-21 22:29:09 +00:00
Neel Natu
159dd56f94 Add support for x2APIC virtualization assist in Intel VT-x.
The vlapic.ops handler 'enable_x2apic_mode' is called when the vlapic mode
is switched to x2APIC. The VT-x implementation of this handler turns off the
APIC-access virtualization and enables the x2APIC virtualization in the VMCS.

The x2APIC virtualization is done by allowing guest read access to a subset
of MSRs in the x2APIC range. In non-root operation the processor will satisfy
an 'rdmsr' access to these MSRs by reading from the virtual APIC page instead.

The guest is also given write access to TPR, EOI and SELF_IPI MSRs which
get special treatment in non-root operation. This is documented in the
Intel SDM section titled "Virtualizing MSR-Based APIC Accesses".

Enforce that APIC-write and APIC-access VM-exits are handled only if
APIC-access virtualization is enabled. The one exception to this is
SELF_IPI virtualization which may result in an APIC-write VM-exit.
2014-02-21 06:03:54 +00:00
Ian Lepore
86a5575402 Add basic cpu frequency control and temperature monitoring to imx6_anatop.
The temperature monitor device is enabled to sample the die temperature at
16hz.  The temperature is published via sysctl.  A callout routine at 10hz
monitors the temperature and throttles back the cpu if the temperature
goes over a user-settable throttle point (by default 10C less than the
critical high-point temperature for the chip).  The hardware is supposed
to be able to deliver an interrupt when the temperature exceeds a settable
limit, but the interrupt never arrives so for now a callout does the job.

At attach time we read the maximum cpu frequency the chip is allowed to run
at and the cpu is set to run at that speed.  It's reported at attach time.
A sysctl variable reports the current speed when queried.

New sysctl values:

  dev.imx6_anatop.0.cpu_mhz: 984
  dev.imx6_anatop.0.temperature: 37.9C
  dev.imx6_anatop.0.throttle_temperature: 95.0C

Steven Lawrance did the initial heavy lifting on this, but I changed
enough stuff that I'm the one to blame if anything breaks.

Submitted by:	Steven Lawrance <stl@koffein.net>
2014-02-21 06:00:06 +00:00
Warner Losh
40a4c9d72e Remove bogus blank line. 2014-02-21 05:17:30 +00:00