Commit Graph

8158 Commits

Author SHA1 Message Date
Mateusz Guzik
628888f0e0 Remove iBCS2, part2: general kernel
Reviewed by:	kib (previous version)
Sponsored by:	The FreeBSD Foundation
2018-12-19 21:57:58 +00:00
Mark Johnston
0e4a3d93ee Remove a use of a negative array index from fxp(4).
This fixes a warning seen when compiling amd64 GENERIC with clang 7.
Also remove the workaround added in r337324.  clang 7 and gcc 4.2
generate the same code with or without the code change.

Reviewed by:	imp (previous version)
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D18603
2018-12-19 04:54:32 +00:00
Justin Hibbits
8763f2174d powerpcspe: Don't require FPU_EMU for powerpcspe IEEE emulation
Build only the necessary fpu_emu files for supporting the SPE IEEE-754
emulation exception handler.

MFC after:	1 week
2018-12-15 04:53:02 +00:00
Marcin Wojtas
a2d5ed9442 Introduce driver for TPM 2.0 in CRB and FIFO (TIS) modes
It was written basing on:
TCG PC Client Platform TPM Profile (PTP) Specification Version 22, Revision 1.03.
It only supports Locality 0. Interrupts are only supported in FIFO mode.

The driver in FIFO mode was tested on x86 with Infineon SLB9665 discrete TPM chip.
Driver in both modes was also tested on qemu with swtpm running on host.

Submitted by: Kornel Duleba <mindal@semihalf.com>
Obtained from: Semihalf
Sponsored by: Stormshield
Differential Revision: https://reviews.freebsd.org/D18048
2018-12-14 16:14:36 +00:00
Emmanuel Vadot
2d5e81fbd0 mv_thermal: Add thermal driver for AP806 and CP110 thermal sensor
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2018-12-12 22:33:05 +00:00
Emmanuel Vadot
44d027bb5d arm64: Add mv_cp110_icu and mv_cp110_gicp
icu is a interrupt concentrator in the CP110 block and gicp
is a gic extension to allow interrupts in the CP block to be turned
into GIC SPI interrupts

Sponsored by:	Rubicon Communications, LLC ("Netgate")
2018-12-12 22:08:43 +00:00
Emmanuel Vadot
2a3fb901a7 twsi: Clean up marvell part and add support for Marvell 7k/8k
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2018-12-12 22:05:07 +00:00
Emmanuel Vadot
73450c4a7a arm64: marvell: Add cp110 clock controller support
The cp110 clock controller controls the clocks and gate of the CP110
hardware block.

Every clock/gate are implemented except the NAND clock.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
2018-12-12 22:04:21 +00:00
Emmanuel Vadot
4f3a5b510b arm64: mv_gpio: Add Marvell 8K support
While here put the interrupts setup in it's own function

Sponsored by:	Rubicon Communications, LCC ("Netgate")
2018-12-12 22:02:57 +00:00
Emmanuel Vadot
e1453c9e4c arm64: marvell: Add driver for Marvell Ap806 System Controller
The first two clocks are for the clusters and their frequencies can be
found reading a register. Then a fixed 1200Mhz clock is present and two
fixed clocks, 'mss' which is 1200 / 6 and 'sdio' which is 1200 / 3.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
2018-12-12 22:01:06 +00:00
Emmanuel Vadot
2d2a085222 arm64: mvebu_pinctrl: Add driver for Marvell Pinmux Controller
Add a driver compatible with Marvell mvebu-pinctrl and add ap806-pinctrl
support.

Sponsored by:	Rubicon Communications, LCC ("Netgate")
2018-12-12 22:00:05 +00:00
Emmanuel Vadot
75a01d59f4 arm64: Add new SoC type MARVELL_8K
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2018-12-12 21:58:30 +00:00
Emmanuel Vadot
2091650b73 fdt: Add support for simple-mfd bus
Quoting the binding Documentation :

"These devices comprise a nexus for heterogeneous hardware blocks containing
more than one non-unique yet varying hardware functionality."

Reviewed by:	loos
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D17751
2018-12-12 21:56:45 +00:00
Emmanuel Vadot
277a038d0d arm64: allwinner: Add pwm driver
Add a pwm driver for Allwinner PWM
Add pwm and aw_pwm to the GENERIC kernel
2018-12-12 20:58:43 +00:00
Emmanuel Vadot
9312900f6d Add a pwm subsystem so we can configure pwm controller from kernel and userland.
The pwm subsystem consist of API for PWM controllers, pwmbus to register them
and a pwm(8) utility to talk to them from userland.

