* [PATCH 0/7] clk: stm32mp25: add Cortex-M0 D3 clocks, ETR/STM and USB2PHY1 STP
@ 2026-10-23 13:28 Gabriel Fernandez
2026-10-23 13:28 ` [PATCH 1/7] clk: stm32mp25: define the number of clocks in the driver Gabriel Fernandez
` (6 more replies)
0 siblings, 7 replies; 8+ messages in thread
From: Gabriel Fernandez @ 2026-10-23 13:28 UTC (permalink / raw)
To: Stephen Boyd, Brian Masney, Jerome Brunet, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Maxime Coquelin,
Alexandre Torgue
Cc: linux-clk, devicetree, linux-stm32, linux-arm-kernel,
linux-kernel, Gabriel Fernandez, Gwenael Treuveur
This series updates the STM32MP25 RCC bindings and clock driver:
- Patch 1 makes the driver define the number of clocks of its provider
(STM32MP25_LAST_CLK) instead of taking it from the binding header,
and drops it from that header. That value is not part of the binding
ABI and would have to change each time an ID is added. This is
already how the STM32MP21 clock driver does it. No functional
change. The driver and the header are changed by the same patch,
as the macro has the same name in both. The driver patches 5 and 7
then update the number of clocks.
- Patches 2-3 align the ETR and STM clocks with the reference manual:
add their kernel clocks and rename the bus clocks and the
RCC_STMCFGR register accordingly. The values of the renamed
identifiers are unchanged and they have no user in the tree.
- Patches 4-5 add the clocks to allocate the D3 peripherals to the
Cortex-M0 (CPU3) and to enable their autonomous mode. The binding
patch also adds the HSI, HSE and MSI kernel clocks as three new RCC
input clocks. They are optional (minItems), so that the existing
device trees remain valid.
- Patches 6-7 add the ck_ker_usb2phy1_stp clock needed by USB host
low power support, with the HSE kernel clock introduced by patch 5
as parent to keep it running in low power modes.
The patches are kept in one series because the binding identifiers are
allocated sequentially in the same header, and patch 7 uses the HSE
kernel clock parent added by patch 5.
Signed-off-by: Gabriel Fernandez <gabriel.fernandez@foss.st.com>
---
Gabriel Fernandez (6):
clk: stm32mp25: define the number of clocks in the driver
dt-bindings: stm32: add kernel clocks for ETR and STM
clk: stm32mp25: update register with reference manual
clk: stm32mp25: add clock for D3 peripherals allocation for Cortex-CM0
dt-bindings: stm32: add binding for usb2phy1stp clock on stm32mp25
clk: stm32mp25: add ck_ker_usb2phy1_stp clock
Gwenael Treuveur (1):
dt-bindings: stm32: add clock binding for Cortex-CM0 on stm32mp25 platform
.../bindings/clock/st,stm32mp25-rcc.yaml | 9 +-
drivers/clk/stm32/clk-stm32mp25.c | 216 +++++++++++++++++++++
drivers/clk/stm32/stm32mp25_rcc.h | 2 +-
include/dt-bindings/clock/st,stm32mp25-rcc.h | 48 ++++-
4 files changed, 268 insertions(+), 7 deletions(-)
---
base-commit: a90ee4305c4a5df72c11b31dacfdc76e00fcf78a
change-id: 20261022-ups_mp25_clk_update-7f1a03b1c6f2
Best regards,
--
Gabriel Fernandez <gabriel.fernandez@foss.st.com>
^ permalink raw reply [flat|nested] 8+ messages in thread* [PATCH 1/7] clk: stm32mp25: define the number of clocks in the driver 2026-10-23 13:28 [PATCH 0/7] clk: stm32mp25: add Cortex-M0 D3 clocks, ETR/STM and USB2PHY1 STP Gabriel Fernandez @ 2026-10-23 13:28 ` Gabriel Fernandez 2026-10-23 13:28 ` [PATCH 2/7] dt-bindings: stm32: add kernel clocks for ETR and STM Gabriel Fernandez ` (5 subsequent siblings) 6 siblings, 0 replies; 8+ messages in thread From: Gabriel Fernandez @ 2026-10-23 13:28 UTC (permalink / raw) To: Stephen Boyd, Brian Masney, Jerome Brunet, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Maxime Coquelin, Alexandre Torgue Cc: linux-clk, devicetree, linux-stm32, linux-arm-kernel, linux-kernel, Gabriel Fernandez The size of the clock provider is given by STM32MP25_LAST_CLK, defined in the binding header. This is not part of the binding ABI: it has to be updated each time an ID is added, and the number of clocks handled by a given driver does not belong to a binding. Define the number of clocks in the driver instead, as done for the STM32MP21 driver, and drop it from the binding header. Both are done in the same patch as the macro has the same name in the two places. No functional change, the value is unchanged (344). Signed-off-by: Gabriel Fernandez <gabriel.fernandez@foss.st.com> --- drivers/clk/stm32/clk-stm32mp25.c | 3 +++ include/dt-bindings/clock/st,stm32mp25-rcc.h | 2 -- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/clk/stm32/clk-stm32mp25.c b/drivers/clk/stm32/clk-stm32mp25.c index eb0bc918ecee..fa025a9f3f37 100644 --- a/drivers/clk/stm32/clk-stm32mp25.c +++ b/drivers/clk/stm32/clk-stm32mp25.c @@ -17,6 +17,9 @@ #include <dt-bindings/clock/st,stm32mp25-rcc.h> #include <dt-bindings/reset/st,stm32mp25-rcc.h> +/* Number of clock identifiers of the binding, SCMI ones excluded: highest ID + 1 */ +#define STM32MP25_LAST_CLK (HSE_DIV2_CK + 1) + /* Clock security definition */ #define SECF_NONE -1 diff --git a/include/dt-bindings/clock/st,stm32mp25-rcc.h b/include/dt-bindings/clock/st,stm32mp25-rcc.h index b6cf05ad4be6..242f61205a9f 100644 --- a/include/dt-bindings/clock/st,stm32mp25-rcc.h +++ b/include/dt-bindings/clock/st,stm32mp25-rcc.h @@ -364,8 +364,6 @@ #define CK_BUS_ETHSWACMMSG 342 #define HSE_DIV2_CK 343 -#define STM32MP25_LAST_CLK 344 - #define CK_SCMI_ICN_HS_MCU 0 #define CK_SCMI_ICN_SDMMC 1 #define CK_SCMI_ICN_DDR 2 -- 2.43.0 ^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 2/7] dt-bindings: stm32: add kernel clocks for ETR and STM 2026-10-23 13:28 [PATCH 0/7] clk: stm32mp25: add Cortex-M0 D3 clocks, ETR/STM and USB2PHY1 STP Gabriel Fernandez 2026-10-23 13:28 ` [PATCH 1/7] clk: stm32mp25: define the number of clocks in the driver Gabriel Fernandez @ 2026-10-23 13:28 ` Gabriel Fernandez 2026-10-23 13:28 ` [PATCH 3/7] clk: stm32mp25: update register with reference manual Gabriel Fernandez ` (4 subsequent siblings) 6 siblings, 0 replies; 8+ messages in thread From: Gabriel Fernandez @ 2026-10-23 13:28 UTC (permalink / raw) To: Stephen Boyd, Brian Masney, Jerome Brunet, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Maxime Coquelin, Alexandre Torgue Cc: linux-clk, devicetree, linux-stm32, linux-arm-kernel, linux-kernel, Gabriel Fernandez Add the kernel clocks of the ETR (CK_KER_ETR) and of the STM (CK_KER_STM) for STM32MP25, with the matching SCMI clocks (CK_SCMI_KER_ETR and CK_SCMI_KER_STM). These are the trace (ATB) clocks of the CoreSight Embedded Trace Router and System Trace Macrocell, while the bus clocks only provide register access (APB). Also rename the bus clocks according to the reference manual, without changing their values: CK_BUS_STM500 into CK_BUS_STM, CK_SCMI_STM500 into CK_SCMI_BUS_STM and CK_SCMI_ETR into CK_SCMI_BUS_ETR. Signed-off-by: Gabriel Fernandez <gabriel.fernandez@foss.st.com> --- include/dt-bindings/clock/st,stm32mp25-rcc.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/include/dt-bindings/clock/st,stm32mp25-rcc.h b/include/dt-bindings/clock/st,stm32mp25-rcc.h index 242f61205a9f..cef997508b56 100644 --- a/include/dt-bindings/clock/st,stm32mp25-rcc.h +++ b/include/dt-bindings/clock/st,stm32mp25-rcc.h @@ -109,7 +109,7 @@ /* LOW SPEED MCU CLOCK */ #define CK_ICN_LS_MCU 88 -#define CK_BUS_STM500 89 +#define CK_BUS_STM 89 #define CK_BUS_FMC 90 #define CK_BUS_GPU 91 #define CK_BUS_ETH1 92 @@ -363,6 +363,8 @@ #define CK_BUS_ETHSWACMCFG 341 #define CK_BUS_ETHSWACMMSG 342 #define HSE_DIV2_CK 343 +#define CK_KER_ETR 344 +#define CK_KER_STM 345 #define CK_SCMI_ICN_HS_MCU 0 #define CK_SCMI_ICN_SDMMC 1 @@ -450,7 +452,7 @@ #define CK_SCMI_TIMG2 83 #define CK_SCMI_BKPSRAM 84 #define CK_SCMI_BSEC 85 -#define CK_SCMI_ETR 87 +#define CK_SCMI_BUS_ETR 87 #define CK_SCMI_FMC 88 #define CK_SCMI_GPIOA 89 #define CK_SCMI_GPIOB 90 @@ -485,6 +487,8 @@ #define CK_SCMI_SYSDBG 119 #define CK_SCMI_SYSATB 120 #define CK_SCMI_TSDBG 121 -#define CK_SCMI_STM500 122 +#define CK_SCMI_BUS_STM 122 +#define CK_SCMI_KER_STM 123 +#define CK_SCMI_KER_ETR 124 #endif /* _DT_BINDINGS_STM32MP25_CLKS_H_ */ -- 2.43.0 ^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 3/7] clk: stm32mp25: update register with reference manual 2026-10-23 13:28 [PATCH 0/7] clk: stm32mp25: add Cortex-M0 D3 clocks, ETR/STM and USB2PHY1 STP Gabriel Fernandez 2026-10-23 13:28 ` [PATCH 1/7] clk: stm32mp25: define the number of clocks in the driver Gabriel Fernandez 2026-10-23 13:28 ` [PATCH 2/7] dt-bindings: stm32: add kernel clocks for ETR and STM Gabriel Fernandez @ 2026-10-23 13:28 ` Gabriel Fernandez 2026-10-23 13:28 ` [PATCH 4/7] dt-bindings: stm32: add clock binding for Cortex-CM0 on stm32mp25 platform Gabriel Fernandez ` (3 subsequent siblings) 6 siblings, 0 replies; 8+ messages in thread From: Gabriel Fernandez @ 2026-10-23 13:28 UTC (permalink / raw) To: Stephen Boyd, Brian Masney, Jerome Brunet, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Maxime Coquelin, Alexandre Torgue Cc: linux-clk, devicetree, linux-stm32, linux-arm-kernel, linux-kernel, Gabriel Fernandez Rename RCC_STM500CFGR into RCC_STMCFGR to match the reference manual. No functional change. Signed-off-by: Gabriel Fernandez <gabriel.fernandez@foss.st.com> --- drivers/clk/stm32/stm32mp25_rcc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/clk/stm32/stm32mp25_rcc.h b/drivers/clk/stm32/stm32mp25_rcc.h index 687bc6a78627..421c74dadf8c 100644 --- a/drivers/clk/stm32/stm32mp25_rcc.h +++ b/drivers/clk/stm32/stm32mp25_rcc.h @@ -319,7 +319,7 @@ #define RCC_OSPI2CFGR 0x518 #define RCC_FMCCFGR 0x51C #define RCC_DBGCFGR 0x520 -#define RCC_STM500CFGR 0x524 +#define RCC_STMCFGR 0x524 #define RCC_ETRCFGR 0x528 #define RCC_GPIOACFGR 0x52C #define RCC_GPIOBCFGR 0x530 -- 2.43.0 ^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 4/7] dt-bindings: stm32: add clock binding for Cortex-CM0 on stm32mp25 platform 2026-10-23 13:28 [PATCH 0/7] clk: stm32mp25: add Cortex-M0 D3 clocks, ETR/STM and USB2PHY1 STP Gabriel Fernandez ` (2 preceding siblings ...) 2026-10-23 13:28 ` [PATCH 3/7] clk: stm32mp25: update register with reference manual Gabriel Fernandez @ 2026-10-23 13:28 ` Gabriel Fernandez 2026-10-23 13:28 ` [PATCH 5/7] clk: stm32mp25: add clock for D3 peripherals allocation for Cortex-CM0 Gabriel Fernandez ` (2 subsequent siblings) 6 siblings, 0 replies; 8+ messages in thread From: Gabriel Fernandez @ 2026-10-23 13:28 UTC (permalink / raw) To: Stephen Boyd, Brian Masney, Jerome Brunet, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Maxime Coquelin, Alexandre Torgue Cc: linux-clk, devicetree, linux-stm32, linux-arm-kernel, linux-kernel, Gabriel Fernandez, Gwenael Treuveur From: Gwenael Treuveur <gwenael.treuveur@foss.st.com> Add the clock identifiers needed to allocate the D3 peripherals to the Cortex-M0 (CPU3 domain) and to enable their autonomous mode: - CK_CPU3 and CK_<IP>_C3: allocation of the CPU3 domain and of the D3 peripherals to CPU3 - CK_CPU3_AM and CK_<IP>_AM: autonomous mode of the CPU3 domain and of the D3 peripherals - CK_HSI_KER_ON, CK_HSE_KER_ON and CK_MSI_KER_ON: kernel clocks of the HSI, HSE and MSI oscillators Add the matching SCMI clocks: CK_SCMI_HSI_KER_ON, CK_SCMI_HSE_KER_ON, CK_SCMI_MSI_KER_ON and the autonomous mode clocks owned by the SCMI server (CK_SCMI_GPIOZ_AM, CK_SCMI_IPCC2_AM, CK_SCMI_LPDMA_AM and CK_SCMI_RTC_AM). The three kernel clocks of the HSI, HSE and MSI oscillators are also added at the end of the RCC input clocks. They are optional, so that the existing device trees remain valid. Signed-off-by: Gwenael Treuveur <gwenael.treuveur@foss.st.com> Signed-off-by: Gabriel Fernandez <gabriel.fernandez@foss.st.com> --- .../bindings/clock/st,stm32mp25-rcc.yaml | 9 +++++- include/dt-bindings/clock/st,stm32mp25-rcc.h | 35 ++++++++++++++++++++++ 2 files changed, 43 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/clock/st,stm32mp25-rcc.yaml b/Documentation/devicetree/bindings/clock/st,stm32mp25-rcc.yaml index 3b7925d2c175..423016ecb602 100644 --- a/Documentation/devicetree/bindings/clock/st,stm32mp25-rcc.yaml +++ b/Documentation/devicetree/bindings/clock/st,stm32mp25-rcc.yaml @@ -32,6 +32,7 @@ properties: const: 1 clocks: + minItems: 80 items: - description: CK_SCMI_HSE High Speed External oscillator (8 to 48 MHz) - description: CK_SCMI_HSI High Speed Internal oscillator (~ 64 MHz) @@ -113,6 +114,9 @@ properties: - description: CK_SCMI_TIMG2 Peripheral bridge for timer2 - description: CK_SCMI_PLL3 PLL3 clock - description: clk_dsi_txbyte DSI byte clock + - description: CK_SCMI_HSI_KER_ON Kernel High Speed Internal oscillator + - description: CK_SCMI_HSE_KER_ON Kernel High Speed External oscillator + - description: CK_SCMI_MSI_KER_ON Kernel Low Power Internal oscillator access-controllers: maxItems: 1 @@ -214,6 +218,9 @@ examples: <&scmi_clk CK_SCMI_TIMG1>, <&scmi_clk CK_SCMI_TIMG2>, <&scmi_clk CK_SCMI_PLL3>, - <&clk_dsi_txbyte>; + <&clk_dsi_txbyte>, + <&scmi_clk CK_SCMI_HSI_KER_ON>, + <&scmi_clk CK_SCMI_HSE_KER_ON>, + <&scmi_clk CK_SCMI_MSI_KER_ON>; }; ... diff --git a/include/dt-bindings/clock/st,stm32mp25-rcc.h b/include/dt-bindings/clock/st,stm32mp25-rcc.h index cef997508b56..53c65e9a12f6 100644 --- a/include/dt-bindings/clock/st,stm32mp25-rcc.h +++ b/include/dt-bindings/clock/st,stm32mp25-rcc.h @@ -365,6 +365,34 @@ #define HSE_DIV2_CK 343 #define CK_KER_ETR 344 #define CK_KER_STM 345 +#define CK_HSI_KER_ON 346 +#define CK_HSE_KER_ON 347 +#define CK_MSI_KER_ON 348 +#define CK_CPU3 349 +#define CK_ADF1_C3 350 +#define CK_GPIOZ_C3 351 +#define CK_I2C8_C3 352 +#define CK_I3C4_C3 353 +#define CK_LPDMA_C3 354 +#define CK_LPTIM3_C3 355 +#define CK_LPTIM4_C3 356 +#define CK_LPTIM5_C3 357 +#define CK_LPUART1_C3 358 +#define CK_RTC_C3 359 +#define CK_SPI8_C3 360 +#define CK_ADF1_AM 361 +#define CK_CPU3_AM 362 +#define CK_GPIOZ_AM 363 +#define CK_I2C8_AM 364 +#define CK_I3C4_AM 365 +#define CK_IPCC2_AM 366 +#define CK_LPDMA_AM 367 +#define CK_LPTIM3_AM 368 +#define CK_LPTIM4_AM 369 +#define CK_LPTIM5_AM 370 +#define CK_LPUART1_AM 371 +#define CK_RTC_AM 372 +#define CK_SPI8_AM 373 #define CK_SCMI_ICN_HS_MCU 0 #define CK_SCMI_ICN_SDMMC 1 @@ -490,5 +518,12 @@ #define CK_SCMI_BUS_STM 122 #define CK_SCMI_KER_STM 123 #define CK_SCMI_KER_ETR 124 +#define CK_SCMI_HSI_KER_ON 125 +#define CK_SCMI_HSE_KER_ON 126 +#define CK_SCMI_MSI_KER_ON 127 +#define CK_SCMI_GPIOZ_AM 128 +#define CK_SCMI_IPCC2_AM 129 +#define CK_SCMI_LPDMA_AM 130 +#define CK_SCMI_RTC_AM 131 #endif /* _DT_BINDINGS_STM32MP25_CLKS_H_ */ -- 2.43.0 ^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 5/7] clk: stm32mp25: add clock for D3 peripherals allocation for Cortex-CM0 2026-10-23 13:28 [PATCH 0/7] clk: stm32mp25: add Cortex-M0 D3 clocks, ETR/STM and USB2PHY1 STP Gabriel Fernandez ` (3 preceding siblings ...) 2026-10-23 13:28 ` [PATCH 4/7] dt-bindings: stm32: add clock binding for Cortex-CM0 on stm32mp25 platform Gabriel Fernandez @ 2026-10-23 13:28 ` Gabriel Fernandez 2026-10-23 13:28 ` [PATCH 6/7] dt-bindings: stm32: add binding for usb2phy1stp clock on stm32mp25 Gabriel Fernandez 2026-10-23 13:28 ` [PATCH 7/7] clk: stm32mp25: add ck_ker_usb2phy1_stp clock Gabriel Fernandez 6 siblings, 0 replies; 8+ messages in thread From: Gabriel Fernandez @ 2026-10-23 13:28 UTC (permalink / raw) To: Stephen Boyd, Brian Masney, Jerome Brunet, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Maxime Coquelin, Alexandre Torgue Cc: linux-clk, devicetree, linux-stm32, linux-arm-kernel, linux-kernel, Gabriel Fernandez, Gwenael Treuveur GATE_<IP>AM allows to enable the Autonomous Mode of the D3 peripherals. GATE_<IP>C3 allows to enable the allocation of the peripherals to CPU3. For any D3 peripheral allocated to CPU3 (CPU3 domain is used and AMEN), MSIKERON must be set to allow the Stop modes. That is why all the autonomous clocks have the MSI KER clock as their parent. Add the HSI KER, HSE KER and MSI KER clocks as new RCC input clocks and register the C3 reset. Update the number of clocks of the provider to cover the new IDs. Signed-off-by: Gwenael Treuveur <gwenael.treuveur@foss.st.com> Signed-off-by: Gabriel Fernandez <gabriel.fernandez@foss.st.com> --- drivers/clk/stm32/clk-stm32mp25.c | 176 +++++++++++++++++++++++++++++++++++++- 1 file changed, 175 insertions(+), 1 deletion(-) diff --git a/drivers/clk/stm32/clk-stm32mp25.c b/drivers/clk/stm32/clk-stm32mp25.c index fa025a9f3f37..a6a1293370eb 100644 --- a/drivers/clk/stm32/clk-stm32mp25.c +++ b/drivers/clk/stm32/clk-stm32mp25.c @@ -18,7 +18,7 @@ #include <dt-bindings/reset/st,stm32mp25-rcc.h> /* Number of clock identifiers of the binding, SCMI ones excluded: highest ID + 1 */ -#define STM32MP25_LAST_CLK (HSE_DIV2_CK + 1) +#define STM32MP25_LAST_CLK (CK_SPI8_AM + 1) /* Clock security definition */ #define SECF_NONE -1 @@ -38,6 +38,7 @@ /* Register: RIFSC_SEMCR */ #define RCC_SEMCR_SEMCID_MASK GENMASK(6, 4) +#define MP25_RIF_RCC_C3 72 #define MP25_RIF_RCC_IS2M 107 #define MP25_RIF_RCC_MCO1 108 #define MP25_RIF_RCC_MCO2 109 @@ -126,6 +127,9 @@ enum { TIMG2, PLL3, DSI_TXBYTE, + HSI_KER_ON, + HSE_KER_ON, + MSI_KER_ON, }; static const struct clk_parent_data adc12_src[] = { @@ -225,6 +229,10 @@ enum enum_gate_cfg { GATE_ADC12, GATE_ADC3, GATE_ADF1, + GATE_ADF1AM, + GATE_ADF1C3, + GATE_C3, + GATE_C3AM, GATE_CCI, GATE_CRC, GATE_CRYP1, @@ -249,6 +257,7 @@ enum enum_gate_cfg { GATE_ETHSWMAC, GATE_ETHSWREF, GATE_FDCAN, + GATE_GPIOZC3, GATE_GPU, GATE_HASH, GATE_HDP, @@ -260,22 +269,35 @@ enum enum_gate_cfg { GATE_I2C6, GATE_I2C7, GATE_I2C8, + GATE_I2C8AM, + GATE_I2C8C3, GATE_I3C1, GATE_I3C2, GATE_I3C3, GATE_I3C4, + GATE_I3C4AM, + GATE_I3C4C3, GATE_IS2M, GATE_IWDG1, GATE_IWDG2, GATE_IWDG3, GATE_IWDG4, GATE_IWDG5, + GATE_LPDMAC3, GATE_LPTIM1, GATE_LPTIM2, GATE_LPTIM3, + GATE_LPTIM3AM, + GATE_LPTIM3C3, GATE_LPTIM4, + GATE_LPTIM4AM, + GATE_LPTIM4C3, GATE_LPTIM5, + GATE_LPTIM5AM, + GATE_LPTIM5C3, GATE_LPUART1, + GATE_LPUART1AM, + GATE_LPUART1C3, GATE_LTDC, GATE_LVDS, GATE_MCO1, @@ -285,6 +307,7 @@ enum enum_gate_cfg { GATE_PCIE, GATE_PKA, GATE_RNG, + GATE_RTCC3, GATE_SAES, GATE_SAI1, GATE_SAI2, @@ -303,6 +326,8 @@ enum enum_gate_cfg { GATE_SPI6, GATE_SPI7, GATE_SPI8, + GATE_SPI8AM, + GATE_SPI8C3, GATE_TIM1, GATE_TIM10, GATE_TIM11, @@ -354,6 +379,10 @@ static const struct stm32_gate_cfg stm32mp25_gates[GATE_NB] = { GATE_CFG(GATE_ADC12, RCC_ADC12CFGR, 1, 0), GATE_CFG(GATE_ADC3, RCC_ADC3CFGR, 1, 0), GATE_CFG(GATE_ADF1, RCC_ADF1CFGR, 1, 0), + GATE_CFG(GATE_ADF1AM, RCC_ADF1CFGR, 3, 0), + GATE_CFG(GATE_ADF1C3, RCC_C3CFGR, 23, 0), + GATE_CFG(GATE_C3, RCC_C3CFGR, 1, 0), + GATE_CFG(GATE_C3AM, RCC_C3CFGR, 3, 0), GATE_CFG(GATE_CCI, RCC_CCICFGR, 1, 0), GATE_CFG(GATE_CRC, RCC_CRCCFGR, 1, 0), GATE_CFG(GATE_CRYP1, RCC_CRYP1CFGR, 1, 0), @@ -378,6 +407,7 @@ static const struct stm32_gate_cfg stm32mp25_gates[GATE_NB] = { GATE_CFG(GATE_ETHSWMAC, RCC_ETHSWCFGR, 1, 0), GATE_CFG(GATE_ETHSWREF, RCC_ETHSWCFGR, 21, 0), GATE_CFG(GATE_FDCAN, RCC_FDCANCFGR, 1, 0), + GATE_CFG(GATE_GPIOZC3, RCC_C3CFGR, 24, 0), GATE_CFG(GATE_GPU, RCC_GPUCFGR, 1, 0), GATE_CFG(GATE_HASH, RCC_HASHCFGR, 1, 0), GATE_CFG(GATE_HDP, RCC_HDPCFGR, 1, 0), @@ -389,22 +419,35 @@ static const struct stm32_gate_cfg stm32mp25_gates[GATE_NB] = { GATE_CFG(GATE_I2C6, RCC_I2C6CFGR, 1, 0), GATE_CFG(GATE_I2C7, RCC_I2C7CFGR, 1, 0), GATE_CFG(GATE_I2C8, RCC_I2C8CFGR, 1, 0), + GATE_CFG(GATE_I2C8AM, RCC_I2C8CFGR, 3, 0), + GATE_CFG(GATE_I2C8C3, RCC_C3CFGR, 21, 0), GATE_CFG(GATE_I3C1, RCC_I3C1CFGR, 1, 0), GATE_CFG(GATE_I3C2, RCC_I3C2CFGR, 1, 0), GATE_CFG(GATE_I3C3, RCC_I3C3CFGR, 1, 0), GATE_CFG(GATE_I3C4, RCC_I3C4CFGR, 1, 0), + GATE_CFG(GATE_I3C4AM, RCC_I3C4CFGR, 3, 0), + GATE_CFG(GATE_I3C4C3, RCC_C3CFGR, 27, 0), GATE_CFG(GATE_IS2M, RCC_IS2MCFGR, 1, 0), GATE_CFG(GATE_IWDG1, RCC_IWDG1CFGR, 1, 0), GATE_CFG(GATE_IWDG2, RCC_IWDG2CFGR, 1, 0), GATE_CFG(GATE_IWDG3, RCC_IWDG3CFGR, 1, 0), GATE_CFG(GATE_IWDG4, RCC_IWDG4CFGR, 1, 0), GATE_CFG(GATE_IWDG5, RCC_IWDG5CFGR, 1, 0), + GATE_CFG(GATE_LPDMAC3, RCC_C3CFGR, 25, 0), GATE_CFG(GATE_LPTIM1, RCC_LPTIM1CFGR, 1, 0), GATE_CFG(GATE_LPTIM2, RCC_LPTIM2CFGR, 1, 0), GATE_CFG(GATE_LPTIM3, RCC_LPTIM3CFGR, 1, 0), + GATE_CFG(GATE_LPTIM3AM, RCC_LPTIM3CFGR, 3, 0), + GATE_CFG(GATE_LPTIM3C3, RCC_C3CFGR, 16, 0), GATE_CFG(GATE_LPTIM4, RCC_LPTIM4CFGR, 1, 0), + GATE_CFG(GATE_LPTIM4AM, RCC_LPTIM4CFGR, 3, 0), + GATE_CFG(GATE_LPTIM4C3, RCC_C3CFGR, 17, 0), GATE_CFG(GATE_LPTIM5, RCC_LPTIM5CFGR, 1, 0), + GATE_CFG(GATE_LPTIM5AM, RCC_LPTIM5CFGR, 3, 0), + GATE_CFG(GATE_LPTIM5C3, RCC_C3CFGR, 18, 0), GATE_CFG(GATE_LPUART1, RCC_LPUART1CFGR, 1, 0), + GATE_CFG(GATE_LPUART1AM, RCC_LPUART1CFGR, 3, 0), + GATE_CFG(GATE_LPUART1C3, RCC_C3CFGR, 20, 0), GATE_CFG(GATE_LTDC, RCC_LTDCCFGR, 1, 0), GATE_CFG(GATE_LVDS, RCC_LVDSCFGR, 1, 0), GATE_CFG(GATE_MCO1, RCC_MCO1CFGR, 8, 0), @@ -413,6 +456,7 @@ static const struct stm32_gate_cfg stm32mp25_gates[GATE_NB] = { GATE_CFG(GATE_OSPIIOM, RCC_OSPIIOMCFGR, 1, 0), GATE_CFG(GATE_PCIE, RCC_PCIECFGR, 1, 0), GATE_CFG(GATE_PKA, RCC_PKACFGR, 1, 0), + GATE_CFG(GATE_RTCC3, RCC_C3CFGR, 26, 0), GATE_CFG(GATE_RNG, RCC_RNGCFGR, 1, 0), GATE_CFG(GATE_SAES, RCC_SAESCFGR, 1, 0), GATE_CFG(GATE_SAI1, RCC_SAI1CFGR, 1, 0), @@ -432,6 +476,8 @@ static const struct stm32_gate_cfg stm32mp25_gates[GATE_NB] = { GATE_CFG(GATE_SPI6, RCC_SPI6CFGR, 1, 0), GATE_CFG(GATE_SPI7, RCC_SPI7CFGR, 1, 0), GATE_CFG(GATE_SPI8, RCC_SPI8CFGR, 1, 0), + GATE_CFG(GATE_SPI8AM, RCC_SPI8CFGR, 3, 0), + GATE_CFG(GATE_SPI8C3, RCC_C3CFGR, 19, 0), GATE_CFG(GATE_TIM1, RCC_TIM1CFGR, 1, 0), GATE_CFG(GATE_TIM10, RCC_TIM10CFGR, 1, 0), GATE_CFG(GATE_TIM11, RCC_TIM11CFGR, 1, 0), @@ -518,6 +564,77 @@ static struct clk_stm32_gate ck_ker_adf1 = { .hw.init = CLK_HW_INIT_INDEX("ck_ker_adf1", FLEXGEN_42, &clk_stm32_gate_ops, 0), }; +static struct clk_stm32_gate ck_ker_adf1_am = { + .gate_id = GATE_ADF1AM, + .hw.init = CLK_HW_INIT_HW("ck_ker_adf1_am", &ck_ker_adf1.hw, &clk_stm32_gate_ops, 0), +}; + +/* C3 */ +static struct clk_stm32_gate ck_cpu3 = { + .gate_id = GATE_C3, + .hw.init = CLK_HW_INIT_INDEX("ck_cpu3", ICN_LS_MCU, &clk_stm32_gate_ops, 0), +}; + +static struct clk_stm32_gate ck_cpu3_am = { + .gate_id = GATE_C3AM, + .hw.init = CLK_HW_INIT_HW("ck_cpu3_am", &ck_cpu3.hw, &clk_stm32_gate_ops, 0), +}; + +static struct clk_stm32_gate ck_c3_adf1 = { + .gate_id = GATE_ADF1C3, + .hw.init = CLK_HW_INIT_INDEX("ck_c3_adf1", MSI_KER_ON, &clk_stm32_gate_ops, 0), +}; + +static struct clk_stm32_gate ck_c3_gpioz = { + .gate_id = GATE_GPIOZC3, + .hw.init = CLK_HW_INIT_INDEX("ck_c3_gpioz", MSI_KER_ON, &clk_stm32_gate_ops, 0), +}; + +static struct clk_stm32_gate ck_c3_i2c8 = { + .gate_id = GATE_I2C8C3, + .hw.init = CLK_HW_INIT_INDEX("ck_c3_i2c8", MSI_KER_ON, &clk_stm32_gate_ops, 0), +}; + +static struct clk_stm32_gate ck_c3_i3c4 = { + .gate_id = GATE_I3C4C3, + .hw.init = CLK_HW_INIT_INDEX("ck_c3_i3c4", MSI_KER_ON, &clk_stm32_gate_ops, 0), +}; + +static struct clk_stm32_gate ck_c3_lpdma = { + .gate_id = GATE_LPDMAC3, + .hw.init = CLK_HW_INIT_INDEX("ck_c3_lpdma", MSI_KER_ON, &clk_stm32_gate_ops, 0), +}; + +static struct clk_stm32_gate ck_c3_lptim3 = { + .gate_id = GATE_LPTIM3C3, + .hw.init = CLK_HW_INIT_INDEX("ck_c3_lptim3", MSI_KER_ON, &clk_stm32_gate_ops, 0), +}; + +static struct clk_stm32_gate ck_c3_lptim4 = { + .gate_id = GATE_LPTIM4C3, + .hw.init = CLK_HW_INIT_INDEX("ck_c3_lptim4", MSI_KER_ON, &clk_stm32_gate_ops, 0), +}; + +static struct clk_stm32_gate ck_c3_lptim5 = { + .gate_id = GATE_LPTIM5C3, + .hw.init = CLK_HW_INIT_INDEX("ck_c3_lptim5", MSI_KER_ON, &clk_stm32_gate_ops, 0), +}; + +static struct clk_stm32_gate ck_c3_lpuart1 = { + .gate_id = GATE_LPUART1C3, + .hw.init = CLK_HW_INIT_INDEX("ck_c3_lpuart1", MSI_KER_ON, &clk_stm32_gate_ops, 0), +}; + +static struct clk_stm32_gate ck_c3_rtc = { + .gate_id = GATE_RTCC3, + .hw.init = CLK_HW_INIT_INDEX("ck_c3_rtc", MSI_KER_ON, &clk_stm32_gate_ops, 0), +}; + +static struct clk_stm32_gate ck_c3_spi8 = { + .gate_id = GATE_SPI8C3, + .hw.init = CLK_HW_INIT_INDEX("ck_c3_spi8", MSI_KER_ON, &clk_stm32_gate_ops, 0), +}; + /* DCMI */ static struct clk_stm32_gate ck_icn_p_cci = { .gate_id = GATE_CCI, @@ -844,6 +961,11 @@ static struct clk_stm32_gate ck_ker_i2c8 = { .hw.init = CLK_HW_INIT_INDEX("ck_ker_i2c8", FLEXGEN_38, &clk_stm32_gate_ops, 0), }; +static struct clk_stm32_gate ck_ker_i2c8_am = { + .gate_id = GATE_I2C8AM, + .hw.init = CLK_HW_INIT_HW("ck_ker_i2c8_am", &ck_ker_i2c8.hw, &clk_stm32_gate_ops, 0), +}; + /* I3C */ static struct clk_stm32_gate ck_icn_p_i3c1 = { .gate_id = GATE_I3C1, @@ -885,6 +1007,11 @@ static struct clk_stm32_gate ck_ker_i3c4 = { .hw.init = CLK_HW_INIT_INDEX("ck_ker_i3c4", FLEXGEN_36, &clk_stm32_gate_ops, 0), }; +static struct clk_stm32_gate ck_ker_i3c4_am = { + .gate_id = GATE_I3C4AM, + .hw.init = CLK_HW_INIT_HW("ck_ker_i3c4_am", &ck_ker_i3c4.hw, &clk_stm32_gate_ops, 0), +}; + /* I2S */ static struct clk_stm32_gate ck_icn_p_is2m = { .gate_id = GATE_IS2M, @@ -958,16 +1085,31 @@ static struct clk_stm32_gate ck_ker_lptim3 = { .hw.init = CLK_HW_INIT_INDEX("ck_ker_lptim3", FLEXGEN_40, &clk_stm32_gate_ops, 0), }; +static struct clk_stm32_gate ck_ker_lptim3_am = { + .gate_id = GATE_LPTIM3AM, + .hw.init = CLK_HW_INIT_HW("ck_ker_lptim3_am", &ck_ker_lptim3.hw, &clk_stm32_gate_ops, 0), +}; + static struct clk_stm32_gate ck_ker_lptim4 = { .gate_id = GATE_LPTIM4, .hw.init = CLK_HW_INIT_INDEX("ck_ker_lptim4", FLEXGEN_41, &clk_stm32_gate_ops, 0), }; +static struct clk_stm32_gate ck_ker_lptim4_am = { + .gate_id = GATE_LPTIM4AM, + .hw.init = CLK_HW_INIT_HW("ck_ker_lptim4_am", &ck_ker_lptim4.hw, &clk_stm32_gate_ops, 0), +}; + static struct clk_stm32_gate ck_ker_lptim5 = { .gate_id = GATE_LPTIM5, .hw.init = CLK_HW_INIT_INDEX("ck_ker_lptim5", FLEXGEN_41, &clk_stm32_gate_ops, 0), }; +static struct clk_stm32_gate ck_ker_lptim5_am = { + .gate_id = GATE_LPTIM5AM, + .hw.init = CLK_HW_INIT_HW("ck_ker_lptim5_am", &ck_ker_lptim5.hw, &clk_stm32_gate_ops, 0), +}; + /* LPUART */ static struct clk_stm32_gate ck_icn_p_lpuart1 = { .gate_id = GATE_LPUART1, @@ -979,6 +1121,11 @@ static struct clk_stm32_gate ck_ker_lpuart1 = { .hw.init = CLK_HW_INIT_INDEX("ck_ker_lpuart1", FLEXGEN_39, &clk_stm32_gate_ops, 0), }; +static struct clk_stm32_gate ck_ker_lpuart1_am = { + .gate_id = GATE_LPUART1AM, + .hw.init = CLK_HW_INIT_HW("ck_ker_lpuart1_am", &ck_ker_lpuart1.hw, &clk_stm32_gate_ops, 0), +}; + /* MCO1 & MCO2 */ static struct clk_stm32_composite ck_mco1 = { .gate_id = GATE_MCO1, @@ -1212,6 +1359,11 @@ static struct clk_stm32_gate ck_ker_spi8 = { .hw.init = CLK_HW_INIT_INDEX("ck_ker_spi8", FLEXGEN_37, &clk_stm32_gate_ops, 0), }; +static struct clk_stm32_gate ck_ker_spi8_am = { + .gate_id = GATE_SPI8AM, + .hw.init = CLK_HW_INIT_HW("ck_ker_spi8_am", &ck_ker_spi8.hw, &clk_stm32_gate_ops, 0), +}; + /* Timers */ static struct clk_stm32_gate ck_icn_p_tim2 = { .gate_id = GATE_TIM2, @@ -1787,13 +1939,34 @@ static const struct clock_config stm32mp25_clock_cfg[] = { STM32_GATE_CFG(CK_KER_CSIPHY, ck_ker_csiphy, SEC_RIFSC(86)), STM32_GATE_CFG(CK_KER_USBTC, ck_ker_usbtc, SEC_RIFSC(69)), STM32_GATE_CFG(CK_KER_I3C4, ck_ker_i3c4, SEC_RIFSC(117)), + STM32_GATE_CFG(CK_I3C4_AM, ck_ker_i3c4_am, SEC_RIFSC(117)), STM32_GATE_CFG(CK_KER_SPI8, ck_ker_spi8, SEC_RIFSC(29)), + STM32_GATE_CFG(CK_SPI8_AM, ck_ker_spi8_am, SEC_RIFSC(29)), STM32_GATE_CFG(CK_KER_I2C8, ck_ker_i2c8, SEC_RIFSC(48)), + STM32_GATE_CFG(CK_I2C8_AM, ck_ker_i2c8_am, SEC_RIFSC(48)), STM32_GATE_CFG(CK_KER_LPUART1, ck_ker_lpuart1, SEC_RIFSC(40)), + STM32_GATE_CFG(CK_LPUART1_AM, ck_ker_lpuart1_am, SEC_RIFSC(40)), STM32_GATE_CFG(CK_KER_LPTIM3, ck_ker_lptim3, SEC_RIFSC(19)), + STM32_GATE_CFG(CK_LPTIM3_AM, ck_ker_lptim3_am, SEC_RIFSC(19)), STM32_GATE_CFG(CK_KER_LPTIM4, ck_ker_lptim4, SEC_RIFSC(20)), + STM32_GATE_CFG(CK_LPTIM4_AM, ck_ker_lptim4_am, SEC_RIFSC(20)), STM32_GATE_CFG(CK_KER_LPTIM5, ck_ker_lptim5, SEC_RIFSC(21)), + STM32_GATE_CFG(CK_LPTIM5_AM, ck_ker_lptim5_am, SEC_RIFSC(21)), STM32_GATE_CFG(CK_KER_ADF1, ck_ker_adf1, SEC_RIFSC(55)), + STM32_GATE_CFG(CK_ADF1_AM, ck_ker_adf1_am, SEC_RIFSC(55)), + STM32_GATE_CFG(CK_CPU3, ck_cpu3, MP25_RIF_RCC_C3), + STM32_GATE_CFG(CK_CPU3_AM, ck_cpu3_am, MP25_RIF_RCC_C3), + STM32_GATE_CFG(CK_ADF1_C3, ck_c3_adf1, MP25_RIF_RCC_C3), + STM32_GATE_CFG(CK_GPIOZ_C3, ck_c3_gpioz, MP25_RIF_RCC_C3), + STM32_GATE_CFG(CK_I2C8_C3, ck_c3_i2c8, MP25_RIF_RCC_C3), + STM32_GATE_CFG(CK_I3C4_C3, ck_c3_i3c4, MP25_RIF_RCC_C3), + STM32_GATE_CFG(CK_LPDMA_C3, ck_c3_lpdma, MP25_RIF_RCC_C3), + STM32_GATE_CFG(CK_LPTIM3_C3, ck_c3_lptim3, MP25_RIF_RCC_C3), + STM32_GATE_CFG(CK_LPTIM4_C3, ck_c3_lptim4, MP25_RIF_RCC_C3), + STM32_GATE_CFG(CK_LPTIM5_C3, ck_c3_lptim5, MP25_RIF_RCC_C3), + STM32_GATE_CFG(CK_LPUART1_C3, ck_c3_lpuart1, MP25_RIF_RCC_C3), + STM32_GATE_CFG(CK_RTC_C3, ck_c3_rtc, MP25_RIF_RCC_C3), + STM32_GATE_CFG(CK_SPI8_C3, ck_c3_spi8, MP25_RIF_RCC_C3), STM32_GATE_CFG(CK_KER_SDMMC1, ck_ker_sdmmc1, SEC_RIFSC(76)), STM32_GATE_CFG(CK_KER_SDMMC2, ck_ker_sdmmc2, SEC_RIFSC(77)), STM32_GATE_CFG(CK_KER_SDMMC3, ck_ker_sdmmc3, SEC_RIFSC(78)), @@ -1942,6 +2115,7 @@ static const struct stm32_reset_cfg *stm32mp25_reset_cfg[STM32MP25_LAST_RESET] = RESET_MP25(CRYP1_R, RCC_CRYP1CFGR, 0, 0), RESET_MP25(CRYP2_R, RCC_CRYP2CFGR, 0, 0), RESET_MP25(PCIE_R, RCC_PCIECFGR, 0, 0), + RESET_MP25(C3_R, RCC_C3CFGR, 0, 0), }; static u16 stm32mp25_cpt_gate[GATE_NB]; -- 2.43.0 ^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 6/7] dt-bindings: stm32: add binding for usb2phy1stp clock on stm32mp25 2026-10-23 13:28 [PATCH 0/7] clk: stm32mp25: add Cortex-M0 D3 clocks, ETR/STM and USB2PHY1 STP Gabriel Fernandez ` (4 preceding siblings ...) 2026-10-23 13:28 ` [PATCH 5/7] clk: stm32mp25: add clock for D3 peripherals allocation for Cortex-CM0 Gabriel Fernandez @ 2026-10-23 13:28 ` Gabriel Fernandez 2026-10-23 13:28 ` [PATCH 7/7] clk: stm32mp25: add ck_ker_usb2phy1_stp clock Gabriel Fernandez 6 siblings, 0 replies; 8+ messages in thread From: Gabriel Fernandez @ 2026-10-23 13:28 UTC (permalink / raw) To: Stephen Boyd, Brian Masney, Jerome Brunet, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Maxime Coquelin, Alexandre Torgue Cc: linux-clk, devicetree, linux-stm32, linux-arm-kernel, linux-kernel, Gabriel Fernandez Add the ck_ker_usb2phy1_stp clock binding required for USB Host (USBH) low power support on STM32MP25. Signed-off-by: Gabriel Fernandez <gabriel.fernandez@foss.st.com> --- include/dt-bindings/clock/st,stm32mp25-rcc.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/dt-bindings/clock/st,stm32mp25-rcc.h b/include/dt-bindings/clock/st,stm32mp25-rcc.h index 53c65e9a12f6..1b0492ac31c5 100644 --- a/include/dt-bindings/clock/st,stm32mp25-rcc.h +++ b/include/dt-bindings/clock/st,stm32mp25-rcc.h @@ -393,6 +393,7 @@ #define CK_LPUART1_AM 371 #define CK_RTC_AM 372 #define CK_SPI8_AM 373 +#define CK_KER_USB2PHY1STP 374 #define CK_SCMI_ICN_HS_MCU 0 #define CK_SCMI_ICN_SDMMC 1 -- 2.43.0 ^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 7/7] clk: stm32mp25: add ck_ker_usb2phy1_stp clock 2026-10-23 13:28 [PATCH 0/7] clk: stm32mp25: add Cortex-M0 D3 clocks, ETR/STM and USB2PHY1 STP Gabriel Fernandez ` (5 preceding siblings ...) 2026-10-23 13:28 ` [PATCH 6/7] dt-bindings: stm32: add binding for usb2phy1stp clock on stm32mp25 Gabriel Fernandez @ 2026-10-23 13:28 ` Gabriel Fernandez 6 siblings, 0 replies; 8+ messages in thread From: Gabriel Fernandez @ 2026-10-23 13:28 UTC (permalink / raw) To: Stephen Boyd, Brian Masney, Jerome Brunet, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Maxime Coquelin, Alexandre Torgue Cc: linux-clk, devicetree, linux-stm32, linux-arm-kernel, linux-kernel, Gabriel Fernandez Add the ck_ker_usb2phy1_stp clock required for USB Host (USBH) low power support. Its rate is the one of ck_ker_usb2phy1. Set hse_ker_ck as the parent clock of ck_ker_usb2phy1_stp to ensure it remains active during the low power modes. Update the number of clocks of the provider to cover the new ID. Signed-off-by: Gabriel Fernandez <gabriel.fernandez@foss.st.com> --- drivers/clk/stm32/clk-stm32mp25.c | 41 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/drivers/clk/stm32/clk-stm32mp25.c b/drivers/clk/stm32/clk-stm32mp25.c index a6a1293370eb..649af99680f4 100644 --- a/drivers/clk/stm32/clk-stm32mp25.c +++ b/drivers/clk/stm32/clk-stm32mp25.c @@ -18,7 +18,7 @@ #include <dt-bindings/reset/st,stm32mp25-rcc.h> /* Number of clock identifiers of the binding, SCMI ones excluded: highest ID + 1 */ -#define STM32MP25_LAST_CLK (CK_SPI8_AM + 1) +#define STM32MP25_LAST_CLK (CK_KER_USB2PHY1STP + 1) /* Clock security definition */ #define SECF_NONE -1 @@ -356,6 +356,7 @@ enum enum_gate_cfg { GATE_USART6, GATE_USBH, GATE_USB2PHY1, + GATE_USB2PHY1STP, GATE_USB2PHY2, GATE_USB3DR, GATE_USB3PCIEPHY, @@ -506,6 +507,7 @@ static const struct stm32_gate_cfg stm32mp25_gates[GATE_NB] = { GATE_CFG(GATE_USART6, RCC_USART6CFGR, 1, 0), GATE_CFG(GATE_USBH, RCC_USBHCFGR, 1, 0), GATE_CFG(GATE_USB2PHY1, RCC_USB2PHY1CFGR, 1, 0), + GATE_CFG(GATE_USB2PHY1STP, RCC_USB2PHY1CFGR, 4, 0), GATE_CFG(GATE_USB2PHY2, RCC_USB2PHY2CFGR, 1, 0), GATE_CFG(GATE_USB3DR, RCC_USB3DRCFGR, 1, 0), GATE_CFG(GATE_USB3PCIEPHY, RCC_USB3PCIEPHYCFGR, 1, 0), @@ -1635,6 +1637,42 @@ static struct clk_stm32_composite ck_ker_usb2phy1 = { &clk_stm32_composite_ops, 0), }; +static int clk_stm32_usb2phy1_stp_enable(struct clk_hw *hw) +{ + return clk_stm32_gate_ops.enable(hw); +} + +static void clk_stm32_usb2phy1_stp_disable(struct clk_hw *hw) +{ + clk_stm32_gate_ops.disable(hw); +} + +static int clk_stm32_usb2phy1_stp_is_enabled(struct clk_hw *hw) +{ + return clk_stm32_gate_ops.is_enabled(hw); +} + +static unsigned long clk_stm32_usb2phy1_stp_recalc_rate(struct clk_hw *hw, + unsigned long parent_rate) +{ + /* The rate of ck_ker_usb2phy1_stp is the same as ck_ker_usb2phy1 */ + return clk_hw_get_rate(&ck_ker_usb2phy1.hw); +} + +static const struct clk_ops clk_stm32_usb2phy1_stp_ops = { + .enable = clk_stm32_usb2phy1_stp_enable, + .disable = clk_stm32_usb2phy1_stp_disable, + .is_enabled = clk_stm32_usb2phy1_stp_is_enabled, + .recalc_rate = clk_stm32_usb2phy1_stp_recalc_rate, +}; + +/* Parent clock of ck_ker_usb2phy1_stp is HSE_KER_ON to ensure it remains active during low power */ +static struct clk_stm32_gate ck_ker_usb2phy1_stp = { + .gate_id = GATE_USB2PHY1STP, + .hw.init = CLK_HW_INIT_INDEX("ck_ker_usb2phy1_stp", HSE_KER_ON, + &clk_stm32_usb2phy1_stp_ops, 0), +}; + /* USB2H */ static struct clk_stm32_gate ck_icn_m_usb2ehci = { .gate_id = GATE_USBH, @@ -1993,6 +2031,7 @@ static const struct clock_config stm32mp25_clock_cfg[] = { STM32_COMPOSITE_CFG(CK_KER_ADC12, ck_ker_adc12, SEC_RIFSC(58)), STM32_COMPOSITE_CFG(CK_KER_ADC3, ck_ker_adc3, SEC_RIFSC(59)), STM32_COMPOSITE_CFG(CK_KER_USB2PHY1, ck_ker_usb2phy1, SEC_RIFSC(63)), + STM32_GATE_CFG(CK_KER_USB2PHY1STP, ck_ker_usb2phy1_stp, SEC_RIFSC(63)), STM32_GATE_CFG(CK_KER_USB2PHY2, ck_ker_usb2phy2, SEC_RIFSC(63)), STM32_COMPOSITE_CFG(CK_KER_USB2PHY2EN, ck_ker_usb2phy2_en, SEC_RIFSC(63)), STM32_COMPOSITE_CFG(CK_KER_USB3PCIEPHY, ck_ker_usb3pciephy, SEC_RIFSC(67)), -- 2.43.0 ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2026-10-23 13:28 UTC | newest] Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2026-10-23 13:28 [PATCH 0/7] clk: stm32mp25: add Cortex-M0 D3 clocks, ETR/STM and USB2PHY1 STP Gabriel Fernandez 2026-10-23 13:28 ` [PATCH 1/7] clk: stm32mp25: define the number of clocks in the driver Gabriel Fernandez 2026-10-23 13:28 ` [PATCH 2/7] dt-bindings: stm32: add kernel clocks for ETR and STM Gabriel Fernandez 2026-10-23 13:28 ` [PATCH 3/7] clk: stm32mp25: update register with reference manual Gabriel Fernandez 2026-10-23 13:28 ` [PATCH 4/7] dt-bindings: stm32: add clock binding for Cortex-CM0 on stm32mp25 platform Gabriel Fernandez 2026-10-23 13:28 ` [PATCH 5/7] clk: stm32mp25: add clock for D3 peripherals allocation for Cortex-CM0 Gabriel Fernandez 2026-10-23 13:28 ` [PATCH 6/7] dt-bindings: stm32: add binding for usb2phy1stp clock on stm32mp25 Gabriel Fernandez 2026-10-23 13:28 ` [PATCH 7/7] clk: stm32mp25: add ck_ker_usb2phy1_stp clock Gabriel Fernandez
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®