soc/xtensa/intel_adsp: Enable WOVCRO based on platform support

Instead of enabling WOVCRO clock based on the SOC, use a configuration
to indicate support, so that each platform can specify if WOVCRO is
supported or not.

Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
This commit is contained in:
Ederson de Souza 2022-07-19 10:01:27 -03:00 committed by Anas Nashif
parent 28e07bf1ba
commit 49d1583e2a
6 changed files with 15 additions and 7 deletions

View file

@ -9,7 +9,7 @@ properties:
cavs-clkctl-clk-wovcro:
type: int
required: false
description: Index of WOVCRO clock encoding in the encoding array (cAVS 2.5 only).
description: Index of WOVCRO clock encoding in the encoding array (if wovcro-supported is true).
cavs-clkctl-clk-lpro:
type: int
@ -40,3 +40,8 @@ properties:
type: int
required: true
description: Index for the lowest frequency clock.
wovcro-supported:
type: boolean
description: |
If WoV clock ring oscillator is supported.

View file

@ -76,6 +76,7 @@
cavs-clkctl-freq-mask = <0x10 0x20000000 0x80000000>;
cavs-clkctl-freq-default = <2>;
cavs-clkctl-freq-lowest = <0>;
wovcro-supported;
};
soc {

View file

@ -63,6 +63,4 @@ config ADSP_TRACE_SIMCALL
of an enclosing simulator process. All window contents will
remain identical.
endif # SOC_FAMILY_INTEL_ADSP

View file

@ -78,7 +78,7 @@ void cavs_clock_init(void)
uint32_t platform_lowest_freq_idx = CAVS_CLOCK_FREQ_LOWEST;
int i;
#ifdef CONFIG_SOC_INTEL_CAVS_V25
#ifdef CAVS_CLOCK_HAS_WOVCRO
CAVS_SHIM.clkctl |= CAVS_CLKCTL_WOVCRO;
if (CAVS_SHIM.clkctl & CAVS_CLKCTL_WOVCRO)
CAVS_SHIM.clkctl = CAVS_SHIM.clkctl & ~CAVS_CLKCTL_WOVCRO;

View file

@ -47,9 +47,13 @@ struct cavs_clock_info *cavs_clocks_get(void);
#define CAVS_CLOCK_FREQ(name) DT_PROP(DT_NODELABEL(clkctl), cavs_clkctl_clk_##name)
#if DT_PROP(DT_NODELABEL(clkctl), wovcro_supported)
#define CAVS_CLOCK_HAS_WOVCRO
#endif
#define CAVS_CLOCK_FREQ_LPRO CAVS_CLOCK_FREQ(lpro)
#define CAVS_CLOCK_FREQ_HPRO CAVS_CLOCK_FREQ(hpro)
#ifdef CONFIG_SOC_INTEL_CAVS_V25
#ifdef CAVS_CLOCK_HAS_WOVCRO
#define CAVS_CLOCK_FREQ_WOVCRO CAVS_CLOCK_FREQ(wovcro)
#endif

View file

@ -28,7 +28,7 @@ static void test_cavs_clock_driver(void)
cavs_clock_set_freq(CAVS_CLOCK_FREQ_HPRO);
check_clocks(clocks, CAVS_CLOCK_FREQ_HPRO);
#ifdef CONFIG_SOC_INTEL_CAVS_V25
#ifdef CAVS_CLOCK_HAS_WOVCRO
cavs_clock_set_freq(CAVS_CLOCK_FREQ_WOVCRO);
check_clocks(clocks, CAVS_CLOCK_FREQ_WOVCRO);
#endif
@ -49,7 +49,7 @@ static void test_cavs_clock_control(void)
CAVS_CLOCK_FREQ_HPRO);
check_clocks(clocks, CAVS_CLOCK_FREQ_HPRO);
#ifdef CONFIG_SOC_INTEL_CAVS_V25
#ifdef CAVS_CLOCK_HAS_WOVCRO
clock_control_set_rate(dev, NULL, (clock_control_subsys_rate_t)
CAVS_CLOCK_FREQ_WOVCRO);
check_clocks(clocks, CAVS_CLOCK_FREQ_WOVCRO);