Commit graph

5254 commits

Author SHA1 Message Date
Kevin Bowling
d1fe04cee8 Revert "arm: Bump KSTACK_PAGES default to match i386/amd64"
This reverts commit b684d812fc.

It causes an issue on a pfsense routing workload where memory
fragmentation prevents the necessary consecutive pages from being
readily available.

Reported by:	pfsense (mjg, scottl)
Approved by:	ian
MFC after:	1 day
Differential Revision:	https://reviews.freebsd.org/D31244

(cherry picked from commit 5647f85ade)
2021-09-02 07:56:25 -07:00
Gordon Bergling
dbb74dd891 Fix some common typos in source code comments
- s/priviledged/privileged/
- s/funtion/function/
- s/doens't/doesn't/
- s/sychronization/synchronization/

(cherry picked from commit 5bdf58e196)
2021-08-31 08:13:15 +02:00
Konstantin Belousov
a686d177a7 Add pmap_vm_page_alloc_check()
(cherry picked from commit 041b7317f7)
2021-08-24 02:21:13 +03:00
Mateusz Guzik
9fc5596c03 arm: hide busdma statistics behind ifdef ARM_BUSDMA_MAPLOAD_STATS
Stat collection using counter(9) is quite expensive on this platform and
these counters are normally not needed.

In particular we see about 1.5% bump in packet rate using Cortex-A9

Reviewed by:	ian
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Different Revision:	https://reviews.freebsd.org/D31592

(cherry picked from commit aec8ad8a9e)
2021-08-23 12:35:09 +00:00
Gordon Bergling
f296898fb7 Fix a common typo in source code comments
- s/aligment/alignment/

(cherry picked from commit a1581cd735)
2021-08-19 09:18:35 +02:00
Andrew Turner
24a9a22bc7 Add more GIC and GICv3 registers
These aren't used by either driver, however they will be needed by
bhyve on arm64 to emulate a GICv3 interrupt controller.

Sponsored by:	Innovate UK

(cherry picked from commit 15fa52a564)
2021-08-05 20:50:16 +00:00
Warner Losh
efc3ebeb69 Revert "arm: remove fslsdma from GENERIC"
The firmware was already in the tree when I did this commit, and I
missed the message. The bug was obsolete.

This reverts commit 9e3761d126.

The commit was f219c05385 in stable/13.

PR:		237466
Sponsored by:	Netflix

(cherry picked from commit e94f1a0a37)
2021-08-03 20:12:22 -06:00
Kevin Bowling
914e70b909 arm: Bump KSTACK_PAGES default to match i386/amd64
See 3f6867ef63 for additional context.

It is also needed for OpenZFS performance and stability.

Reviewed by:	ian (arm), imp
Differential Revision:	https://reviews.freebsd.org/D31244

(cherry picked from commit b684d812fc)
2021-08-03 15:51:14 -07:00
Mateusz Guzik
289a9ba5e6 arm: dedup counter(9) address calculation
Sponsored by:	Rubicon Communications, LLC ("Netgate")

(cherry picked from commit 78e3a16861)
2021-07-25 07:00:14 +00:00
Emmanuel Vadot
b71d5848cd armv7: allwinner: Add aw_r_intc driver
This is also needed after the 5.13 dts update.

Sponsored by:	Diablotin Systems
Reported by:	Mark Millard <marklmi@yahoo.com>

(cherry picked from commit 48687f733f)
2021-07-22 19:30:22 +02:00
Emmanuel Vadot
2b07bfa110 arm64: allwinner: Add r_intc driver
The r intc interrupt controller seems to do a lot of things :
- It can handle the NMI interrupt
- It have local interrupts for some device that also can be muxed with GIC
- It can serve as an forwarder for the GIC

It's mostly used for deepsleep/wakeup if I understood correctly and we do not
support this on arm64.

For now just forward everything to the GIC so interrupts works again for device
which now have this interrupts controller set since dts v5.12

Sponsored by:	Diablotin Systems

(cherry picked from commit 993e8236c3)
2021-07-22 19:30:21 +02:00
Emmanuel Vadot
6a633b65cc arm: allwinner: Add clock driver for Display Engine to the build
This is needed for drm

(cherry picked from commit 25593adbc1)
2021-07-22 19:23:07 +02:00
Emmanuel Vadot
1fbd603533 arm64: allwinner: clk: Test with the current parent freq first
Even if the clock is flagged with AW_CLK_SET_PARENT the current parent
freq might be enough to get a correct divisor.
So test first if we can get the expected freq before changing the parent
freq.

(cherry picked from commit ac1d7397bf)
2021-07-22 19:23:06 +02:00
Emmanuel Vadot
f7e159e926 arm: Add no-cftconvert for sdma-imx6 files
Fixes a warning when building kernel:
ctfconvert: file.c: Couldn't read ehdr: Invalid argument

MFC after:	3 days

(cherry picked from commit 0c80ad2dc6)
2021-07-22 19:20:47 +02:00
Emmanuel Vadot
8c4e42f5be arm: allwinner: Add mmc_pwrseq support
If a pwrseq is found, set power accordingly.

Sponsored by:	Diablotin Systems

(cherry picked from commit 6bc8fe8a9f)
2021-07-22 19:09:47 +02:00
Emmanuel Vadot
770dcb677f arm: SOCFPGA: Add ext_resources driver
mmc_fdt_helpers needs clock and regulators.
Add all the ext_resources driver to SOCFPGA conf file to fix the build

Reported by:    mjg

(cherry picked from commit 2d926ed71e)
2021-07-22 19:09:46 +02:00
Emmanuel Vadot
3ef7edce20 arm: RPI-B: Add ext_resources driver
mmc_fdt_helpers needs clock and regulators.
Add all the ext_resources driver to RPI-B conf file to fix the build

Reported by:	mjg

(cherry picked from commit 996afd401c)
2021-07-22 19:09:46 +02:00
Emmanuel Vadot
e05134d056 arm: allwinner: aw_mmc: Check regulators status before enabling/disabling them
Sponsored by:	Diablotin Systems
Differential Revision:	https://reviews.freebsd.org/D30294

(cherry picked from commit 115e71a457)
2021-07-22 19:09:44 +02:00
Emmanuel Vadot
ee2a263974 arm64: allwinner: axp81x: Add support for regnode_status
This method is used to know if a regulator is enabled or not.

Sponsored by:	Diablotin Systems
Differential Revision:	https://reviews.freebsd.org/D30290

(cherry picked from commit 182717da88)
2021-07-22 19:09:40 +02:00
Emmanuel Vadot
d5c0a7d9cc allwinner: aw_mmc: Convert driver to use the mmc_sim interface
A lot more generic cam related things are done in mmc_sim so this simplify
the driver a lot.

Differential Revision:	https://reviews.freebsd.org/D27486
Reviewed by:	imp

(cherry picked from commit 2671bdb540)
2021-07-22 18:42:10 +02:00
Konstantin Belousov
39f259b1d5 Do not call FreeBSD-ABI specific code for all ABIs
(cherry picked from commit 28a66fc3da)
2021-07-22 01:11:52 +03:00
Mateusz Guzik
a54e547950 arm: replace byte-by-byte memcmp with an already existing asm variant
So happens bcmp as found in support.S is in fact renamed memcmp, add
memcmp back as a symbol.

This is a direct commit to keep the old symbol around, see
9ef5b65085 ("arm: bcmp -> memcmp") in main for reference.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
2021-07-19 09:54:18 +00:00
MIHIRA Sanpei Yoshiro
f219c05385 arm: remove fslsdma from GENERIC
The fslsdma device requires sdma_fw, but that's not included in
GENERIC. That firmware is not in the FreeBSD tree at the moment, but
could easily be.

