xref: /xnu-8792.61.2/pexpert/pexpert/arm64/board_config.h (revision 42e220869062b56f8d7d0726fd4c88954f87902c)
1 /*
2  * Copyright (c) 2007-2021 Apple Inc. All rights reserved.
3  * Copyright (c) 2005-2006 Apple Computer, Inc. All rights reserved.
4  */
5 #ifndef _PEXPERT_ARM_BOARD_CONFIG_H
6 #define _PEXPERT_ARM_BOARD_CONFIG_H
7 
8 #include <mach/machine.h>
9 
10 /*
11  * Per-SoC configuration.  General order is:
12  *
13  * CPU type
14  * CPU configuration
15  * CPU feature disables / workarounds
16  * CPU topology
17  * Other platform configuration (e.g. DARTs, PPL)
18  *
19  * This should answer the question: "what's unique about this SoC?"
20  *
21  * arm64/H*.h should answer the question: "what's unique about this CPU core?"
22  *
23  * For __ARM_AMP__ systems that have different cache line sizes on different
24  * clusters, MAX_L2_CLINE must reflect the largest L2 cache line size
25  * across all clusters.
26  */
27 
28 #ifdef ARM64_BOARD_CONFIG_T6000
29 #include <pexpert/arm64/H13.h>
30 
31 
32 #define MAX_L2_CLINE                   7
33 #define MAX_CPUS                       10
34 #define MAX_CPU_CLUSTERS               3
35 #define MAX_CPU_CLUSTER_PHY_ID         10
36 #define HAS_IOA                        1
37 
38 #define PMAP_CS                        1
39 #define PMAP_CS_ENABLE                 1
40 #define XNU_MONITOR                    1 /* Secure pmap runtime */
41 #define __ARM_42BIT_PA_SPACE__         1
42 #define USE_APPLEARMSMP                1
43 #if DEVELOPMENT || DEBUG
44 #define XNU_ENABLE_PROCESSOR_EXIT      1 /* Enable xnu processor_exit() by default */
45 #endif
46 #define XNU_HANDLE_MCC                 1 /* This platform may support MCC error recovery */
47 #endif  /* ARM64_BOARD_CONFIG_T6000 */
48 
49 
50 
51 
52 
53 
54 
55 
56 
57 #ifdef ARM64_BOARD_CONFIG_T8101
58 #include <pexpert/arm64/H13.h>
59 
60 #define MAX_L2_CLINE                   7
61 #define MAX_CPUS                       8
62 #define MAX_CPU_CLUSTERS               2
63 
64 #define PMAP_CS                        1
65 #define PMAP_CS_ENABLE                 1
66 #define XNU_MONITOR                    1 /* Secure pmap runtime */
67 #endif  /* ARM64_BOARD_CONFIG_T8101 */
68 
69 #ifdef ARM64_BOARD_CONFIG_T8103
70 #include <pexpert/arm64/H13.h>
71 
72 #define MAX_L2_CLINE                   7
73 #define MAX_CPUS                       8
74 #define MAX_CPU_CLUSTERS               2
75 
76 #define PMAP_CS                        1
77 #define PMAP_CS_ENABLE                 1
78 #define XNU_MONITOR                    1 /* Secure pmap runtime */
79 #endif  /* ARM64_BOARD_CONFIG_T8103 */
80 
81 
82 
83 
84 
85 
86 
87 
88 
89 
90 #ifdef ARM64_BOARD_CONFIG_BCM2837
91 #include <pexpert/arm64/BCM2837.h>
92 
93 #define MAX_L2_CLINE                   6
94 #define MAX_CPUS                       4
95 #define MAX_CPU_CLUSTERS               1
96 
97 #define CORE_NCTRS                     8 /* Placeholder; KPC is not enabled for this target */
98 #endif  /* ARM64_BOARD_CONFIG_BCM2837 */
99 
100 #ifdef ARM64_BOARD_CONFIG_VMAPPLE
101 #include <pexpert/arm64/VMAPPLE.h>
102 
103 #define MAX_L2_CLINE                   7
104 #define MAX_CPUS                       32 /* limited by CPU copy window size and cpu checkin mask */
105 #define MAX_CPU_CLUSTERS               1
106 
107 #define CORE_NCTRS                     2
108 
109 #define USE_APPLEARMSMP                1
110 
111 #endif  /* ARM64_BOARD_CONFIG_VMAPPLE */
112 
113 
114 #ifndef HAS_UNCORE_CTRS
115 #undef UNCORE_VERSION
116 #undef UNCORE_PER_CLUSTER
117 #undef UNCORE_NCTRS
118 #endif
119 
120 #if MAX_CPU_CLUSTERS == 1
121 #undef __ARM_AMP__
122 #endif
123 
124 #ifndef MAX_CPU_CLUSTER_PHY_ID
125 #define MAX_CPU_CLUSTER_PHY_ID (MAX_CPU_CLUSTERS - 1)
126 #endif
127 
128 #ifdef PREFER_ARM64_32_BINARIES
129 #define PREFERRED_USER_CPU_TYPE CPU_TYPE_ARM64_32
130 #define PREFERRED_USER_CPU_SUBTYPE CPU_SUBTYPE_ARM64_32_V8
131 #endif
132 
133 
134 /*
135  * Some platforms have very expensive timebase routines.  An optimization
136  * is to avoid switching timers on kernel exit/entry, which results in all
137  * time billed to the system timer.  However, when exposed to userspace, it's
138  * reported as user time to indicate that work was done on behalf of
139  * userspace.
140  */
141 
142 #if CONFIG_SKIP_PRECISE_USER_KERNEL_TIME
143 #define PRECISE_USER_KERNEL_TIME HAS_FAST_CNTVCT
144 #else /* CONFIG_SKIP_PRECISE_USER_KERNEL_TIME */
145 #define PRECISE_USER_KERNEL_TIME 1
146 #endif /* !CONFIG_SKIP_PRECISE_USER_KERNEL_TIME */
147 
148 #endif /* ! _PEXPERT_ARM_BOARD_CONFIG_H */
149