* [PATCH v7 0/3] Register the STM32MP25 RCC driver as an access controller.
@ 2025-09-22 8:12 Clément Le Goffic
2025-09-22 8:12 ` [PATCH v7 1/3] dt-bindings: stm32: stm32mp25: add `#access-controller-cells` property Clément Le Goffic
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Clément Le Goffic @ 2025-09-22 8:12 UTC (permalink / raw)
To: Michael Turquette, Stephen Boyd, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Maxime Coquelin, Alexandre Torgue,
Gabriel Fernandez
Cc: linux-clk, devicetree, linux-stm32, linux-arm-kernel,
linux-kernel, Clément Le Goffic, Clément Le Goffic
The STM32MP25 RCC peripheral as an access controller is allowed to know
whether the clocks are secured or not.
The STM32MP25 RCC peripheral knows about the clock secure configuration
of all non RIF-aware peripheral.
In parallel all the RIF-aware peripheral configuration information
are known by the RIFSC peripheral which is already an access
controller.
This v7 is a subset of the v6 and other prior versions, split to simplify
the review and merging process.
Changes in v7:
- None
- Link to v6: https://lore.kernel.org/all/20250909-b4-ddrperfm-upstream-v6-2-ce082cc801b5@gmail.com/
Signed-off-by: Clément Le Goffic <legoffic.clement@gmail.com>
---
Clément Le Goffic (3):
dt-bindings: stm32: stm32mp25: add `#access-controller-cells` property
clk: stm32mp25: add firewall grant_access ops
arm64: dts: st: set rcc as an access-controller
.../bindings/clock/st,stm32mp25-rcc.yaml | 7 ++++
arch/arm64/boot/dts/st/stm32mp251.dtsi | 1 +
drivers/clk/stm32/clk-stm32mp25.c | 40 +++++++++++++++++++++-
3 files changed, 47 insertions(+), 1 deletion(-)
---
base-commit: 07e27ad16399afcd693be20211b0dfae63e0615f
change-id: 20250916-b4-rcc-upstream-8a8ea3af6a0d
prerequisite-change-id: 20250916-b4-firewall-upstream-dfe8588a21f8:v7
prerequisite-patch-id: 1ead960f405c7a2dcc9111acd0bb4c95ed33954f
Best regards,
--
Clément Le Goffic <legoffic.clement@gmail.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v7 1/3] dt-bindings: stm32: stm32mp25: add `#access-controller-cells` property
2025-09-22 8:12 [PATCH v7 0/3] Register the STM32MP25 RCC driver as an access controller Clément Le Goffic
@ 2025-09-22 8:12 ` Clément Le Goffic
2025-09-22 8:12 ` [PATCH v7 2/3] clk: stm32mp25: add firewall grant_access ops Clément Le Goffic
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Clément Le Goffic @ 2025-09-22 8:12 UTC (permalink / raw)
To: Michael Turquette, Stephen Boyd, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Maxime Coquelin, Alexandre Torgue,
Gabriel Fernandez
Cc: linux-clk, devicetree, linux-stm32, linux-arm-kernel,
linux-kernel, Clément Le Goffic, Clément Le Goffic
From: Clément Le Goffic <clement.legoffic@foss.st.com>
RCC is able to check the availability of a clock.
Allow to query the RCC with a firewall ID.
Signed-off-by: Clément Le Goffic <clement.legoffic@foss.st.com>
Acked-by: Rob Herring (Arm) <robh@kernel.org>
Signed-off-by: Clément Le Goffic <legoffic.clement@gmail.com>
---
Documentation/devicetree/bindings/clock/st,stm32mp25-rcc.yaml | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/Documentation/devicetree/bindings/clock/st,stm32mp25-rcc.yaml b/Documentation/devicetree/bindings/clock/st,stm32mp25-rcc.yaml
index 88e52f10d1ec..4d471e3d89bc 100644
--- a/Documentation/devicetree/bindings/clock/st,stm32mp25-rcc.yaml
+++ b/Documentation/devicetree/bindings/clock/st,stm32mp25-rcc.yaml
@@ -31,6 +31,11 @@ properties:
'#reset-cells':
const: 1
+ '#access-controller-cells':
+ const: 1
+ description:
+ Contains the firewall ID associated to the peripheral.
+
clocks:
items:
- description: CK_SCMI_HSE High Speed External oscillator (8 to 48 MHz)
@@ -123,6 +128,7 @@ required:
- reg
- '#clock-cells'
- '#reset-cells'
+ - '#access-controller-cells'
- clocks
additionalProperties: false
@@ -136,6 +142,7 @@ examples:
reg = <0x44200000 0x10000>;
#clock-cells = <1>;
#reset-cells = <1>;
+ #access-controller-cells = <1>;
clocks = <&scmi_clk CK_SCMI_HSE>,
<&scmi_clk CK_SCMI_HSI>,
<&scmi_clk CK_SCMI_MSI>,
--
2.43.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH v7 2/3] clk: stm32mp25: add firewall grant_access ops
2025-09-22 8:12 [PATCH v7 0/3] Register the STM32MP25 RCC driver as an access controller Clément Le Goffic
2025-09-22 8:12 ` [PATCH v7 1/3] dt-bindings: stm32: stm32mp25: add `#access-controller-cells` property Clément Le Goffic
@ 2025-09-22 8:12 ` Clément Le Goffic
2025-09-22 8:12 ` [PATCH v7 3/3] arm64: dts: st: set rcc as an access-controller Clément Le Goffic
2025-09-22 17:27 ` [PATCH v7 0/3] Register the STM32MP25 RCC driver as an access controller Rob Herring (Arm)
3 siblings, 0 replies; 5+ messages in thread
From: Clément Le Goffic @ 2025-09-22 8:12 UTC (permalink / raw)
To: Michael Turquette, Stephen Boyd, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Maxime Coquelin, Alexandre Torgue,
Gabriel Fernandez
Cc: linux-clk, devicetree, linux-stm32, linux-arm-kernel,
linux-kernel, Clément Le Goffic, Clément Le Goffic
From: Clément Le Goffic <clement.legoffic@foss.st.com>
On STM32MP25, the RCC peripheral manages the secure level of resources
that are used by other devices such as clocks.
Declare this peripheral as a firewall controller.
Signed-off-by: Clément Le Goffic <clement.legoffic@foss.st.com>
Signed-off-by: Clément Le Goffic <legoffic.clement@gmail.com>
---
drivers/clk/stm32/clk-stm32mp25.c | 40 ++++++++++++++++++++++++++++++++++++++-
1 file changed, 39 insertions(+), 1 deletion(-)
diff --git a/drivers/clk/stm32/clk-stm32mp25.c b/drivers/clk/stm32/clk-stm32mp25.c
index 52f0e8a12926..af4bc06d703a 100644
--- a/drivers/clk/stm32/clk-stm32mp25.c
+++ b/drivers/clk/stm32/clk-stm32mp25.c
@@ -4,8 +4,10 @@
* Author: Gabriel Fernandez <gabriel.fernandez@foss.st.com> for STMicroelectronics.
*/
+#include <linux/bus/stm32_firewall.h>
#include <linux/bus/stm32_firewall_device.h>
#include <linux/clk-provider.h>
+#include <linux/device.h>
#include <linux/io.h>
#include <linux/platform_device.h>
@@ -1602,6 +1604,11 @@ static int stm32_rcc_get_access(void __iomem *base, u32 index)
return 0;
}
+static int stm32mp25_rcc_grant_access(struct stm32_firewall_controller *ctrl, u32 firewall_id)
+{
+ return stm32_rcc_get_access(ctrl->mmio, firewall_id);
+}
+
static int stm32mp25_check_security(struct device_node *np, void __iomem *base,
const struct clock_config *cfg)
{
@@ -1970,6 +1977,7 @@ MODULE_DEVICE_TABLE(of, stm32mp25_match_data);
static int stm32mp25_rcc_clocks_probe(struct platform_device *pdev)
{
+ struct stm32_firewall_controller *rcc_controller;
struct device *dev = &pdev->dev;
void __iomem *base;
int ret;
@@ -1982,7 +1990,36 @@ static int stm32mp25_rcc_clocks_probe(struct platform_device *pdev)
if (ret)
return ret;
- return stm32_rcc_init(dev, stm32mp25_match_data, base);
+ ret = stm32_rcc_init(dev, stm32mp25_match_data, base);
+ if (ret)
+ return ret;
+
+ rcc_controller = devm_kzalloc(&pdev->dev, sizeof(*rcc_controller), GFP_KERNEL);
+ if (!rcc_controller)
+ return -ENOMEM;
+
+ rcc_controller->dev = dev;
+ rcc_controller->mmio = base;
+ rcc_controller->name = dev_driver_string(dev);
+ rcc_controller->type = STM32_PERIPHERAL_FIREWALL;
+ rcc_controller->grant_access = stm32mp25_rcc_grant_access;
+
+ platform_set_drvdata(pdev, rcc_controller);
+
+ ret = stm32_firewall_controller_register(rcc_controller);
+ if (ret) {
+ dev_err(dev, "Couldn't register as a firewall controller: %d\n", ret);
+ return ret;
+ }
+
+ return 0;
+}
+
+static void stm32mp25_rcc_clocks_remove(struct platform_device *pdev)
+{
+ struct stm32_firewall_controller *rcc_controller = platform_get_drvdata(pdev);
+
+ stm32_firewall_controller_unregister(rcc_controller);
}
static struct platform_driver stm32mp25_rcc_clocks_driver = {
@@ -1991,6 +2028,7 @@ static struct platform_driver stm32mp25_rcc_clocks_driver = {
.of_match_table = stm32mp25_match_data,
},
.probe = stm32mp25_rcc_clocks_probe,
+ .remove = stm32mp25_rcc_clocks_remove,
};
static int __init stm32mp25_clocks_init(void)
--
2.43.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH v7 3/3] arm64: dts: st: set rcc as an access-controller
2025-09-22 8:12 [PATCH v7 0/3] Register the STM32MP25 RCC driver as an access controller Clément Le Goffic
2025-09-22 8:12 ` [PATCH v7 1/3] dt-bindings: stm32: stm32mp25: add `#access-controller-cells` property Clément Le Goffic
2025-09-22 8:12 ` [PATCH v7 2/3] clk: stm32mp25: add firewall grant_access ops Clément Le Goffic
@ 2025-09-22 8:12 ` Clément Le Goffic
2025-09-22 17:27 ` [PATCH v7 0/3] Register the STM32MP25 RCC driver as an access controller Rob Herring (Arm)
3 siblings, 0 replies; 5+ messages in thread
From: Clément Le Goffic @ 2025-09-22 8:12 UTC (permalink / raw)
To: Michael Turquette, Stephen Boyd, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Maxime Coquelin, Alexandre Torgue,
Gabriel Fernandez
Cc: linux-clk, devicetree, linux-stm32, linux-arm-kernel,
linux-kernel, Clément Le Goffic, Clément Le Goffic
From: Clément Le Goffic <clement.legoffic@foss.st.com>
RCC now implements firewall access ops to check the access to
resources. Allow client nodes to query the RCC with one firewall ID.
Signed-off-by: Clément Le Goffic <clement.legoffic@foss.st.com>
Signed-off-by: Clément Le Goffic <legoffic.clement@gmail.com>
---
arch/arm64/boot/dts/st/stm32mp251.dtsi | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm64/boot/dts/st/stm32mp251.dtsi b/arch/arm64/boot/dts/st/stm32mp251.dtsi
index 303abf915b8e..fbedf23def52 100644
--- a/arch/arm64/boot/dts/st/stm32mp251.dtsi
+++ b/arch/arm64/boot/dts/st/stm32mp251.dtsi
@@ -1677,6 +1677,7 @@ rcc: clock-controller@44200000 {
reg = <0x44200000 0x10000>;
#clock-cells = <1>;
#reset-cells = <1>;
+ #access-controller-cells = <1>;
clocks = <&scmi_clk CK_SCMI_HSE>,
<&scmi_clk CK_SCMI_HSI>,
<&scmi_clk CK_SCMI_MSI>,
--
2.43.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v7 0/3] Register the STM32MP25 RCC driver as an access controller.
2025-09-22 8:12 [PATCH v7 0/3] Register the STM32MP25 RCC driver as an access controller Clément Le Goffic
` (2 preceding siblings ...)
2025-09-22 8:12 ` [PATCH v7 3/3] arm64: dts: st: set rcc as an access-controller Clément Le Goffic
@ 2025-09-22 17:27 ` Rob Herring (Arm)
3 siblings, 0 replies; 5+ messages in thread
From: Rob Herring (Arm) @ 2025-09-22 17:27 UTC (permalink / raw)
To: Clément Le Goffic
Cc: linux-kernel, devicetree, Maxime Coquelin, linux-arm-kernel,
Gabriel Fernandez, Krzysztof Kozlowski, linux-stm32, linux-clk,
Michael Turquette, Conor Dooley, Alexandre Torgue,
Clément Le Goffic, Stephen Boyd
On Mon, 22 Sep 2025 10:12:17 +0200, Clément Le Goffic wrote:
> The STM32MP25 RCC peripheral as an access controller is allowed to know
> whether the clocks are secured or not.
> The STM32MP25 RCC peripheral knows about the clock secure configuration
> of all non RIF-aware peripheral.
> In parallel all the RIF-aware peripheral configuration information
> are known by the RIFSC peripheral which is already an access
> controller.
>
> This v7 is a subset of the v6 and other prior versions, split to simplify
> the review and merging process.
>
> Changes in v7:
> - None
> - Link to v6: https://lore.kernel.org/all/20250909-b4-ddrperfm-upstream-v6-2-ce082cc801b5@gmail.com/
>
> Signed-off-by: Clément Le Goffic <legoffic.clement@gmail.com>
> ---
> Clément Le Goffic (3):
> dt-bindings: stm32: stm32mp25: add `#access-controller-cells` property
> clk: stm32mp25: add firewall grant_access ops
> arm64: dts: st: set rcc as an access-controller
>
> .../bindings/clock/st,stm32mp25-rcc.yaml | 7 ++++
> arch/arm64/boot/dts/st/stm32mp251.dtsi | 1 +
> drivers/clk/stm32/clk-stm32mp25.c | 40 +++++++++++++++++++++-
> 3 files changed, 47 insertions(+), 1 deletion(-)
> ---
> base-commit: 07e27ad16399afcd693be20211b0dfae63e0615f
> change-id: 20250916-b4-rcc-upstream-8a8ea3af6a0d
> prerequisite-change-id: 20250916-b4-firewall-upstream-dfe8588a21f8:v7
> prerequisite-patch-id: 1ead960f405c7a2dcc9111acd0bb4c95ed33954f
>
> Best regards,
> --
> Clément Le Goffic <legoffic.clement@gmail.com>
>
>
>
My bot found new DTB warnings on the .dts files added or changed in this
series.
Some warnings may be from an existing SoC .dtsi. Or perhaps the warnings
are fixed by another series. Ultimately, it is up to the platform
maintainer whether these warnings are acceptable or not. No need to reply
unless the platform maintainer has comments.
If you already ran DT checks and didn't see these error(s), then
make sure dt-schema is up to date:
pip3 install dtschema --upgrade
This patch series was applied (using b4) to base:
Base: using specified base-commit 07e27ad16399afcd693be20211b0dfae63e0615f
Deps: looking for dependencies matching 1 patch-ids
Deps: Applying prerequisite patch: [PATCH v7] bus: firewall: move stm32_firewall header file in include folder
If this is not the correct base, please add 'base-commit' tag
(or use b4 which does this automatically)
New warnings running 'make CHECK_DTBS=y for arch/arm64/boot/dts/st/' for 20250922-b4-rcc-upstream-v7-0-2dfc4e018f40@gmail.com:
arch/arm64/boot/dts/st/stm32mp235f-dk.dtb: clock-controller@44200000 (st,stm32mp25-rcc): '#access-controller-cells' is a required property
from schema $id: http://devicetree.org/schemas/clock/st,stm32mp25-rcc.yaml#
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2025-09-22 17:28 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-22 8:12 [PATCH v7 0/3] Register the STM32MP25 RCC driver as an access controller Clément Le Goffic
2025-09-22 8:12 ` [PATCH v7 1/3] dt-bindings: stm32: stm32mp25: add `#access-controller-cells` property Clément Le Goffic
2025-09-22 8:12 ` [PATCH v7 2/3] clk: stm32mp25: add firewall grant_access ops Clément Le Goffic
2025-09-22 8:12 ` [PATCH v7 3/3] arm64: dts: st: set rcc as an access-controller Clément Le Goffic
2025-09-22 17:27 ` [PATCH v7 0/3] Register the STM32MP25 RCC driver as an access controller Rob Herring (Arm)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).