The license for the firmware can be found in the linux firmware repo:
https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/commit/?id=3123d78e09d2f815de4d94aa35c07b3c0469c80e
and looks to be a BSD license + no reverse engineer.

We can add this back after the firmware is imported, made a port, or
whose automatic loading can be made to happen.

Reviewed by:		imp (with ian finding the license)
PR:			237466
MFC after:		1 week

(cherry picked from commit 9e3761d126)
2021-07-16 12:28:44 -06:00
Olivier Houchard
82a1d67f01 arm: Make sure we can handle a thumb entry point.
Similarly to what's been done on arm64 with commit
712c060c94, when executing a binary, if the
entry point is a thumb symbol, then make sure we set the PSL_T flag, otherwise
the CPU will interpret it in ARM mode, and that will likely leads to an
undefined instruction.

PR:	256899
MFC after: 	1 week

(cherry picked from commit 8c3bd133dd)
Signed-off-by: Olivier Houchard <cognet@FreeBSD.org>
2021-07-07 22:22:41 +02:00
Mitchell Horne
9d61599983 Consolidate machine/endian.h definitions
This change serves two purposes.

First, we take advantage of the compiler provided endian definitions to
eliminate some long-standing duplication between the different versions
of this header. __BYTE_ORDER__ has been defined since GCC 4.6, so there
is no need to rely on platform defaults or e.g. __MIPSEB__ to determine
endianness. A new common sub-header is added, but there should be no
changes to the visibility of these definitions.

Second, this eliminates the hand-rolled __bswapNN() routines, again in
favor of the compiler builtins. This was done already for x86 in
e6ff6154d2. The benefit here is that we no longer have to maintain our
own implementations on each arch, and can instead rely on the compiler
to emit appropriate instructions or libcalls, as available. This should
result in equivalent or better code generation. Notably 32-bit arm will
start using the `rev` instruction for these routines, which is available
on armv6+.

PR:		236920
Reviewed by:	arichardson, imp
Tested by:	bdragon (BE powerpc)
MFC after:	3 weeks
Differential Revision:	https://reviews.freebsd.org/D29012

(cherry picked from commit 720dc6bcb5)
2021-06-24 20:42:56 -03:00
Mark Johnston
aa8280a902 arm: Remove last_fault_code
It is unused since the removal of pmap-v4.c in commit b88b275145.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 62ba0def55)
2021-06-14 16:25:15 -04:00
Andrew Turner
4b70759183 Also enable IPIs on 32-bit arm
This was missed in 2420f6a

Reported by:	tuexen, imp

(cherry picked from commit 0ec205197b)
2021-06-11 19:23:50 +01:00
Juraj Lutter
e7cd56cfe0 rpi_ft5406: Recognize raspberrypi,firmware-ts touchscreen
- Recognize raspberrypi,firmware-ts touchscreen
- Move the driver from ofwbus to simplebus

Reviewed by:	manu
MFC after:	2 weeks
Differential Revision: https://reviews.freebsd.org/D30169

(cherry picked from commit c2c9ef3ced)
2021-05-23 15:31:22 +02:00
Ed Maste
6cd1cb27a9 regen syscall files after 0bd5d81f1e 2021-05-19 20:32:47 -04:00
Mitchell Horne
e21ed730a5 gdb: report specific stop reason for watchpoints
The remote protocol allows for implementations to report more specific
reasons for the break in execution back to the client [1]. This is
entirely optional, so it is only implemented for amd64, arm64, and i386
at the moment.

[1] https://sourceware.org/gdb/current/onlinedocs/gdb/Stop-Reply-Packets.html

Reviewed by:	jhb
Sponsored by:	NetApp, Inc.
Sponsored by:	Klara, Inc.
NetApp PR:	51

(cherry picked from commit 7446b0888d)
2021-04-21 10:20:33 -03:00
Mitchell Horne
ea2f252e97 ddb: replace watchpoint set/clear functions
Use the new kdb variants. Print more specific error messages.

