From: Gabriel Fernandez <redacted>
Platform STM32MP1 can be used in configuration where some clocks and
IP resets can relate as secure resources.
These resources are moved from a RCC clock/reset handle to a SCMI
clock/reset_domain handle.
The RCC clock driver is now dependent of the SCMI driver, then we have
to manage now the probe defering.
v1 -> v2:
- fix yamllint warnings.
Gabriel Fernandez (14):
clk: stm32mp1: merge 'clk-hsi-div' and 'ck_hsi' into one clock
clk: stm32mp1: merge 'ck_hse_rtc' and 'ck_rtc' into one clock
clk: stm32mp1: remove intermediate pll clocks
clk: stm32mp1: convert to module driver
clk: stm32mp1: move RCC reset controller into RCC clock driver
reset: stm32mp1: remove stm32mp1 reset
dt-bindings: clock: add IDs for SCMI clocks on stm32mp15
dt-bindings: reset: add IDs for SCMI reset domains on stm32mp15
dt-bindings: reset: add MCU HOLD BOOT ID for SCMI reset domains on
stm32mp15
clk: stm32mp1: new compatible for secure RCC support
ARM: dts: stm32: define SCMI resources on stm32mp15
ARM: dts: stm32: move clocks/resets to SCMI resources for stm32mp15
dt-bindings: clock: stm32mp1 new compatible for secure rcc
ARM: dts: stm32: introduce basic boot include on stm32mp15x board
.../bindings/clock/st,stm32mp1-rcc.yaml | 6 +-
arch/arm/boot/dts/stm32mp15-no-scmi.dtsi | 158 ++++++
arch/arm/boot/dts/stm32mp151.dtsi | 127 +++--
arch/arm/boot/dts/stm32mp153.dtsi | 4 +-
arch/arm/boot/dts/stm32mp157.dtsi | 2 +-
arch/arm/boot/dts/stm32mp15xc.dtsi | 4 +-
drivers/clk/Kconfig | 10 +
drivers/clk/clk-stm32mp1.c | 495 +++++++++++++++---
drivers/reset/Kconfig | 6 -
drivers/reset/Makefile | 1 -
drivers/reset/reset-stm32mp1.c | 115 ----
include/dt-bindings/clock/stm32mp1-clks.h | 27 +
include/dt-bindings/reset/stm32mp1-resets.h | 15 +
13 files changed, 704 insertions(+), 266 deletions(-)
create mode 100644 arch/arm/boot/dts/stm32mp15-no-scmi.dtsi
delete mode 100644 drivers/reset/reset-stm32mp1.c
--
2.17.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
From: Gabriel Fernandez <redacted>
RCC clock and reset controller shared same memory mapping.
As RCC clock driver is now a module, the best way to register clock
and reset controller is to do it in same driver.
Signed-off-by: Gabriel Fernandez <redacted>
---
drivers/clk/clk-stm32mp1.c | 157 ++++++++++++++++++++++++++++++++++---
1 file changed, 144 insertions(+), 13 deletions(-)
From: Gabriel Fernandez <redacted>
stm32mp15 TZ secure firmware provides SCMI reset domains for
secure resources. This change defines the SCMI reset domain
identifiers used by SCMI agents and servers.
Stm32mp15 TZ secure firmware provides SCMI clocks for oscillators, some
PLL output and few secure aware interfaces. This change defines the
SCMI clock identifiers used by SCMI agents and servers.
Server SCMI0 exposes reset controllers for resources under RCC[TZEN]
configuration control.
Signed-off-by: Etienne Carriere <redacted>
Signed-off-by: Gabriel Fernandez <redacted>
---
include/dt-bindings/reset/stm32mp1-resets.h | 13 +++++++++++++
1 file changed, 13 insertions(+)
From: Rob Herring <robh@kernel.org> Date: 2021-02-09 19:12:30
On Tue, 26 Jan 2021 10:01:14 +0100, gabriel.fernandez@foss.st.com wrote:
From: Gabriel Fernandez <redacted>
stm32mp15 TZ secure firmware provides SCMI reset domains for
secure resources. This change defines the SCMI reset domain
identifiers used by SCMI agents and servers.
Stm32mp15 TZ secure firmware provides SCMI clocks for oscillators, some
PLL output and few secure aware interfaces. This change defines the
SCMI clock identifiers used by SCMI agents and servers.
Server SCMI0 exposes reset controllers for resources under RCC[TZEN]
configuration control.
Signed-off-by: Etienne Carriere <redacted>
Signed-off-by: Gabriel Fernandez <redacted>
---
include/dt-bindings/reset/stm32mp1-resets.h | 13 +++++++++++++
1 file changed, 13 insertions(+)
From: Gabriel Fernandez <redacted>
This patch is to prepare STM32MP1 clocks in trusted mode.
This Merge will facilitate to have a more coherent clock tree
in no trusted / trusted world.
Signed-off-by: Gabriel Fernandez <redacted>
---
drivers/clk/clk-stm32mp1.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
@@ -1657,16 +1657,16 @@ static const struct stm32_mux_cfg ker_mux_cfg[M_LAST] = {};staticconststructclock_configstm32mp1_clock_cfg[]={-/* Oscillator divider */-DIV(NO_ID,"clk-hsi-div","clk-hsi",CLK_DIVIDER_POWER_OF_TWO,-RCC_HSICFGR,0,2,CLK_DIVIDER_READ_ONLY),-/* External / Internal Oscillators */GATE_MP1(CK_HSE,"ck_hse","clk-hse",0,RCC_OCENSETR,8,0),/* ck_csi is used by IO compensation and should be critical */GATE_MP1(CK_CSI,"ck_csi","clk-csi",CLK_IS_CRITICAL,RCC_OCENSETR,4,0),-GATE_MP1(CK_HSI,"ck_hsi","clk-hsi-div",0,RCC_OCENSETR,0,0),+COMPOSITE(CK_HSI,"ck_hsi",PARENT("clk-hsi"),0,+_GATE_MP1(RCC_OCENSETR,0,0),+_NO_MUX,+_DIV(RCC_HSICFGR,0,2,CLK_DIVIDER_POWER_OF_TWO|+CLK_DIVIDER_READ_ONLY,NULL)),GATE(CK_LSI,"ck_lsi","clk-lsi",0,RCC_RDLSICR,0,0),GATE(CK_LSE,"ck_lse","clk-lse",0,RCC_BDCR,0,0),
--
2.17.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
From: Gabriel Fernandez <redacted>
Adds support for probe deferral in way to prepare
integration of the security in RCC clock and reset
drivers.
Some kernel clocks will be provided by the SCMI drivers.
Since RCC clock driver create clocks which parents
are SCMI clocks, RCC clock driver probe can be deferred.
Signed-off-by: Etienne Carriere <redacted>
Signed-off-by: Gabriel Fernandez <redacted>
---
drivers/clk/clk-stm32mp1.c | 121 ++++++++++++++++++++++++-------------
1 file changed, 78 insertions(+), 43 deletions(-)
@@ -2096,8 +2095,7 @@ static int stm32_register_hw_clk(struct device *dev,return0;}-staticintstm32_rcc_init(structdevice_node*np,-void__iomem*base,+staticintstm32_rcc_init(structdevice*dev,void__iomem*base,conststructof_device_id*match_data){structclk_hw_onecell_data*clk_data;
@@ -2106,9 +2104,9 @@ static int stm32_rcc_init(struct device_node *np,conststructstm32_clock_match_data*data;interr,n,max_binding;-match=of_match_node(match_data,np);+match=of_match_node(match_data,dev_of_node(dev));if(!match){-pr_err("%s: match data not found\n",__func__);+dev_err(dev,"match data not found\n");return-ENODEV;}
@@ -2116,8 +2114,8 @@ static int stm32_rcc_init(struct device_node *np,max_binding=data->maxbinding;-clk_data=kzalloc(struct_size(clk_data,hws,max_binding),-GFP_KERNEL);+clk_data=devm_kzalloc(dev,struct_size(clk_data,hws,max_binding),+GFP_KERNEL);if(!clk_data)return-ENOMEM;
@@ -2129,36 +2127,73 @@ static int stm32_rcc_init(struct device_node *np,hws[n]=ERR_PTR(-ENOENT);for(n=0;n<data->num;n++){-err=stm32_register_hw_clk(NULL,clk_data,base,&rlock,+err=stm32_register_hw_clk(dev,clk_data,base,&rlock,&data->cfg[n]);if(err){-pr_err("%s: can't register %s\n",__func__,-data->cfg[n].name);--kfree(clk_data);+dev_err(dev,"Can't register clk %s: %d\n",+data->cfg[n].name,err);returnerr;}}-returnof_clk_add_hw_provider(np,of_clk_hw_onecell_get,clk_data);+returnof_clk_add_hw_provider(dev_of_node(dev),of_clk_hw_onecell_get,clk_data);}-staticvoidstm32mp1_rcc_init(structdevice_node*np)+staticintstm32mp1_rcc_init(structdevice*dev){void__iomem*base;+intret;-base=of_iomap(np,0);+base=of_iomap(dev_of_node(dev),0);if(!base){-pr_err("%pOFn: unable to map resource",np);-of_node_put(np);-return;+pr_err("%pOFn: unable to map resource",dev_of_node(dev));+ret=-ENOMEM;+gotoout;}-if(stm32_rcc_init(np,base,stm32mp1_match_data)){-iounmap(base);-of_node_put(np);+ret=stm32_rcc_init(dev,base,stm32mp1_match_data);++out:+if(ret){+if(base)+iounmap(base);++of_node_put(dev_of_node(dev));}++returnret;+}++staticintstm32mp1_rcc_clocks_probe(structplatform_device*pdev)+{+structdevice*dev=&pdev->dev;++returnstm32mp1_rcc_init(dev);+}++staticintstm32mp1_rcc_clocks_remove(structplatform_device*pdev)+{+structdevice*dev=&pdev->dev;+structdevice_node*child,*np=dev_of_node(dev);++for_each_available_child_of_node(np,child)+of_clk_del_provider(child);++return0;}-CLK_OF_DECLARE_DRIVER(stm32mp1_rcc,"st,stm32mp1-rcc",stm32mp1_rcc_init);+staticstructplatform_driverstm32mp1_rcc_clocks_driver={+.driver={+.name="stm32mp1_rcc",+.of_match_table=stm32mp1_match_data,+},+.probe=stm32mp1_rcc_clocks_probe,+.remove=stm32mp1_rcc_clocks_remove,+};++staticint__initstm32mp1_clocks_init(void)+{+returnplatform_driver_register(&stm32mp1_rcc_clocks_driver);+}+core_initcall(stm32mp1_clocks_init);
--
2.17.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
From: Gabriel Fernandez <redacted>
This patch is to prepare STM32MP1 clocks in trusted mode.
Integrate the mux clock into pll clock will facilitate to have a more
coherent clock tree in no trusted / trusted mode.
Signed-off-by: Gabriel Fernandez <redacted>
---
drivers/clk/clk-stm32mp1.c | 65 ++++++++++++++++++++++++--------------
1 file changed, 42 insertions(+), 23 deletions(-)
From: Gabriel Fernandez <redacted>
'ck_rtc' has multiple clocks as input (ck_hsi, ck_lsi, and ck_hse).
A divider is available only on the specific rtc input for ck_hse.
This Merge will facilitate to have a more coherent clock tree
in no trusted / trusted world.
Signed-off-by: Gabriel Fernandez <redacted>
---
drivers/clk/clk-stm32mp1.c | 49 +++++++++++++++++++++++++++++++++-----
1 file changed, 43 insertions(+), 6 deletions(-)
From: Gabriel Fernandez <redacted>
'ck_rtc' has multiple clocks as input (ck_hsi, ck_lsi, and ck_hse).
A divider is available only on the specific rtc input for ck_hse.
This Merge will facilitate to have a more coherent clock tree
in no trusted / trusted world.
Signed-off-by: Gabriel Fernandez <redacted>
---
drivers/clk/clk-stm32mp1.c | 49 +++++++++++++++++++++++++++++++++-----
1 file changed, 43 insertions(+), 6 deletions(-)
@@ -1031,6 +1031,42 @@ static struct clk_hw *clk_register_cktim(struct device *dev, const char *name,returnhw;}+/* The divider of RTC clock concerns only ck_hse clock */+#define HSE_RTC 3++staticunsignedlongclk_divider_rtc_recalc_rate(structclk_hw*hw,+unsignedlongparent_rate)+{+if(clk_hw_get_parent(hw)==clk_hw_get_parent_by_index(hw,HSE_RTC))+returnclk_divider_ops.recalc_rate(hw,parent_rate);++returnparent_rate;+}++staticlongclk_divider_rtc_round_rate(structclk_hw*hw,unsignedlongrate,+unsignedlong*prate)+{+if(clk_hw_get_parent(hw)==clk_hw_get_parent_by_index(hw,HSE_RTC))
This clk op can be called at basically any time. Maybe this should use
the determine rate op and then look to see what the parent is that comes
in via the rate request structure? Or is the intention to keep this
pinned to one particular parent? Looking at this right now it doesn't
really make much sense why the current parent state should play into
what rate the clk can round to, unless there is some more clk flags
going on that constrain the ability to change this clk's parent.
From: Gabriel Fernandez <redacted>
'ck_rtc' has multiple clocks as input (ck_hsi, ck_lsi, and ck_hse).
A divider is available only on the specific rtc input for ck_hse.
This Merge will facilitate to have a more coherent clock tree
in no trusted / trusted world.
Signed-off-by: Gabriel Fernandez <redacted>
---
drivers/clk/clk-stm32mp1.c | 49 +++++++++++++++++++++++++++++++++-----
1 file changed, 43 insertions(+), 6 deletions(-)
@@ -1031,6 +1031,42 @@ static struct clk_hw *clk_register_cktim(struct device *dev, const char *name,returnhw;}+/* The divider of RTC clock concerns only ck_hse clock */+#define HSE_RTC 3++staticunsignedlongclk_divider_rtc_recalc_rate(structclk_hw*hw,+unsignedlongparent_rate)+{+if(clk_hw_get_parent(hw)==clk_hw_get_parent_by_index(hw,HSE_RTC))+returnclk_divider_ops.recalc_rate(hw,parent_rate);++returnparent_rate;+}++staticlongclk_divider_rtc_round_rate(structclk_hw*hw,unsignedlongrate,+unsignedlong*prate)+{+if(clk_hw_get_parent(hw)==clk_hw_get_parent_by_index(hw,HSE_RTC))
This clk op can be called at basically any time. Maybe this should use
the determine rate op and then look to see what the parent is that comes
in via the rate request structure? Or is the intention to keep this
pinned to one particular parent? Looking at this right now it doesn't
really make much sense why the current parent state should play into
what rate the clk can round to, unless there is some more clk flags
going on that constrain the ability to change this clk's parent.
Yes the intention is to keep this pinned for one particular parent.
This divider is only applied on the 4th input of the MUX of the RTC and
doesn't affect the HSE frequency for all the system.
Oscillators
-----
| lse |----------------+----------------> ck_lse
----- |
----- |
| lsi |------------+--------------------> ck_lsi
----- | |
| |
----- | |
| hse |----+-------|---|----------------> ck_hse
----- | | |
| | | |\ mux
| | | OFF -->| \
| | | | \ gate
| | --------->| | ---
| | | |--->| |--> ck_rtc
| ------------->| | ---
| ----------- | |
----| % 1 to 64 |--->| /
----------- |/
divider
I manage the RTC with a clock composite with a gate a mux and a specific
rate ops for hse input.
That why i need to the parent state.
Best Regards
Gabriel
From: Gabriel Fernandez <redacted>
Add ID to SCMI0 to exposes reset controller for the MCU HOLD BOOT resource.
Signed-off-by: Arnaud Pouliquen <redacted>
Signed-off-by: Gabriel Fernandez <redacted>
---
include/dt-bindings/reset/stm32mp1-resets.h | 2 ++
1 file changed, 2 insertions(+)
From: Rob Herring <robh@kernel.org> Date: 2021-02-09 19:26:47
On Tue, 26 Jan 2021 10:01:15 +0100, gabriel.fernandez@foss.st.com wrote:
From: Gabriel Fernandez <redacted>
Add ID to SCMI0 to exposes reset controller for the MCU HOLD BOOT resource.
Signed-off-by: Arnaud Pouliquen <redacted>
Signed-off-by: Gabriel Fernandez <redacted>
---
include/dt-bindings/reset/stm32mp1-resets.h | 2 ++
1 file changed, 2 insertions(+)
From: Gabriel Fernandez <redacted>
stm32mp15 TZ secure firmware provides SCMI clocks for oscillators, some
PLL output and few secure aware interfaces.
This change defines the SCMI clock identifiers used by SCMI agents
and servers.
Server SCMI0 exposes clocks and reset controllers for resources under
RCC[TZEN] configuration control.
Server SCMI1 exposes clocks for resources under RCC[MCKPROT] control.
Signed-off-by: Etienne Carriere <redacted>
Signed-off-by: Gabriel Fernandez <redacted>
---
include/dt-bindings/clock/stm32mp1-clks.h | 27 +++++++++++++++++++++++
1 file changed, 27 insertions(+)
From: Rob Herring <robh@kernel.org> Date: 2021-02-09 19:08:23
On Tue, 26 Jan 2021 10:01:13 +0100, gabriel.fernandez@foss.st.com wrote:
From: Gabriel Fernandez <redacted>
stm32mp15 TZ secure firmware provides SCMI clocks for oscillators, some
PLL output and few secure aware interfaces.
This change defines the SCMI clock identifiers used by SCMI agents
and servers.
Server SCMI0 exposes clocks and reset controllers for resources under
RCC[TZEN] configuration control.
Server SCMI1 exposes clocks for resources under RCC[MCKPROT] control.
Signed-off-by: Etienne Carriere <redacted>
Signed-off-by: Gabriel Fernandez <redacted>
---
include/dt-bindings/clock/stm32mp1-clks.h | 27 +++++++++++++++++++++++
1 file changed, 27 insertions(+)
From: Gabriel Fernandez <redacted>
Platform STM32MP1 can be used in configuration where some clock
resources cannot be accessed by Linux kernel when executing in non-secure
state of the CPU(s).
In such configuration, the RCC clock driver must not register clocks
it cannot access.
They are expected to be registered from another clock driver such
as the SCMI clock driver.
This change uses specific compatible string "st,stm32mp1-rcc-secure"
to specify RCC clock driver configuration where RCC is secure.
Signed-off-by: Etienne Carriere <redacted>
Signed-off-by: Gabriel Fernandez <redacted>
---
drivers/clk/Kconfig | 10 ++++
drivers/clk/clk-stm32mp1.c | 101 ++++++++++++++++++++++++++++++++++++-
2 files changed, 110 insertions(+), 1 deletion(-)
@@ -2296,11 +2361,45 @@ static int stm32mp1_rcc_init(struct device *dev)returnret;}+staticintget_clock_deps(structdevice*dev)+{+staticconstchar*constclock_deps_name[]={+"hsi","hse","csi","lsi","lse",+};+size_tdeps_size=sizeof(structclk*)*ARRAY_SIZE(clock_deps_name);+structclk**clk_deps;+inti;++clk_deps=devm_kzalloc(dev,deps_size,GFP_KERNEL);+if(!clk_deps)+return-ENOMEM;++for(i=0;i<ARRAY_SIZE(clock_deps_name);i++){+structclk*clk=of_clk_get_by_name(dev_of_node(dev),+clock_deps_name[i]);++if(IS_ERR(clk)){+if(PTR_ERR(clk)!=-EINVAL&&PTR_ERR(clk)!=-ENOENT)+returnPTR_ERR(clk);+}else{+/* Device gets a reference count on the clock */+clk_deps[i]=devm_clk_get(dev,__clk_get_name(clk));+clk_put(clk);+}+}++return0;+}+staticintstm32mp1_rcc_clocks_probe(structplatform_device*pdev){structdevice*dev=&pdev->dev;+intret=get_clock_deps(dev);++if(!ret)+ret=stm32mp1_rcc_init(dev);-returnstm32mp1_rcc_init(dev);+returnret;}staticintstm32mp1_rcc_clocks_remove(structplatform_device*pdev)
--
2.17.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
From: Gabriel Fernandez <redacted>
Platform stm32mp15 relies on SCMI resources (clocks and reset domains).
This change adds SCMI resources description in the platform device
tree. SCMI resources uses a mailbox based on some shared memory and
a SMC mailbox notification.
SCMI0 exposes clocks and reset controllers for resources under RCC[TZEN]
configuration control. It is default enabled as SoC default
configuration is RCC[TZEN]=1.
SCMI1 exposes clocks for resources under RCC[MCKPROT] control. The node
is disabled by default as default configuration is RCC[MCKPROT]=0.
Signed-off-by: Etienne Carriere <redacted>
Signed-off-by: Gabriel Fernandez <redacted>
---
arch/arm/boot/dts/stm32mp151.dtsi | 50 +++++++++++++++++++++++++++++++
1 file changed, 50 insertions(+)
From: Gabriel Fernandez <redacted>
Introduce new compatible string "st,stm32mp1-rcc-secure" for
stm32mp1 clock driver when the device is configured with RCC
security support hardened.
Signed-off-by: Etienne Carriere <redacted>
Signed-off-by: Gabriel Fernandez <redacted>
---
.../devicetree/bindings/clock/st,stm32mp1-rcc.yaml | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
From: Rob Herring <robh@kernel.org> Date: 2021-02-09 19:26:46
On Tue, 26 Jan 2021 10:01:19 +0100, gabriel.fernandez@foss.st.com wrote:
From: Gabriel Fernandez <redacted>
Introduce new compatible string "st,stm32mp1-rcc-secure" for
stm32mp1 clock driver when the device is configured with RCC
security support hardened.
Signed-off-by: Etienne Carriere <redacted>
Signed-off-by: Gabriel Fernandez <redacted>
---
.../devicetree/bindings/clock/st,stm32mp1-rcc.yaml | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
From: Gabriel Fernandez <redacted>
Include this .dtsi file to be backward compatible with old basic bootchain.
For example add:
include "stm32mp15-no-scmi.dtsi" in a stm32mp157c*.dts file.
Signed-off-by: Gabriel Fernandez <redacted>
---
arch/arm/boot/dts/stm32mp15-no-scmi.dtsi | 158 +++++++++++++++++++++++
1 file changed, 158 insertions(+)
create mode 100644 arch/arm/boot/dts/stm32mp15-no-scmi.dtsi
From: Gabriel Fernandez <redacted>
This change reflects board hardware configuration where RCC security
features are configured for RCC[TZEN]=1 and RCC[MCKPROT]=0, that is
RCC TrustZone is hardened and RCC MCKPROT is disabled.
Clock and reset controllers that relate to SoC secure resources are
moved from a RCC clock/reset handle to a SCMI clock/reset_domain handle.
These clocks are all the platform oscillators (HSI/LSI/CSI/HSE/LSE),
clocks for few subsystem and peripheral interfaces.
This change add a SCMI clock dependency on RCC clock device since it
registers clocks which parent clocks are provided by the SCMI clock
driver. This change allows the RCC clock device probe to be deferred
until SCMI clocks are fully registered in the system.
Signed-off-by: Etienne Carriere <redacted>
Signed-off-by: Gabriel Fernandez <redacted>
---
arch/arm/boot/dts/stm32mp151.dtsi | 77 +++++++++++-------------------
arch/arm/boot/dts/stm32mp153.dtsi | 4 +-
arch/arm/boot/dts/stm32mp157.dtsi | 2 +-
arch/arm/boot/dts/stm32mp15xc.dtsi | 4 +-
4 files changed, 32 insertions(+), 55 deletions(-)
From: Ahmad Fatoum <a.fatoum@pengutronix.de> Date: 2021-02-18 11:17:24
Hello Gabriel,
On 26.01.21 10:01, gabriel.fernandez@foss.st.com wrote:
From: Gabriel Fernandez <redacted>
This change reflects board hardware configuration where RCC security
features are configured for RCC[TZEN]=1 and RCC[MCKPROT]=0, that is
RCC TrustZone is hardened and RCC MCKPROT is disabled.
Clock and reset controllers that relate to SoC secure resources are
moved from a RCC clock/reset handle to a SCMI clock/reset_domain handle.
These clocks are all the platform oscillators (HSI/LSI/CSI/HSE/LSE),
clocks for few subsystem and peripheral interfaces.
This change add a SCMI clock dependency on RCC clock device since it
registers clocks which parent clocks are provided by the SCMI clock
driver. This change allows the RCC clock device probe to be deferred
until SCMI clocks are fully registered in the system.
This would break existing boards, right? If so, you should move the
last patch in the series before this one and patch all existing boards
to use it. Maintainers of individual boards can then opt-in later by
deleting the arch/arm/boot/dts/stm32mp15-no-scmi.dtsi inclusion.
Cheers,
Ahmad
On 1/26/21 3:01 AM, gabriel.fernandez@foss.st.com wrote:
From: Gabriel Fernandez <redacted>
Platform STM32MP1 can be used in configuration where some clocks and
IP resets can relate as secure resources.
These resources are moved from a RCC clock/reset handle to a SCMI
clock/reset_domain handle.
The RCC clock driver is now dependent of the SCMI driver, then we have
to manage now the probe defering.
v1 -> v2:
- fix yamllint warnings.
Hi Gabriel,
I don't have much clout with the maintainers, but I have to NAK this
series after finding major breakage.
The problem with series is that it breaks pretty much every board it
touches. I have a DK2 here that I'm using for development, which no
longer boots with this series applied.
The crux of the matter is that this series assumes all boards will boot
with an FSBL that implements a very specific SCMI clock tree. This is
major ABI breakage for anyone not using TF-A as the first stage
bootloader. Anyone using u-boot SPL is screwed.
This series imposes a SOC-wide change via the dtsi files. So even boards
that you don't intend to convert to SCMI will get broken this way.
Adding a -no-scmi file that isn't used anywhere doesn't help things.
Here's what I suggest:
Generate new dtb files for those boards that you want to convert. So you
would get:
- stm32mp157c-dk2.dtb # Good old hardware clocks
- stm32mp157c-dk2-secure-rcc.dtb # Clocks accessible by scmi.
A lot of users use a larger build system where they extract the relevant
files. With the scheme I'm proposing you don't break their builds, and
you allow SCMI users to have upstream support.
This means that you'll have to rethink the DTS and DTSI changes to
accomodate both use cases.
Thanks,
Alex
Gabriel Fernandez (14):
clk: stm32mp1: merge 'clk-hsi-div' and 'ck_hsi' into one clock
clk: stm32mp1: merge 'ck_hse_rtc' and 'ck_rtc' into one clock
clk: stm32mp1: remove intermediate pll clocks
clk: stm32mp1: convert to module driver
clk: stm32mp1: move RCC reset controller into RCC clock driver
reset: stm32mp1: remove stm32mp1 reset
dt-bindings: clock: add IDs for SCMI clocks on stm32mp15
dt-bindings: reset: add IDs for SCMI reset domains on stm32mp15
dt-bindings: reset: add MCU HOLD BOOT ID for SCMI reset domains on
stm32mp15
clk: stm32mp1: new compatible for secure RCC support
ARM: dts: stm32: define SCMI resources on stm32mp15
ARM: dts: stm32: move clocks/resets to SCMI resources for stm32mp15
dt-bindings: clock: stm32mp1 new compatible for secure rcc
ARM: dts: stm32: introduce basic boot include on stm32mp15x board
.../bindings/clock/st,stm32mp1-rcc.yaml | 6 +-
arch/arm/boot/dts/stm32mp15-no-scmi.dtsi | 158 ++++++
arch/arm/boot/dts/stm32mp151.dtsi | 127 +++--
arch/arm/boot/dts/stm32mp153.dtsi | 4 +-
arch/arm/boot/dts/stm32mp157.dtsi | 2 +-
arch/arm/boot/dts/stm32mp15xc.dtsi | 4 +-
drivers/clk/Kconfig | 10 +
drivers/clk/clk-stm32mp1.c | 495 +++++++++++++++---
drivers/reset/Kconfig | 6 -
drivers/reset/Makefile | 1 -
drivers/reset/reset-stm32mp1.c | 115 ----
include/dt-bindings/clock/stm32mp1-clks.h | 27 +
include/dt-bindings/reset/stm32mp1-resets.h | 15 +
13 files changed, 704 insertions(+), 266 deletions(-)
create mode 100644 arch/arm/boot/dts/stm32mp15-no-scmi.dtsi
delete mode 100644 drivers/reset/reset-stm32mp1.c
-----Original Message-----
From: Alex G. <redacted>
Sent: mardi 9 mars 2021 22:50
To: Gabriel FERNANDEZ - foss <redacted>; Michael
Turquette [off-list ref]; Stephen Boyd
[off-list ref]; Rob Herring [off-list ref]; Maxime Coquelin
[off-list ref]; Alexandre TORGUE
[off-list ref]; Philipp Zabel [off-list ref];
Etienne CARRIERE [off-list ref]; marex@denx.de; Marek
Vasut [off-list ref]
Cc: devicetree@vger.kernel.org; linux-kernel@vger.kernel.org; linux-
clk@vger.kernel.org; linux-arm-kernel@lists.infradead.org; linux-stm32@st-
md-mailman.stormreply.com
Subject: Re: [PATCH v2 00/14] Introduce STM32MP1 RCC in secured mode
On 1/26/21 3:01 AM, gabriel.fernandez@foss.st.com wrote:
quoted
From: Gabriel Fernandez <redacted>
Platform STM32MP1 can be used in configuration where some clocks and
IP resets can relate as secure resources.
These resources are moved from a RCC clock/reset handle to a SCMI
clock/reset_domain handle.
The RCC clock driver is now dependent of the SCMI driver, then we have
to manage now the probe defering.
v1 -> v2:
- fix yamllint warnings.
Hi Gabriel,
I don't have much clout with the maintainers, but I have to NAK this series
after finding major breakage.
The problem with series is that it breaks pretty much every board it touches.
I have a DK2 here that I'm using for development, which no longer boots with
this series applied.
The crux of the matter is that this series assumes all boards will boot with an
FSBL that implements a very specific SCMI clock tree. This is major ABI
breakage for anyone not using TF-A as the first stage bootloader. Anyone
using u-boot SPL is screwed.
This series imposes a SOC-wide change via the dtsi files. So even boards that
you don't intend to convert to SCMI will get broken this way.
Adding a -no-scmi file that isn't used anywhere doesn't help things.
You are right. We mainly take care about NO ST (DH/...) boards, but not really about current usage
Of our stm32 boards. Several options exist:
1- Break the current ABI: as soon as those patches are merged, stm32mp157c-dk2.dtb will impose to use
A tf-a for scmi clocks. For people using u-boot spl, the will have to create their own "no-secure" devicetree.
2-As you suggest, create a new "secure" dtb per boards (Not my wish for maintenance perspectives).
3- Keep kernel device tree as they are and applied this secure layer (scmi clocks phandle) thanks to dtbo in
U-boot.
The third could be the less costly.
Thanks
Alex
Here's what I suggest:
Generate new dtb files for those boards that you want to convert. So you
would get:
- stm32mp157c-dk2.dtb # Good old hardware clocks
- stm32mp157c-dk2-secure-rcc.dtb # Clocks accessible by scmi.
A lot of users use a larger build system where they extract the relevant files.
With the scheme I'm proposing you don't break their builds, and you allow
SCMI users to have upstream support.
This means that you'll have to rethink the DTS and DTSI changes to
accomodate both use cases.
Thanks,
Alex
quoted
Gabriel Fernandez (14):
clk: stm32mp1: merge 'clk-hsi-div' and 'ck_hsi' into one clock
clk: stm32mp1: merge 'ck_hse_rtc' and 'ck_rtc' into one clock
clk: stm32mp1: remove intermediate pll clocks
clk: stm32mp1: convert to module driver
clk: stm32mp1: move RCC reset controller into RCC clock driver
reset: stm32mp1: remove stm32mp1 reset
dt-bindings: clock: add IDs for SCMI clocks on stm32mp15
dt-bindings: reset: add IDs for SCMI reset domains on stm32mp15
dt-bindings: reset: add MCU HOLD BOOT ID for SCMI reset domains on
stm32mp15
clk: stm32mp1: new compatible for secure RCC support
ARM: dts: stm32: define SCMI resources on stm32mp15
ARM: dts: stm32: move clocks/resets to SCMI resources for stm32mp15
dt-bindings: clock: stm32mp1 new compatible for secure rcc
ARM: dts: stm32: introduce basic boot include on stm32mp15x board
.../bindings/clock/st,stm32mp1-rcc.yaml | 6 +-
arch/arm/boot/dts/stm32mp15-no-scmi.dtsi | 158 ++++++
arch/arm/boot/dts/stm32mp151.dtsi | 127 +++--
arch/arm/boot/dts/stm32mp153.dtsi | 4 +-
arch/arm/boot/dts/stm32mp157.dtsi | 2 +-
arch/arm/boot/dts/stm32mp15xc.dtsi | 4 +-
drivers/clk/Kconfig | 10 +
drivers/clk/clk-stm32mp1.c | 495 +++++++++++++++---
drivers/reset/Kconfig | 6 -
drivers/reset/Makefile | 1 -
drivers/reset/reset-stm32mp1.c | 115 ----
include/dt-bindings/clock/stm32mp1-clks.h | 27 +
include/dt-bindings/reset/stm32mp1-resets.h | 15 +
13 files changed, 704 insertions(+), 266 deletions(-)
create mode 100644 arch/arm/boot/dts/stm32mp15-no-scmi.dtsi
delete mode 100644 drivers/reset/reset-stm32mp1.c
From: Marek Vasut <marex@denx.de> Date: 2021-03-11 11:44:08
On 3/11/21 9:08 AM, Alexandre TORGUE wrote:
Hi ALex
Hello everyone,
[...]
quoted
Subject: Re: [PATCH v2 00/14] Introduce STM32MP1 RCC in secured mode
On 1/26/21 3:01 AM, gabriel.fernandez@foss.st.com wrote:
quoted
From: Gabriel Fernandez <redacted>
Platform STM32MP1 can be used in configuration where some clocks and
IP resets can relate as secure resources.
These resources are moved from a RCC clock/reset handle to a SCMI
clock/reset_domain handle.
The RCC clock driver is now dependent of the SCMI driver, then we have
to manage now the probe defering.
v1 -> v2:
- fix yamllint warnings.
Hi Gabriel,
I don't have much clout with the maintainers, but I have to NAK this series
after finding major breakage.
The problem with series is that it breaks pretty much every board it touches.
I have a DK2 here that I'm using for development, which no longer boots with
this series applied.
The crux of the matter is that this series assumes all boards will boot with an
FSBL that implements a very specific SCMI clock tree. This is major ABI
breakage for anyone not using TF-A as the first stage bootloader. Anyone
using u-boot SPL is screwed.
This series imposes a SOC-wide change via the dtsi files. So even boards that
you don't intend to convert to SCMI will get broken this way.
Adding a -no-scmi file that isn't used anywhere doesn't help things.
You are right. We mainly take care about NO ST (DH/...) boards, but not really about current usage
Of our stm32 boards. Several options exist:
Since a lot of people benefit from the good upstream support for the MP1
_and_ keep updating their machines to get the latest fixes, it is very
important to keep the current usage working.
1- Break the current ABI: as soon as those patches are merged, stm32mp157c-dk2.dtb will impose to use
A tf-a for scmi clocks. For people using u-boot spl, the will have to create their own "no-secure" devicetree.
NAK, this breaks existing boards and existing setups, e.g. DK2 that does
not use ATF.
2-As you suggest, create a new "secure" dtb per boards (Not my wish for maintenance perspectives).
I agree with Alex (G) that the "secure" option should be opt-in.
That way existing setups remain working and no extra requirements are
imposed on MP1 users. Esp. since as far as I understand this, the
"secure" part isn't really about security, but rather about moving clock
configuration from Linux to some firmware blob.
3- Keep kernel device tree as they are and applied this secure layer (scmi clocks phandle) thanks to dtbo in
U-boot.
Is this really better than
#include "stm32mp15xx-enable-secure-stuff.dtsi"
in a board DT ? Because that is how I imagine the opt-in "secure" option
could work.
Subject: Re: [PATCH v2 00/14] Introduce STM32MP1 RCC in secured mode
On 1/26/21 3:01 AM, gabriel.fernandez@foss.st.com wrote:
quoted
From: Gabriel Fernandez <redacted>
Platform STM32MP1 can be used in configuration where some clocks and
IP resets can relate as secure resources.
These resources are moved from a RCC clock/reset handle to a SCMI
clock/reset_domain handle.
The RCC clock driver is now dependent of the SCMI driver, then we have
to manage now the probe defering.
v1 -> v2:
- fix yamllint warnings.
Hi Gabriel,
I don't have much clout with the maintainers, but I have to NAK this
series
after finding major breakage.
The problem with series is that it breaks pretty much every board it
touches.
I have a DK2 here that I'm using for development, which no longer
boots with
this series applied.
The crux of the matter is that this series assumes all boards will
boot with an
FSBL that implements a very specific SCMI clock tree. This is major ABI
breakage for anyone not using TF-A as the first stage bootloader. Anyone
using u-boot SPL is screwed.
This series imposes a SOC-wide change via the dtsi files. So even
boards that
you don't intend to convert to SCMI will get broken this way.
Adding a -no-scmi file that isn't used anywhere doesn't help things.
You are right. We mainly take care about NO ST (DH/...) boards, but
not really about current usage
Of our stm32 boards. Several options exist:
Since a lot of people benefit from the good upstream support for the MP1
_and_ keep updating their machines to get the latest fixes, it is very
important to keep the current usage working.
quoted
1- Break the current ABI: as soon as those patches are merged,
stm32mp157c-dk2.dtb will impose to use
A tf-a for scmi clocks. For people using u-boot spl, the will have to
create their own "no-secure" devicetree.
NAK, this breaks existing boards and existing setups, e.g. DK2 that does
not use ATF. >
quoted
2-As you suggest, create a new "secure" dtb per boards (Not my wish
for maintenance perspectives).
I agree with Alex (G) that the "secure" option should be opt-in.
That way existing setups remain working and no extra requirements are
imposed on MP1 users. Esp. since as far as I understand this, the
"secure" part isn't really about security, but rather about moving clock
configuration from Linux to some firmware blob.
quoted
3- Keep kernel device tree as they are and applied this secure layer
(scmi clocks phandle) thanks to dtbo in
U-boot.
Is this really better than
#include "stm32mp15xx-enable-secure-stuff.dtsi"
in a board DT ? Because that is how I imagine the opt-in "secure" option
could work.
The dtbo usage could avoid to add another st board (actually a secure
config) in arch/arm/boot/dts.
Cheers
Alex
From: Marek Vasut <marex@denx.de> Date: 2021-03-11 13:24:03
On 3/11/21 2:15 PM, Alexandre TORGUE wrote:
Hi Marek
Hello Alexandre,
On 3/11/21 12:43 PM, Marek Vasut wrote:
quoted
On 3/11/21 9:08 AM, Alexandre TORGUE wrote:
quoted
Hi ALex
Hello everyone,
[...]
quoted
quoted
Subject: Re: [PATCH v2 00/14] Introduce STM32MP1 RCC in secured mode
On 1/26/21 3:01 AM, gabriel.fernandez@foss.st.com wrote:
quoted
From: Gabriel Fernandez <redacted>
Platform STM32MP1 can be used in configuration where some clocks and
IP resets can relate as secure resources.
These resources are moved from a RCC clock/reset handle to a SCMI
clock/reset_domain handle.
The RCC clock driver is now dependent of the SCMI driver, then we have
to manage now the probe defering.
v1 -> v2:
- fix yamllint warnings.
Hi Gabriel,
I don't have much clout with the maintainers, but I have to NAK this
series
after finding major breakage.
The problem with series is that it breaks pretty much every board it
touches.
I have a DK2 here that I'm using for development, which no longer
boots with
this series applied.
The crux of the matter is that this series assumes all boards will
boot with an
FSBL that implements a very specific SCMI clock tree. This is major ABI
breakage for anyone not using TF-A as the first stage bootloader.
Anyone
using u-boot SPL is screwed.
This series imposes a SOC-wide change via the dtsi files. So even
boards that
you don't intend to convert to SCMI will get broken this way.
Adding a -no-scmi file that isn't used anywhere doesn't help things.
You are right. We mainly take care about NO ST (DH/...) boards, but
not really about current usage
Of our stm32 boards. Several options exist:
Since a lot of people benefit from the good upstream support for the
MP1 _and_ keep updating their machines to get the latest fixes, it is
very important to keep the current usage working.
quoted
1- Break the current ABI: as soon as those patches are merged,
stm32mp157c-dk2.dtb will impose to use
A tf-a for scmi clocks. For people using u-boot spl, the will have to
create their own "no-secure" devicetree.
NAK, this breaks existing boards and existing setups, e.g. DK2 that
does not use ATF. >
quoted
2-As you suggest, create a new "secure" dtb per boards (Not my wish
for maintenance perspectives).
I agree with Alex (G) that the "secure" option should be opt-in.
That way existing setups remain working and no extra requirements are
imposed on MP1 users. Esp. since as far as I understand this, the
"secure" part isn't really about security, but rather about moving
clock configuration from Linux to some firmware blob.
quoted
3- Keep kernel device tree as they are and applied this secure layer
(scmi clocks phandle) thanks to dtbo in
U-boot.
Is this really better than
#include "stm32mp15xx-enable-secure-stuff.dtsi"
in a board DT ? Because that is how I imagine the opt-in "secure"
option could work.
The dtbo usage could avoid to add another st board (actually a secure
config) in arch/arm/boot/dts.
It isn't even a board, it is a configuration. Could you detect this
secure/non-secure state at runtime, have both clock options in the DT,
and handle it accordingly ? That might be even better option.
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Subject: Re: [PATCH v2 00/14] Introduce STM32MP1 RCC in secured mode
On 1/26/21 3:01 AM, gabriel.fernandez@foss.st.com wrote:
quoted
From: Gabriel Fernandez <redacted>
Platform STM32MP1 can be used in configuration where some clocks and
IP resets can relate as secure resources.
These resources are moved from a RCC clock/reset handle to a SCMI
clock/reset_domain handle.
The RCC clock driver is now dependent of the SCMI driver, then we have
to manage now the probe defering.
v1 -> v2:
- fix yamllint warnings.
Hi Gabriel,
I don't have much clout with the maintainers, but I have to NAK this
series
after finding major breakage.
The problem with series is that it breaks pretty much every board it
touches.
I have a DK2 here that I'm using for development, which no longer
boots with
this series applied.
The crux of the matter is that this series assumes all boards will
boot with an
FSBL that implements a very specific SCMI clock tree. This is major ABI
breakage for anyone not using TF-A as the first stage bootloader. Anyone
using u-boot SPL is screwed.
This series imposes a SOC-wide change via the dtsi files. So even
boards that
you don't intend to convert to SCMI will get broken this way.
Adding a -no-scmi file that isn't used anywhere doesn't help things.
You are right. We mainly take care about NO ST (DH/...) boards, but
not really about current usage
Of our stm32 boards. Several options exist:
Since a lot of people benefit from the good upstream support for the MP1
_and_ keep updating their machines to get the latest fixes, it is very
important to keep the current usage working.
quoted
1- Break the current ABI: as soon as those patches are merged,
stm32mp157c-dk2.dtb will impose to use
A tf-a for scmi clocks. For people using u-boot spl, the will have to
create their own "no-secure" devicetree.
NAK, this breaks existing boards and existing setups, e.g. DK2 that does
not use ATF.
quoted
2-As you suggest, create a new "secure" dtb per boards (Not my wish
for maintenance perspectives).
I agree with Alex (G) that the "secure" option should be opt-in.
That way existing setups remain working and no extra requirements are
imposed on MP1 users. Esp. since as far as I understand this, the
"secure" part isn't really about security, but rather about moving clock
configuration from Linux to some firmware blob.
quoted
3- Keep kernel device tree as they are and applied this secure layer
(scmi clocks phandle) thanks to dtbo in
U-boot.
Is this really better than
#include "stm32mp15xx-enable-secure-stuff.dtsi"
in a board DT ? Because that is how I imagine the opt-in "secure" option
could work.
Discussing with Patrick about u-boot, we could use dtbo application
thanks to extlinux.conf. BUT it it will not prevent other case (i.e.
TF-A which jump directly in kernel@). So the "least worst" solution is
to create a new "stm32mp1257c-scmi-dk2 board which will overload clock
entries with a scmi phandle (as proposed by Alex).
Gabriel, can you wait a bit before sending something about SCMI in dtsi,
I would like to align this strategy internally.
Marek, Alex: thanks for your inputs.
Regards
Alex
From: Ahmad Fatoum <a.fatoum@pengutronix.de> Date: 2021-03-11 14:42:07
Hello,
On 11.03.21 15:02, Alexandre TORGUE wrote:
On 3/11/21 12:43 PM, Marek Vasut wrote:
quoted
On 3/11/21 9:08 AM, Alexandre TORGUE wrote:
quoted
1- Break the current ABI: as soon as those patches are merged, stm32mp157c-dk2.dtb will impose to use
A tf-a for scmi clocks. For people using u-boot spl, the will have to create their own "no-secure" devicetree.
NAK, this breaks existing boards and existing setups, e.g. DK2 that does not use ATF.
quoted
2-As you suggest, create a new "secure" dtb per boards (Not my wish for maintenance perspectives).
I agree with Alex (G) that the "secure" option should be opt-in.
That way existing setups remain working and no extra requirements are imposed on MP1 users. Esp. since as far as I understand this, the "secure" part isn't really about security, but rather about moving clock configuration from Linux to some firmware blob.
quoted
3- Keep kernel device tree as they are and applied this secure layer (scmi clocks phandle) thanks to dtbo in
U-boot.
Is this really better than
#include "stm32mp15xx-enable-secure-stuff.dtsi"
in a board DT ? Because that is how I imagine the opt-in "secure" option could work.
Discussing with Patrick about u-boot, we could use dtbo application thanks to extlinux.conf. BUT it it will not prevent other case (i.e. TF-A which jump directly in kernel@). So the "least worst" solution is to create a new "stm32mp1257c-scmi-dk2 board which will overload clock entries with a scmi phandle (as proposed by Alex).
I raised this issue before with your colleagues. I still believe the correct way
would be for the TF-A to pass down either a device tree or an overlay with the
actual settings in use, e.g.:
- Clocks/Resets done via SCMI
- Reserved memory regions
If TF-A directly boots Linux, it can apply the overlay itself, otherwise it's
passed down to SSBL that applies it before booting Linux.
Cheers,
Ahmad
Gabriel, can you wait a bit before sending something about SCMI in dtsi, I would like to align this strategy internally.
Marek, Alex: thanks for your inputs.
Regards
Alex
1- Break the current ABI: as soon as those patches are merged, stm32mp157c-dk2.dtb will impose to use
A tf-a for scmi clocks. For people using u-boot spl, the will have to create their own "no-secure" devicetree.
NAK, this breaks existing boards and existing setups, e.g. DK2 that does not use ATF.
quoted
2-As you suggest, create a new "secure" dtb per boards (Not my wish for maintenance perspectives).
I agree with Alex (G) that the "secure" option should be opt-in.
That way existing setups remain working and no extra requirements are imposed on MP1 users. Esp. since as far as I understand this, the "secure" part isn't really about security, but rather about moving clock configuration from Linux to some firmware blob.
quoted
3- Keep kernel device tree as they are and applied this secure layer (scmi clocks phandle) thanks to dtbo in
U-boot.
Is this really better than
#include "stm32mp15xx-enable-secure-stuff.dtsi"
in a board DT ? Because that is how I imagine the opt-in "secure" option could work.
Discussing with Patrick about u-boot, we could use dtbo application thanks to extlinux.conf. BUT it it will not prevent other case (i.e. TF-A which jump directly in kernel@). So the "least worst" solution is to create a new "stm32mp1257c-scmi-dk2 board which will overload clock entries with a scmi phandle (as proposed by Alex).
I raised this issue before with your colleagues. I still believe the correct way
would be for the TF-A to pass down either a device tree or an overlay with the
actual settings in use, e.g.:
- Clocks/Resets done via SCMI
- Reserved memory regions
If TF-A directly boots Linux, it can apply the overlay itself, otherwise it's
passed down to SSBL that applies it before booting Linux.
Discussing with tf-a and u-boot guys, this solution could imply hard
synchronization between tf-a/u-boot. The most simple remains a "secure" dts.
regards
Alex
Cheers,
Ahmad
quoted
Gabriel, can you wait a bit before sending something about SCMI in dtsi, I would like to align this strategy internally.
Marek, Alex: thanks for your inputs.
Regards
Alex
From: Ahmad Fatoum <a.fatoum@pengutronix.de> Date: 2021-03-11 15:50:06
Hello,
On 11.03.21 16:18, Alexandre TORGUE wrote:
quoted
I raised this issue before with your colleagues. I still believe the correct way
would be for the TF-A to pass down either a device tree or an overlay with the
actual settings in use, e.g.:
- Clocks/Resets done via SCMI
- Reserved memory regions
If TF-A directly boots Linux, it can apply the overlay itself, otherwise it's
passed down to SSBL that applies it before booting Linux.
Discussing with tf-a and u-boot guys, this solution could imply hard synchronization between tf-a/u-boot. The most simple remains a "secure" dts.
OP-TEE can be configured via CFG_EXTERNAL_DTB_OVERLAY to pass
along an overlay that describes the reserved memory regions it uses.
A similiar approach could work here. The only synchronization you need
in Linux is to keep phandles that the overlay can reference.
Cheers,
Ahmad
regards
Alex
quoted
Cheers,
Ahmad
quoted
Gabriel, can you wait a bit before sending something about SCMI in dtsi, I would like to align this strategy internally.
Marek, Alex: thanks for your inputs.
Regards
Alex
From: Marek Vasut <marex@denx.de> Date: 2021-03-11 16:12:59
On 3/11/21 3:41 PM, Ahmad Fatoum wrote:
Hello,
Hi,
On 11.03.21 15:02, Alexandre TORGUE wrote:
quoted
On 3/11/21 12:43 PM, Marek Vasut wrote:
quoted
On 3/11/21 9:08 AM, Alexandre TORGUE wrote:
quoted
1- Break the current ABI: as soon as those patches are merged, stm32mp157c-dk2.dtb will impose to use
A tf-a for scmi clocks. For people using u-boot spl, the will have to create their own "no-secure" devicetree.
NAK, this breaks existing boards and existing setups, e.g. DK2 that does not use ATF.
quoted
2-As you suggest, create a new "secure" dtb per boards (Not my wish for maintenance perspectives).
I agree with Alex (G) that the "secure" option should be opt-in.
That way existing setups remain working and no extra requirements are imposed on MP1 users. Esp. since as far as I understand this, the "secure" part isn't really about security, but rather about moving clock configuration from Linux to some firmware blob.
quoted
3- Keep kernel device tree as they are and applied this secure layer (scmi clocks phandle) thanks to dtbo in
U-boot.
Is this really better than
#include "stm32mp15xx-enable-secure-stuff.dtsi"
in a board DT ? Because that is how I imagine the opt-in "secure" option could work.
Discussing with Patrick about u-boot, we could use dtbo application thanks to extlinux.conf. BUT it it will not prevent other case (i.e. TF-A which jump directly in kernel@). So the "least worst" solution is to create a new "stm32mp1257c-scmi-dk2 board which will overload clock entries with a scmi phandle (as proposed by Alex).
I raised this issue before with your colleagues. I still believe the correct way
would be for the TF-A to pass down either a device tree or an overlay with the
actual settings in use, e.g.:
- Clocks/Resets done via SCMI
- Reserved memory regions
If TF-A directly boots Linux, it can apply the overlay itself, otherwise it's
passed down to SSBL that applies it before booting Linux.
That sounds good and it is something e.g. R-Car already does, it merges
DT fragment from prior stages at U-Boot level and then passes the result
to Linux.
So on ST hardware, the same could very well happen and it would work for
both non-ATF / ATF / ATF+TEE options.
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
1- Break the current ABI: as soon as those patches are merged,
stm32mp157c-dk2.dtb will impose to use
A tf-a for scmi clocks. For people using u-boot spl, the will have
to create their own "no-secure" devicetree.
NAK, this breaks existing boards and existing setups, e.g. DK2 that
does not use ATF.
quoted
2-As you suggest, create a new "secure" dtb per boards (Not my wish
for maintenance perspectives).
I agree with Alex (G) that the "secure" option should be opt-in.
That way existing setups remain working and no extra requirements
are imposed on MP1 users. Esp. since as far as I understand this,
the "secure" part isn't really about security, but rather about
moving clock configuration from Linux to some firmware blob.
quoted
3- Keep kernel device tree as they are and applied this secure
layer (scmi clocks phandle) thanks to dtbo in
U-boot.
Is this really better than
#include "stm32mp15xx-enable-secure-stuff.dtsi"
in a board DT ? Because that is how I imagine the opt-in "secure"
option could work.
Discussing with Patrick about u-boot, we could use dtbo application
thanks to extlinux.conf. BUT it it will not prevent other case (i.e.
TF-A which jump directly in kernel@). So the "least worst" solution
is to create a new "stm32mp1257c-scmi-dk2 board which will overload
clock entries with a scmi phandle (as proposed by Alex).
I raised this issue before with your colleagues. I still believe the
correct way
would be for the TF-A to pass down either a device tree or an overlay
with the
actual settings in use, e.g.:
- Clocks/Resets done via SCMI
- Reserved memory regions
If TF-A directly boots Linux, it can apply the overlay itself,
otherwise it's
passed down to SSBL that applies it before booting Linux.
That sounds good and it is something e.g. R-Car already does, it merges
DT fragment from prior stages at U-Boot level and then passes the result
to Linux.
So on ST hardware, the same could very well happen and it would work for
both non-ATF / ATF / ATF+TEE options.
Even this solution sounds good but we are currently not able to do it in
our TF-A/u-boot so not feasible for the moment. So we have to find a
solution for now. Create a new dtb can be this solution. Our internal
strategy is to use scmi on our official ST board. It will be a really
drawback to include a "no-scmi.dtsi" in DH boards (for example) and to
create a stm32mp157c-noscmi-dk2.dts ?
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
1- Break the current ABI: as soon as those patches are merged,
stm32mp157c-dk2.dtb will impose to use
A tf-a for scmi clocks. For people using u-boot spl, the will have
to create their own "no-secure" devicetree.
NAK, this breaks existing boards and existing setups, e.g. DK2 that
does not use ATF.
quoted
2-As you suggest, create a new "secure" dtb per boards (Not my
wish for maintenance perspectives).
I agree with Alex (G) that the "secure" option should be opt-in.
That way existing setups remain working and no extra requirements
are imposed on MP1 users. Esp. since as far as I understand this,
the "secure" part isn't really about security, but rather about
moving clock configuration from Linux to some firmware blob.
quoted
3- Keep kernel device tree as they are and applied this secure
layer (scmi clocks phandle) thanks to dtbo in
U-boot.
Is this really better than
#include "stm32mp15xx-enable-secure-stuff.dtsi"
in a board DT ? Because that is how I imagine the opt-in "secure"
option could work.
Discussing with Patrick about u-boot, we could use dtbo application
thanks to extlinux.conf. BUT it it will not prevent other case (i.e.
TF-A which jump directly in kernel@). So the "least worst" solution
is to create a new "stm32mp1257c-scmi-dk2 board which will overload
clock entries with a scmi phandle (as proposed by Alex).
I raised this issue before with your colleagues. I still believe the
correct way
would be for the TF-A to pass down either a device tree or an overlay
with the
actual settings in use, e.g.:
- Clocks/Resets done via SCMI
- Reserved memory regions
If TF-A directly boots Linux, it can apply the overlay itself,
otherwise it's
passed down to SSBL that applies it before booting Linux.
That sounds good and it is something e.g. R-Car already does, it
merges DT fragment from prior stages at U-Boot level and then passes
the result to Linux.
So on ST hardware, the same could very well happen and it would work
for both non-ATF / ATF / ATF+TEE options.
Even this solution sounds good but we are currently not able to do it in
our TF-A/u-boot so not feasible for the moment. So we have to find a
solution for now. Create a new dtb can be this solution. Our internal
strategy is to use scmi on our official ST board. It will be a really
drawback to include a "no-scmi.dtsi" in DH boards (for example) and to
create a stm32mp157c-noscmi-dk2.dts ?
It could work, as long as all users are reminded to change their build
scripts to pick up a "-noscmi.dtb". I suspect that if this were the case
we'll see quite a few bug reports saying "stm32mp1 no longer boots with
kernel v5.13".
I didn't think of this originally, though u-boot already does the DTB
patching for OPTEE reserved memory regions. It's not too hard to also
patch in the SCMI clocks at boot. In u-boot's case, runtime detection
might even be feasible.
Alex
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
From: Marek Vasut <marex@denx.de> Date: 2021-03-11 20:10:20
On 3/11/21 7:10 PM, Alexandre TORGUE wrote:
Hi Guys
On 3/11/21 5:11 PM, Marek Vasut wrote:
quoted
On 3/11/21 3:41 PM, Ahmad Fatoum wrote:
quoted
Hello,
Hi,
quoted
On 11.03.21 15:02, Alexandre TORGUE wrote:
quoted
On 3/11/21 12:43 PM, Marek Vasut wrote:
quoted
On 3/11/21 9:08 AM, Alexandre TORGUE wrote:
quoted
1- Break the current ABI: as soon as those patches are merged,
stm32mp157c-dk2.dtb will impose to use
A tf-a for scmi clocks. For people using u-boot spl, the will have
to create their own "no-secure" devicetree.
NAK, this breaks existing boards and existing setups, e.g. DK2 that
does not use ATF.
quoted
2-As you suggest, create a new "secure" dtb per boards (Not my
wish for maintenance perspectives).
I agree with Alex (G) that the "secure" option should be opt-in.
That way existing setups remain working and no extra requirements
are imposed on MP1 users. Esp. since as far as I understand this,
the "secure" part isn't really about security, but rather about
moving clock configuration from Linux to some firmware blob.
quoted
3- Keep kernel device tree as they are and applied this secure
layer (scmi clocks phandle) thanks to dtbo in
U-boot.
Is this really better than
#include "stm32mp15xx-enable-secure-stuff.dtsi"
in a board DT ? Because that is how I imagine the opt-in "secure"
option could work.
Discussing with Patrick about u-boot, we could use dtbo application
thanks to extlinux.conf. BUT it it will not prevent other case (i.e.
TF-A which jump directly in kernel@). So the "least worst" solution
is to create a new "stm32mp1257c-scmi-dk2 board which will overload
clock entries with a scmi phandle (as proposed by Alex).
I raised this issue before with your colleagues. I still believe the
correct way
would be for the TF-A to pass down either a device tree or an overlay
with the
actual settings in use, e.g.:
- Clocks/Resets done via SCMI
- Reserved memory regions
If TF-A directly boots Linux, it can apply the overlay itself,
otherwise it's
passed down to SSBL that applies it before booting Linux.
That sounds good and it is something e.g. R-Car already does, it
merges DT fragment from prior stages at U-Boot level and then passes
the result to Linux.
So on ST hardware, the same could very well happen and it would work
for both non-ATF / ATF / ATF+TEE options.
Even this solution sounds good but we are currently not able to do it in
our TF-A/u-boot so not feasible for the moment.
Why not ? U-Boot is perfectly capable of merging prior stage DT and DT
loaded from elsewhere. See R-Car3 for example.
So we have to find a
solution for now. Create a new dtb can be this solution. Our internal
strategy is to use scmi on our official ST board. It will be a really
drawback to include a "no-scmi.dtsi" in DH boards (for example) and to
create a stm32mp157c-noscmi-dk2.dts ?
I would highly prefer the SCMI to be opt-in, not opt-out.
But still, isn't it possible to auto-detect the board configuration in
Linux and pick the clock enumeration based on that automatically ?
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
1- Break the current ABI: as soon as those patches are merged,
stm32mp157c-dk2.dtb will impose to use
A tf-a for scmi clocks. For people using u-boot spl, the will
have to create their own "no-secure" devicetree.
NAK, this breaks existing boards and existing setups, e.g. DK2
that does not use ATF.
quoted
2-As you suggest, create a new "secure" dtb per boards (Not my
wish for maintenance perspectives).
I agree with Alex (G) that the "secure" option should be opt-in.
That way existing setups remain working and no extra requirements
are imposed on MP1 users. Esp. since as far as I understand this,
the "secure" part isn't really about security, but rather about
moving clock configuration from Linux to some firmware blob.
quoted
3- Keep kernel device tree as they are and applied this secure
layer (scmi clocks phandle) thanks to dtbo in
U-boot.
Is this really better than
#include "stm32mp15xx-enable-secure-stuff.dtsi"
in a board DT ? Because that is how I imagine the opt-in "secure"
option could work.
Discussing with Patrick about u-boot, we could use dtbo application
thanks to extlinux.conf. BUT it it will not prevent other case
(i.e. TF-A which jump directly in kernel@). So the "least worst"
solution is to create a new "stm32mp1257c-scmi-dk2 board which will
overload clock entries with a scmi phandle (as proposed by Alex).
I raised this issue before with your colleagues. I still believe the
correct way
would be for the TF-A to pass down either a device tree or an
overlay with the
actual settings in use, e.g.:
- Clocks/Resets done via SCMI
- Reserved memory regions
If TF-A directly boots Linux, it can apply the overlay itself,
otherwise it's
passed down to SSBL that applies it before booting Linux.
That sounds good and it is something e.g. R-Car already does, it
merges DT fragment from prior stages at U-Boot level and then passes
the result to Linux.
So on ST hardware, the same could very well happen and it would work
for both non-ATF / ATF / ATF+TEE options.
Even this solution sounds good but we are currently not able to do it
in our TF-A/u-boot so not feasible for the moment.
Why not ? U-Boot is perfectly capable of merging prior stage DT and DT
loaded from elsewhere. See R-Car3 for example.
Ok, We will check what it is possible to do by this way before taking a
decision.
Thanks
Alex
quoted
So we have to find a solution for now. Create a new dtb can be this
solution. Our internal strategy is to use scmi on our official ST
board. It will be a really drawback to include a "no-scmi.dtsi" in DH
boards (for example) and to create a stm32mp157c-noscmi-dk2.dts ?
I would highly prefer the SCMI to be opt-in, not opt-out.
But still, isn't it possible to auto-detect the board configuration in
Linux and pick the clock enumeration based on that automatically ?