aboutsummaryrefslogtreecommitdiff
path: root/core/arch/arm/plat-imx/a7_plat_init.S
blob: c65270f394679295c9d8891757e5c8ac093f8cc3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/* SPDX-License-Identifier: BSD-2-Clause */
/*
 * Copyright 2017-2019 NXP
 *
 * Peng Fan  <peng.fan@nxp.com>
 */

/*
 * Entry points for the A7 init.
 * It is assume no stack is available when these routines are called.
 * It is assume each routine is called with return address in LR
 * and with ARM registers R0, R1, R2, R3 being scratchable.
 */

#include <arm.h>
#include <arm32.h>
#include <arm32_macros.S>
#include <asm.S>
#include <kernel/unwind.h>
#include <platform_config.h>

.section .text
.balign 4
.code 32

/*
 * Cortex A7 configuration early configuration
 *
 * Use scratables registers R0-R3.
 * No stack usage.
 * LR store return address.
 * Trap CPU in case of error.
 */
FUNC plat_cpu_reset_early , :
UNWIND(	.fnstart)

	/*
	 * DDI: Disable dual issue [bit28=0]
	 * DDVM: Disable Distributed Virtual Memory transactions [bit15=0]
	 * L1PCTL: L1 Data prefetch control [bit14:13=2b11]
	 * L1RADIS: L1 Data Cache read-allocate mode disable [bit12=0]
	 * L2RADIS: L2 Data Cache read-allocate mode disable [bit11=0]
	 * DODMBS: Disable optimized data memory barrier behavior [bit10=0]
	 * SMP: Enables coherent requests to the processor [bit6=0]
	 */
	mov_imm r0, 0x00006040
	write_actlr r0

	mov_imm r0, 0x00040C00
	write_nsacr r0

	bx	lr
UNWIND(	.fnend)
END_FUNC plat_cpu_reset_early

FUNC get_core_pos_mpidr , :
UNWIND(	.fnstart)
	/* Drop ClusterId. There is no SoCs with more than 4 A7 Cores. */
	and	r0, r0, #MPIDR_CPU_MASK
	bx	lr
UNWIND(	.fnend)
END_FUNC get_core_pos_mpidr