xref: /openbmc/qemu/target/ppc/cpu_init.h (revision c0d96407)
1f41e7f76SHarsh Prateek Bora #ifndef TARGET_PPC_CPU_INIT_H
2f41e7f76SHarsh Prateek Bora #define TARGET_PPC_CPU_INIT_H
3f41e7f76SHarsh Prateek Bora 
4f41e7f76SHarsh Prateek Bora #define PPC_INSNS_FLAGS_POWER9                                       \
5f41e7f76SHarsh Prateek Bora     (PPC_INSNS_BASE | PPC_ISEL | PPC_STRING | PPC_MFTB |             \
6f41e7f76SHarsh Prateek Bora      PPC_FLOAT | PPC_FLOAT_FSEL | PPC_FLOAT_FRES |                   \
7f41e7f76SHarsh Prateek Bora      PPC_FLOAT_FSQRT | PPC_FLOAT_FRSQRTE | PPC_FLOAT_FRSQRTES |      \
8f41e7f76SHarsh Prateek Bora      PPC_FLOAT_STFIWX | PPC_FLOAT_EXT | PPC_CACHE | PPC_CACHE_ICBI | \
9f41e7f76SHarsh Prateek Bora      PPC_CACHE_DCBZ | PPC_MEM_SYNC | PPC_MEM_EIEIO | PPC_MEM_TLBIE | \
10f41e7f76SHarsh Prateek Bora      PPC_MEM_TLBSYNC | PPC_64B | PPC_64H | PPC_64BX | PPC_ALTIVEC |  \
11f41e7f76SHarsh Prateek Bora      PPC_SEGMENT_64B | PPC_SLBI | PPC_POPCNTB | PPC_POPCNTWD |       \
12f41e7f76SHarsh Prateek Bora      PPC_CILDST)
13f41e7f76SHarsh Prateek Bora 
14f41e7f76SHarsh Prateek Bora #define PPC_INSNS_FLAGS_POWER10 PPC_INSNS_FLAGS_POWER9
15*c0d96407SAditya Gupta #define PPC_INSNS_FLAGS_POWER11 PPC_INSNS_FLAGS_POWER10
16f41e7f76SHarsh Prateek Bora 
17f41e7f76SHarsh Prateek Bora #define PPC_INSNS_FLAGS2_POWER_COMMON                                \
18f41e7f76SHarsh Prateek Bora     (PPC2_VSX | PPC2_VSX207 | PPC2_DFP | PPC2_DBRX |                 \
19f41e7f76SHarsh Prateek Bora      PPC2_PERM_ISA206 | PPC2_DIVE_ISA206 | PPC2_ATOMIC_ISA206 |      \
20f41e7f76SHarsh Prateek Bora      PPC2_FP_CVT_ISA206 | PPC2_FP_TST_ISA206 | PPC2_BCTAR_ISA207 |   \
21f41e7f76SHarsh Prateek Bora      PPC2_LSQ_ISA207 | PPC2_ALTIVEC_207 | PPC2_ISA205 |              \
22f41e7f76SHarsh Prateek Bora      PPC2_ISA207S | PPC2_FP_CVT_S64 | PPC2_ISA300 | PPC2_PRCNTL |    \
23f41e7f76SHarsh Prateek Bora      PPC2_MEM_LWSYNC | PPC2_BCDA_ISA206)
24f41e7f76SHarsh Prateek Bora 
25f41e7f76SHarsh Prateek Bora #define PPC_INSNS_FLAGS2_POWER9                                      \
26f41e7f76SHarsh Prateek Bora     (PPC_INSNS_FLAGS2_POWER_COMMON | PPC2_TM)
27f41e7f76SHarsh Prateek Bora #define PPC_INSNS_FLAGS2_POWER10                                     \
28f41e7f76SHarsh Prateek Bora     (PPC_INSNS_FLAGS2_POWER_COMMON | PPC2_ISA310)
29*c0d96407SAditya Gupta #define PPC_INSNS_FLAGS2_POWER11 PPC_INSNS_FLAGS2_POWER10
30f41e7f76SHarsh Prateek Bora 
31f41e7f76SHarsh Prateek Bora #define PPC_MSR_MASK_POWER_COMMON           \
32f41e7f76SHarsh Prateek Bora     ((1ull << MSR_SF) |                     \
33f41e7f76SHarsh Prateek Bora      (1ull << MSR_HV) |                     \
34f41e7f76SHarsh Prateek Bora      (1ull << MSR_VR) |                     \
35f41e7f76SHarsh Prateek Bora      (1ull << MSR_VSX) |                    \
36f41e7f76SHarsh Prateek Bora      (1ull << MSR_EE) |                     \
37f41e7f76SHarsh Prateek Bora      (1ull << MSR_PR) |                     \
38f41e7f76SHarsh Prateek Bora      (1ull << MSR_FP) |                     \
39f41e7f76SHarsh Prateek Bora      (1ull << MSR_ME) |                     \
40f41e7f76SHarsh Prateek Bora      (1ull << MSR_FE0) |                    \
41f41e7f76SHarsh Prateek Bora      (1ull << MSR_SE) |                     \
42f41e7f76SHarsh Prateek Bora      (1ull << MSR_DE) |                     \
43f41e7f76SHarsh Prateek Bora      (1ull << MSR_FE1) |                    \
44f41e7f76SHarsh Prateek Bora      (1ull << MSR_IR) |                     \
45f41e7f76SHarsh Prateek Bora      (1ull << MSR_DR) |                     \
46f41e7f76SHarsh Prateek Bora      (1ull << MSR_PMM) |                    \
47f41e7f76SHarsh Prateek Bora      (1ull << MSR_RI) |                     \
48f41e7f76SHarsh Prateek Bora      (1ull << MSR_LE))
49f41e7f76SHarsh Prateek Bora 
50f41e7f76SHarsh Prateek Bora #define PPC_MSR_MASK_POWER9         \
51f41e7f76SHarsh Prateek Bora     (PPC_MSR_MASK_POWER_COMMON | (1ull << MSR_TM))
52f41e7f76SHarsh Prateek Bora #define PPC_MSR_MASK_POWER10        \
53f41e7f76SHarsh Prateek Bora     PPC_MSR_MASK_POWER_COMMON
54*c0d96407SAditya Gupta #define PPC_MSR_MASK_POWER11 PPC_MSR_MASK_POWER10
55f41e7f76SHarsh Prateek Bora 
56f41e7f76SHarsh Prateek Bora #define PPC_PCR_MASK_POWER9         \
57f41e7f76SHarsh Prateek Bora     (PCR_COMPAT_2_05 | PCR_COMPAT_2_06 | PCR_COMPAT_2_07)
58f41e7f76SHarsh Prateek Bora #define PPC_PCR_MASK_POWER10        \
59f41e7f76SHarsh Prateek Bora     (PPC_PCR_MASK_POWER9 | PCR_COMPAT_3_00)
60*c0d96407SAditya Gupta #define PPC_PCR_MASK_POWER11 PPC_PCR_MASK_POWER10
61f41e7f76SHarsh Prateek Bora 
62f41e7f76SHarsh Prateek Bora #define PPC_PCR_SUPPORTED_POWER9    \
63f41e7f76SHarsh Prateek Bora     (PCR_COMPAT_3_00 | PCR_COMPAT_2_07 | PCR_COMPAT_2_06 | PCR_COMPAT_2_05)
64f41e7f76SHarsh Prateek Bora #define PPC_PCR_SUPPORTED_POWER10   \
65f41e7f76SHarsh Prateek Bora     (PPC_PCR_SUPPORTED_POWER9 | PCR_COMPAT_3_10)
66*c0d96407SAditya Gupta #define PPC_PCR_SUPPORTED_POWER11 PPC_PCR_SUPPORTED_POWER10
67f41e7f76SHarsh Prateek Bora 
68f41e7f76SHarsh Prateek Bora #define PPC_LPCR_MASK_POWER9                                                 \
69f41e7f76SHarsh Prateek Bora     (LPCR_VPM1 | LPCR_ISL | LPCR_KBV | LPCR_DPFD |                           \
70f41e7f76SHarsh Prateek Bora      (LPCR_PECE_U_MASK & LPCR_HVEE) | LPCR_ILE | LPCR_AIL |                  \
71f41e7f76SHarsh Prateek Bora      LPCR_UPRT | LPCR_EVIRT | LPCR_ONL | LPCR_HR | LPCR_LD |                 \
72f41e7f76SHarsh Prateek Bora      (LPCR_PECE_L_MASK & (LPCR_PDEE | LPCR_HDEE | LPCR_EEE | LPCR_DEE |      \
73f41e7f76SHarsh Prateek Bora                           LPCR_OEE)) | LPCR_MER | LPCR_GTSE | LPCR_TC |      \
74f41e7f76SHarsh Prateek Bora      LPCR_HEIC | LPCR_LPES0 | LPCR_HVICE | LPCR_HDICE)
75f41e7f76SHarsh Prateek Bora /* DD2 adds an extra HAIL bit */
76f41e7f76SHarsh Prateek Bora #define PPC_LPCR_MASK_POWER10   \
77f41e7f76SHarsh Prateek Bora     (PPC_LPCR_MASK_POWER9 | LPCR_HAIL)
78*c0d96407SAditya Gupta #define PPC_LPCR_MASK_POWER11 PPC_LPCR_MASK_POWER10
79f41e7f76SHarsh Prateek Bora 
80f41e7f76SHarsh Prateek Bora #define POWERPC_FLAGS_POWER_COMMON                                       \
81f41e7f76SHarsh Prateek Bora     (POWERPC_FLAG_VRE | POWERPC_FLAG_SE | POWERPC_FLAG_BE |              \
82f41e7f76SHarsh Prateek Bora      POWERPC_FLAG_PMM | POWERPC_FLAG_BUS_CLK | POWERPC_FLAG_CFAR |       \
83f41e7f76SHarsh Prateek Bora      POWERPC_FLAG_VSX | POWERPC_FLAG_SCV)
84f41e7f76SHarsh Prateek Bora 
85f41e7f76SHarsh Prateek Bora #define POWERPC_FLAGS_POWER9  \
86f41e7f76SHarsh Prateek Bora     (POWERPC_FLAGS_POWER_COMMON | POWERPC_FLAG_TM)
87f41e7f76SHarsh Prateek Bora #define POWERPC_FLAGS_POWER10 \
88f41e7f76SHarsh Prateek Bora     (POWERPC_FLAGS_POWER_COMMON | POWERPC_FLAG_BHRB)
89*c0d96407SAditya Gupta #define POWERPC_FLAGS_POWER11 POWERPC_FLAGS_POWER10
90f41e7f76SHarsh Prateek Bora 
91f41e7f76SHarsh Prateek Bora #endif /* TARGET_PPC_CPU_INIT_H */
92