Commit 60f81bfc authored by Gabriel Fernandez's avatar Gabriel Fernandez Committed by Stephen Boyd

clk: stm32mp2: use of STM32 access controller

Use an STM32 access controller to filter the registration of clocks.
If a clock is used by the security world, then it must not registered.
Signed-off-by: default avatarGabriel Fernandez <gabriel.fernandez@foss.st.com>
Link: https://lore.kernel.org/r/20240529131310.260954-2-gabriel.fernandez@foss.st.comSigned-off-by: default avatarStephen Boyd <sboyd@kernel.org>
parent 1613e604
...@@ -46,7 +46,7 @@ static int stm32_rcc_clock_init(struct device *dev, ...@@ -46,7 +46,7 @@ static int stm32_rcc_clock_init(struct device *dev,
struct clk_hw *hw = ERR_PTR(-ENOENT); struct clk_hw *hw = ERR_PTR(-ENOENT);
if (data->check_security && if (data->check_security &&
data->check_security(base, cfg_clock)) data->check_security(dev->of_node, base, cfg_clock))
continue; continue;
if (cfg_clock->func) if (cfg_clock->func)
......
...@@ -71,7 +71,7 @@ struct stm32_rcc_match_data { ...@@ -71,7 +71,7 @@ struct stm32_rcc_match_data {
unsigned int maxbinding; unsigned int maxbinding;
struct clk_stm32_clock_data *clock_data; struct clk_stm32_clock_data *clock_data;
struct clk_stm32_reset_data *reset_data; struct clk_stm32_reset_data *reset_data;
int (*check_security)(void __iomem *base, int (*check_security)(struct device_node *np, void __iomem *base,
const struct clock_config *cfg); const struct clock_config *cfg);
int (*multi_mux)(void __iomem *base, const struct clock_config *cfg); int (*multi_mux)(void __iomem *base, const struct clock_config *cfg);
}; };
......
...@@ -1458,7 +1458,7 @@ static const struct clock_config stm32mp13_clock_cfg[] = { ...@@ -1458,7 +1458,7 @@ static const struct clock_config stm32mp13_clock_cfg[] = {
STM32_COMPOSITE_CFG(CK_MCO2, ck_mco2, SECF_MCO2), STM32_COMPOSITE_CFG(CK_MCO2, ck_mco2, SECF_MCO2),
}; };
static int stm32mp13_clock_is_provided_by_secure(void __iomem *base, static int stm32mp13_clock_is_provided_by_secure(struct device_node *np, void __iomem *base,
const struct clock_config *cfg) const struct clock_config *cfg)
{ {
int sec_id = cfg->sec_id; int sec_id = cfg->sec_id;
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment