clk: imx7d: add A7-M4 AMP power management support
When M4 is active, Linux needs to take care of the power management considering M4 status, this patch adds runtime check for clock management for M4 active case. Signed-off-by: Anson Huang <Anson.Huang@nxp.com> [ Aisheng: update to CLK HW APIs ] Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>5.4-rM2-2.2.x-imx-squashed
parent
e0bbe08475
commit
a1b58d4754
|
@ -14,6 +14,7 @@
|
|||
#include <linux/of_address.h>
|
||||
#include <linux/of_irq.h>
|
||||
#include <linux/types.h>
|
||||
#include <soc/imx/src.h>
|
||||
|
||||
#include "clk.h"
|
||||
|
||||
|
@ -887,6 +888,11 @@ static void __init imx7d_clocks_init(struct device_node *ccm_node)
|
|||
|
||||
clk_set_parent(hws[IMX7D_MIPI_CSI_ROOT_SRC]->clk, hws[IMX7D_PLL_SYS_PFD3_CLK]->clk);
|
||||
|
||||
if (imx_src_is_m4_enabled()) {
|
||||
clk_set_parent(hws[IMX7D_ARM_M4_ROOT_SRC]->clk, hws[IMX7D_PLL_SYS_MAIN_240M_CLK]->clk);
|
||||
clk_prepare_enable(hws[IMX7D_ARM_M4_ROOT_CLK]->clk);
|
||||
}
|
||||
|
||||
/* use old gpt clk setting, gpt1 root clk must be twice as gpt counter freq */
|
||||
clk_set_parent(hws[IMX7D_GPT1_ROOT_SRC]->clk, hws[IMX7D_OSC_24M_CLK]->clk);
|
||||
|
||||
|
|
|
@ -161,6 +161,9 @@ void imx_register_uart_clocks(struct clk ** const clks[])
|
|||
|
||||
static int __init imx_clk_disable_uart(void)
|
||||
{
|
||||
if (imx_src_is_m4_enabled())
|
||||
return 0;
|
||||
|
||||
if (imx_keep_uart_clocks && imx_uart_clocks) {
|
||||
int i;
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
#include <linux/spinlock.h>
|
||||
#include <linux/clk-provider.h>
|
||||
#include <soc/imx/src.h>
|
||||
|
||||
extern spinlock_t imx_ccm_lock;
|
||||
|
||||
|
@ -376,7 +377,17 @@ static inline struct clk *imx_clk_gate2_cgr(const char *name,
|
|||
static inline struct clk_hw *imx_clk_hw_gate3(const char *name, const char *parent,
|
||||
void __iomem *reg, u8 shift)
|
||||
{
|
||||
return clk_hw_register_gate(NULL, name, parent,
|
||||
/*
|
||||
* per design team's suggestion, clk root is NOT consuming
|
||||
* much power, and clk root enable/disable does NOT have domain
|
||||
* control, so they suggest to leave clk root always on when
|
||||
* M4 is enabled.
|
||||
*/
|
||||
if (imx_src_is_m4_enabled())
|
||||
return clk_hw_register_fixed_factor(NULL, name, parent,
|
||||
CLK_SET_RATE_PARENT, 1, 1);
|
||||
else
|
||||
return clk_hw_register_gate(NULL, name, parent,
|
||||
CLK_SET_RATE_PARENT | CLK_OPS_PARENT_ENABLE,
|
||||
reg, shift, 0, &imx_ccm_lock);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue