Commit Graph

259574 Commits

Author SHA1 Message Date
thorpej
6ffcc72460 Fix compilation error pointed out by nishimura@. 2018-06-17 14:50:54 +00:00
jmcneill
62d94959b4 Make gate enable/disable logic easier to read. NFC. 2018-06-17 14:48:15 +00:00
jmcneill
69e07b1e4f Avoid calling bus_dmamap_sync with len=0 2018-06-17 13:12:25 +00:00
jmcneill
05a266f0d1 Fix soft reset logic 2018-06-17 11:52:38 +00:00
maxv
38a9944369 Enable eager fpu automatically at boot time if the cpu is affected. Intel
hasn't published a list of its affected products, but it appears that Xen
was given this information since they have a specific detection code.

We could just unconditionally enable eager; but on x86_32 eager may have
a greater performance cost than lazy, and we don't want to lose
performance on unaffected (and ~old) CPUs running NetBSD/i386.

So use the same code as Xen: take Family 6, and whitelist certain models.
2018-06-17 07:13:02 +00:00
maxv
215b7bbcb9 No, I meant to put the panic in fpudna not fputrap. Also appease it: panic
only if the fpu already has a state. We're fine with getting a DNA, what
we're not fine with is if the DNA is received while the FPU is busy.

I believe (even though I couldn't trigger it) that the panic would
otherwise fire if PT_SETFPREGS is used. And also ACPI sleep/wakeup,
probably.
2018-06-17 06:03:40 +00:00
thorpej
1de0c2e2c3 Oops, another one. 2018-06-17 01:08:15 +00:00
thorpej
81d957210f Remove now-unused variable. 2018-06-17 01:07:06 +00:00
jmcneill
89ceabbe77 Enable gpio reset logic 2018-06-17 00:33:05 +00:00
jmcneill
f4c4027689 Match generic snps,dwc2 compat string 2018-06-16 23:44:26 +00:00
jmcneill
d697558468 Replace register numbers with defines, fixing a bunch of typos in the process. 2018-06-16 23:14:47 +00:00
jmcneill
47ed8dfc30 Remove unused defines 2018-06-16 23:13:29 +00:00
thorpej
6f3ab6bd89 More cleanup to i2c autoconfiguration:
- Get all of the drivers onto the new match quality constants.
- Introduce a new helper function, iic_use_direct_match(), that has
  all of the logic for direct-config matching.  If it returns true,
  the driver returns the match result (which may be 0).  If it returns
  false, the driver does indirect-config matching.
- iic_compat_match() now returns a weighted match quality; matches to
  lower-indexed "compatible" device property are more-specific matches,
  and return a better match quality accordingly.

In addition to the above:
- Add support for direct-config matching this driver based on
  "compatible" properties.
- Address-only matching is now done based on the specific addresses
  the requested model supports.
- "compatible" property can specify to the driver which model is to
  be used, so that using config "flags" directives aren't required
  in the direct-config case.

XXX More changes coming that require re-factoring some other code.
2018-06-16 21:28:07 +00:00
thorpej
23a4765aee More cleanup to i2c autoconfiguration:
- Get all of the drivers onto the new match quality constants.
- Introduce a new helper function, iic_use_direct_match(), that has
  all of the logic for direct-config matching.  If it returns true,
  the driver returns the match result (which may be 0).  If it returns
  false, the driver does indirect-config matching.
- iic_compat_match() now returns a weighted match quality; matches to
  lower-indexed "compatible" device property are more-specific matches,
  and return a better match quality accordingly.

XXX This driver is an odd-ball with respect to the hardware device.
See comments in the match routine.  Unclear how best to handle it.
2018-06-16 21:24:36 +00:00
thorpej
aa41e9922c More cleanup to i2c autoconfiguration:
- Get all of the drivers onto the new match quality constants.
- Introduce a new helper function, iic_use_direct_match(), that has
  all of the logic for direct-config matching.  If it returns true,
  the driver returns the match result (which may be 0).  If it returns
  false, the driver does indirect-config matching.
- iic_compat_match() now returns a weighted match quality; matches to
  lower-indexed "compatible" device property are more-specific matches,
  and return a better match quality accordingly.
2018-06-16 21:22:13 +00:00
kamil
b3019d4b3d Correct previous change to CHAR_T_OFFSET
The intended operation is offsetof(), not alignof().

Noted by <christos>
2018-06-16 21:00:12 +00:00
mrg
86fb244de3 check MK{FOO} defaults for $MACHINE as well as $MACHINE_ARCH.
should restore firmware files for some platforms that were
missing them.
2018-06-16 19:05:17 +00:00
kamil
bef3ed2e02 Disable MKSANITIZER in lib/csu
These low-level libraries are expected to be not touched by a sanitizer.
Every libc program not using sanitizers cannot work with sanitized csu.
2018-06-16 18:58:00 +00:00
kamil
4e2759a682 Do not cause Undefined Behavior in vi(1)
Replace unportable manual calculation of alignof() that causes UB, with
a GCC extension __alignof__.

This fixes a problem reported by UBSan with the MKSANITIZER distribution.
2018-06-16 18:54:52 +00:00
kamil
911756fc6b Do not reference buffer after the code scope {}
rk_getpwuid_r() returns a pointer pwd->pw_dir to a buffer pwbuf[].

It's not safe to store another a copy of pwd->pw_dir in outter scope and
use it out of the scope where there exists pwbuf[].

This fixes a problem reported by ASan under MKSANITIZER.
2018-06-16 18:51:36 +00:00
jdolecek
2d5df332d0 switch to using OpenBSD eehpy(4) code to drive maphy(4), synchronizing support
for several special PHY conditions, particularly:
- Properly re-initialise the PHY upon resume
- Store next page in the Link Partner Next Page register for compatibility
  with 802.3ab on 88E3016 PHYs.  Fixes some autonegotiation problems on msk(4)
- Make 88E3016 actually work
- Make sure page 0 is selected when we initialize the PHY.  Fixes problems
  with the eephy(4) that attaches to nfe(4) on machines like the Sun Ultra 40.
  (we had condition for this, now the page 0 is selected for any PHY type)
- Disable fiber/copper auto-selection on the 88E1111 if it is in RGMII mode, to
  work around the fact that the onboard PHYs attached to nfe(4) on the Sun
  X4100 M2 have fiber/copper auto-selection enabled even though the interfaces
  are clearly copper-only

make sure to also add appropriate licenses, since basically nothing
really significant remains out of previous code

use FreeBSD <dev/mii/e1000reg.h> for register definitions as a base instead
of OpenBSD <dev/mii/eephyreg.h>, since it has some extra definitions for some
3016 bits, but add the several extra bits from OpenBSD needed by the code;
removed no longed used <dev/mii/makphyreg.h>

tested with PHY 88E1111, there no particular change observed - the
link status works as it did before, just now it does media nego
even before the interface is up

should however fix 88E3016 support and hence PR kern/49270 and PR kern/53301
2018-06-16 17:44:53 +00:00
maxv
d5fa95b5c2 Need IPIs when enabling eager fpu switch, to clear each fpu and get us
started. Otherwise it is possible that the first context switch on one of
the cpus will restore an invalid fpu state in the new lwp, if that lwp
had its fpu state stored on another cpu that didn't have time to do an
fpu save since eager-fpu was enabled.

Use barriers and all the related crap. The point is that we want to
ensure that no context switch occurs between [each fpu is cleared] and
[x86_fpu_eager is set to 'true'].

Also add KASSERTs.
2018-06-16 17:11:13 +00:00
gson
7c2276b8da Use space between words 2018-06-16 15:18:33 +00:00
jdolecek
27cebfdeb4 uncomment ena(4) now that it compiles; even though it's not working yet, this
ensures it's included in eventual subsystem rototils
2018-06-16 15:04:29 +00:00
jdolecek
3df85d0774 make ena(4) compile, with best efford exercised to convert code to NetBSD
equivalents; where possible left the original code intact to make it
easier to compare against FreeBSD original

made non-working stubs for some functions which don't have direct
equivalent yet - this includes all of <sys/buf_ring.h>, m_getjcl(),
m_append, and m_collapse(); these need to be adressed

left XXX/TODO in if_enavar.h, colocated with the non-working stubs
2018-06-16 15:00:35 +00:00
jmcneill
3bd93666d0 Comment out EARLYCONS 2018-06-16 14:41:25 +00:00
jmcneill
ad023d6ae1 initialize bs_cookie for generic_dsb tags 2018-06-16 13:53:45 +00:00
jmcneill
e70658e1da Fix rate calculation of fractional mode PLLs 2018-06-16 13:24:04 +00:00
christos
10a71a2955 PR/53371: Thomas Barabosch: Potential memory leak in usr.sbin/ndp/ndp.c 2018-06-16 13:09:41 +00:00
jmcneill
f23c9524b7 Fix reading through /dev/gpio and use the same style for writing registers in both fdt and /dev/gpio cases 2018-06-16 12:49:46 +00:00
jmcneill
18bcfa6c40 incldue -> include 2018-06-16 10:42:41 +00:00
nakayama
0a75be7b21 Change aprint_error_dev to aprint_normal_dev for normal completion case. 2018-06-16 08:24:55 +00:00
dholland
d8a5b30306 atomic_and/atomic_or do bitwise ops, not logical ops. 2018-06-16 08:11:32 +00:00
maxv
a1036dda1b Actually, don't do anything if we switch to a kernel thread. When the cpu
switches back to a user thread the fpu is restored, so no point calling
fninit (which doesn't clear all the states anyway).
2018-06-16 05:52:17 +00:00
macallan
e107bf1bfb explicitly turn off tiling translation - now software rendered characters
look right again on r3xx hardware
2018-06-16 01:25:23 +00:00
christos
759529ae76 PR/53368: Thomas Barabosch: Potential integer overflow in usr.bin/patch/inp.c 2018-06-16 00:40:14 +00:00
jmcneill
cbd78171e7 arm: Add support for Rockchip RK3328 SoC. 2018-06-16 00:19:42 +00:00
jmcneill
6726462d1f Add initial support for Rockchip RK3328 SoC. 2018-06-16 00:19:04 +00:00
jmcneill
449a1b03ca Add VERID reg bits 2018-06-16 00:15:40 +00:00
jmcneill
041c183a3d Add flag for disabling store-and-forward mode, and a callback for notifying
bus glue that the link speed has changed.
2018-06-16 00:15:00 +00:00
jmcneill
3b4803fc33 If clock-output-names is specified, use it for the clock name instead of the node name 2018-06-16 00:13:06 +00:00
jmcneill
8be04e5f29 fdtbus_clock_assign: simplify 2018-06-16 00:12:35 +00:00
jmcneill
c2be7dd40a Pull in arm/locore.h for arm_dsb() on aarch64 2018-06-15 23:57:55 +00:00
wiz
20caeb0eac Fix Dd argument. Remove unnecessary whitespace. 2018-06-15 23:15:56 +00:00
wiz
3a719c4bc0 Add missing word. 2018-06-15 23:13:19 +00:00
wiz
5fe4139bca Sort SEE ALSO. 2018-06-15 23:11:56 +00:00
uwe
964f7e1fe4 Fix fmttab value for L2CR_L2PE (parity enabled) so that we don't print
self-contradictory "no parity parity enabled".
2018-06-15 23:11:39 +00:00
pgoyette
56d0105401 Add missing .Fn mark-up 2018-06-15 22:40:33 +00:00
pgoyette
6ca7a307a1 Add note that there is no way to delete an individual datum from a
container.
2018-06-15 22:27:40 +00:00
pgoyette
6e6eddc2d0 Bump date for previous changes 2018-06-15 22:11:17 +00:00