Reviewed by:	jhb, markj
Sponsored by:	NetApp, Inc.
Sponsored by:	Klara, Inc.

(cherry picked from commit 9d81dd5404)
2021-04-21 10:20:33 -03:00
Mitchell Horne
2d0ad402a0 arm: implement kdb watchpoint functions
Implement wrappers around the existing debug_monitor interface, to be
consumed by MI kernel debugger code.

For now, the various db_printf() calls in this code remain. In the
future, they could be converted to printf() or removed altogether, to
properly decouple the DDB and GDB options.

Reviewed by:	jhb, kib, markj
Sponsored by:	NetApp, Inc.
Sponsored by:	Klara, Inc.

(cherry picked from commit 5a2933d0bf)
2021-04-21 10:20:33 -03:00
Gordon Bergling
52f66bc3ff arm64: Add support for bcm2838 RNG
The hardware random number generator of the RPi4 differs slightly
from the version found on the RPi3.

This commit extends the existing bcm2835_rng driver to function on the RPi4.

Submitted by:	James Mintram <me at jamesrm dot com>
Reviewed by:	markm, cem, delphij
Approved by:	csprng(cem, markm)
Differential Revision:	https://reviews.freebsd.org/D22493

(cherry picked from commit e797dc58bd)
2021-03-20 11:12:13 +01:00
Emmanuel Vadot
796faf365c arm64: rpi4: gpio: Add brcm,bcm2711-gpio compatible
Looks like we never enabled the main gpio controller on the RPI4 board.
Now gpio are usable.

MFC after:	3 days

(cherry picked from commit 2551d92850)
2021-02-20 20:17:44 +01:00
Emmanuel Vadot
944f431655 arm64: rpi4: firmware: Attach at BUS_PASS_BUS + BUS_PASS_ORDER_LATE
The node have now a compatible with simple-mfd so we need to attach
at the same pass so the specific driver will be used.

MFC after:	3 days
PR:		252971

(cherry picked from commit 1cf2823631)
2021-02-20 20:17:40 +01:00
Michal Meloun
6930f97474 arm32: Align arguments of sync_icache() syscall to cacheline size.
Otherwise, we may miss synchronization of the last cacheline.
MFC after:	3 days

(cherry picked from commit ec090f4a67)
2021-02-11 16:08:21 +01:00
Marcin Wojtas
cd925aaa73 marvell: ap806_clock: add missing frequency modes
In the driver init routine the CPU clock frequency
value is obtained from a dedicated register. Until now
only part of the values were handled by the mv_ap806_clock
driver. Fix that by adding missing cases.

Submitted by: Zyta Szpak <zr@semihalf.com>
MFC after: 1 week
Obtained from: Semihalf
Sponsored by: Marvell

(cherry picked from commit a86b0839d7)
2021-02-02 13:28:35 +01:00
Mark Johnston
19d2d50e43 Revert "Define PNP info after defining driver modules"
This reverts commit aa37baf3d7.

The reverted commit was motivated by a problem observed on stable/12,
but it turns out that a better solution was committed in r348309 but not
MFCed.  So, revert this change since it is unnecessary and not really
correct: it assumes that the order in which module metadata records is
defined determines their order in the output linker set.  While this
seems to hold in my testing, it is not guaranteed.

Reported by:	cem
Discussed with:	imp

(cherry picked from commit 519b64e27f)
2021-01-29 19:39:14 -05:00
Glen Barber
bfd1570515 Create the stable/13 branch
Prune *-NODEBUG kernels.
Turn off debug options.
Bump to ALPHA2.

Approved by:	re (implicit)
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2021-01-21 19:08:57 -05:00
Mark Johnston
aa37baf3d7 Define PNP info after defining driver modules
PNP info definitions currently have an unfortunate requirement in that
they must follow the associated module definition in the module metadata
linker set.  Otherwise devmatch can segfault while processing the linker
hints file since kldxref maintains the order in the linker set.