Reviewed by:	oshgobo (capsicum), bcr (manpage), 0mp (manpage)
Differential Revision:	https://reviews.freebsd.org/D17938
2018-12-12 20:56:56 +00:00
Maxim Sobolev
9b5ada0b59 Add NETGRAPH_CHECKSUM.
MFC after:	1 week
2018-12-12 20:40:01 +00:00
Maxim Sobolev
b9e0c8c2cc Add NETGRAPH_CHECKSUM.
MFC after:	1 week
2018-12-12 19:02:37 +00:00
Dimitry Andric
67350cb56a Merge ^/head r340918 through r341763. 2018-12-09 11:39:45 +00:00
Jayachandran C.
13aacaeea4 acpica: support parsing of arm64 affinity in acpi_pxm.c
ACPI SRAT table on arm64 uses GICC entries to provide CPU locality
information. These entries use an AcpiProcessorUid to identify the
CPU (unlike on x86 where the entries have an APIC ID).

Update acpi_pxm.c to extend the cpu_add/cpu_find/cpu_get_info
functions to handle AcpiProcessorUid. Use the updated functions
while parsing ACPI_SRAT_GICC_AFFINITY entry for arm64.

Also update sys/conf/files.arm64 to build acpi_pxm.c when ACPI is
enabled.

Reviewed by:	markj (previous version)
Differential Revision:	https://reviews.freebsd.org/D17942
2018-12-08 19:32:23 +00:00
Jayachandran C.
9417fa9e3c acpica : move SRAT/SLIT parsing to sys/dev/acpica
This moves the architecture independent parts of sys/x86/acpica/srat.c
to sys/dev/acpica/acpi_pxm.c, to be used later on arm64. The function
declarations are moved to sys/dev/acpica/acpivar.h

We also need to update sys/conf/files.{i386,amd64} to use the new file.
No functional changes.

Reviewed by:	markj, imp
Differential Revision:	https://reviews.freebsd.org/D17941
2018-12-08 19:10:58 +00:00
Hans Petter Selasky
8a886978d4 Fix LINT build after r341572.
MFC after:		1 week
Sponsored by:		Mellanox Technologies
2018-12-05 15:42:31 +00:00
Vincenzo Maffione
b6e66be22b netmap: align codebase to the current upstream (760279cfb2730a585)
Changelist:
  - Replace netmap passthrough host support with a more general
    mechanism to call TXSYNC/RXSYNC from an in-kernel event-loop.
    No kernel threads are used to use this feature: the application
    is required to spawn a thread (or a process) and issue a
    SYNC_KLOOP_START (NIOCCTRL) command in the thread body. The
    kernel loop is executed by the ioctl implementation, which returns
    to userspace only when a different thread calls SYNC_KLOOP_STOP
    or the netmap file descriptor is closed.
  - Update the if_ptnet driver to cope with the new data structures,
    and prune all the obsolete ptnetmap code.
  - Add support for "null" netmap ports, useful to allocate netmap_if,
    netmap_ring and netmap buffers to be used by specialized applications
    (e.g. hypervisors). TXSYNC/RXSYNC on these ports have no effect.
  - Various fixes and code refactoring.

Sponsored by:	Sunny Valley Networks
Differential Revision:	https://reviews.freebsd.org/D18015
2018-12-05 11:57:16 +00:00
Alex Richardson
c10d927c40 Fix newvers.sh with BUILD_WITH_STRICT_TMPPATH=1
newvers.sh runs mkfifo which did not exist before this change.
However, I didn't notice before because it is run from a function
where a missing command does cause a noticeable failure.

Reviewed By:	emaste, markj
Differential Revision: https://reviews.freebsd.org/D18377
2018-12-05 10:57:57 +00:00
Eric van Gyzen
9dae3b521e altq: manual cleanup after r341507
Remove a file that became practically empty.
Fix indentation.

Like r341507, I do not plan to MFC, but anyone else can.
2018-12-04 23:53:42 +00:00
Emmanuel Vadot
04f9b8a116 Add Silergy SYR827 PMIC driver
SYR827 is a PMIC that can output a voltage from 0.7125V to 1.5V in 12.5mV steps
It's controlled via I2C.

MFC after:	1 month
2018-12-01 20:31:49 +00:00
Emmanuel Vadot
36ae7efe61 arm64/rockchip: add RK3399 support
Add CRU (Clock and Reset Unit) driver for RK3399.
Add support in rk_pinctrl driver.

Submitted by:  Greg V <greg@unrelenting.technology> (Original version)
Differential Revision: https://reviews.freebsd.org/D16732

MFC after:	1 month
2018-12-01 20:28:16 +00:00
Andrew Rybchenko
391763d7b4 sfxge(4): add firmware image layout option
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18214
2018-11-29 06:29:24 +00:00
John Baldwin
78afed1396 Move CLIP table handling out of TOM and into the base driver.
- Store the clip table in 'struct adapter' instead of in the TOM softc.
- Init the clip table during attach and teardown during detach.
- While here, add a dev.<nexus>.<unit>.misc.clip sysctl to dump the
  CLIP table.

This does mean that we update the clip table even if TOE is not enabled,
but non-TOE things need the CLIP table anyway.

Reviewed by:	np, Krishnamraju Eraparaju @ Chelsio
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D18010
2018-11-29 01:15:53 +00:00
Emmanuel Vadot
cee1927ea2 Add RK805 PMIC Support
RK805 is the companion PMIC for RK3328 SoC.
Add a driver for it with most of it's regulators supported.

MFC after:	1 month
2018-11-28 13:53:43 +00:00
Andrew Rybchenko
ae64ac9336 sfxge(4): add Medford2 support to NIC module
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18142
2018-11-27 12:14:16 +00:00
Mark Murray
70bfe7f7a8 Add dependency to allow if_muge device to be only ethernet device in stripped-down RPI3 kernel. 2018-11-26 22:45:58 +00:00
Andrew Rybchenko
fdbe38cf9d sfxge(4): add API to control UDP tunnel ports
HW needs to know which UDP packets should be treated as tunnel
encapsulation to do inner packet recognition, classification and
offloads.

Submitted by:   Ivan Malov <ivan.malov at oktetlabs.ru>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18134
2018-11-26 06:20:13 +00:00
Dimitry Andric
3d5db45595 Merge ^/head r340427 through r340868. 2018-11-24 14:46:06 +00:00
Emmanuel Vadot
f9f020a409 Derive PHY class to new one specialized for USB PHY functions.
Submitted by:	mmel
2018-11-23 19:43:18 +00:00
Navdeep Parhar
c7a20141cc cxgbe(4): Update T4/5/6 firmwares to 1.22.0.3.
Obtained from:	Chelsio Communications
MFC after:	2 months
Sponsored by:	Chelsio Communications
2018-11-19 21:59:07 +00:00
Dimitry Andric
6149ed01a1 Merge ^/head r340368 through r340426. 2018-11-14 06:46:44 +00:00
Kyle Evans
1cde2e974d dtb.mk: Fix passing of ECHO to make_dtb{,o}.sh 2018-11-12 17:10:44 +00:00
Dimitry Andric
9b5cb2f639 Merge ^/head r340235 through r340367. 2018-11-12 16:41:41 +00:00
Ed Maste
c4698dec73 Add comment to explain kernel ldscript 0x200000 constant
Reported by:	linimon
2018-11-09 20:33:38 +00:00
Kyle Evans
13cf5074d0 Use ${ECHO} in dtb/dtbo build, pass in from dtb.mk for -s
Reported by:	sbruno
MFC after:	3 days
2018-11-09 18:56:40 +00:00
Mark Johnston
5186028dc4 Use --work-tree instead of specifying an absolute path.
Otherwise the diff command being run from outside the checkout resulted
in warnings.

Discussed with:	emaste
X-MFC with:	r340083
2018-11-08 17:20:00 +00:00
Ed Maste
179460e148 newvers.sh: avoid regenerating vers.c if content unchanged
When reproducible build mode is enabled vers.c may be unchanged between
successive builds.  In this case avoid changing the file's metadata so
that it does not cause dependent targets to be rebuilt.

Sponsored by:	The FreeBSD Foundation
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D17892
2018-11-07 20:36:57 +00:00
Dimitry Andric
c06e7b66a1 Merge ^/head r340126 through r340212. 2018-11-07 18:52:28 +00:00
Andrew Turner
4ea56599e8 Port the NetBSD ubsan runtime to the FreeBSD kernel.
This allows us to build the ubsan code added in r340189 into the kernel
with the KUBSAN option. This will report when undefined behaviour is
detected in the currently running kernel.

