From a471a85680ef59b29b2b4840881873064ca0dd32 Mon Sep 17 00:00:00 2001 From: Kai Vehmanen Date: Thu, 19 Sep 2024 15:50:14 +0300 Subject: [PATCH 1/5] platform: intel: cavs: remove runtime_pm core/mem init The initialization of DSP state is now done in Zephyr, so the calls to initialize DSP core and memory state are no longer needed and can be removed. Signed-off-by: Kai Vehmanen --- src/platform/intel/cavs/platform.c | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/src/platform/intel/cavs/platform.c b/src/platform/intel/cavs/platform.c index 50b482d1e905..e9976b3ac7db 100644 --- a/src/platform/intel/cavs/platform.c +++ b/src/platform/intel/cavs/platform.c @@ -121,17 +121,6 @@ static struct pm_notifier pm_state_notifier = { int platform_init(struct sof *sof) { int ret; - int i; - - /* Turn off memory for all unused cores */ - for (i = 0; i < CONFIG_CORE_COUNT; i++) - if (i != PLATFORM_PRIMARY_CORE_ID) - pm_runtime_put(CORE_MEMORY_POW, i); - - /* pm runtime already initialized, request the DSP to stay in D0 - * until we are allowed to do full power gating (by the IPC req). - */ - pm_runtime_disable(PM_RUNTIME_DSP, 0); trace_point(TRACE_BOOT_PLATFORM_CLOCK); platform_clock_init(sof); From 9dd8e543856df5542aa2d2bdd9a82ba5a619eb13 Mon Sep 17 00:00:00 2001 From: Kai Vehmanen Date: Thu, 19 Sep 2024 16:58:40 +0300 Subject: [PATCH 2/5] platform: intel: cavs: remove calls to platform_pm_runtime_get Since commit 35b17a41c118 ("platform: tigerlake: remove XTOS platform definitions"), the platform_pm_runtime_get() has been a no-op call with a dummy implementation in zephyr/lib/pm_runtime.c. Signed-off-by: Kai Vehmanen --- src/platform/intel/cavs/platform.c | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/src/platform/intel/cavs/platform.c b/src/platform/intel/cavs/platform.c index e9976b3ac7db..fde0f22f0a22 100644 --- a/src/platform/intel/cavs/platform.c +++ b/src/platform/intel/cavs/platform.c @@ -26,7 +26,6 @@ #include #include #include -#include #include #include #include @@ -96,11 +95,6 @@ int platform_boot_complete(uint32_t boot_message) { struct ipc_cmd_hdr header; -#if CONFIG_TIGERLAKE - /* TGL specific HW recommended flow */ - pm_runtime_get(PM_RUNTIME_DSP, PWRD_BY_HPRO | (CONFIG_CORE_COUNT - 1)); -#endif - mailbox_dspbox_write(0, &ready, sizeof(ready)); /* get any IPC specific boot message and optional data */ @@ -139,15 +133,6 @@ int platform_init(struct sof *sof) /* Set CPU to max frequency for booting (single shim_write below) */ trace_point(TRACE_BOOT_PLATFORM_CPU_FREQ); -#if CONFIG_TIGERLAKE - /* prevent DSP Common power gating */ - pm_runtime_get(PM_RUNTIME_DSP, PLATFORM_PRIMARY_CORE_ID); - -#if CONFIG_DSP_RESIDENCY_COUNTERS - init_dsp_r_state(r0_r_state); -#endif /* CONFIG_DSP_RESIDENCY_COUNTERS */ -#endif /* CONFIG_TIGERLAKE */ - /* init DMACs */ trace_point(TRACE_BOOT_PLATFORM_DMA); ret = dmac_init(sof); From 5e729039d6954830ea788a311be29a954475eee2 Mon Sep 17 00:00:00 2001 From: Kai Vehmanen Date: Thu, 19 Sep 2024 15:24:55 +0300 Subject: [PATCH 3/5] zephyr: decouple from platform pm_runtime.h interface SOF defines a pm_runtime.h interface that consists of a RTOS layer and a platform specific layer. So far, the interface has been used in driver code and a very small set of audio modules (e.g. key phrase buffer in kpb.c). The platform layer has only been implemented on Intel platforms. A no-op implementation is used for other platforms. As all Intel platforms have moved to Zephyr, this now allows to simplify the code a lot for SOF Zephyr builds and drop all dependencies to the pm_runtime.h platform layer. With Zephyr, the drivers are defined on Zephyr side and the device runtime management can be handled with Zephyr device interfaces. This patch removes all use of the pm_runtime.h platform layer in Zephyr builds and replaces linkage of generic sof/src/lib/pm_runtime.c with sof/zephyr/lib/pm_runtime.c. The Zephyr sof/lib/pm_runtime.h provides sufficient functionality to cover all uses of pm_runtime interface in SOF application code (e.g. init and kbp). The changes simplify the codebase and reduce the amount of boilerplate code needed to add new hardware targets to SOF, when Zephyr is used as the RTOS. Signed-off-by: Kai Vehmanen --- zephyr/CMakeLists.txt | 4 +- zephyr/include/sof/lib/pm_runtime.h | 131 ++++++++++++++++++++++++++++ zephyr/lib/pm_runtime.c | 36 ++++---- 3 files changed, 150 insertions(+), 21 deletions(-) create mode 100644 zephyr/include/sof/lib/pm_runtime.h diff --git a/zephyr/CMakeLists.txt b/zephyr/CMakeLists.txt index 296fd27e4841..eaf185b9c8b8 100644 --- a/zephyr/CMakeLists.txt +++ b/zephyr/CMakeLists.txt @@ -231,7 +231,6 @@ if (CONFIG_SOC_SERIES_INTEL_CAVS_V25) zephyr_library_sources( ${SOF_PLATFORM_PATH}/intel/cavs/platform.c ${SOF_PLATFORM_PATH}/tigerlake/lib/clk.c - lib/pm_runtime.c lib/clk.c lib/dma.c ) @@ -251,7 +250,6 @@ if (CONFIG_SOC_SERIES_INTEL_ADSP_ACE) # Platform sources zephyr_library_sources( ${SOF_PLATFORM_PATH}/intel/ace/platform.c - lib/pm_runtime.c lib/clk.c lib/dma.c ) @@ -428,7 +426,6 @@ zephyr_library_sources( # SOF library - parts to transition to Zephyr over time ${SOF_LIB_PATH}/clk.c ${SOF_LIB_PATH}/notifier.c - ${SOF_LIB_PATH}/pm_runtime.c ${SOF_LIB_PATH}/cpu-clk-manager.c ${SOF_LIB_PATH}/dma.c ${SOF_LIB_PATH}/dai.c @@ -461,6 +458,7 @@ zephyr_library_sources( schedule.c lib/alloc.c lib/cpu.c + lib/pm_runtime.c # Common library functions - Will be moved to Zephyr over time lib.c diff --git a/zephyr/include/sof/lib/pm_runtime.h b/zephyr/include/sof/lib/pm_runtime.h new file mode 100644 index 000000000000..ee02eff51aad --- /dev/null +++ b/zephyr/include/sof/lib/pm_runtime.h @@ -0,0 +1,131 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * + * Copyright(c) 2024 Intel Corporation. + */ + +#ifndef __SOF_LIB_PM_RUNTIME_H__ +#define __SOF_LIB_PM_RUNTIME_H__ + +#include +#include + +/** \addtogroup pm_runtime PM Runtime + * SOF PM runtime specification mapping for Zephyr builds. + * + * This interface is considered deprecated and native Zephyr + * interfaces should be used instead. + * @{ + */ + +/** \brief Runtime power management context */ +enum pm_runtime_context { + PM_RUNTIME_DSP /**< DSP */ +}; + +/** + * \brief Initializes runtime power management. + */ +static inline void pm_runtime_init(struct sof *sof) +{ +} + +/** + * \brief Retrieves power management resource (async). + * + * \param[in] context Type of power management context. + * \param[in] index Index of the device. + */ +void pm_runtime_get(enum pm_runtime_context context, uint32_t index); + +/** + * \brief Retrieves power management resource. + * + * \param[in] context Type of power management context. + * \param[in] index Index of the device. + */ +static inline void pm_runtime_get_sync(enum pm_runtime_context context, uint32_t index) +{ +} + + +/** + * \brief Releases power management resource (async). + * + * \param[in] context Type of power management context. + * \param[in] index Index of the device. + */ +void pm_runtime_put(enum pm_runtime_context context, uint32_t index); + +/** + * \brief Releases power management resource. + * + * \param[in] context Type of power management context. + * \param[in] index Index of the device. + */ +static inline void pm_runtime_put_sync(enum pm_runtime_context context, uint32_t index) +{ +} + +/** + * \brief Enables power management operations for the resource. + * + * \param[in] context Type of power management context. + * \param[in] index Index of the device. + */ +void pm_runtime_enable(enum pm_runtime_context context, uint32_t index); + +/** + * \brief Disables power management operations for the resource. + * + * \param[in] context Type of power management context. + * \param[in] index Index of the device. + */ +void pm_runtime_disable(enum pm_runtime_context context, uint32_t index); + +/** + * \brief Reports state of the power managed resource. + * + * @param context Type of power management context. + * @param index Index of the resource. + * + * @return true if the resource is active or pm disabled, false otherwise. + */ +bool pm_runtime_is_active(enum pm_runtime_context context, uint32_t index); + +static inline void platform_pm_runtime_prepare_d0ix_en(uint32_t index) +{ +} + +#if CONFIG_DSP_RESIDENCY_COUNTERS + +/** + * \brief Initializes DSP residency counters. + * + * \param[in] context Type of power management context. + */ +static inline void init_dsp_r_state(enum dsp_r_state) +{ +} + +/** + * \brief Reports DSP residency state. + * + * \param[in] new state + */ +static inline void report_dsp_r_state(enum dsp_r_state) +{ +} + +/** + * \brief Retrieves current DSP residency state. + * + * @return active DSP residency state + */ +static inline enum dsp_r_state get_dsp_r_state(void) +{ +} +#endif + +/** @}*/ + +#endif /* __SOF_LIB_PM_RUNTIME_H__ */ diff --git a/zephyr/lib/pm_runtime.c b/zephyr/lib/pm_runtime.c index 3f614683c8bc..fcaa03cb7275 100644 --- a/zephyr/lib/pm_runtime.c +++ b/zephyr/lib/pm_runtime.c @@ -64,7 +64,7 @@ const struct pm_state_info *pm_policy_next_state(uint8_t cpu, int32_t ticks) } #endif /* CONFIG_PM_POLICY_CUSTOM */ -void platform_pm_runtime_enable(uint32_t context, uint32_t index) +void pm_runtime_enable(enum pm_runtime_context context, uint32_t index) { switch (context) { case PM_RUNTIME_DSP: @@ -77,7 +77,8 @@ void platform_pm_runtime_enable(uint32_t context, uint32_t index) } } -void platform_pm_runtime_disable(uint32_t context, uint32_t index) +/** Disables power _management_. The management, not the power. */ +void pm_runtime_disable(enum pm_runtime_context context, uint32_t index) { switch (context) { case PM_RUNTIME_DSP: @@ -89,19 +90,18 @@ void platform_pm_runtime_disable(uint32_t context, uint32_t index) } } -void platform_pm_runtime_init(struct pm_runtime_data *prd) -{ } - -void platform_pm_runtime_get(enum pm_runtime_context context, uint32_t index, - uint32_t flags) -{ } - -void platform_pm_runtime_put(enum pm_runtime_context context, uint32_t index, - uint32_t flags) -{ } - -void platform_pm_runtime_prepare_d0ix_en(uint32_t index) -{ } - -void platform_pm_runtime_power_off(void) -{ } +/** Is the _power_ active. The power, not its management. */ +bool pm_runtime_is_active(enum pm_runtime_context context, uint32_t index) +{ + switch (context) { + case PM_RUNTIME_DSP: +#if defined(CONFIG_PM) + return pm_policy_state_lock_is_active(PM_STATE_RUNTIME_IDLE, PM_ALL_SUBSTATES); +#else + return true; +#endif + default: + break; + } + return false; +} From 8797d3774458ae653cc9646a46c0cc78cc44845f Mon Sep 17 00:00:00 2001 From: Kai Vehmanen Date: Thu, 19 Sep 2024 15:48:30 +0300 Subject: [PATCH 4/5] platform: intel: remove pm_runtime.h Platform implementation no longer mandatory for SOF Zephyr builds, so the pm_runtime.h file can be removed for these platforms. Signed-off-by: Kai Vehmanen --- .../intel/cavs/include/cavs/lib/pm_runtime.h | 97 ------------------- .../include/platform/lib/pm_runtime.h | 72 -------------- .../include/platform/lib/pm_runtime.h | 70 ------------- .../include/platform/lib/pm_runtime.h | 72 -------------- .../include/platform/lib/pm_runtime.h | 27 ------ 5 files changed, 338 deletions(-) delete mode 100644 src/platform/intel/cavs/include/cavs/lib/pm_runtime.h delete mode 100644 src/platform/lunarlake/include/platform/lib/pm_runtime.h delete mode 100644 src/platform/meteorlake/include/platform/lib/pm_runtime.h delete mode 100644 src/platform/pantherlake/include/platform/lib/pm_runtime.h delete mode 100644 src/platform/tigerlake/include/platform/lib/pm_runtime.h diff --git a/src/platform/intel/cavs/include/cavs/lib/pm_runtime.h b/src/platform/intel/cavs/include/cavs/lib/pm_runtime.h deleted file mode 100644 index 9b91c544fd58..000000000000 --- a/src/platform/intel/cavs/include/cavs/lib/pm_runtime.h +++ /dev/null @@ -1,97 +0,0 @@ -/* SPDX-License-Identifier: BSD-3-Clause - * - * Copyright(c) 2019 Intel Corporation. All rights reserved. - * - * Author: Tomasz Lauda - */ - -/** - * \file cavs/lib/pm_runtime.h - * \brief Runtime power management header file for cAVS platforms - * \author Tomasz Lauda - */ - -#ifdef __PLATFORM_LIB_PM_RUNTIME_H__ - -#ifndef __CAVS_LIB_PM_RUNTIME_H__ -#define __CAVS_LIB_PM_RUNTIME_H__ - -#include - -/** - * \brief extra pwr flag to power up a core with a specific reason - * it can be powered down only with the same reason (flag) - */ -#define PWRD_MASK MASK(31, 30) -#define PWRD_BY_HPRO BIT(31) /**< requested by HPRO */ -#define PWRD_BY_TPLG BIT(30) /**< typical power up */ - -struct pm_runtime_data; - -/** \brief cAVS specific runtime power management data. */ -struct cavs_pm_runtime_data { - bool dsp_d0; /**< dsp target D0(true) or D0ix(false) */ - int host_dma_l1_sref; /**< ref counter for Host DMA accesses */ - uint32_t sleep_core_mask; /**< represents cores in waiti state */ - uint32_t prepare_d0ix_core_mask; /**< indicates whether core needs */ - /**< to prepare to d0ix power down */ - /**< before next waiti */ - int dsp_client_bitmap[CONFIG_CORE_COUNT]; /**< simple pwr override */ -}; - -/** - * \brief Initializes platform specific runtime power management. - * \param[in,out] prd Runtime power management data. - */ -void platform_pm_runtime_init(struct pm_runtime_data *prd); - -/** - * \brief Retrieves platform specific power management resource. - * - * \param[in] context Type of power management context. - * \param[in] index Index of the device. - * \param[in] flags Flags, set of RPM_... - */ -void platform_pm_runtime_get(uint32_t context, uint32_t index, uint32_t flags); - -/** - * \brief Releases platform specific power management resource. - * - * \param[in] context Type of power management context. - * \param[in] index Index of the device. - * \param[in] flags Flags, set of RPM_... - */ -void platform_pm_runtime_put(uint32_t context, uint32_t index, uint32_t flags); - -void platform_pm_runtime_enable(uint32_t context, uint32_t index); - -void platform_pm_runtime_disable(uint32_t context, uint32_t index); - -void platform_pm_runtime_prepare_d0ix_en(uint32_t index); - -void platform_pm_runtime_prepare_d0ix_dis(uint32_t index); - -int platform_pm_runtime_prepare_d0ix_is_req(uint32_t index); - -bool platform_pm_runtime_is_active(uint32_t context, uint32_t index); - -/** - * \brief Power gates platform specific hardware resources. - */ -void platform_pm_runtime_power_off(void); - -/** - * \brief CAVS DSP residency counters - * R0 - HPRO clock, highest power consumption state - * R1 - LPRO clock, low power consumption state - * R2 - LPS, lowest power consumption state - * with extra priority to R2 (LPS) which cannot be interrupted by R0/R1 changes - */ - -#endif - -#else - -#error "Do not include outside of platform/lib/pm_runtime.h" - -#endif diff --git a/src/platform/lunarlake/include/platform/lib/pm_runtime.h b/src/platform/lunarlake/include/platform/lib/pm_runtime.h deleted file mode 100644 index a5d16dc40f78..000000000000 --- a/src/platform/lunarlake/include/platform/lib/pm_runtime.h +++ /dev/null @@ -1,72 +0,0 @@ -/* SPDX-License-Identifier: BSD-3-Clause - * - * Copyright(c) 2023 Intel Corporation. All rights reserved. - * - * Author: Tomasz Lauda - */ - -/** - * \file platform/lunarlake/include/platform/lib/pm_runtime.h - * \brief Runtime power management header file for Tigerlake - * \author Tomasz Lauda - */ - -#ifdef __SOF_LIB_PM_RUNTIME_H__ - -#ifndef __PLATFORM_LIB_PM_RUNTIME_H__ -#define __PLATFORM_LIB_PM_RUNTIME_H__ - -#include -#include - -/** - * \brief extra pwr flag to power up a core with a specific reason - * it can be powered down only with the same reason (flag) - */ -#define PWRD_MASK MASK(31, 30) -#define PWRD_BY_HPRO BIT(31) /**< requested by HPRO */ -#define PWRD_BY_TPLG BIT(30) /**< typical power up */ - -struct pm_runtime_data; - -/** - * \brief Initializes platform specific runtime power management. - * \param[in,out] prd Runtime power management data. - */ -void platform_pm_runtime_init(struct pm_runtime_data *prd); - -/** - * \brief Retrieves platform specific power management resource. - * - * \param[in] context - Type of power management context. - * \param[in] index - index of the device. - * \param[in] flags - Flags, set of RPM_... - */ -void platform_pm_runtime_get(uint32_t context, uint32_t index, uint32_t flags); - -/** - * \brief Releases platform specific power management resource. - * - * \param[in] context - Type of power management context. - * \param[in] index - Index of the device. - * \param[in] flags - Flags, set of RPM_... - */ -void platform_pm_runtime_put(uint32_t context, uint32_t index, uint32_t flags); - -void platform_pm_runtime_prepare_d0ix_en(uint32_t index); - -void platform_pm_runtime_enable(uint32_t context, uint32_t index); - -void platform_pm_runtime_disable(uint32_t context, uint32_t index); - -bool platform_pm_runtime_is_active(uint32_t context, uint32_t index); - -void platform_pm_runtime_power_off(void); - -#endif /* __PLATFORM_LIB_PM_RUNTIME_H__ */ - -#else - -#error "This file shouldn't be included from outside of sof/lib/pm_runtime.h" - -#endif /* __SOF_LIB_PM_RUNTIME_H__ */ diff --git a/src/platform/meteorlake/include/platform/lib/pm_runtime.h b/src/platform/meteorlake/include/platform/lib/pm_runtime.h deleted file mode 100644 index bbf7c018e904..000000000000 --- a/src/platform/meteorlake/include/platform/lib/pm_runtime.h +++ /dev/null @@ -1,70 +0,0 @@ -/* SPDX-License-Identifier: BSD-3-Clause - * - * Copyright(c) 2022 Intel Corporation. All rights reserved. - * - * Author: Tomasz Lauda - */ - -/** - * \file platform/tigerlake/include/platform/lib/pm_runtime.h - * \brief Runtime power management header file for Tigerlake - * \author Tomasz Lauda - */ - -#ifdef __SOF_LIB_PM_RUNTIME_H__ - -#ifndef __PLATFORM_LIB_PM_RUNTIME_H__ -#define __PLATFORM_LIB_PM_RUNTIME_H__ - -#include -#include - -/** - * \brief extra pwr flag to power up a core with a specific reason - * it can be powered down only with the same reason (flag) - */ -#define PWRD_MASK MASK(31, 30) -#define PWRD_BY_HPRO BIT(31) /**< requested by HPRO */ -#define PWRD_BY_TPLG BIT(30) /**< typical power up */ - -struct pm_runtime_data; - -/** - * \brief Initializes platform specific runtime power management. - * \param[in,out] prd Runtime power management data. - */ -void platform_pm_runtime_init(struct pm_runtime_data *prd); - -/** - * \brief Retrieves platform specific power management resource. - * - * \param[in] context Type of power management context. - * \param[in] index Index of the device. - * \param[in] flags Flags, set of RPM_... - */ -void platform_pm_runtime_get(uint32_t context, uint32_t index, uint32_t flags); - -/** - * \brief Releases platform specific power management resource. - * - * \param[in] context Type of power management context. - * \param[in] index Index of the device. - * \param[in] flags Flags, set of RPM_... - */ -void platform_pm_runtime_put(uint32_t context, uint32_t index, uint32_t flags); - -void platform_pm_runtime_prepare_d0ix_en(uint32_t index); - -void platform_pm_runtime_enable(uint32_t context, uint32_t index); - -void platform_pm_runtime_disable(uint32_t context, uint32_t index); - -bool platform_pm_runtime_is_active(uint32_t context, uint32_t index); - -#endif /* __PLATFORM_LIB_PM_RUNTIME_H__ */ - -#else - -#error "This file shouldn't be included from outside of sof/lib/pm_runtime.h" - -#endif /* __SOF_LIB_PM_RUNTIME_H__ */ diff --git a/src/platform/pantherlake/include/platform/lib/pm_runtime.h b/src/platform/pantherlake/include/platform/lib/pm_runtime.h deleted file mode 100644 index edb1ebdeee49..000000000000 --- a/src/platform/pantherlake/include/platform/lib/pm_runtime.h +++ /dev/null @@ -1,72 +0,0 @@ -/* SPDX-License-Identifier: BSD-3-Clause - * - * Copyright(c) 2022-2024 Intel Corporation. - * - * Author: Tomasz Lauda - */ - -/** - * \file platform/pantherlake/include/platform/lib/pm_runtime.h - * \brief Runtime power management header file for Tigerlake - * \author Tomasz Lauda - */ - -#ifdef __SOF_LIB_PM_RUNTIME_H__ - -#ifndef __PLATFORM_LIB_PM_RUNTIME_H__ -#define __PLATFORM_LIB_PM_RUNTIME_H__ - -#include -#include - -/** - * \brief extra pwr flag to power up a core with a specific reason - * it can be powered down only with the same reason (flag) - */ -#define PWRD_MASK MASK(31, 30) -#define PWRD_BY_HPRO BIT(31) /**< requested by HPRO */ -#define PWRD_BY_TPLG BIT(30) /**< typical power up */ - -struct pm_runtime_data; - -/** - * \brief Initializes platform specific runtime power management. - * \param[in,out] prd Runtime power management data. - */ -void platform_pm_runtime_init(struct pm_runtime_data *prd); - -/** - * \brief Retrieves platform specific power management resource. - * - * \param[in] context Type of power management context. - * \param[in] index of the device. - * \param[in] flags, set of RPM_... - */ -void platform_pm_runtime_get(uint32_t context, uint32_t index, uint32_t flags); - -/** - * \brief Releases platform specific power management resource. - * - * \param[in] context Type of power management context. - * \param[in] index of the device. - * \param[in] flags, set of RPM_... - */ -void platform_pm_runtime_put(uint32_t context, uint32_t index, uint32_t flags); - -void platform_pm_runtime_prepare_d0ix_en(uint32_t index); - -void platform_pm_runtime_enable(uint32_t context, uint32_t index); - -void platform_pm_runtime_disable(uint32_t context, uint32_t index); - -bool platform_pm_runtime_is_active(uint32_t context, uint32_t index); - -void platform_pm_runtime_power_off(void); - -#endif /* __PLATFORM_LIB_PM_RUNTIME_H__ */ - -#else - -#error "This file shouldn't be included from outside of sof/lib/pm_runtime.h" - -#endif /* __SOF_LIB_PM_RUNTIME_H__ */ diff --git a/src/platform/tigerlake/include/platform/lib/pm_runtime.h b/src/platform/tigerlake/include/platform/lib/pm_runtime.h deleted file mode 100644 index fbc670e5baec..000000000000 --- a/src/platform/tigerlake/include/platform/lib/pm_runtime.h +++ /dev/null @@ -1,27 +0,0 @@ -/* SPDX-License-Identifier: BSD-3-Clause - * - * Copyright(c) 2018 Intel Corporation. All rights reserved. - * - * Author: Tomasz Lauda - */ - -/** - * \file platform/tigerlake/include/platform/lib/pm_runtime.h - * \brief Runtime power management header file for Tigerlake - * \author Tomasz Lauda - */ - -#ifdef __SOF_LIB_PM_RUNTIME_H__ - -#ifndef __PLATFORM_LIB_PM_RUNTIME_H__ -#define __PLATFORM_LIB_PM_RUNTIME_H__ - -#include - -#endif /* __PLATFORM_LIB_PM_RUNTIME_H__ */ - -#else - -#error "This file shouldn't be included from outside of sof/lib/pm_runtime.h" - -#endif /* __SOF_LIB_PM_RUNTIME_H__ */ From 8114e4f5037f81a527748406ca87bad2647563f1 Mon Sep 17 00:00:00 2001 From: Laurentiu Mihalcea Date: Fri, 20 Sep 2024 13:19:11 +0300 Subject: [PATCH 5/5] platform: imx: remove pm_runtime.h Remove pm_runtime.h file from some imx platforms (imx93, imx8, and imx8ulp), which only support Zephyr builds. This is done because the header is no longer mandatory. The operations implemented in it were NOPs. Signed-off-by: Laurentiu Mihalcea Signed-off-by: Kai Vehmanen --- .../imx8/include/platform/lib/pm_runtime.h | 61 ------------------ .../imx8ulp/include/platform/lib/pm_runtime.h | 62 ------------------- .../include/platform/lib/pm_runtime.h | 56 ----------------- 3 files changed, 179 deletions(-) delete mode 100644 src/platform/imx8/include/platform/lib/pm_runtime.h delete mode 100644 src/platform/imx8ulp/include/platform/lib/pm_runtime.h delete mode 100644 src/platform/imx93_a55/include/platform/lib/pm_runtime.h diff --git a/src/platform/imx8/include/platform/lib/pm_runtime.h b/src/platform/imx8/include/platform/lib/pm_runtime.h deleted file mode 100644 index f2b85b2e9d4e..000000000000 --- a/src/platform/imx8/include/platform/lib/pm_runtime.h +++ /dev/null @@ -1,61 +0,0 @@ -/* SPDX-License-Identifier: BSD-3-Clause - * - * Copyright 2019 NXP - * - * Author: Daniel Baluta - */ - -#ifdef __SOF_LIB_PM_RUNTIME_H__ - -#ifndef __PLATFORM_LIB_PM_RUNTIME_H__ -#define __PLATFORM_LIB_PM_RUNTIME_H__ - -#include - -struct pm_runtime_data; - -/** - * \brief Initializes platform specific runtime power management. - * \param[in,out] prd Runtime power management data. - */ -static inline void platform_pm_runtime_init(struct pm_runtime_data *prd) { } - -/** - * \brief Retrieves platform specific power management resource. - * - * \param[in] context Type of power management context. - * \param[in] index Index of the device. - * \param[in] flags Flags, set of RPM_... - */ -static inline void platform_pm_runtime_get(uint32_t context, uint32_t index, - uint32_t flags) { } - -/** - * \brief Releases platform specific power management resource. - * - * \param[in] context Type of power management context. - * \param[in] index Index of the device. - * \param[in] flags Flags, set of RPM_... - */ -static inline void platform_pm_runtime_put(uint32_t context, uint32_t index, - uint32_t flags) { } - -static inline void platform_pm_runtime_enable(uint32_t context, - uint32_t index) {} - -static inline void platform_pm_runtime_disable(uint32_t context, - uint32_t index) {} - -static inline bool platform_pm_runtime_is_active(uint32_t context, - uint32_t index) -{ - return false; -} - -#endif /* __PLATFORM_LIB_PM_RUNTIME_H__ */ - -#else - -#error "This file shouldn't be included from outside of sof/lib/pm_runtime.h" - -#endif /* __SOF_LIB_PM_RUNTIME_H__ */ diff --git a/src/platform/imx8ulp/include/platform/lib/pm_runtime.h b/src/platform/imx8ulp/include/platform/lib/pm_runtime.h deleted file mode 100644 index e3e246cf8301..000000000000 --- a/src/platform/imx8ulp/include/platform/lib/pm_runtime.h +++ /dev/null @@ -1,62 +0,0 @@ -/* SPDX-License-Identifier: BSD-3-Clause - * - * Copyright 2021 NXP - * - * Author: Daniel Baluta - * Author: Zhang Peng - */ - -#ifdef __SOF_LIB_PM_RUNTIME_H__ - -#ifndef __PLATFORM_LIB_PM_RUNTIME_H__ -#define __PLATFORM_LIB_PM_RUNTIME_H__ - -#include - -struct pm_runtime_data; - -/** - * \brief Initializes platform specific runtime power management. - * \param[in,out] prd Runtime power management data. - */ -static inline void platform_pm_runtime_init(struct pm_runtime_data *prd) { } - -/** - * \brief Retrieves platform specific power management resource. - * - * \param[in] context Type of power management context. - * \param[in] index Index of the device. - * \param[in] flags Flags, set of RPM_... - */ -static inline void platform_pm_runtime_get(uint32_t context, uint32_t index, - uint32_t flags) { } - -/** - * \brief Releases platform specific power management resource. - * - * \param[in] context Type of power management context. - * \param[in] index Index of the device. - * \param[in] flags Flags, set of RPM_... - */ -static inline void platform_pm_runtime_put(uint32_t context, uint32_t index, - uint32_t flags) { } - -static inline void platform_pm_runtime_enable(uint32_t context, - uint32_t index) {} - -static inline void platform_pm_runtime_disable(uint32_t context, - uint32_t index) {} - -static inline bool platform_pm_runtime_is_active(uint32_t context, - uint32_t index) -{ - return false; -} - -#endif /* __PLATFORM_LIB_PM_RUNTIME_H__ */ - -#else - -#error "This file shouldn't be included from outside of sof/lib/pm_runtime.h" - -#endif /* __SOF_LIB_PM_RUNTIME_H__ */ diff --git a/src/platform/imx93_a55/include/platform/lib/pm_runtime.h b/src/platform/imx93_a55/include/platform/lib/pm_runtime.h deleted file mode 100644 index 8665518b08d5..000000000000 --- a/src/platform/imx93_a55/include/platform/lib/pm_runtime.h +++ /dev/null @@ -1,56 +0,0 @@ -/* SPDX-License-Identifier: BSD-3-Clause - * - * Copyright 2023 NXP - */ - -#ifdef __SOF_LIB_PM_RUNTIME_H__ - -#ifndef __PLATFORM_LIB_PM_RUNTIME_H__ -#define __PLATFORM_LIB_PM_RUNTIME_H__ - -/* TODO: is this required? Should this be implemented using Zephyr PM - * API? - */ -#include - -struct pm_runtime_data; - -static inline void platform_pm_runtime_init(struct pm_runtime_data *prd) -{ -} - -static inline void platform_pm_runtime_get(uint32_t context, - uint32_t index, - uint32_t flags) -{ -} - -static inline void platform_pm_runtime_put(uint32_t context, - uint32_t index, - uint32_t flags) -{ -} - -static inline void platform_pm_runtime_enable(uint32_t context, - uint32_t index) -{ -} - -static inline void platform_pm_runtime_disable(uint32_t context, - uint32_t index) -{ -} - -static inline bool platform_pm_runtime_is_active(uint32_t context, - uint32_t index) -{ - return false; -} - -#endif /* __PLATFORM_LIB_PM_RUNTIME_H__ */ - -#else - -#error "This file shouldn't be included from outside of sof/lib/pm_runtime.h" - -#endif /* __SOF_LIB_PM_RUNTIME_H__ */