Commit Graph

35 Commits

Author SHA1 Message Date
John Baldwin
7ae99f80b6 pmap_unmapdev/bios: Accept a pointer instead of a vm_offset_t.
This matches the return type of pmap_mapdev/bios.

Reviewed by:	kib, markj
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D36548
2022-09-22 15:08:52 -07:00
Mateusz Guzik
654548838b arm: clean up empty lines in .c and .h files 2020-09-01 21:17:24 +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
Marcin Wojtas
ccc1e6eb49 Use PLATFORM for initializing Marvell ArmadaXP and Armada38X
Spliting armv5 and armv7 machdep is necessary for adding Armada38X and
ArmadaXP to GENERIC config.
PLATFORM framework checks SOC type in FDT and will select proper
initialization function implementation during runtime.
Pointers to SoC specific implementation are stored in array of
platform_method_t and provided to framework by FDT_PLATFORM_DEF macro.
PLATFORM framework supports also reset function. To simplify implementation
cpu_reset is moved from mv_common to armv5 and armv7 machdep.

Armada38X and ArmadaXP share now common list of files, so resolve all
dependencies as well.

Submitted by: Rafal Kozik <rk@semihalf.com>
	      Marcin Wojtas <mw@semihalf.com>
Reviewed by: mw
Obtained from: Semihalf
Sponsored by: Stormshield
Differential Revision: https://reviews.freebsd.org/D14744
2018-04-04 08:40:49 +00:00
Marcin Wojtas
526de79be2 Make get_tclk and get_cpu_freq generic for Marvell armv7 SoCs
In GENERIC kernel choosing proper get_tclk and get_cpu_freq implementation must
be done in runtime. Kernel for both SoC need to have implementation of each
other functions, so common file list mv/files.arm7 is added.
Marvell armv5 SoC have their own non-generic implementation of those function.

Submitted by: Rafal Kozik <rk@semihalf.com>
Obtained from: Semihalf
Sponsored by: Stormshield
Differential Revision: https://reviews.freebsd.org/D14739
2018-04-03 22:10:50 +00:00
Marcin Wojtas
0a57279ba4 Split get_sar_value function for Marvell ArmadaXP and Armada38X
get_sar_value is implemented only for ArmadaXP and Armada38X. Splitting it for
two different functions and change registers names result in more generic code.

Submitted by: Rafal Kozik <rk@semihalf.com>
Reviewed by: andrew
Obtained from: Semihalf
Sponsored by: Stormshield
Differential Revision: https://reviews.freebsd.org/D14736
2018-04-03 21:38:11 +00:00
Ian Lepore
2d09b07279 Make kernel option KERNVIRTADDR optional, remove it from std.<platform>
files that can use the default value.

It used to be required that the low-order bits of KERNVIRTADDR matched
the low-order bits of the physical load address for all arm platforms.
That hasn't been a requirement for armv6 platforms since FreeBSD 10.
There is no longer any relationship between load addr and KERNVIRTADDR
except that both must be aligned to a 2 MiB boundary.

This change makes the default KERNVIRTADDR value 0xc0000000, and removes the
options from all the platforms that can use the default value.  The default
is now defined in vmparam.h, and that file is now included in a few new
places that reference KERNVIRTADDR, since it may not come in via the
forced-include of opt_global.h on the compile command line.
2017-12-30 00:20:49 +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
Zbigniew Bodek
11a6a330c8 Enhance Armada 38x SoC identification string
Add hw_clockrate and CPU frequency, basing on sample-at-reset
configuration.

Submitted by:	Arnaud Ysmal <arnaud.ysmal@stormshield.eu>
		Marcin Wojtas <mw@semihalf.com>
Obtained from: Stormshield, Semihalf
Sponsored by: Stormshield
Reviewed by: andrew
Differential revision: https://reviews.freebsd.org/D10899
2017-06-16 17:18:29 +00:00
Andrew Turner
df7675353e Stop including fdt_common.h from the arm code when it's unneeded.
Sponsored by:	ABT Systems Ltd
2016-11-14 11:41:22 +00:00
Pedro F. Giffuni
33495e5daf Use our nitems() macro when param.h is available.
Replacements specific to arm, mips, pc98, powerpc and sparc64.

Discussed in:	freebsd-current
2016-04-20 15:45:55 +00:00
Andrew Turner
7133fe0f33 Almost all copies of platform_mp_init_secondary just called
intr_pic_init_secondary. Replace them with a direct call. On BCM2836
and ARMADA XP we need to add this function, but it can be empty.

Reviewed by:	ian, imp
Sponsored by:	ABT Systems Ltd
Differential Revision:	https://reviews.freebsd.org/D5460
2016-02-26 16:04:47 +00:00
Andrew Turner
3210b87554 Remove platform_mp_probe as it's almost identical on most ARM SoCs, and
slightly wrong on the others. We should just check if mp_ncpus is set to
more than one CPU as we may wish to run on a single core even when SMP is
available.

Reviewed by:	ian
Sponsored by:	ABT Systems Ltd
Differential Revision:	https://reviews.freebsd.org/D5458
2016-02-26 15:54:34 +00:00
Andrew Turner
243b36c321 Remove platform_ipi_send, it's an unneeded as all implementations are
identical.

Sponsored by:	 ABT Systems Ltd
2016-02-25 20:48:23 +00:00
Svatopluk Kraus
7758916f44 Move ARM_L2_PIPT option to std.armv6 for all armv6 platforms.
Only L2 PIPT cache is supported for __ARM_ARCH >= 6.

In fact, this is just a pure proclamation as this option is used
only in armv4 specific files now.
2016-02-22 11:47:28 +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
ebda969939 ARM: Rename remaining instances of cpufunc_id() to cpu_ident(),
forgotten in r295096.
Remove tlb_flushI/tlb_flushI_SE functions forgotten in r295122.
2016-02-01 14:28:58 +00:00
Zbigniew Bodek
fa85e32f0c Mark gpio as "optional" in files.mv and edit Marvell's kernconfs
Including arm/mv/gpio.c now depends on 'gpio' device. 'device gpio' was
added to all kernconf files of Marvell boards, except ARMADAXP (dummy
mv_gpio_res definition was removed) and ARMADA38X (not supported yet).

This commit allows to use generic files.mv on A38X.

Reviewed by:    andrew
Obtained from:	Semihalf
Sponsored by:	Stormshield
Submitted by:	Bartosz Szczepanek <bsz@semihalf.com>
Differential revision:	https://reviews.freebsd.org/D4372
2016-01-20 11:57:11 +00:00
Andrew Turner
aeef645f92 Stop setting {KERN,}PHYSADDR on armv6, it's unneeded.
Sponsored by:	ABT Systems Ltd
2015-11-20 16:12:22 +00:00
Tijl Coosemans
27f38a8d69 Since r289279 bufinit() uses mp_ncpus, but some architectures set this
variable during mp_start() which is too late.  Move this to mp_setmaxid()
where other architectures set it and move x86 assertions to MI code.

Reviewed by:	kib (x86 part)
2015-11-08 14:26:50 +00:00
Andrew Turner
087af50ab8 Include vm/pmap.h for pmap_kextract. 2015-04-04 23:03:11 +00:00
Ian Lepore
16b2a62ec4 Use pmap_mapdev()/unmapdev() to temporarily map on-chip sram while copying
the startup trampoline code.  The old code allocated a kva page, mapped it
using using pmap_kenter_nocache(), then freed the kva without destroying
the mapping.  This is the only use of pmap_kenter_nocache() in the system,
so redoing this one use of allows it to be garbage collected in the
near future.
2015-03-26 19:33:07 +00:00
Zbigniew Bodek
47fdf913c1 Avoid using hard-coded SoC's register address in mptramp code for Armada XP
SoC's registers base address may differ between boards
(0xf1000000 or 0xd0000000). Therefore, in order to use
the proper CPU Boot Address Redirect register during SMP
initialization in mptramp the real, physical address has
to be passed to mptramp based on the value from DT.

