Commit Graph

5207 Commits

Author SHA1 Message Date
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
Michal Meloun
bd03acedb8 arm: Fix atomic_testand{set,clear}_32(). According to atomic (9), the bit position argument should be a modulo operand size. While I'm in, add missing implementation of atomic_testandclear_64(). For more details see https://reviews.freebsd.org/D27886
Discused with:	rlibby
MFC after:	3 weeks
2021-01-02 20:53:11 +01:00
Kyle Evans
202aea9c82 arm: tune vmparam.h towards a little more modern
An 8MB max stack size is quite limiting in today's world, and in-fact is
the *default* stack size for almost every other arch (including mips).

Raise the default to 4MB (should be pretty reasonable) and the max to 64MB.
NetBSD made a similar move back in 2015 and raised MAXDSIZ to 1856 at the
same time, so let's just roll that in as well. They later lowered it, but
eventually raised it back to 1856 in order to build rust.

This was noticed while looking at qemu-bsd-user's default stack sizes and
growth behavior (or lack thereof).

Reviewed by:	ian
Differential Revision:	https://reviews.freebsd.org/D27218
2020-12-31 11:13:13 -06:00
Andrew Turner
80062279f7 Add pmu.h missed in 5e78bbb74a
Reported by:	rlibby
Sponsored by:	Innovate UK
2020-12-31 10:12:34 +00:00
Andrew Turner
5e78bbb74a Split out the FDT arm pmu attachment
This will allow us to add an ACPI attachment.

Submitted by:	Greg V <greg@unrelenting.technology> (earlier version)
Sponsored by:	Innovate UK
2020-12-30 16:11:02 +00:00
Michal Meloun
b9cbd68d1c ARM: Enhance common Nvidia Tegra drivers by support for Tegra210 SoC.
MFC after:	4 weeks
2020-12-26 19:13:10 +01:00
Michal Meloun
aa76f0c397 PMC: remove now orphaned PMC for INTEL XScale processors.
Support for XScale architecture has been deleted in FreeBSD 13.
2020-12-25 15:21:53 +01:00
Emmanuel Vadot
33ab8d095a arm: Remove samsung exnynos port
Remove the exynos SoC support, this haven't been updated in a while,
isn't present in GENERIC and nobody is motivated to resurect it.

Differential Revision:	https://reviews.freebsd.org/D24444
2020-12-17 17:09:43 +00:00
Michal Meloun
cad703dc09 Remove unused functions and variables in cpufunc.[ch]. 2020-12-14 14:00:54 +00:00
Michal Meloun
a527975133 Finish implementation of ARM PMU interrupts.
The ARM PMU may use single per-core interrupt or may use multiple generic
interrupts, one per core. In this case, special attention must be paid to
the correct identification of the physical location of the core, its order
in the external database (FDT) and the associated cpuid.

Also keep in mind that a SoC can have multiple different PMUs
(usually one per cluster)
2020-12-14 13:10:19 +00:00
Mark Johnston
8bf82b340e arm: Let the GDB stub write to SP, LR and GP registers
This can be handy if gdb's stack unwinder fails, for example because of
a bug in kgdb's trap frame unwinder.

PR:		251463
Submitted by:	Dmitry Salychev <dsl@mcusim.org>
MFC after:	1 week
2020-12-07 15:09:28 +00:00
Michal Meloun
6844eecfed Add basic support for Freescale LX2160A SoC.
All peripherals but the network processor are supported.
2020-12-05 12:08:37 +00:00
Michal Meloun
0f9a385a3a Connect RK3288 to GENERIC kernel. 2020-12-05 10:10:25 +00:00
Michal Meloun
b0352107f1 Add support for RK3288 SoC. 2020-12-04 16:24:44 +00:00
Mark Johnston
b957b18594 Always use 64-bit physical addresses for dump_avail[] in minidumps
As of r365978, minidumps include a copy of dump_avail[].  This is an
array of vm_paddr_t ranges.  libkvm walks the array assuming that
sizeof(vm_paddr_t) is equal to the platform "word size", but that's not
correct on some platforms.  For instance, i386 uses a 64-bit vm_paddr_t.

