Skip to content

Commit 89931cb

Browse files
Alexandre Torguearndb
authored andcommitted
ARM: dts: stm32: move SCMI related nodes in a dedicated file for stm32mp15
Adding a "secure" version of STM32 boards (DK1/DK2/ED1/EV1), SCMI (clock/ reset) protocol and OP-TEE node have been added in SoC dtsi file (stm32mp151.dtsi). They have been added with a status disabled in order to keep our legacy unchanged. It is actually not enough to keep our legacy unchanged. First, just a reminder about our use case: TF-A (BL2) loads and starts OP-TEE, then loads and runs U-Boot. U-Boot code checks if an OP-TEE is running, if yes it searches in Kernel device tree if an OP-TEE node is present: -If the OP-TEE node is not present then U-Boot copies OP-TEE node and its reserved memory region from U-Boot device tree to the kernel device tree. -If the OP-TEE node is present then it does nothing (this OP-TEE node will be used by Linux). So U-Boot lets the kernel device tree unchanged thinking it is correct for an OP-TEE usage. It is the case for our legacy boards, the OP-TEE node is present (although disabled) but the reserved memory region is not declared. As no memory region has been reserved for OP-TEE, the end of DDR is seen by the kernel as free and then used for CMA. But as OP-TEE is running, this end of DDR is already used by OP-TEE. So as soon as kernel tries to access to the CMA region OP-TEE raises an error. To fix it, all OP-TEE node and SCMI is moved in a dedicated file. Fixes: 40b4157 ("ARM: dts: stm32: enable optee firmware and SCMI support on STM32MP15") Signed-off-by: Alexandre Torgue <[email protected]> Link: https://lore.kernel.org/r/[email protected]' Signed-off-by: Arnd Bergmann <[email protected]>
1 parent 002ec15 commit 89931cb

File tree

6 files changed

+51
-89
lines changed

6 files changed

+51
-89
lines changed

arch/arm/boot/dts/stm32mp15-scmi.dtsi

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
2+
/*
3+
* Copyright (C) STMicroelectronics 2022 - All Rights Reserved
4+
* Author: Alexandre Torgue <[email protected]> for STMicroelectronics.
5+
*/
6+
7+
/ {
8+
firmware {
9+
optee: optee {
10+
compatible = "linaro,optee-tz";
11+
method = "smc";
12+
};
13+
14+
scmi: scmi {
15+
compatible = "linaro,scmi-optee";
16+
#address-cells = <1>;
17+
#size-cells = <0>;
18+
linaro,optee-channel-id = <0>;
19+
shmem = <&scmi_shm>;
20+
21+
scmi_clk: protocol@14 {
22+
reg = <0x14>;
23+
#clock-cells = <1>;
24+
};
25+
26+
scmi_reset: protocol@16 {
27+
reg = <0x16>;
28+
#reset-cells = <1>;
29+
};
30+
};
31+
};
32+
33+
soc {
34+
scmi_sram: sram@2ffff000 {
35+
compatible = "mmio-sram";
36+
reg = <0x2ffff000 0x1000>;
37+
#address-cells = <1>;
38+
#size-cells = <1>;
39+
ranges = <0 0x2ffff000 0x1000>;
40+
41+
scmi_shm: scmi-sram@0 {
42+
compatible = "arm,scmi-shmem";
43+
reg = <0 0x80>;
44+
};
45+
};
46+
};
47+
};

arch/arm/boot/dts/stm32mp151.dtsi

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -115,54 +115,13 @@
115115
status = "disabled";
116116
};
117117

