1 /*
2  * Arm SCP/MCP Software
3  * Copyright (c) 2017-2021, Arm Limited and Contributors. All rights reserved.
4  *
5  * SPDX-License-Identifier: BSD-3-Clause
6  */
7 
8 #ifndef SGM776_PIK_CPU_H
9 #define SGM776_PIK_CPU_H
10 
11 #include <fwk_macros.h>
12 
13 #include <stdint.h>
14 
15 #define PE_COUNT_MAX  16
16 
17 /*!
18  * \brief PE Static Configuration register definitions
19  */
20 struct static_config_reg {
21     FWK_RW uint32_t STATIC_CONFIG;
22     FWK_RW uint32_t RVBARADDR_LW;
23     FWK_RW uint32_t RVBARADDR_UP;
24            uint32_t RESERVED;
25 };
26 
27 /*!
28  * \brief AP cores clock control register definitions
29  */
30 struct coreclk_reg {
31     FWK_RW uint32_t CTRL;
32     FWK_RW uint32_t DIV;
33            uint32_t RESERVED;
34     FWK_RW uint32_t MOD;
35 };
36 
37 /*!
38  * \brief CPU (v8.2) PIK register definitions
39  */
40 struct pik_cpu_reg {
41     FWK_RW  uint32_t     CLUSTER_CONFIG;
42             uint8_t      RESERVED0[0x10 - 0x4];
43     struct static_config_reg STATIC_CONFIG[PE_COUNT_MAX];
44             uint8_t      RESERVED1[0x800 - 0x110];
45     FWK_RW  uint32_t     PPUCLK_CTRL;
46     FWK_RW  uint32_t     PPUCLK_DIV1;
47             uint8_t      RESERVED2[0x810 - 0x808];
48     FWK_RW  uint32_t     PCLK_CTRL;
49             uint8_t      RESERVED3[0x820 - 0x814];
50     FWK_RW  uint32_t     DBGCLK_CTRL;
51     FWK_RW  uint32_t     DBGCLK_DIV1;
52             uint8_t      RESERVED4[0x830 - 0x828];
53     FWK_RW  uint32_t     GICCLK_CTRL;
54             uint8_t      RESERVED5[0x840 - 0x834];
55     FWK_RW  uint32_t     AMBACLK_CTRL;
56             uint8_t      RESERVED6[0x850 - 0x844];
57     FWK_RW  uint32_t     CLUSCLK_CTRL;
58     FWK_RW  uint32_t     CLUSCLK_DIV1;
59             uint8_t      RESERVED7[0x860 - 0x858];
60     struct coreclk_reg   CORECLK[PE_COUNT_MAX];
61             uint8_t      RESERVED8[0xA00 - 0x960];
62     FWK_R   uint32_t     CLKFORCE_STATUS;
63     FWK_RW  uint32_t     CLKFORCE_SET;
64     FWK_RW  uint32_t     CLKFORCE_CLR;
65             uint8_t      RESERVED9[0xB00 - 0xA0C];
66     FWK_R   uint32_t     NERRIQ_INT_STATUS;
67     FWK_R   uint32_t     NFAULTIQ_INT_STATUS;
68             uint8_t      RESERVED10[0xFB4 - 0xB08];
69     FWK_R   uint32_t     CAP3;
70     FWK_R   uint32_t     CAP2;
71     FWK_R   uint32_t     CAP;
72     FWK_R   uint32_t     PCL_CONFIG;
73             uint8_t      RESERVED11[0xFD0 - 0xFC4];
74     FWK_R   uint32_t     PID4;
75     FWK_R   uint32_t     PID5;
76     FWK_R   uint32_t     PID6;
77     FWK_R   uint32_t     PID7;
78     FWK_R   uint32_t     PID0;
79     FWK_R   uint32_t     PID1;
80     FWK_R   uint32_t     PID2;
81     FWK_R   uint32_t     PID3;
82     FWK_R   uint32_t     ID0;
83     FWK_R   uint32_t     ID1;
84     FWK_R   uint32_t     ID2;
85     FWK_R   uint32_t     ID3;
86 };
87 
88 #define PIK_CPU_CAP_CLUSSYNC       UINT32_C(0x00000001)
89 #define PIK_CPU_CAP_CORESYNC(CORE) ((uint32_t)(1 << ((CORE) + 1)))
90 #define PIK_CPU_CAP_PE_MASK        UINT32_C(0xF0000000)
91 #define PIK_CPU_CAP_PE_POS         28
92 
93 #define PIK_CPU_PCL_CONFIG_NO_OF_PPU UINT32_C(0x0000000F)
94 
95 #endif  /* SGM776_PIK_CPU_H */
96