Fix the problem by always dumping 64-bit addresses.  On platforms where
vm_paddr_t is 32 bits wide, namely arm and mips (sometimes), translate
dump_avail[] to an array of uint64_t ranges.  With this change, libkvm
no longer needs to maintain a notion of the target word size, so get rid
of it.

This is a no-op on platforms where sizeof(vm_paddr_t) == 8.

Reviewed by:	alc, kib
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D27082
2020-12-03 17:12:31 +00:00
Michal Meloun
d06e999c2a Fix r368153. Wrong branch of #ifdef __ARMEB__ was deleted. 2020-12-02 08:14:56 +00:00
Michal Meloun
8bbe6af949 Remove duplicated SV_ASLR from the elf flags.
Reported by:	lattera
2020-12-01 09:18:18 +00:00
Emmanuel Vadot
020df50904 arm: allwinner: aw_mmc: Add a sysctl for debuging
Add a new hw.aw_mmc.debug sysctl to help debugging the driver.
Bit 0 will debug card changes (removal, insertion, power up/down)
Bit 1 will debug ios changes
Bit 2 will debug interrupts received
Bit 3 will debug commands sent
2020-11-30 14:48:50 +00:00
Michal Meloun
bd89101586 Store MPIDR register in pcpu.
MPIDR represents physical locality of given core and it should be used as
the only viable/robust connection between cpuid (which have zero relation to
cores topology) and external description (for example  in FDT).  It can be
used for determining which interrupt is associated to given per-CPU PMU
or by scheduler for determining big/little core or cluster topology.

MFC after: 3 weeks
2020-11-29 18:59:01 +00:00
Michal Meloun
7c6c12ebcd Remove unused options.
Marvell files and their related SOC_MV_<foo> options should be cleaned up
in another pass.
2020-11-29 17:42:32 +00:00
Michal Meloun
f72366f927 _ARM_ARCH_5E is always defined, we not support older CPUs. 2020-11-29 16:44:22 +00:00
Michal Meloun
b842cbbc01 Remove orphaned configs. 2020-11-29 15:39:54 +00:00
Michal Meloun
13a3f95057 Remove remaining fragments of code for older already ceased ARM versions. 2020-11-29 15:24:00 +00:00
Michal Meloun
0879a64283 Remove remaining support of big endian byte order.
Big endian support was ceased by removing ARMv4 sub architecture.
2020-11-29 15:04:39 +00:00
Michal Meloun
5c2967f66f Remove the pre-ARMv6 and pre-INTRNG code.
ARM has required ARMV6+ and INTRNg for some time now, so remove
always false #ifdefs and unconditionally do always true #ifdefs.
2020-11-29 08:40:12 +00:00
Michal Meloun
b88b275145 Remove now unused armv4 and not-INTRNG files. 2020-11-28 15:00:08 +00:00
Mark Johnston
a92526f3f1 arm: Correctly report the size of FPA registers to GDB
Modern ARM systems do not have an FPA unit but GDB reserves register
indices for FPA registers and expects the stub to know their sizes.

PR:		251022
Submitted by:	Dmitry Salychev <dsl@mcusim.org>
MFC after:	2 weeks
2020-11-27 16:35:43 +00:00
Emmanuel Vadot
978a8cccd8 arm: allwinner: a23 timer functions are only used for arm64 2020-11-26 17:19:47 +00:00
Emmanuel Vadot
e7d11d07e0 arm: tegra: Remove unused variable 2020-11-26 17:19:30 +00:00
Emmanuel Vadot
3c5e248d9d arm: mv: Remove unused code 2020-11-26 17:19:13 +00:00
Emmanuel Vadot
8704ae04f4 arm: ti: Remove unused function ti_first_gpio_bank 2020-11-26 17:18:54 +00:00
Ian Lepore
a7623790fb Add the firmware blob required to use the sdma hardware in the imx6
processor, and its associated license text (which is similar to a
bsd-3-clause, but with a prohibition against decompiling).  Install a copy
of the license in /usr/share/doc/legal/imx, to comply with the license terms
that requires a copy of the license to be delivered along with the firmware.