118-
firmware {
119-
optee: optee {
120-
compatible = "linaro,optee-tz";
121-
method = "smc";
122-
status = "disabled";
123-
};
124-
125-
scmi: scmi {
126-
compatible = "linaro,scmi-optee";
127-
#address-cells = <1>;
128-
#size-cells = <0>;
129-
linaro,optee-channel-id = <0>;
130-
shmem = <&scmi_shm>;
131-
status = "disabled";
132-
133-
scmi_clk: protocol@14 {
134-
reg = <0x14>;
135-
#clock-cells = <1>;
136-
};
137-
138-
scmi_reset: protocol@16 {
139-
reg = <0x16>;
140-
#reset-cells = <1>;
141-
};
142-
};
143-
};
144-
145118
soc {
146119
compatible = "simple-bus";
147120
#address-cells = <1>;
148121
#size-cells = <1>;
149122
interrupt-parent = <&intc>;
150123
ranges;
151124

152-
scmi_sram: sram@2ffff000 {
153-
compatible = "mmio-sram";
154-
reg = <0x2ffff000 0x1000>;
155-
#address-cells = <1>;
156-
#size-cells = <1>;
157-
ranges = <0 0x2ffff000 0x1000>;
158-
159-
scmi_shm: scmi-sram@0 {
160-
compatible = "arm,scmi-shmem";
161-
reg = <0 0x80>;
162-
status = "disabled";
163-
};
164-
};
165-
166125
timers2: timer@40000000 {
167126
#address-cells = <1>;
168127
#size-cells = <0>;

arch/arm/boot/dts/stm32mp157a-dk1-scmi.dts

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
/dts-v1/;
88

99
#include "stm32mp157a-dk1.dts"
10+
#include "stm32mp15-scmi.dtsi"
1011

1112
/ {
1213
model = "STMicroelectronics STM32MP157A-DK1 SCMI Discovery Board";
@@ -54,10 +55,6 @@
5455
resets = <&scmi_reset RST_SCMI_MCU>;
5556
};
5657

57-
&optee {
58-
status = "okay";
59-
};
60-
6158
&rcc {
6259
compatible = "st,stm32mp1-rcc-secure", "syscon";
6360
clock-names = "hse", "hsi", "csi", "lse", "lsi";
@@ -76,11 +73,3 @@
7673
&rtc {
7774
clocks = <&scmi_clk CK_SCMI_RTCAPB>, <&scmi_clk CK_SCMI_RTC>;
7875
};
79-
80-
&scmi {
81-
status = "okay";
82-
};
83-
84-
&scmi_shm {
85-
status = "okay";
86-
};

arch/arm/boot/dts/stm32mp157c-dk2-scmi.dts

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
/dts-v1/;
88

99
#include "stm32mp157c-dk2.dts"
10+
#include "stm32mp15-scmi.dtsi"
1011

1112
/ {
1213
model = "STMicroelectronics STM32MP157C-DK2 SCMI Discovery Board";
@@ -63,10 +64,6 @@
6364
resets = <&scmi_reset RST_SCMI_MCU>;
6465
};
6566

66-
&optee {
67-
status = "okay";
68-
};
69-
7067
&rcc {
7168
compatible = "st,stm32mp1-rcc-secure", "syscon";
7269
clock-names = "hse", "hsi", "csi", "lse", "lsi";
@@ -85,11 +82,3 @@
8582
&rtc {
8683
clocks = <&scmi_clk CK_SCMI_RTCAPB>, <&scmi_clk CK_SCMI_RTC>;
8784
};
88-
89-
&scmi {
90-
status = "okay";
91-
};
92-
93-
&scmi_shm {
94-
status = "okay";
95-
};

arch/arm/boot/dts/stm32mp157c-ed1-scmi.dts

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
/dts-v1/;
88

99
#include "stm32mp157c-ed1.dts"
10+
#include "stm32mp15-scmi.dtsi"
1011

1112
/ {
1213
model = "STMicroelectronics STM32MP157C-ED1 SCMI eval daughter";
@@ -59,10 +60,6 @@
5960
resets = <&scmi_reset RST_SCMI_MCU>;
6061
};
6162

62-
&optee {
63-
status = "okay";
64-
};
65-
6663
&rcc {
6764
compatible = "st,stm32mp1-rcc-secure", "syscon";
6865
clock-names = "hse", "hsi", "csi", "lse", "lsi";
@@ -81,11 +78,3 @@
8178
&rtc {
8279
clocks = <&scmi_clk CK_SCMI_RTCAPB>, <&scmi_clk CK_SCMI_RTC>;
8380
};
84-
85-
&scmi {
86-
status = "okay";
87-
};
88-
89-
&scmi_shm {
90-
status = "okay";
91-
};

arch/arm/boot/dts/stm32mp157c-ev1-scmi.dts

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
/dts-v1/;
88

99
#include "stm32mp157c-ev1.dts"
10+
#include "stm32mp15-scmi.dtsi"
1011

1112
/ {
1213
model = "STMicroelectronics STM32MP157C-EV1 SCMI eval daughter on eval mother";
@@ -68,10 +69,6 @@
6869
resets = <&scmi_reset RST_SCMI_MCU>;
6970
};
7071

71-
&optee {
72-
status = "okay";
73-
};
74-
7572
&rcc {
7673
compatible = "st,stm32mp1-rcc-secure", "syscon";
7774
clock-names = "hse", "hsi", "csi", "lse", "lsi";
@@ -90,11 +87,3 @@
9087
&rtc {
9188
clocks = <&scmi_clk CK_SCMI_RTCAPB>, <&scmi_clk CK_SCMI_RTC>;
9289
};
93-
94-
&scmi {
95-
status = "okay";
96-
};
97-
98-
&scmi_shm {
99-
status = "okay";
100-
};

0 commit comments

Comments
 (0)