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

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.com


Signed-off-by: default avatarStephen Boyd <sboyd@kernel.org>
parent 1613e604
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -46,7 +46,7 @@ static int stm32_rcc_clock_init(struct device *dev,
		struct clk_hw *hw = ERR_PTR(-ENOENT);

		if (data->check_security &&
		    data->check_security(base, cfg_clock))
		    data->check_security(dev->of_node, base, cfg_clock))
			continue;

		if (cfg_clock->func)
+1 −1
Original line number Diff line number Diff line
@@ -71,7 +71,7 @@ struct stm32_rcc_match_data {
	unsigned int			maxbinding;
	struct clk_stm32_clock_data	*clock_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);
	int (*multi_mux)(void __iomem *base, const struct clock_config *cfg);
};
+1 −1
Original line number Diff line number Diff line
@@ -1458,7 +1458,7 @@ static const struct clock_config stm32mp13_clock_cfg[] = {
	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)
{
	int sec_id = cfg->sec_id;
+287 −195

File changed.

Preview size limit exceeded, changes collapsed.