A number of drivers violate this requirement.  In some cases this can
cause devmatch(8) to segfault when processing the linker hints file.
Work around the problem for now simply by adjusting the drivers.

Reviewed by:	imp
MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D28260
2021-01-21 14:30:18 -05:00
Oleksandr Tymoshenko
248f0cabca make maximum interrupt number tunable on ARM, ARM64, MIPS, and RISC-V
Use a machdep.nirq tunable intead of compile-time constant NIRQ
as a value for maximum number of interrupts. It allows keep a system
footprint small by default with an option to increase the limit
for large systems like server-grade ARM64

Reviewd by:	mhorne
Differential Revision:	https://reviews.freebsd.org/D27844
Submitted by:	Klara, Inc.
Sponsored by:	Ampere Computing
2021-01-18 16:36:39 -08:00
Emmanuel Vadot
8a7a4683b0 arm: arm64: Directly use #include <dt-binding/...>
We have it in the includes path and this will help the transition to the
new device-tree import in sys/contrib
2021-01-15 14:17:03 +01:00
Andrew Turner
6eebda3bba Split out the NODEBUG options to a common file
This is the superset of the nooptions found in the -DEBUG kernels.

Reviewed by:	emaste, manu
Sponsored by:	Innovate UK
Differential Revision:	https://reviews.freebsd.org/D28152
2021-01-14 16:57:53 +00:00
Thomas Skibo
facdd1cd20 cgem: add 64-bit support
Add 64-bit address support to Cadence CGEM Ethernet driver for use in
other SoCs such as the Zynq UltraScale+ and SiFive HighFive Unleashed.

Reviewed by:	philip, 0mp (manpages)
Differential Revision: https://reviews.freebsd.org/D24304
2021-01-10 16:51:52 -04:00
Kyle Evans
da77382f55 arm: revert MAXDSIZ change from 202aea9c82
This imposes a fairly severe limitation on space available for mmap that
was not noticed prior to commit. Unfixed mmap will only map from
[data + MAXSIZE, end of user VA space], bringing the amount of usable space
down way too low for non-trivial link jobs (for instance).

Reported by:	mmel
2021-01-09 14:14:00 -06:00
Vladimir Kondratyev
67de2db262 Factor-out hardware-independent part of USB HID support to new module
It will be used by the upcoming HID-over-i2C implementation.  Should be
no-op, except hid.ko module dependency is to be added to affected drivers.

Reviewed by:	hselasky, manu
Differential revision:	https://reviews.freebsd.org/D27867
2021-01-08 02:18:42 +03:00
Vladimir Kondratyev
5af73ad51b evdev: Remove useless "initial value" parameter from evdev_support_abs()
It can not be used for setting of state of multitouch events.
If necessary, use evdev_push_event() instead of it.
2021-01-08 02:18:41 +03:00
Alan Cox
7beeacb27b Honor the vm page's PG_NODUMP flag on arm and i386.
Reviewed by:	kib, markj
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D27949
2021-01-04 16:15:42 -06:00
Ryan Libby
486580c44c arm: fix atomic_testand{set,clear}_64 for ops on high bits
The fix in bd03acedb8 worked for 32-bit
ops, and for 64-bit ops for bit arguments of 0 - 95, but then was broken
for operations on the high 32 bits after that.

Reviewed by:	markj, mmel
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D27897
2021-01-02 18:09:37 -08:00
Mitchell Horne
65d1a4cfda Handle KDB_WHY_TRAP return on arm and mips
Upon exit from the debugger, checking the return code of kdb_trap()
allows one to retry the fatal page fault. This matches what is done on
all other architectures.

Reviewed by:	jhb (earlier version)
Differential Revision:	https://reviews.freebsd.org/D27535
2021-01-02 19:07:04 -04:00