[PATCH v7 1/2] clk: stm32: introduce clocks for STM32MP257 platform

Stephen Boyd sboyd at kernel.org
Thu Dec 21 16:48:59 PST 2023


Quoting Gabriel FERNANDEZ (2023-12-21 02:31:53)
> 
> On 12/20/23 23:16, Stephen Boyd wrote:
> > Quoting gabriel.fernandez at foss.st.com (2023-12-19 05:09:08)
> >> diff --git a/drivers/clk/stm32/clk-stm32mp25.c b/drivers/clk/stm32/clk-stm32mp25.c
> >> new file mode 100644
> >> index 000000000000..313e022c6142
> >> --- /dev/null
> >> +++ b/drivers/clk/stm32/clk-stm32mp25.c
> >> @@ -0,0 +1,1826 @@
> >> +// SPDX-License-Identifier: GPL-2.0-only
> >> +/*
> >> + * Copyright (C) STMicroelectronics 2023 - All Rights Reserved
> >> + * Author: Gabriel Fernandez <gabriel.fernandez at foss.st.com> for STMicroelectronics.
> >> + */
> >> +
> >> +#include <linux/clk.h>
> >> +#include <linux/of_address.h>
> >> +#include <linux/platform_device.h>
> >> +
> >> +#include "clk-stm32-core.h"
> >> +#include "reset-stm32.h"
> >> +#include "stm32mp25_rcc.h"
> >> +
> >> +#include <dt-bindings/clock/st,stm32mp25-rcc.h>
> >> +#include <dt-bindings/reset/st,stm32mp25-rcc.h>
> >> +
> >> +static const struct clk_parent_data adc12_src[] = {
> >> +       { .name = "ck_flexgen_46" },
> > This is a new driver. Don't use .name here. Instead use .index or .hw
> > and if that can't work then use .fw_name.
> 
> These parent clocks are managed by a secure world and exposed through SCMI.
> 
> If I use .index or .fw_name, do I have to expose 122 clocks in my DT node ?
> 
> This will significantly increase the size of the DT file
> 
>              clock-names = "hse", "hsi", ..., "ck_scmi_stm500";
>              clocks = <&scmi_clk CK_SCMI_HSE>, <&scmi_clk CK_SCMI_HSI>,  
> ... ,   <&scmi_clk CK_SCMI_STM500>;
> 

Yes? We want DT to express the connections between device nodes, and if
the clks managed by SCMI are consumed here then they need to be
specified via the clocks property.

> 
> >
> >> +       { }
> >> +};
> >> +MODULE_DEVICE_TABLE(of, stm32mp25_match_data);
> >> +
> >> +static int get_clock_deps(struct device *dev)
> > What is the explanation for this function?
> 
> It 's to manage the dependency with the SCMI clock driver.

Please elaborate. Are you making sure the SCMI clk driver has probed
before this driver? Why? What's wrong with probing this driver first?



More information about the linux-arm-kernel mailing list