1 /*
2  * Arm SCP/MCP Software
3  * Copyright (c) 2020-2021, Arm Limited and Contributors. All rights reserved.
4  *
5  * SPDX-License-Identifier: BSD-3-Clause
6  */
7 
8 #ifndef CLOCK_SOC_H
9 #define CLOCK_SOC_H
10 
11 #include <fwk_macros.h>
12 
13 #define CLOCK_RATE_REFCLK (100UL * FWK_MHZ)
14 #define CLOCK_RATE_SYSPLLCLK (2000UL * FWK_MHZ)
15 
16 /*
17  * PLL clock indexes.
18  */
19 enum clock_pll_idx {
20     CLOCK_PLL_IDX_CPU_KLEIN,
21     CLOCK_PLL_IDX_CPU_MATTERHORN,
22     CLOCK_PLL_IDX_CPU_MATTERHORN_ELP_ARM,
23     CLOCK_PLL_IDX_SYS,
24     CLOCK_PLL_IDX_DPU,
25     CLOCK_PLL_IDX_PIX0,
26     CLOCK_PLL_IDX_PIX1,
27     CLOCK_PLL_IDX_COUNT
28 };
29 
30 /*
31  * PIK clock indexes.
32  */
33 enum clock_pik_idx {
34     CLOCK_PIK_IDX_CLUS0_CPU0,
35     CLOCK_PIK_IDX_CLUS0_CPU1,
36     CLOCK_PIK_IDX_CLUS0_CPU2,
37     CLOCK_PIK_IDX_CLUS0_CPU3,
38     CLOCK_PIK_IDX_CLUS0_CPU4,
39     CLOCK_PIK_IDX_CLUS0_CPU5,
40     CLOCK_PIK_IDX_CLUS0_CPU6,
41     CLOCK_PIK_IDX_CLUS0_CPU7,
42     CLOCK_PIK_IDX_GIC,
43     CLOCK_PIK_IDX_PCLKSCP,
44     CLOCK_PIK_IDX_SYSPERCLK,
45     CLOCK_PIK_IDX_UARTCLK,
46     CLOCK_PIK_IDX_DPU,
47     CLOCK_PIK_IDX_COUNT
48 };
49 
50 /*!
51  * \brief Selectable clock sources for TC0 cluster clocks.
52  */
53 enum mod_clusclock_source_tc0 {
54     /*! The clock is gated */
55     MOD_PIK_CLOCK_CLUSCLK_SOURCE_TC0_GATED = 0x0,
56     /*! The clock source is set to the system reference clock */
57     MOD_PIK_CLOCK_CLUSCLK_SOURCE_TC0_SYSREFCLK = 0x1,
58     /*! The clock source is set to a private cluster PLL */
59     MOD_PIK_CLOCK_CLUSCLK_SOURCE_TC0_PLL0 = 0x2,
60     /*! The clock source is set to a private cluster PLL */
61     MOD_PIK_CLOCK_CLUSCLK_SOURCE_TC0_PLL1 = 0x4,
62     /*! The clock source is set to a private cluster PLL */
63     MOD_PIK_CLOCK_CLUSCLK_SOURCE_TC0_PLL2 = 0x8,
64     /*! The clock source is set to a private cluster PLL */
65     MOD_PIK_CLOCK_CLUSCLK_SOURCE_TC0_PLL3 = 0x10,
66     /*! Number of valid clock sources */
67     MOD_PIK_CLOCK_CLUSCLK_SOURCE_TC0_MAX
68 };
69 
70 /*
71  * CSS clock indexes.
72  */
73 enum clock_css_idx {
74     CLOCK_CSS_IDX_CPU_GROUP_KLEIN,
75     CLOCK_CSS_IDX_CPU_GROUP_MATTERHORN,
76     CLOCK_CSS_IDX_CPU_GROUP_MATTERHORN_ELP_ARM,
77     CLOCK_CSS_IDX_DPU,
78     CLOCK_CSS_IDX_COUNT
79 };
80 
81 /*
82  * Clock indexes.
83  */
84 enum clock_idx {
85     CLOCK_IDX_CPU_GROUP_KLEIN,
86     CLOCK_IDX_CPU_GROUP_MATTERHORN,
87     CLOCK_IDX_CPU_GROUP_MATTERHORN_ELP_ARM,
88     CLOCK_IDX_DPU,
89     CLOCK_IDX_PIXEL_0,
90     CLOCK_IDX_PIXEL_1,
91     CLOCK_IDX_COUNT
92 };
93 
94 #endif /* CLOCK_SOC_H */
95