Reviewed by: gber
2014-06-05 21:37:04 +00:00
Zbigniew Bodek
d0307444ed Fix broken SMP startup on Armada XP after r265694
During Armada's platform_mp_start_ap(), mptramp code
is being copied to the specific physical location (0xffff0000).
Before r265694 the address to which the code should be copied
was equal to the address of mpentry routine that followed the
mptramp in locore.S. Now the mptramp end address should be
exported and used as a copy limit.

Reviewed by: gber
2014-06-05 21:35:10 +00:00
Ian Lepore
f296249f58 Move the mptramp code which is specific to the Marvell ArmadaXP SoC out of
the common locore.S file and into the mv/armadaxp directory.
2014-05-08 18:36:42 +00:00
Ian Lepore
aab6f7ed9a Move the declaration for mpentry() into a header file instead of pasting
it into a bunch of different .c files.  Remove declarations for the unused
mptramp() function from everywhere except AramadaXP (and I think it's
really not used there either, because the code that references it appears
to be insanely does-nothing in nature).
2014-02-23 22:35:18 +00:00
Andrew Turner
979d76c948 Remove STARTUP_PAGETABLE_ADDR from the ARM configs and replace it with
memory at the end of the kernel.

This helps reduce the SoC and board specific configuration required.

Reviewed by:	bsdimp
Tested by:	jmg (armeb), br
2014-01-28 09:12:04 +00:00
Zbigniew Bodek
d7b0107591 Change Armada XP kernel load address to the u-boot's end address
Loading kernel to 0xf00000 has no practical reason.
Starting it from the u-boot's highest possible end address
(2MB counting from 0x0) makes more sense.

Tested by:	kevlo
2013-10-28 21:37:45 +00:00
Jeff Roberson
5df87b21d3 Replace kernel virtual address space allocation with vmem. This provides
transparent layering and better fragmentation.

 - Normalize functions that allocate memory to use kmem_*
 - Those that allocate address space are named kva_*
 - Those that operate on maps are named kmap_*
 - Implement recursive allocation handling for kmem_arena in vmem.

Reviewed by:	alc
Tested by:	pho
Sponsored by:	EMC / Isilon Storage Division
2013-08-07 06:21:20 +00:00
Grzegorz Bernacki
5c39c3ffa2 Properly initialize Armada XP MP subsystem.
- correct setting of Auxiliary Control Register for MP mode
- correct setting of Auxiliarty Debug registers
- cleanup management of memory contains bootup code
- early initialization of Coherency Fabric (MP and not-MP mode)
- enable Snoop Filtering

Obtained from:	Semihalf
2013-05-06 14:12:36 +00:00
Grzegorz Bernacki
3a1f2172c0 Initialize L2 cache for Armada XP.
Obtained from:	Semihalf
2013-05-06 13:52:49 +00:00
Olivier Houchard
9e9b17fba7 Fix build for SMP.
Submitted by:	Giovanni Trematerra <gianni at freebsd DOT org>
2012-11-01 12:26:31 +00:00
Grzegorz Bernacki
4c641b9a6a Enable PCI for Armada XP
Obtained from:	Semihalf
2012-09-14 09:59:27 +00:00
Grzegorz Bernacki
d65cdf4b9d Add support for Armada XP A0.
- Add functions to calculate clocks instead using hardcoded values
- Update reset and timers functions
- Update number of interrupts
- Change name of platform from db88f78100 to db78460
- Correct DRAM size and PCI IRQ routing in dts file.

Obtained from:	Semihalf
2012-09-14 09:55:19 +00:00
Oleksandr Tymoshenko
16694521fe Merging of projects/armv6, part 7
Add Marvell ARMADA XP support

Obtained from:	Marvell, Semihalf
2012-08-15 05:15:49 +00:00