1 /*
2  * Arm SCP/MCP Software
3  * Copyright (c) 2018-2021, Arm Limited and Contributors. All rights reserved.
4  *
5  * SPDX-License-Identifier: BSD-3-Clause
6  *
7  * Description:
8  *     SCP PIK registers
9  */
10 
11 #ifndef SGI575_PIK_SCP_H
12 #define SGI575_PIK_SCP_H
13 
14 #include <fwk_macros.h>
15 
16 #include <stdint.h>
17 
18 /*!
19  * \brief SCP PIK register definitions
20  */
21 struct pik_scp_reg {
22             uint8_t   RESERVED0[0x10 - 0x0];
23     FWK_RW  uint32_t  RESET_SYNDROME;
24             uint8_t   RESERVED1[0x20 - 0x14];
25     FWK_RW  uint32_t  SURVIVAL_RESET_STATUS;
26             uint8_t   RESERVED2[0x34 - 0x24];
27     FWK_RW  uint32_t  ADDR_TRANS;
28     FWK_RW  uint32_t  DBG_ADDR_TRANS;
29             uint8_t   RESERVED3[0x40 - 0x3C];
30     FWK_RW  uint32_t  WS1_TIMER_MATCH;
31     FWK_RW  uint32_t  WS1_TIMER_EN;
32             uint8_t   RESERVED4[0x200 - 0x48];
33     FWK_R   uint32_t  SS_RESET_STATUS;
34     FWK_W   uint32_t  SS_RESET_SET;
35     FWK_W   uint32_t  SS_RESET_CLR;
36             uint8_t   RESERVED5[0x810 - 0x20C];
37     FWK_RW  uint32_t  CORECLK_CTRL;
38     FWK_RW  uint32_t  CORECLK_DIV1;
39             uint8_t   RESERVED6[0x820 - 0x818];
40     FWK_RW  uint32_t  ACLK_CTRL;
41     FWK_RW  uint32_t  ACLK_DIV1;
42             uint8_t   RESERVED7[0xA10 - 0x828];
43     FWK_R   uint32_t  PLL_STATUS[17];
44             uint8_t   RESERVED8[0xA60 - 0xA54];
45     FWK_R   uint32_t  CONS_MMUTCU_INT_STATUS;
46     FWK_R   uint32_t  CONS_MMUTBU_INT_STATUS0;
47     FWK_R   uint32_t  CONS_MMUTBU_INT_STATUS1;
48     FWK_W   uint32_t  CONS_MMUTCU_INT_CLR;
49     FWK_W   uint32_t  CONS_MMUTBU_INT_CLR0;
50     FWK_W   uint32_t  CONS_MMUTBU_INT_CLR1;
51             uint8_t   RESERVED9[0xB00 - 0xA78];
52     FWK_R   uint32_t  MHU_NS_INT_STATUS;
53     FWK_R   uint32_t  MHU_S_INT_STATUS;
54             uint8_t   RESERVED10[0xB20 - 0xB08];
55     FWK_R   uint32_t  CPU_PPU_INT_STATUS[8];
56     FWK_R   uint32_t  CLUS_PPU_INT_STATUS;
57             uint8_t   RESERVED11[0xB60 - 0xB44];
58     FWK_R   uint32_t  TIMER_INT_STATUS[8];
59     FWK_RW  uint32_t  CPU_PLL_LOCK_STATUS[8];
60             uint8_t   RESERVED12[0xBC0 - 0xBA0];
61     FWK_RW  uint32_t  CPU_PLL_UNLOCK_STATUS[8];
62             uint8_t   RESERVED13[0xBF0 - 0xBE0];
63     FWK_RW  uint32_t  CLUSTER_PLL_LOCK_STATUS;
64     FWK_RW  uint32_t  CLUSTER_PLL_UNLOCK_STATUS;
65             uint8_t   RESERVED14[0xC00 - 0xBF8];
66     FWK_R   uint32_t  CLUS_FAULT_INT_STATUS;
67             uint8_t   RESERVED15[0xC30 - 0xC04];
68     FWK_R   uint32_t  CLUSTER_ECCERR_INT_STATUS;
69             uint8_t   RESERVED16[0xD00 - 0xC34];
70     FWK_R   uint32_t  DMC0_4_INT_STATUS;
71     FWK_R   uint32_t  DMC1_5_INT_STATUS;
72     FWK_R   uint32_t  DMC2_6_INT_STATUS;
73     FWK_R   uint32_t  DMC3_7_INT_STATUS;
74             uint8_t   RESERVED17[0xFC0 - 0xD10];
75     FWK_R   uint32_t  PCL_CFG;
76             uint8_t   RESERVED18[0xFD0 - 0xFC4];
77     FWK_R   uint32_t  PID4;
78     FWK_R   uint32_t  PID5;
79     FWK_R   uint32_t  PID6;
80     FWK_R   uint32_t  PID7;
81     FWK_R   uint32_t  PID0;
82     FWK_R   uint32_t  PID1;
83     FWK_R   uint32_t  PID2;
84     FWK_R   uint32_t  PID3;
85     FWK_R   uint32_t  ID0;
86     FWK_R   uint32_t  ID1;
87     FWK_R   uint32_t  ID2;
88     FWK_R   uint32_t  ID3;
89 };
90 
91 #define PLL_STATUS_0_REFCLK      UINT32_C(0x00000001)
92 #define PLL_STATUS_0_SYSPLLLOCK  UINT32_C(0x00000002)
93 #define PLL_STATUS_0_DDRPLLLOCK  UINT32_C(0x00000004)
94 #define PLL_STATUS_0_INTPLLLOCK  UINT32_C(0x00000008)
95 
96 #define PLL_STATUS_CPUPLLLOCK(CPU)  ((uint32_t)(1 << (CPU % 32)))
97 
98 #endif  /* SGI575_PIK_SCP_H */
99