Commit Graph

80 Commits

Author SHA1 Message Date
Doug Moore
1c76d3a9fb Implement the ffs and fls functions, and their longer counterparts, in
cpufunc, in terms of __builtin_ffs and the like, for arm32 v6 and v7
architectures, and use those, rather than the simple libkern
implementations, in building arm32 kernels.

Reviewed by: manu
Approved by: kib, markj (mentors)
Tested by: iz-rpi03_hs-karlsruhe.de, mikael.urankar_gmail.com, ian
Differential Revision: https://reviews.freebsd.org/D20412
2019-05-28 15:47:00 +00:00
Andrew Turner
3f9baabdd0 Remove cpu_pfr from arm. It's unused. 2018-08-14 16:01:25 +00:00
Andrew Turner
cb5ce014d4 Use the cp15 functions to read cp15 registers rather than using assembly
functions. The former are static inline functions so will compile to a
single instruction.
2018-07-28 17:21:34 +00:00
Andrew Turner
90e9f8828e Make the arm cpu setup functions static. Any other place that needs these
functions will use the function pointer we create for them.
2018-07-28 12:20:42 +00:00
Andrew Turner
0faf121391 Remove old CPU_ values from the arm cpufunc code. These have been removed. 2018-07-28 12:00:32 +00:00
Warner Losh
c81b12e0d7 Revert r336773: it removed too much.
r336773 removed all things xscale. However, some things xscale are
really armv5. Revert that entirely. A more modest removal will follow.

Noticed by: andrew@
2018-07-27 21:25:01 +00:00
Warner Losh
626930c2fd Remove xscale support
The OLD XSCALE stuff hasn't been useful in a while. The original
committer (cognet@) was the only one that had boards for it. He's
blessed this removal. Newer XSCALE (GUMSTIX) is for hardware that's
quite old. After discussion on arm@, it was clear there was no support
for keeping it.

Differential Review: https://reviews.freebsd.org/D16313
2018-07-27 18:33:09 +00:00
Michal Meloun
cc28ae0479 Remove the dead code from ARM cpufunc_* files.
The elf trampoline was never been supported for ARMv6 and ARMv7 and was
disconnected from kernel build many months ago.

MFC after:	2 weeks
2018-07-18 10:33:07 +00:00
Warner Losh
ff9452772d Remove kernel support for armeb
Remove all the big-endian arm architectures (ixp425 and ixp435)
support in the kernel and associated drivers.

Differential Revision:  https://reviews.freebsd.org/D16257
2018-07-17 23:23:45 +00:00
John Baldwin
a9c91abd3b Export a breakpoint() function to userland for arm and arm64.
Enable ptrace() tests using breakpoint() on these architectures.

Reviewed by:	andrew
Differential Revision:	https://reviews.freebsd.org/D15191
2018-07-06 23:49:17 +00:00
Pedro F. Giffuni
af3dc4a7ca sys/arm: further adoption of SPDX licensing ID tags.
Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.
2017-11-27 15:04:10 +00:00
Michal Meloun
93a065e749 Remake support for SMP kernel on UP cpu:
- Use new option SMP_ON_UP instead of (mis)using specific CPU type.
   By this, any SMP kernel can be compiled with SMP_ON_UP support.
 - Enable runtime detection of CPU multiprocessor extensions only
   if SMP_ON_UP option is used. In other cases (pure SMP or UP),
   statically compile only required variant.
 - Don't leak multiprocessor instructions to UP kernel.
 - Correctly handle data cache write back to point of unification.
   DCCMVAU is supported on all armv7 cpus.
 - For SMP_ON_UP kernels, detect proper TTB flags on runtime.

Differential Revision: https://reviews.freebsd.org/D9133
2017-02-02 06:14:44 +00:00
Ian Lepore
3b9a898298 Remove arm's cpuconf.h, and references to it, after moving a few lines from
it into pmap-v4.h where they are used.  Other than those few lines of
support for different MMU types, nothing in cpuconf.h has been used in our
code for quite a while.

The file existed to set up a variety of symbols to describe the
architecture.  Over the past few years we have converted all of our source
to use the new architecture symbols standardized by ARM Inc, and predefined
by both clang and gcc.

PR:		216104
2017-01-16 16:44:13 +00:00
Andrew Turner
bf715082c3 Remove armadaxp_idcache_wbinv_all, it's a static function in the ELF
trampoline and not used outside this.

Sponsored by:	ABT Systems Ltd
2016-10-25 16:33:05 +00:00
Andrew Turner
ff300d2316 Remove arm11x6_setttb and armv7_setttb as they are unused. While here
remove unneeded code from the ARMv7 cpu assembly code.

Sponsored by:	ABT Systems Ltd
2016-10-25 16:25:06 +00:00
Michal Meloun
7cc70732a3 ARM: SEV/WFE instructions are implemented starting from ARMv6K,
use it directly.

MFC after: 1 week
2016-10-06 13:18:18 +00:00
Andrew Turner
c5bf621b7a We don't use cpu_control on armv6, remove the macro there. 2016-10-05 14:00:05 +00:00
Michal Meloun
9567acca41 ARM: Remove next bunch of unused cpu_functions from ARMv6. 2016-10-05 12:19:09 +00:00
Andrew Turner
1834282de6 Split CPU_CORTEXA into CPU_CORTEXA8, for the Cortex-A8, and CPU_CORTEXA_MP,
for later Cortex-A CPUs that support the Multiprocessor Extensions. This
will be needed to support both in a single GENERIC kernel while still
being able to only build for a single SoC.

Reviewed by:	mmel
Relnotes:	yes
Sponsored by:	ABT Systems Ltd
Differential Revision:	https://reviews.freebsd.org/D8138
2016-10-04 12:25:44 +00:00
Andrew Turner
0e484d95ca Remove unused functions on armv6. Some of the cache handling code is still
used in the elf trampoline so add a macro to handle this.

Sponsored by:	ABT Systems Ltd
2016-10-03 16:10:38 +00:00
Andrew Turner
610d93d80a Remove the parts of cpu_functions from armv6 that are unused on that
architecture.

Sponsored by:	ABT Systems Ltd
2016-10-03 14:43:57 +00:00
Michal Meloun
a89156f53f ARM: Use new ARMv6 naming conventions for cache and TLB functions
in all but ARMv4 specific files.
Expand ARMv6 compatibility stubs in cpu-v4.h. Use physical address
in L2 cache functions if ARM_L2_PIPT is defined.
2016-02-05 14:57:41 +00:00
Michal Meloun
0b5afe4aea ARM: Don't use ugly (and hidden) global variable, control register is
readable at any time.
2016-02-04 12:11:18 +00:00
Michal Meloun
d1e8cd8a88 ARM: Consistently use cpu_setttb() instead of setttb().
Remove unused #define for drain_writebuf.
2016-02-03 16:44:06 +00:00
Michal Meloun
d397c7a0af ARM: Replace only once used cpu_icache_sync_all() by ranged equivalent.
Remove it from cpu_functions table.
2016-02-03 13:47:50 +00:00
Michal Meloun
afdcfee483 ARM: Remove support for xscale i80219 and i80321 CPUs. We haven't single
supported config/board with these CPUs.
2016-02-03 09:15:44 +00:00
Michal Meloun
e3f95afdec ARM: All remaining functions in cpufunc_asm_arm10.S are identical with
functions in cpufunc_asm_arm9.S. Use arm9 variants and remove
cpufunc_asm_arm10.S completly.
2016-02-02 14:53:34 +00:00
Michal Meloun
fc4c15c466 ARM: Remove last unused function, cpu_flush_prefetchbuf(),
from cpu_functions table.
2016-02-02 10:50:32 +00:00
Michal Meloun
03fa312bb7 ARM: Remove never used cpu_tlb_flushI and cpu_tlb_flushI_SE() functions
and their implementations.
2016-02-01 13:13:53 +00:00
Michal Meloun
bf488b9dde ARM: cpufunc_domains, cpufunc_faultstatus and cpufunc_faultaddress
functions are equal for all ARM variants. Remove them from cpu_functions
table.
2016-01-31 16:34:06 +00:00
Michal Meloun
0d87509689 ARM: Next round of cpufunc.* cleaning. Nobody uses flush_brnchtgt* functions,
delete them.
2016-01-31 15:36:13 +00:00
Michal Meloun
24338d26d4 ARM: First round of cpufunc.* cleaning. All abort_fixup functions are
not currently used or defined. Delete them.
2016-01-31 13:59:16 +00:00
Michal Meloun
eefa6312dd ARM: Remove TLB IPI.
We don't support SMP on ARMv6. All ARMv7 multicore cpus already uses
hardware broadcast for TLB and cache operations.
2016-01-30 13:11:13 +00:00
Michal Meloun
ae47b5ecd3 ARM: Remove outdated katelib.h.
Approved by:	kib (mentor)
2015-12-15 12:52:45 +00:00
Michal Meloun
5fcbe89ac9 ARM: Refactor interrupt_enable/disable/restore.
Allow manipulation with PSR_A bit on ARMv6+.
Remove declaration of unused functions.

This effectively enables asynchronous aborts on early bootstrap stage,
which previously was not enabled due to an error in enable_interrupts().

PR:		201434
Reported by:	Gregory Soutade <soutade at gmail.com>
Approved by:	kib (mentor)
2015-11-10 13:47:28 +00:00
Michal Meloun
4dbc00835d ARM: Remove trailing whitespace from sys/arm/include
No functional changes.

Approved by:    kib (mentor)
2015-11-10 12:02:41 +00:00
Ganbold Tsagaankhuu
3f67197271 It appears to be armv7_sleep is a duplication of armv7_cpu_sleep.
For consistency with the naming conventions used by the other
implementations kill armv7_sleep and keep armv7_cpu_sleep.

Differential Revision:	https://reviews.freebsd.org/D2537
Submitted by:	John Wehle
Reviewed by:	ian@, andrew@
2015-05-15 00:39:51 +00:00
Andrew Turner
a3db11e053 Remove support for CPU_XSCALE_80200. None of our configs support it, and
there wasn;t an option to enable it.

While here remove a check for CPU_ARM10 being defined as it has also been
removed.
2015-03-30 09:29:45 +00:00
Andrew Turner
303c8079ab Remove support for CPU_FA626TE. It's unused by any of our kernel configs. 2015-03-30 08:38:18 +00:00
Andrew Turner
37b25ee6f2 pj4b_config and pj4bv7_setup are only used when CPU_MV_PJ4B is defined. 2015-03-29 22:45:33 +00:00
Andrew Turner
930798f3a1 Remove arm1136 support. We don't have any configs that use it, and I don't
expect us to add support for any more arm11 SoCs.
2015-03-29 21:12:59 +00:00
Andrew Turner
9a25f3e847 Remove the bootconfig parsing. We never used it and always passed either an
empty string or NULL to the setup functions that called into it.
2015-03-29 20:37:28 +00:00
Andrew Turner
6532862008 Remove unused cpufunc arm11 and armv6 code. While here only define the
remaining functions in the context we use them in.
2015-03-29 18:44:15 +00:00
Andrew Turner
c0fde778ab Remove unused arm10_* functions. The remaining functions are only used in
mv configs.
2015-03-29 17:42:32 +00:00
Andrew Turner
7a959e4944 Remove support for CPU_ARM10. No kernel configs could possibly use this as
it's not an available option. Along with this we will never support this
cpu type as very few arm10 chips were made.
2015-03-29 17:13:44 +00:00
George V. Neville-Neil
fcb5606706 Initial version of DTrace on ARM32.
Submitted by:	Howard Su based on work by Oleksandr Tymoshenko
Reviewed by:	ian, andrew, rpaulo, markj
2015-02-10 19:41:30 +00:00
Ian Lepore
8d59f6c4da Eliminate an unused macro whose name clashes now with a function in the
new cpu-v6.h.  This should have been part of r276334.
2014-12-28 18:26:15 +00:00
Zbigniew Bodek
1e17cf74b6 Delete obsolete and unused PJ4B CPU functions
Since PJ4Bv7 uses armv7_ CPU functions only pj4b_config
function is necessary. Remove obsolete routines.
2014-05-25 19:19:41 +00:00
Ian Lepore
b07d0cbce3 Add cpu_l2cache_drain_writebuf(), use it to implement generic_bs_barrier().
On modern ARM SoCs the L2 cache controller sits between the CPU and the
AXI bus, and most on-chip memory-mapped devices are on the AXI bus.  We
map the device registers using the 'Device' memory attribute, which means
the memory is not cached, but writes to it are buffered.  Ensuring that a
write has made it all the way to a device may require that the L2
controller take some action.

There is currently only one implementation of the new function, for the
PL310 cache controller.  It invokes a function that the controller
manual calls "cache sync" but it actually has nothing to do with cache at
all, it triggers a drain of all pending store buffer writes and it blocks
until they complete.

The sheeva and xscale L2 controllers (which predate the concept of Device
memory) don't seem to have a corresponding function.  It appears that the
standard armv5 drain_writebuf function includes draining all the way
through the L2 controller.
2014-05-11 04:24:57 +00:00
Ian Lepore
457e64a02f Make this declaration into a proper function prototype. 2014-04-29 23:29:28 +00:00