Obtained from:	https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/tree/imx/sdma/sdma-imx6q.bin https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/tree/LICENSE.sdma_firmware
2020-11-26 01:40:04 +00:00
Ian Lepore
2814e68675 Extend the imx6 gpc->gic interrupt controller fixup of fdt data at runtime
to work with the pmu and tempmon nodes as well as the soc node.  This allows
interrupts to work on the pmu and tempmon devices even though we don't have
a driver for the low-power gpc interrupt controller (which is not a problem
because we also don't have support for entering deep power-down modes where
it gets used).
2020-11-25 20:05:05 +00:00
Ian Lepore
0ffeeb414f Convert the imx6_snvs RTC driver to access registers via the syscon device.
This is required for it to work correctly in the GENERIC kernel.
2020-11-25 19:10:20 +00:00
Ian Lepore
253dde678e Add the standard extres pseudo devices to the IMX6 kernel config.
Some imx6 drivers are being converted to use features that weren't available
when they were first written (such as accessing shared device registers via
the syscon pseudo-device), so imx6 custom kernels that reference those
devices will now need this infrastructure in place.
2020-11-25 19:08:22 +00:00
Ian Lepore
4b7ae525a8 A couple small fixes for the imx6_sdma driver...
Attach after interrupt controllers, since the attach function tries to
set up an interrupt handler.

Check for the availability of the required firmware early in the attach
code (before allocating resources).  If the firmware is not available, set
a static var to remember that, so that if the device is re-probed on later
passes it won't repeatedly try to attach and then complain again about
missing firmware.
2020-11-25 18:09:01 +00:00
Ian Lepore
ddd30dd82b Only attach the ti_scm_syscon driver when running on a compatible TI chip.
This prevents attaching on non-TI systems in the GENERIC kernel.

Reviewed by:	manu@, mmel@
2020-11-25 15:45:20 +00:00
Emmanuel Vadot
f442e2fcf9 arm: allwinner: aw_rtc: Add H6 compatible 2020-11-25 11:20:04 +00:00
Emmanuel Vadot
4fbcbfe809 arm64: allwinner: H6: Fix pll 4x clocks
The clock configured by the registers are the 4x version not the 1x.
2020-11-25 11:19:42 +00:00
Emmanuel Vadot
a2a0878362 arm: Remove old amlogic support
Remove the port for aml8726.
Kernel config was removed in r346096 and this port was never migrated
to GENERIC.
It is also impossible to obtain such hardware nowadays.

Reviewed by:	imp
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D27281
2020-11-24 17:51:10 +00:00
Emmanuel Vadot
48cfe64b83 arm: Remove old rockchip support
Remove the port for rk30xx.
Kernel config was removed in r346096 and this port was never migrated
to GENERIC.
It is also impossible to obtain such hardware nowadays and this code
don't provide anything beside booting.

Reviewed by:	imp
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D27280
2020-11-24 17:50:22 +00:00
Emmanuel Vadot
354cb625ee if_awg: Add a awg_dma_start_tx function that trigger dma engine
No functional changes intended
2020-11-20 11:30:44 +00:00
Emmanuel Vadot
5fba90649a if_awg: Reorder functions and sort them by usage
No functional changes intended
2020-11-20 11:29:37 +00:00
Emmanuel Vadot
a19071cea2 if_awg: Add awg_stop_dma and use it in awg_stop
No functional changes intended
2020-11-20 11:28:23 +00:00
Emmanuel Vadot
16790d8f79 if_awg: Add a function to enable/disable the mac tx/rx
No functional changes intended
2020-11-20 11:27:26 +00:00
Emmanuel Vadot
612a1b8d69 if_awg: Split init code into sub function
Be clear of what we enable or init.

No functional changes intended
2020-11-20 11:26:20 +00:00
Emmanuel Vadot
e65794334b if_awg: Remove the taskqueue for miibus_statchg
I guess it was added so we can obtain the device lock but we already
have it when the function is called.

No functional changes intended
2020-11-20 11:25:54 +00:00
Mark Johnston
a28c28e6ef Remove NO_EVENTTIMERS support
The arm configs that required it have been removed from the tree.
Removing this option makes the callout code easier to read and
discourages developers from adding new configs without eventtimer
drivers.

Reviewed by:	ian, imp, mav
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D27270
2020-11-19 02:50:48 +00:00