1 // SPDX-License-Identifier: BSD-3-Clause
2 //
3 // Copyright(c) 2019 Intel Corporation. All rights reserved.
4 //
5 // Author: Tomasz Lauda <tomasz.lauda@linux.intel.com>
6 //         Janusz Jankowski <janusz.jankowski@linux.intel.com>
7 
8 #include <sof/common.h>
9 #include <sof/drivers/ssp.h>
10 #include <sof/lib/clk.h>
11 
12 static const struct freq_table platform_cpu_freq[] = {
13 	{ 120000000, 120000 },
14 	{ CLK_MAX_CPU_HZ, 400000 },
15 };
16 
17 const uint32_t cpu_freq_enc[] = {
18 	SHIM_CLKCTL_RLROSCC | SHIM_CLKCTL_OCS_LP_RING |
19 		SHIM_CLKCTL_HMCS_DIV2 | SHIM_CLKCTL_LMCS_DIV4,
20 	SHIM_CLKCTL_RHROSCC | SHIM_CLKCTL_OCS_HP_RING |
21 		SHIM_CLKCTL_HMCS_DIV2 | SHIM_CLKCTL_LMCS_DIV4,
22 };
23 
24 const uint32_t cpu_freq_status_mask[] = {
25 	SHIM_CLKSTS_LROSCCS,
26 	SHIM_CLKSTS_HROSCCS,
27 };
28 
29 STATIC_ASSERT(NUM_CPU_FREQ == ARRAY_SIZE(platform_cpu_freq),
30 	      invalid_number_of_cpu_frequencies);
31 
32 const struct freq_table *cpu_freq = platform_cpu_freq;
33 
34 /* IMPORTANT: array should be filled in increasing order
35  * (regarding to .freq field)
36  */
37 static const struct freq_table platform_ssp_freq[] = {
38 	{ 24000000, 24000 },
39 	{ 96000000, 96000 },
40 };
41 
42 static const uint32_t platform_ssp_freq_sources[] = {
43 	SSP_CLOCK_XTAL_OSCILLATOR,
44 	SSP_CLOCK_PLL_FIXED,
45 };
46 
47 STATIC_ASSERT(NUM_SSP_FREQ == ARRAY_SIZE(platform_ssp_freq),
48 	      invalid_number_of_ssp_frequencies);
49 
50 const struct freq_table *ssp_freq = platform_ssp_freq;
51 const uint32_t *ssp_freq_sources = platform_ssp_freq_sources;
52