]> git.saurik.com Git - apple/xnu.git/blob - pexpert/pexpert/arm64/apple_arm64_common.h
34005a9ed8399c006da0e08752f89e1cbaebc44d
[apple/xnu.git] / pexpert / pexpert / arm64 / apple_arm64_common.h
1 /*
2 * Copyright (c) 2019 Apple Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28
29 #ifndef _PEXPERT_ARM64_APPLE_ARM64_COMMON_H
30 #define _PEXPERT_ARM64_APPLE_ARM64_COMMON_H
31
32 #define __ARM_ARCH__ 8
33 #define __ARM_VMSA__ 8
34 #define __ARM_VFP__ 4
35 #define __ARM_COHERENT_CACHE__ 1
36 #define __ARM_COHERENT_IO__ 1
37 #define __ARM_IC_NOALIAS_ICACHE__ 1
38 #define __ARM_DEBUG__ 7
39 #define __ARM_ENABLE_SWAP__ 1
40 #define __ARM_V8_CRYPTO_EXTENSIONS__ 1
41
42 #ifndef ARM_LARGE_MEMORY
43 #define __ARM64_PMAP_SUBPAGE_L1__ 1
44 #endif
45
46 #define APPLE_ARM64_ARCH_FAMILY 1
47 #define ARM_ARCH_TIMER
48 #define ARM_BOARD_WFE_TIMEOUT_NS 1000
49
50 #if defined(HAS_CTRR)
51 #define KERNEL_INTEGRITY_CTRR 1
52 #elif defined(HAS_KTRR)
53 #define KERNEL_INTEGRITY_KTRR 1
54 #elif defined(MONITOR)
55 #define KERNEL_INTEGRITY_WT 1
56 #endif
57
58
59 #include <pexpert/arm64/apple_arm64_regs.h>
60 #include <pexpert/arm64/AIC.h>
61
62 #ifndef ASSEMBLER
63 #include <pexpert/arm/S3cUART.h>
64
65 #if !defined(APPLETYPHOON) && !defined(APPLETWISTER)
66 #include <pexpert/arm/dockchannel.h>
67
68 // AOP_CLOCK frequency * 30 ms
69 #define DOCKCHANNEL_DRAIN_PERIOD (192000000 * 0.03)
70 #endif
71
72 #endif /* ASSEMBLER */
73
74 /*
75 * See arm64/proc_reg.h for how these values are constructed from the MIDR.
76 * The chip-revision property from EDT also uses these constants.
77 */
78 #define CPU_VERSION_A0 0x00
79 #define CPU_VERSION_A1 0x01
80 #define CPU_VERSION_B0 0x10
81 #define CPU_VERSION_B1 0x11
82 #define CPU_VERSION_C0 0x20
83 #define CPU_VERSION_UNKNOWN 0xff
84
85 #endif /* !_PEXPERT_ARM64_APPLE_ARM64_COMMON_H */