As it can be large, the kernel is 65MB on arm64, loader may not be able to
load the kernel on all architectures so is disabled by default for now.

Sponsored by:	DARPA, AFRL
2018-11-06 17:32:07 +00:00
Dimitry Andric
2a22df74e9 Merge ^/head r339813 through r340125. 2018-11-04 15:49:06 +00:00
Ed Maste
50b53a8dc3 newvers.sh: fix git false positive -dirty tag
Assuming that any output from `git diff-index --name-only` implies
changes in the working tree results in false positives: files with
metadata, but not content, changes are also listed.

Check that content differences exist before adding the -dirty tag to
the git hash.

PR:		229230
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D15968
2018-11-02 21:20:46 +00:00
Ed Maste
ea96b3de2b Retire CLANG_NO_IAS34
CLANG_NO_IAS34 was introduced in r276696 to allow then-HEAD kernels to
be built with clang 3.4 in FreeBSD 10.  As FreeBSD 11 and later includes
a version of Clang with a sufficiently capable integrated assembler we
do not need the workaround any longer.

Sponsored by:	The FreeBSD Foundation
2018-11-01 23:11:47 +00:00
Konstantin Belousov
6bc6a54280 Add pci_early function to detect Intel stolen memory.
On some Intel devices BIOS does not properly reserve memory (called
"stolen memory") for the GPU.  If the stolen memory is claimed by the
OS, functions that depend on stolen memory (like frame buffer
compression) can't be used.

A function called pci_early_quirks that is called before the virtual
memory system is started was added. In Linux, this PCI early quirks
function iterates through all PCI slots to check for any device that
require quirks.  While this more generic solution is preferable I only
ported the Intel graphics specific parts because I think my
implementation would be too similar to Linux GPL'd solution after
looking at the Linux code too much.

The code regarding Intel graphics stolen memory was ported from
Linux. In the case of Intel graphics stolen memory this
pci_early_quirks will read the stolen memory base and size from north
bridge registers.  The values are stored in global variables that is
later read by linuxkpi_gplv2. Linuxkpi stores these values in a
Linux-specific structure that is read by the drm driver.

Relevant linuxkpi code is here:
https://github.com/FreeBSDDesktop/kms-drm/blob/drm-v4.16/linuxkpi/gplv2/src/linux_compat.c#L37

For now, only amd64 arch is suppor ted since that is the only arch
supported by the new drm drivers. I was told that Intel GPUs are
always located on 0:2:0 so these values are hard coded for now.

Note that the structure and early execution of the detection code is
not required in its current form, but we expect that the code will be
added shortly which fixes the potential BIOS bugs by reserving the
stolen range in phys_avail[].  This must be done as early as possible
to avoid conflicts with the potential usage of the memory in kernel.

Submitted by:	Johannes Lundberg <johalun0@gmail.com>
Reviewed by:	bwidawsk, imp
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D16719
Differential revision:	https://reviews.freebsd.org/D17775
2018-10-31 23:17:00 +00:00
John Baldwin
58b6812de1 Only invoke 'ls' if the local modules directory exists.
This avoids a spurious make warning if /usr/local/sys/modules doesn't
exist.

Submitted by:	rgrimes
Reported by:	markj
2018-10-30 18:20:34 +00:00
Bjoern A. Zeeb
43f75d57a2 Introduce an EXPERIMENTAL option for both src.conf(5) and the kernel.
In the last decade(s) we have seen both short term or long term projects
committed to the tree which were considered or even marked "experimental".
While out-of-tree development has become easier than it used to be in
CVS times, there still is a need to have the code shipping with HEAD but
not enabled by default.

While people may think about VIMAGE as one of the recent larger, long term
projects, early protocol implementations (before they are standardised)
are others.  (Free)BSD historically was one of the operating systems
which would have running code at early stages and help develop and
influence standardisation and the industry.

Give developers an opportunity to be more pro-active for early adoption
or running large scale code changes stumbling over each others but not
the user's feet.  I have not added the option to NOTES in order to avoid
breaking supported option builds, which require constant compile testing.

Discussed with:	people in the corridor
2018-10-30 15:46:30 +00:00