Add power domain driver support for i.mx8m family
Subsystems (2)
cover Add power domain driver support for i.mx8m family
The i.MX8M family is a set of NXP product focus on delivering the latest and greatest video and audio experience combining state-of-the-art media-specific features with high-performance processing while optimized for lowest power consumption. i.MX8MQ, i.MX8MM, i.MX8MN, even the furture i.MX8MP are all belong to this family.
The GPC module is used to manage the PU power domains' power on/off. For the whole i.MX8M family, different SoC has differnt power domain design. the power up sequence has significant difference. all the power sequence must be guaranteed by SW. Some domains' power up sequence need to access the SRC module or sub-system specific GPR. the SRC register & SS's register are not in in the GPC's memory range.
it makes us hard to use the GPCv2 driver to cover all the different power up requirement. Each time, a new SoC is added, we must modify the GPCv2 driver to make it resuable for it. a lot of code need to be added in GPCv2 to support it. we need to access the SRC & SS' GPR, then the GPCv2 driver can NOT be self-contained. Accessing the non-driver specific module's register is a bad practice. Although, the GPC module provided the similar function for PU power domain, but it is not 100% compatible with GPCv2.
The most important thing is that the GPC & SRC module is a security critical resource that security permission must be considered when building the security system. The GPC module is not only used by PU power domain power on/off. It is also used by the TF-A PSCI code to do the CPU core power management. the SRC module control the CPU CORE reset and the CPU reset vector address. if we give the non-secure world write permission to SRC. System can be easily induced to malicious code.
This patchset add a more generic power domain driver that give us the possibility to use one driver to cover the whole i.MX8M family power domain in kernel side. kernel side doesn't need to handle the power domain difference anymore, all the sequence can be abstracted & handled in TF-A side. Most important, We don't need to care if the GPC & SRC is security protected.
Jacky Bai (3):
dt-bindings: power: Add power domain binding for i.mx8m family
soc: imx: Add power domain driver support for i.mx8m family
arm64: dts: freescale: Add power domain nodes for i.mx8mm
.../bindings/power/fsl,imx8m-genpd.txt | 46 ++++ arch/arm64/boot/dts/freescale/imx8mm.dtsi | 103 ++++++++ drivers/soc/imx/Kconfig | 6 + drivers/soc/imx/Makefile | 1 + drivers/soc/imx/imx8m_pm_domains.c | 224 ++++++++++++++++++ include/soc/imx/imx_sip.h | 12 + 6 files changed, 392 insertions(+) create mode 100644 Documentation/devicetree/bindings/power/fsl,imx8m-genpd.txt create mode 100644 drivers/soc/imx/imx8m_pm_domains.c create mode 100644 include/soc/imx/imx_sip.h
Signature · 1 line
2.21.0
PATCH 1/3 dt-bindings: power: Add power domain binding for i.mx8m family
Add the binding doc of power domain for i.MX8M SOC family.
--- .../bindings/power/fsl,imx8m-genpd.txt | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 Documentation/devicetree/bindings/power/fsl,imx8m-genpd.txt
Documentation/devicetree/bindings/power/fsl,imx8m-genpd.txt new file +46 -0
@@ -0,0 +1,46 @@ +Device Tree Bindings for Freescale i.MX8M Generic Power Domain +============================================================== +The binding for the i.MX8M Generic power Domain[1]. + +[1] Documentation/devicetree/bindings/power/power_domain.txt + +Required properties: + + - compatible: should be of: + - "fsl,imx8m-power-domain" + - #power-domain-cells: Number of cells in a PM domain Specifier, must be 0 + - domain-index: should be the domain index number need to pass to TF-A + - domain-name: the name of this pm domain + +Optional properties: + - clocks: a number of phandles to clocks that need to be enabled during + domain power-up sequence to ensure reset propagation into devices + located inside this power domain + - power-supply: Power supply used to power the domain + - parent-domains: the phandle to the parent power domain + +example: + vpu_g1_pd: vpug1-pd { + compatible = "fsl,imx8mm-pm-domain"; + #power-domain-cells = <0>; + domain-index = <6>; + domain-name = "vpu_g1"; + parent-domains = <&vpumix_pd>; + clocks = <&clk IMX8MM_CLK_VPU_G1_ROOT>; + }; + + +Specifying Power domain for IP modules +====================================== + +IP cores belonging to a power domain should contain a 'power-domains' +property that is a phandle for PGC node representing the domain. + +Example of a device that is part of the vpu_g1 power domain: + vpu_g1: vpu_g1@38300000 { + /* ... */ + interrupts = <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>; + interrupt-names = "irq_hantro"; + /* ... */ + power-domains = <&vpu_g1_pd>; + };
Signature · 1 line
2.21.0
PATCH 2/3 soc: imx: Add power domain driver support for i.mx8m family
In reply to Jacky BaiThe i.MX8M family is a set of NXP product focus on delivering the latest and greatest video and audio experience combining state-of-the-art media-specific features with high-performance processing while optimized for lowest power consumption.
i.MX8MQ, i.MX8MM, i.MX8MN, even the furture i.MX8MP are all belong to this family. A GPC module is used to manage all the PU power domain on/off. But the situation is that the number of power domains & the power up sequence has significate difference on those SoCs. Even on the same SoC. The power up sequence still has big difference. It makes us hard to reuse the GPCv2 driver to cover the whole i.MX8M family. Each time a new SoC is supported in the mainline kernel, we need to modify the GPCv2 driver to support it. We need to add or modify hundred lines of code in worst case. It is a bad practice for the driver maintainability.
This driver add a more generic power domain driver that the actual power on/off is done by TF-A code. the abstraction give us the possibility that using one driver to cover the whole i.MX8M family in kernel side.
--- drivers/soc/imx/Kconfig | 6 + drivers/soc/imx/Makefile | 1 + drivers/soc/imx/imx8m_pm_domains.c | 224 +++++++++++++++++++++++++++++ include/soc/imx/imx_sip.h | 12 ++ 4 files changed, 243 insertions(+) create mode 100644 drivers/soc/imx/imx8m_pm_domains.c create mode 100644 include/soc/imx/imx_sip.h
drivers/soc/imx/Kconfig +6 -0
@@ -7,4 +7,10 @@ config IMX_GPCV2_PM_DOMAINS select PM_GENERIC_DOMAINS default y if SOC_IMX7D +config IMX8M_PM_DOMAINS + bool "i.MX8M PM domains" + depends on ARCH_MXC || (COMPILE_TEST && OF) + depends on PM + select PM_GENERIC_DOMAINS + endmenu
drivers/soc/imx/Makefile +1 -0
@@ -1,2 +1,3 @@ obj-$(CONFIG_HAVE_IMX_GPC) += gpc.o obj-$(CONFIG_IMX_GPCV2_PM_DOMAINS) += gpcv2.o +obj-$(CONFIG_IMX8M_PM_DOMAINS) += imx8m_pm_domains.o
drivers/soc/imx/imx8m_pm_domains.c new file +224 -0
224 lines not on this page · raw message
include/soc/imx/imx_sip.h new file +12 -0
@@ -0,0 +1,12 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* +* Copyright 2019 NXP +*/ + +#ifndef __IMX_SIP_H__ +#define __IMX_SIP_H__ + +#define IMX_SIP_GPC 0xC2000000 +#define IMX_SIP_CONFIG_GPC_PM_DOMAIN 0x03 + +#endif /* __IMX_SIP_H__ */
Signature · 1 line
2.21.0
PATCH 3/3 arm64: dts: freescale: Add power domain nodes for i.mx8mm
In reply to Jacky BaiAdd the power domain nodes for i.MX8MM.
--- arch/arm64/boot/dts/freescale/imx8mm.dtsi | 103 ++++++++++++++++++++++ 1 file changed, 103 insertions(+)
arch/arm64/boot/dts/freescale/imx8mm.dtsi +103 -0
@@ -149,6 +149,109 @@ interrupt-affinity = <&A53_0>, <&A53_1>, <&A53_2>, <&A53_3>; }; + power-domains { + compatible = "simple-bus"; + /* HSIO SS */ + hsiomix_pd: hsiomix-pd { + compatible = "fsl,imx8m-pm-domain"; + #power-domain-cells = <0>; + domain-index = <0>; + domain-name = "hsiomix"; + clocks = <&clk IMX8MM_CLK_USB1_CTRL_ROOT>; + }; + + pcie_pd: pcie-pd { + compatible = "fsl,imx8m-pm-domain"; + #power-domain-cells = <0>; + domain-index = <1>; + domain-name = "pcie"; + parent-domains = <&hsiomix_pd>; + }; + + usb_otg1_pd: usbotg1-pd { + compatible = "fsl,imx8m-pm-domain"; + #power-domain-cells = <0>; + domain-index = <2>; + domain-name = "usb_otg1"; + parent-domains = <&hsiomix_pd>; + }; + + usb_otg2_pd: usbotg2-pd { + compatible = "fsl,imx8m-pm-domain"; + #power-domain-cells = <0>; + domain-index = <3>; + domain-name = "usb_otg2"; + parent-domains = <&hsiomix_pd>; + }; + + /* GPU SS */ + gpumix_pd: gpumix-pd { + compatible = "fsl,imx8m-pm-domain"; + #power-domain-cells = <0>; + domain-index = <4>; + domain-name = "gpumix"; + clocks = <&clk IMX8MM_CLK_GPU_BUS_ROOT>, + <&clk IMX8MM_CLK_GPU_AHB>, + <&clk IMX8MM_CLK_GPU2D_ROOT>, + <&clk IMX8MM_CLK_GPU3D_ROOT>; + }; + + /* VPU SS */ + vpumix_pd: vpumix-pd { + compatible = "fsl,imx8m-pm-domain"; + #power-domain-cells = <0>; + domain-index = <5>; + domain-name = "vpumix"; + clocks = <&clk IMX8MM_CLK_VPU_DEC_ROOT>; + }; + + vpu_g1_pd: vpug1-pd { + compatible = "fsl,imx8m-pm-domain"; + #power-domain-cells = <0>; + domain-index = <6>; + domain-name = "vpu_g1"; + parent-domains = <&vpumix_pd>; + clocks = <&clk IMX8MM_CLK_VPU_G1_ROOT>; + }; + + vpu_g2_pd: vpug2-pd { + compatible = "fsl,imx8m-pm-domain"; + #power-domain-cells = <0>; + domain-index = <7>; + domain-name = "vpu_g2"; + parent-domains = <&vpumix_pd>; + clocks = <&clk IMX8MM_CLK_VPU_G2_ROOT>; + }; + + vpu_h1_pd: vpuh1-pd { + compatible = "fsl,imx8m-pm-domain"; + #power-domain-cells = <0>; + domain-index = <8>; + domain-name = "vpu_h1"; + parent-domains = <&vpumix_pd>; + clocks = <&clk IMX8MM_CLK_VPU_H1_ROOT>; + }; + + /* DISP SS */ + dispmix_pd: dispmix-pd { + compatible = "fsl,imx8m-pm-domain"; + #power-domain-cells = <0>; + domain-index = <9>; + domain-name = "dispmix"; + clocks = <&clk IMX8MM_CLK_DISP_ROOT>, + <&clk IMX8MM_CLK_DISP_AXI_ROOT>, + <&clk IMX8MM_CLK_DISP_APB_ROOT>; + }; + + mipi_pd: mipi-pd { + compatible = "fsl,imx8m-pm-domain"; + #power-domain-cells = <0>; + domain-index = <10>; + domain-name = "mipi"; + parent-domains = <&dispmix_pd>; + }; + }; + timer { compatible = "arm,armv8-timer"; interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(6) | IRQ_TYPE_LEVEL_LOW)>, /* Physical Secure */
Signature · 1 line
2.21.0
Quoted 25 lines
From: Jacky Bai
Sent: Wednesday, April 17, 2019 1:27 PMThe i.MX8M family is a set of NXP product focus on delivering the latest and greatest video and audio experience combining state-of-the-art media-specific features with high-performance processing while optimized for lowest power consumption.
i.MX8MQ, i.MX8MM, i.MX8MN, even the furture i.MX8MP are all belong to this family.The GPC module is used to manage the PU power domains' power on/off. For the whole i.MX8M family, different SoC has differnt power domain design. the power up sequence has significant difference.
all the power sequence must be guaranteed by SW. Some domains' power up sequence need to access the SRC module or sub-system specific GPR. the SRC register & SS's register are not in in the GPC's memory range.it makes us hard to use the GPCv2 driver to cover all the different power up requirement. Each time, a new SoC is added, we must modify the GPCv2 driver to make it resuable for it. a lot of code need to be added in GPCv2 to support it. we need to access the SRC & SS' GPR, then the GPCv2 driver can NOT be self-contained. Accessing the non-driver specific module's register is a bad practice. Although, the GPC module provided the similar function for PU power domain, but it is not 100% compatible with GPCv2.
Quoted 8 lines
The most important thing is that the GPC & SRC module is a security critical resource that security permission must be considered when building the security system. The GPC module is not only used by PU power domain power on/off. It is also used by the TF-A PSCI code to do the CPU core power management. the SRC module control the CPU CORE reset and the CPU reset vector address. if we give the non-secure world write permission to SRC. System can be easily induced to malicious code.
Considering the security issue, it looks to me a right direction to move GPC power handling into ATF.
It also helps build a more generic driver and ease other OS integration needed by customers (e.g. QNX, Win10).
Lucas,
How do you think of it?
Regards
Dong Aisheng
Quoted 26 lines
This patchset add a more generic power domain driver that give us the possibility to use one driver to cover the whole i.MX8M family power domain in kernel side. kernel side doesn't need to handle the power domain difference anymore, all the sequence can be abstracted & handled in TF-A side. Most important, We don't need to care if the GPC & SRC is security protected.
Jacky Bai (3):
dt-bindings: power: Add power domain binding for i.mx8m family
soc: imx: Add power domain driver support for i.mx8m family
arm64: dts: freescale: Add power domain nodes for i.mx8mm.../bindings/power/fsl,imx8m-genpd.txt | 46 ++++ arch/arm64/boot/dts/freescale/imx8mm.dtsi | 103 ++++++++ drivers/soc/imx/Kconfig | 6 + drivers/soc/imx/Makefile | 1 + drivers/soc/imx/imx8m_pm_domains.c | 224 ++++++++++++++++++ include/soc/imx/imx_sip.h | 12 + 6 files changed, 392 insertions(+) create mode 100644 Documentation/devicetree/bindings/power/fsl,imx8m-genpd.txt create mode 100644 drivers/soc/imx/imx8m_pm_domains.c create mode 100644 include/soc/imx/imx_sip.h--
2.21.0
Am Mittwoch, den 17.04.2019, 11:16 +0000 schrieb Aisheng Dong:
Quoted 34 lines
Quoted 25 lines
From: Jacky Bai
Sent: Wednesday, April 17, 2019 1:27 PMThe i.MX8M family is a set of NXP product focus on delivering the latest and greatest video and audio experience combining state-of-the-art media-specific features with high-performance processing while optimized for lowest power consumption.
i.MX8MQ, i.MX8MM, i.MX8MN, even the furture i.MX8MP are all belong to this family.The GPC module is used to manage the PU power domains' power on/off. For the whole i.MX8M family, different SoC has differnt power domain design. the power up sequence has significant difference.
all the power sequence must be guaranteed by SW. Some domains' power up sequence need to access the SRC module or sub-system specific GPR. the SRC register & SS's register are not in in the GPC's memory range.it makes us hard to use the GPCv2 driver to cover all the different power up requirement. Each time, a new SoC is added, we must modify the GPCv2 driver to make it resuable for it. a lot of code need to be added in GPCv2 to support it. we need to access the SRC & SS' GPR, then the GPCv2 driver can NOT be self-contained. Accessing the non-driver specific module's register is a bad practice. Although, the GPC module provided the similar function for PU power domain, but it is not 100% compatible with GPCv2.
Quoted 8 lines
The most important thing is that the GPC & SRC module is a security critical resource that security permission must be considered when building the security system. The GPC module is not only used by PU power domain power on/off. It is also used by the TF-A PSCI code to do the CPU core power management. the SRC module control the CPU CORE reset and the CPU reset vector address. if we give the non-secure world write permission to SRC. System can be easily induced to malicious code.
Quoted 7 lines
Considering the security issue, it looks to me a right direction to move GPC power handling into ATF.
It also helps build a more generic driver and ease other OS integration needed by customers (e.g. QNX, Win10).Lucas,
How do you think of it?
I don't yet buy the security argument. There are many more shared parts on the SoC, like the clock controller, that would need to be taken away from the non-secure world if one would want to run an untrusted OS kernel on a i.MX8M system.
To properly implement security on any i.MX8M based system the firmware would need to grow something like a full ARM SCPI implementation, so all shared critical peripherals are solely under firmware control.
I agree that it might make sense to move some parts into the firmware and have much simpler OS level drivers, but I don't agree on the implementation direction taken here. Growing custom PSCI extension interfaces will only get us so far, without solving the system security issue in a holistic way. It is my strong believe that only a complete rearchitecture of the OS support on top of a ARM SCPI firmware interface can solve this properly.
Regards,
Lucas
Quoted 42 lines · Lucas Stach
Am Mittwoch, den 17.04.2019, 11:16 +0000 schrieb Aisheng Dong:
Quoted 33 lines
Quoted 25 lines
From: Jacky Bai
Sent: Wednesday, April 17, 2019 1:27 PMThe i.MX8M family is a set of NXP product focus on delivering the latest and greatest video and audio experience combining state-of-the-art media-specific features with high-performance processing while optimized for lowest power consumption.
i.MX8MQ, i.MX8MM, i.MX8MN, even the furture i.MX8MP are all belong to this family.The GPC module is used to manage the PU power domains' power on/off. For the whole i.MX8M family, different SoC has differnt power domain design. the power up sequence has significant difference.
all the power sequence must be guaranteed by SW. Some domains' power up sequence need to access the SRC module or sub-system specific GPR. the SRC register & SS's register are not in in the GPC's memory range.it makes us hard to use the GPCv2 driver to cover all the different power up requirement. Each time, a new SoC is added, we must modify the GPCv2 driver to make it resuable for it. a lot of code need to be added in GPCv2 to support it. we need to access the SRC & SS' GPR, then the GPCv2 driver can NOT be self-contained. Accessing the non-driver specific module's register is a bad practice. Although, the GPC module provided the similar function for PU power domain, but it is not 100% compatible with GPCv2.
Quoted 7 lines
The most important thing is that the GPC & SRC module is a security critical resource that security permission must be considered when building the security system. The GPC module is not only used by PU power domain power on/off. It is also used by the TF-A PSCI code to do the CPU core power management. the SRC module control the CPU CORE reset and the CPU reset vector address. if we give the non-secure world write permission to SRC. System can be easily induced to malicious code.
Quoted 7 lines
Considering the security issue, it looks to me a right direction to move GPC power handling into ATF.
It also helps build a more generic driver and ease other OS integration needed by customers (e.g. QNX, Win10).Lucas,
How do you think of it?
Quoted 8 lines
I don't yet buy the security argument. There are many more shared parts on the SoC, like the clock controller, that would need to be taken away from the non-secure world if one would want to run an untrusted OS kernel on a i.MX8M system.
To properly implement security on any i.MX8M based system the firmware would need to grow something like a full ARM SCPI implementation, so all shared critical peripherals are solely under firmware control.
It might be possible to rework this to use some form of SCMI-over-SMC instead of vendor-specific SMCCC SIP calls
+SCMI maintainer
Quoted 7 lines
I agree that it might make sense to move some parts into the firmware and have much simpler OS level drivers, but I don't agree on the implementation direction taken here. Growing custom PSCI extension interfaces will only get us so far, without solving the system security issue in a holistic way. It is my strong believe that only a complete rearchitecture of the OS support on top of a ARM SCPI firmware interface can solve this properly.
Hiding everything critical for security (especially CCM) behind a SCMI interface would be a large amount of work but introducing SCMI incrementally (starting with imx8mm power) would be useful by itself because it simplifies OS implementation.
Many at NXP have attempted to evaluate SCMI and their conclusion has always been that "many extensions are required".
--
Regards,
Leonard
Am Mittwoch, den 17.04.2019, 12:40 +0000 schrieb Leonard Crestez:
Quoted 65 lines · Lucas Stach
Quoted 42 lines
Am Mittwoch, den 17.04.2019, 11:16 +0000 schrieb Aisheng Dong:
Quoted 33 lines
Quoted 25 lines
From: Jacky Bai
Sent: Wednesday, April 17, 2019 1:27 PMThe i.MX8M family is a set of NXP product focus on delivering the latest and greatest video and audio experience combining state-of-the-art media-specific features with high-performance processing while optimized for lowest power consumption.
i.MX8MQ, i.MX8MM, i.MX8MN, even the furture i.MX8MP are all belong to this family.The GPC module is used to manage the PU power domains' power on/off. For the whole i.MX8M family, different SoC has differnt power domain design. the power up sequence has significant difference.
all the power sequence must be guaranteed by SW. Some domains' power up sequence need to access the SRC module or sub-system specific GPR. the SRC register & SS's register are not in in the GPC's memory range.it makes us hard to use the GPCv2 driver to cover all the different power up requirement. Each time, a new SoC is added, we must modify the GPCv2 driver to make it resuable for it. a lot of code need to be added in GPCv2 to support it. we need to access the SRC & SS' GPR, then the GPCv2 driver can NOT be self-contained. Accessing the non-driver specific module's register is a bad practice. Although, the GPC module provided the similar function for PU power domain, but it is not 100% compatible with GPCv2.
Quoted 7 lines
The most important thing is that the GPC & SRC module is a security critical resource that security permission must be considered when building the security system. The GPC module is not only used by PU power domain power on/off. It is also used by the TF-A PSCI code to do the CPU core power management. the SRC module control the CPU CORE reset and the CPU reset vector address. if we give the non-secure world write permission to SRC. System can be easily induced to malicious code.
Quoted 7 lines
Considering the security issue, it looks to me a right direction to move GPC power handling into ATF.
It also helps build a more generic driver and ease other OS integration needed by customers (e.g. QNX, Win10).Lucas,
How do you think of it?Quoted 8 lines
I don't yet buy the security argument. There are many more shared parts on the SoC, like the clock controller, that would need to be taken away from the non-secure world if one would want to run an untrusted OS kernel on a i.MX8M system.
To properly implement security on any i.MX8M based system the firmware would need to grow something like a full ARM SCPI implementation, so all shared critical peripherals are solely under firmware control.
It might be possible to rework this to use some form of SCMI-over-SMC instead of vendor-specific SMCCC SIP calls
+SCMI maintainer
Quoted 7 lines
I agree that it might make sense to move some parts into the firmware and have much simpler OS level drivers, but I don't agree on the implementation direction taken here. Growing custom PSCI extension interfaces will only get us so far, without solving the system security issue in a holistic way. It is my strong believe that only a complete rearchitecture of the OS support on top of a ARM SCPI firmware interface can solve this properly.
Quoted 4 lines
Hiding everything critical for security (especially CCM) behind a SCMI interface would be a large amount of work but introducing SCMI incrementally (starting with imx8mm power) would be useful by itself because it simplifies OS implementation.
I'm totally on-board with baby steps if it gets us into the right direction, so what you propose makes sense to me.
What I'm not okay with is tying the upstream kernel into an ad-hoc firmware interface in the name of system security, if there is no chance that proper security will ever be able to be achieved with the ad-hoc interface. Having dependencies between the OS kernel and system firmware is a burden on system integrators and I'm only willing to accept that burden if it's clear that there is some real value to it.
Regards,
Lucas
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Quoted 71 lines · Lucas Stach
Am Mittwoch, den 17.04.2019, 12:40 +0000 schrieb Leonard Crestez:
Quoted 65 lines · Lucas Stach
Quoted 42 lines
Am Mittwoch, den 17.04.2019, 11:16 +0000 schrieb Aisheng Dong:
Quoted 33 lines
Quoted 25 lines
From: Jacky Bai
Sent: Wednesday, April 17, 2019 1:27 PMThe i.MX8M family is a set of NXP product focus on delivering the latest and greatest video and audio experience combining state-of-the-art media-specific features with high-performance processing while optimized for lowest power consumption.
i.MX8MQ, i.MX8MM, i.MX8MN, even the furture i.MX8MP are all belong to this family.The GPC module is used to manage the PU power domains' power on/off. For the whole i.MX8M family, different SoC has differnt power domain design. the power up sequence has significant difference.
all the power sequence must be guaranteed by SW. Some domains' power up sequence need to access the SRC module or sub-system specific GPR. the SRC register & SS's register are not in in the GPC's memory range.it makes us hard to use the GPCv2 driver to cover all the different power up requirement. Each time, a new SoC is added, we must modify the GPCv2 driver to make it resuable for it. a lot of code need to be added in GPCv2 to support it. we need to access the SRC & SS' GPR, then the GPCv2 driver can NOT be self-contained. Accessing the non-driver specific module's register is a bad practice. Although, the GPC module provided the similar function for PU power domain, but it is not 100% compatible with GPCv2.
Quoted 7 lines
The most important thing is that the GPC & SRC module is a security critical resource that security permission must be considered when building the security system. The GPC module is not only used by PU power domain power on/off. It is also used by the TF-A PSCI code to do the CPU core power management. the SRC module control the CPU CORE reset and the CPU reset vector address. if we give the non-secure world write permission to SRC. System can be easily induced to malicious code.
Quoted 7 lines
Considering the security issue, it looks to me a right direction to move GPC power handling into ATF.
It also helps build a more generic driver and ease other OS integration needed by customers (e.g. QNX, Win10).Lucas,
How do you think of it?Quoted 8 lines
I don't yet buy the security argument. There are many more shared parts on the SoC, like the clock controller, that would need to be taken away from the non-secure world if one would want to run an untrusted OS kernel on a i.MX8M system.
To properly implement security on any i.MX8M based system the firmware would need to grow something like a full ARM SCPI implementation, so all shared critical peripherals are solely under firmware control.
It might be possible to rework this to use some form of SCMI-over-SMC instead of vendor-specific SMCCC SIP calls
+SCMI maintainer
Quoted 7 lines
I agree that it might make sense to move some parts into the firmware and have much simpler OS level drivers, but I don't agree on the implementation direction taken here. Growing custom PSCI extension interfaces will only get us so far, without solving the system security issue in a holistic way. It is my strong believe that only a complete rearchitecture of the OS support on top of a ARM SCPI firmware interface can solve this properly.
Quoted 4 lines
Hiding everything critical for security (especially CCM) behind a SCMI interface would be a large amount of work but introducing SCMI incrementally (starting with imx8mm power) would be useful by itself because it simplifies OS implementation.
Quoted 5 lines
I'm totally on-board with baby steps if it gets us into the right direction, so what you propose makes sense to me.
What I'm not okay with is tying the upstream kernel into an ad-hoc firmware interface in the name of system security,
Exactly, sorry I should have read through the thread. I just responded in other email with similar thoughts/concerns.
Signature · 7 lines
Regards, Sudeep _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Quoted 54 lines
Subject: Re: [PATCH 0/3] Add power domain driver support for i.mx8m family
Quoted 15 lines · Lucas Stach
Am Mittwoch, den 17.04.2019, 11:16 +0000 schrieb Aisheng Dong:
Quoted 14 lines
Quoted 14 lines
From: Jacky Bai
Sent: Wednesday, April 17, 2019 1:27 PMThe i.MX8M family is a set of NXP product focus on delivering the latest and greatest video and audio experience combining state-of-the-art media-specific features with high-performance processing while optimized for lowest power consumption. i.MX8MQ, i.MX8MM, i.MX8MN, even the furture i.MX8MP are all belong to this family.
The GPC module is used to manage the PU power domains' power on/off. For the whole i.MX8M family, different SoC has differnt power domain design. the power up sequence has significant difference. all the power sequence must be guaranteed by SW. Some domains'
power
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
up sequence need to access the SRC module or sub-system specific GPR. the SRC register & SS's register are not in in the GPC's memory range.
it makes us hard to use the GPCv2 driver to cover all the different power up requirement. Each time, a new SoC is added, we must modify the GPCv2 driver to make it resuable for it. a lot of code need to be added
in GPCv2 to support it.
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
we need to access the SRC & SS' GPR, then the GPCv2 driver can NOT be self-contained. Accessing the non-driver specific module's register is a bad practice. Although, the GPC module provided the similar function for PU power domain, but it is not 100% compatible with
GPCv2.
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
The most important thing is that the GPC & SRC module is a security critical resource that security permission must be considered when building the security system. The GPC module is not only used by PU power domain power on/off. It is also used by the TF-A PSCI code to do the CPU core power management. the SRC module control the CPU CORE reset and the CPU reset vector address. if we give the non-secure
world write permission to SRC.
Quoted 15 lines
Quoted 9 lines
Quoted 1 line
System can be easily induced to malicious code.
Considering the security issue, it looks to me a right direction to move GPC power handling into ATF.
It also helps build a more generic driver and ease other OS integration needed by customers (e.g. QNX, Win10).Lucas,
How do you think of it?I don't yet buy the security argument. There are many more shared parts on the SoC, like the clock controller, that would need to be taken away from the non-secure world if one would want to run an untrusted OS kernel on a i.MX8M system.
Quoted 6 lines
Quoted 3 lines
To properly implement security on any i.MX8M based system the firmware would need to grow something like a full ARM SCPI implementation, so all shared critical peripherals are solely under firmware control.
It might be possible to rework this to use some form of SCMI-over-SMC instead of vendor-specific SMCCC SIP calls
Whether SCMI or just SIP, it will make it easy to support virtualization(partition) or TEE.
Quoted 2 lines
+SCMI maintainer
We need implement firmware in ATF, and use SMC as the mailbox. I have taken Andre's previous patch to support smc mailbox and addressed some comments, and trying integrate with SCMI.
The major issue is SCMI spec does not include SMC support.
Sudeep, do you have any suggestions?
Thanks,
Peng.
Quoted 19 lines
Quoted 8 lines
I agree that it might make sense to move some parts into the firmware and have much simpler OS level drivers, but I don't agree on the implementation direction taken here. Growing custom PSCI extension interfaces will only get us so far, without solving the system security issue in a holistic way. It is my strong believe that only a complete rearchitecture of the OS support on top of a ARM SCPI firmware interface can solve this properly.
Hiding everything critical for security (especially CCM) behind a SCMI interface would be a large amount of work but introducing SCMI incrementally (starting with imx8mm power) would be useful by itself because it simplifies OS implementation.
Many at NXP have attempted to evaluate SCMI and their conclusion has always been that "many extensions are required".
--
Regards,
Leonard
Quoted 1 line · Leonard Crestez
On 4/17/2019 3:13 PM, Lucas Stach wrote:
[...]
Quoted 6 lines
Quoted 6 lines
I don't yet buy the security argument. There are many more shared parts on the SoC, like the clock controller, that would need to be taken away from the non-secure world if one would want to run an untrusted OS kernel on a i.MX8M system.
Quoted 7 lines
Quoted 3 lines
To properly implement security on any i.MX8M based system the firmware would need to grow something like a full ARM SCPI implementation, so all shared critical peripherals are solely under firmware control.
It might be possible to rework this to use some form of SCMI-over-SMC instead of vendor-specific SMCCC SIP calls
Sounds feasible and good if all the custom IDs/calls/..etc are well hidden in the firmware(TF-A in this case) behind the existing abstraction in Linux kernel.
Quoted 2 lines
+SCMI maintainer
Thanks for including.
Quoted 7 lines
Quoted 7 lines
I agree that it might make sense to move some parts into the firmware and have much simpler OS level drivers, but I don't agree on the implementation direction taken here. Growing custom PSCI extension interfaces will only get us so far, without solving the system security issue in a holistic way. It is my strong believe that only a complete rearchitecture of the OS support on top of a ARM SCPI firmware interface can solve this properly.
+1 again, just to re-iterate the emphasis on the above and the degree to which I align with it.
Quoted 5 lines
Hiding everything critical for security (especially CCM) behind a SCMI interface would be a large amount of work but introducing SCMI incrementally (starting with imx8mm power) would be useful by itself because it simplifies OS implementation.
Agreed, but not at the expense of introducing and maintaining *random* *one-off* *custom* SMC extensions. Sorry, that's not open to debate.
Quoted 3 lines
Many at NXP have attempted to evaluate SCMI and their conclusion has always been that "many extensions are required".
I would like to hear the evaluation. Don't assume that you need to implement something similar to ARM SCMI reference design. All OSPM like Linux kernel cares is conformance to the interface, what/how you implement on the other side is left to you.
Signature · 2 lines
Regards, Sudeep
Quoted 24 lines · Sudeep Holla
Quoted 11 lines
Quoted 8 lines
I don't yet buy the security argument. There are many more shared parts on the SoC, like the clock controller, that would need to be taken away from the non-secure world if one would want to run an untrusted OS kernel on a i.MX8M system.
To properly implement security on any i.MX8M based system the firmware would need to grow something like a full ARM SCPI implementation, so all shared critical peripherals are solely under firmware control.
It might be possible to rework this to use some form of SCMI-over-SMC instead of vendor-specific SMCCC SIP calls
Sounds feasible and good if all the custom IDs/calls/..etc are well hidden in the firmware(TF-A in this case) behind the existing abstraction in Linux kernel.
Quoted 4 lines
Hiding everything critical for security (especially CCM) behind a SCMI interface would be a large amount of work but introducing SCMI incrementally (starting with imx8mm power) would be useful by itself because it simplifies OS implementation.
Agreed, but not at the expense of introducing and maintaining *random* *one-off* *custom* SMC extensions. Sorry, that's not open to debate.
Quoted 7 lines
Quoted 2 lines
Many at NXP have attempted to evaluate SCMI and their conclusion has always been that "many extensions are required".
I would like to hear the evaluation. Don't assume that you need to implement something similar to ARM SCMI reference design. All OSPM like Linux kernel cares is conformance to the interface, what/how you implement on the other side is left to you.
Brief summary from some attempts at nudging NXP devs towards SCMI:
There is no SCMI-over-SMC support specified? This would make it possible to use SCMI as a purely software solution on platforms which did not take SCMI into account at hardware design time or which don't have a dedicated SCP inside the SOC. This applies to all imx.
Peng has been looking at some out-of-tree arm-smc-mailbox patches so it's not just NXP which would like the option of implementing SCMI vendor side in ATF. Like this: https://lwn.net/Articles/726861/
Blessing SCMI-over-SMC would allow stuff like intercepting a SCMI message in EL2; checking if the guest is allowed to use that resource and then either forward to EL3 or return an error.
SCMI clock protocol does not cover muxes? On imx the clk hierarchy is very intricate and it relies on many clk core features (including notifiers) and occasional assigned-clocks-parents properties to control muxes from linux. Moving all that to firmware would be a huge amount of effort.
If SCMI included a generic clk mux and allowed keeping the clk hierarchy inside linux then the effort required for hiding the CCM would still be large, but more approachable. It would not "simplify the rich OS" but it would still improve security.
Last point is that SCMI does not cover pinctrl? This is a large chunk of firmware functionality on some imx and security control over individual pins is desirable.
--
Regards,
Leonard
Quoted 28 lines · Leonard Crestez
Quoted 27 lines · Sudeep Holla
Quoted 11 lines
Quoted 8 lines
I don't yet buy the security argument. There are many more shared parts on the SoC, like the clock controller, that would need to be taken away from the non-secure world if one would want to run an untrusted OS kernel on a i.MX8M system.
To properly implement security on any i.MX8M based system the firmware would need to grow something like a full ARM SCPI implementation, so all shared critical peripherals are solely under firmware control.
It might be possible to rework this to use some form of SCMI-over-SMC instead of vendor-specific SMCCC SIP calls
Sounds feasible and good if all the custom IDs/calls/..etc are well hidden in the firmware(TF-A in this case) behind the existing abstraction in Linux kernel.
Quoted 4 lines
Hiding everything critical for security (especially CCM) behind a SCMI interface would be a large amount of work but introducing SCMI incrementally (starting with imx8mm power) would be useful by itself because it simplifies OS implementation.
Agreed, but not at the expense of introducing and maintaining *random* *one-off* *custom* SMC extensions. Sorry, that's not open to debate.
Quoted 2 lines
Many at NXP have attempted to evaluate SCMI and their conclusion has always been that "many extensions are required".
Quoted 7 lines
Quoted 4 lines
I would like to hear the evaluation. Don't assume that you need to implement something similar to ARM SCMI reference design. All OSPM like Linux kernel cares is conformance to the interface, what/how you implement on the other side is left to you.
Brief summary from some attempts at nudging NXP devs towards SCMI:
Thanks for providing the evaluation details.
Quoted 6 lines
There is no SCMI-over-SMC support specified? This would make it possible to use SCMI as a purely software solution on platforms which did not take SCMI into account at hardware design time or which don't have a dedicated SCP inside the SOC. This applies to all imx.
While I admit, the section of SCMI specification that touches transport is quite lean, I would view it as done intentionally as the specification is mainly concentrated on it's subject matter which is protocol and not the transport itself. So did the evaluation attempted to consider/try SMC as transport retaining protocol as is ?
I can't see any issues with that and hence I am asking it loud here.
Quoted 4 lines
Peng has been looking at some out-of-tree arm-smc-mailbox patches so it's not just NXP which would like the option of implementing SCMI vendor side in ATF. Like this: https://lwn.net/Articles/726861/
OK, any inputs from that study ?
Quoted 4 lines
Blessing SCMI-over-SMC would allow stuff like intercepting a SCMI message in EL2; checking if the guest is allowed to use that resource and then either forward to EL3 or return an error.
Why are you mixing virtualisation and EL2 here ? Yes we need them but it should be optional and if a platform doesn't need it, it should be possible to skip it.
Quoted 7 lines
SCMI clock protocol does not cover muxes? On imx the clk hierarchy is very intricate and it relies on many clk core features (including notifiers) and occasional assigned-clocks-parents properties to control muxes from linux. Moving all that to firmware would be a huge amount of effort.
Yes it may be huge amount of work. But is it completely safe as claimed ? Giving access to mux controls in OSPM is no so safe/secure in the modern world. So you either make it safe with that extra huge effort needed or just keep everything in OSPM. But IMO anything in between is not worth it.
Quoted 5 lines
If SCMI included a generic clk mux and allowed keeping the clk hierarchy inside linux then the effort required for hiding the CCM would still be large, but more approachable. It would not "simplify the rich OS" but it would still improve security.
Why do you need to keep the clk hierarchy in Linux ?
Quoted 5 lines
Last point is that SCMI does not cover pinctrl? This is a large chunk of firmware functionality on some imx and security control over individual pins is desirable.
Yes but is that something available at runtime ? Can't that be one-off firmware setting. Will Linux need to configure it differently on each boot ? Just trying to understand. You say security control here and is it really safe to give OS access to control those ?
In short, if you had a full blown protocol like few other platforms, the push back would have been minimal. Instead, i.MX chose to implement a solution which doesn't have a design thought before and custom SMC APIs added on fly whenever a new request is raised by OSPM to control things that it thinks it should. I am sure, the very next platform will have it's own set of requirements and custom SMC APIs/interface and no one has even bothered about long term maintenance of these.
So assuming that trend, I would NACK this as it stands.
--
Regards,
Sudeep
Quoted 8 lines · Sudeep Holla
Quoted 6 lines · Leonard Crestez
Quoted 5 lines · Sudeep Holla
Quoted 5 lines
Quoted 5 lines
I don't yet buy the security argument. There are many more shared parts on the SoC, like the clock controller, that would need to be taken away from the non-secure world if one would want to run an untrusted OS kernel on a i.MX8M system.
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 3 lines
To properly implement security on any i.MX8M based system the firmware would need to grow something like a full ARM SCPI implementation, so all shared critical peripherals are solely under firmware control.
It might be possible to rework this to use some form of SCMI-over-SMC instead of vendor-specific SMCCC SIP calls
I was just curious to know if there is any progress being made on this. The i.mx8mm-evk is missing functionality upstream and I think the power domain support would help enable some of these features.
thanks
adam
Quoted 107 lines
Quoted 16 lines
Quoted 16 lines
Sounds feasible and good if all the custom IDs/calls/..etc are well hidden in the firmware(TF-A in this case) behind the existing abstraction in Linux kernel.
Quoted 4 lines
Hiding everything critical for security (especially CCM) behind a SCMI interface would be a large amount of work but introducing SCMI incrementally (starting with imx8mm power) would be useful by itself because it simplifies OS implementation.
Agreed, but not at the expense of introducing and maintaining *random* *one-off* *custom* SMC extensions. Sorry, that's not open to debate.
Quoted 2 lines
Many at NXP have attempted to evaluate SCMI and their conclusion has always been that "many extensions are required".
Quoted 7 lines
Quoted 4 lines
I would like to hear the evaluation. Don't assume that you need to implement something similar to ARM SCMI reference design. All OSPM like Linux kernel cares is conformance to the interface, what/how you implement on the other side is left to you.
Brief summary from some attempts at nudging NXP devs towards SCMI:
Thanks for providing the evaluation details.
Quoted 6 lines
There is no SCMI-over-SMC support specified? This would make it possible to use SCMI as a purely software solution on platforms which did not take SCMI into account at hardware design time or which don't have a dedicated SCP inside the SOC. This applies to all imx.
While I admit, the section of SCMI specification that touches transport is quite lean, I would view it as done intentionally as the specification is mainly concentrated on it's subject matter which is protocol and not the transport itself. So did the evaluation attempted to consider/try SMC as transport retaining protocol as is ?
I can't see any issues with that and hence I am asking it loud here.
Quoted 4 lines
Peng has been looking at some out-of-tree arm-smc-mailbox patches so it's not just NXP which would like the option of implementing SCMI vendor side in ATF. Like this: https://lwn.net/Articles/726861/
OK, any inputs from that study ?
Quoted 4 lines
Blessing SCMI-over-SMC would allow stuff like intercepting a SCMI message in EL2; checking if the guest is allowed to use that resource and then either forward to EL3 or return an error.
Why are you mixing virtualisation and EL2 here ? Yes we need them but it should be optional and if a platform doesn't need it, it should be possible to skip it.
Quoted 7 lines
SCMI clock protocol does not cover muxes? On imx the clk hierarchy is very intricate and it relies on many clk core features (including notifiers) and occasional assigned-clocks-parents properties to control muxes from linux. Moving all that to firmware would be a huge amount of effort.
Yes it may be huge amount of work. But is it completely safe as claimed ? Giving access to mux controls in OSPM is no so safe/secure in the modern world. So you either make it safe with that extra huge effort needed or just keep everything in OSPM. But IMO anything in between is not worth it.
Quoted 5 lines
If SCMI included a generic clk mux and allowed keeping the clk hierarchy inside linux then the effort required for hiding the CCM would still be large, but more approachable. It would not "simplify the rich OS" but it would still improve security.
Why do you need to keep the clk hierarchy in Linux ?
Quoted 5 lines
Last point is that SCMI does not cover pinctrl? This is a large chunk of firmware functionality on some imx and security control over individual pins is desirable.
Yes but is that something available at runtime ? Can't that be one-off firmware setting. Will Linux need to configure it differently on each boot ? Just trying to understand. You say security control here and is it really safe to give OS access to control those ?
In short, if you had a full blown protocol like few other platforms, the push back would have been minimal. Instead, i.MX chose to implement a solution which doesn't have a design thought before and custom SMC APIs added on fly whenever a new request is raised by OSPM to control things that it thinks it should. I am sure, the very next platform will have it's own set of requirements and custom SMC APIs/interface and no one has even bothered about long term maintenance of these.
So assuming that trend, I would NACK this as it stands.
--
Regards,
Sudeep_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Hi,
Quoted 13 lines · Adam Ford
Quoted 12 lines · Sudeep Holla
Quoted 10 lines · Leonard Crestez
Quoted 9 lines · Sudeep Holla
Quoted 9 lines
Quoted 8 lines
I don't yet buy the security argument. There are many more shared parts on the SoC, like the clock controller, that would need to be taken away from the non-secure world if one would want to run an untrusted OS kernel on a i.MX8M system.
To properly implement security on any i.MX8M based system the firmware would need to grow something like a full ARM SCPI implementation, so all shared critical peripherals are solely under firmware control.
Quoted 7 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
It might be possible to rework this to use some form of SCMI-over-SMC instead of vendor-specific SMCCC SIP calls
I was just curious to know if there is any progress being made on this. The i.mx8mm-evk is missing functionality upstream and I think the power domain support would help enable some of these features.
Has there been any decision or action taken in this topic? Will the power domain driver as proposed in this patch be upstreamed at some time, or rather not?
I try to build a mainline BSP for i.MX8MM (ML U-Boot, ML TF-A, ML Linux) and I integrated display and graphics support from the downstream NXP kernel.
While most things already work fine, there's the issue of how to handle the power domains. Currently I need to ungate some clocks in the TF-A BL31 to get for example the GPU running. If I understand this correctly the proposed power domain driver could handle this in Linux otherwise.
Thanks,
Frieder
Quoted 46 lines
-----Original Message-----
From: Schrempf Frieder <[email protected]>
Sent: Thursday, February 13, 2020 5:16 PM
To: Adam Ford <[email protected]>; Sudeep Holla <[email protected]>
Cc: Aisheng Dong <[email protected]>; [email protected]; Peng Fan <[email protected]>; Souvik Chakravarty <[email protected]>; Jacky Bai <[email protected]>; [email protected]; Clément Faure <[email protected]>; [email protected]; [email protected]; [email protected]; dl-linux-imx <[email protected]>; [email protected]; Andre Przywara <[email protected]>; Silvano Di Ninno <[email protected]>; Leonard Crestez <[email protected]>; [email protected]; [email protected]; Lucas Stach <[email protected]>
Subject: Re: [PATCH 0/3] Add power domain driver support for i.mx8m familyHi,
Quoted 1 line · Adam Ford
On Thu, Apr 18, 2019 at 9:43 AM Sudeep Holla <[email protected]>
Quoted 11 lines · wrote:
Quoted 11 lines · Leonard Crestez
Quoted 9 lines · Sudeep Holla
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
I don't yet buy the security argument. There are many more shared parts on the SoC, like the clock controller, that would need to be taken away from the non-secure world if one would want to run an untrusted OS kernel on a i.MX8M system.
To properly implement security on any i.MX8M based system the firmware would need to grow something like a full ARM SCPI implementation, so all shared critical peripherals are solely under
firmware control.
Quoted 8 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
It might be possible to rework this to use some form of SCMI-over-SMC instead of vendor-specific SMCCC SIP calls
I was just curious to know if there is any progress being made on this. The i.mx8mm-evk is missing functionality upstream and I think the power domain support would help enable some of these features.
Has there been any decision or action taken in this topic? Will the power domain driver as proposed in this patch be upstreamed at some time, or rather not?
Quoted 9 lines
I try to build a mainline BSP for i.MX8MM (ML U-Boot, ML TF-A, ML Linux) and I integrated display and graphics support from the downstream NXP kernel.
While most things already work fine, there's the issue of how to handle the power domains. Currently I need to ungate some clocks in the TF-A BL31 to get for example the GPU running. If I understand this correctly the proposed power domain driver could handle this in Linux otherwise.
the SCMI over SMC is still under review
BR
Jacky Bai
Quoted 2 lines
Thanks,
Frieder
Quoted 50 lines · Jacky Bai
Quoted 50 lines
-----Original Message-----
From: Schrempf Frieder <[email protected]>
Sent: Thursday, February 13, 2020 5:16 PM
To: Adam Ford <[email protected]>; Sudeep Holla <[email protected]>
Cc: Aisheng Dong <[email protected]>; [email protected]; Peng Fan <[email protected]>; Souvik Chakravarty <[email protected]>; Jacky Bai <[email protected]>; [email protected]; Clément Faure <[email protected]>; [email protected]; [email protected]; [email protected]; dl-linux-imx <[email protected]>; [email protected]; Andre Przywara <[email protected]>; Silvano Di Ninno <[email protected]>; Leonard Crestez <[email protected]>; [email protected]; [email protected]; Lucas Stach <[email protected]>
Subject: Re: [PATCH 0/3] Add power domain driver support for i.mx8m familyHi,
Quoted 1 line · Adam Ford
On Thu, Apr 18, 2019 at 9:43 AM Sudeep Holla <[email protected]>
Quoted 11 lines · wrote:
Quoted 11 lines · Leonard Crestez
Quoted 9 lines · Sudeep Holla
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
I don't yet buy the security argument. There are many more shared parts on the SoC, like the clock controller, that would need to be taken away from the non-secure world if one would want to run an untrusted OS kernel on a i.MX8M system.
To properly implement security on any i.MX8M based system the firmware would need to grow something like a full ARM SCPI implementation, so all shared critical peripherals are solely under
firmware control.
Quoted 8 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
It might be possible to rework this to use some form of SCMI-over-SMC instead of vendor-specific SMCCC SIP calls
I was just curious to know if there is any progress being made on this. The i.mx8mm-evk is missing functionality upstream and I think the power domain support would help enable some of these features.
Has there been any decision or action taken in this topic? Will the power domain driver as proposed in this patch be upstreamed at some time, or rather not?
I try to build a mainline BSP for i.MX8MM (ML U-Boot, ML TF-A, ML Linux) and I integrated display and graphics support from the downstream NXP kernel.
Quoted 8 lines
Quoted 5 lines
While most things already work fine, there's the issue of how to handle the power domains. Currently I need to ungate some clocks in the TF-A BL31 to get for example the GPU running. If I understand this correctly the proposed power domain driver could handle this in Linux otherwise.
the SCMI over SMC is still under review
Ok, I see. Thanks for the information.
Once the SCMI over SMC driver is available in Linux, what else needs to be done to handle the example case given above (GPU root clock ungate)?
I guess this would need an imx-specific handler in the TF-A. Is this interface already available in mainline TF-A?
Quoted 48 lines · Jacky Bai
Quoted 48 lines
-----Original Message-----
From: Schrempf Frieder <[email protected]>
Sent: Thursday, February 13, 2020 5:16 PM
To: Adam Ford <[email protected]>; Sudeep Holla <[email protected]>
Cc: Aisheng Dong <[email protected]>; [email protected]; Peng Fan <[email protected]>; Souvik Chakravarty <[email protected]>; Jacky Bai <[email protected]>; [email protected]; Clément Faure <[email protected]>; [email protected]; [email protected]; [email protected]; dl-linux-imx <[email protected]>; [email protected]; Andre Przywara <[email protected]>; Silvano Di Ninno <[email protected]>; Leonard Crestez <[email protected]>; [email protected]; [email protected]; Lucas Stach <[email protected]>
Subject: Re: [PATCH 0/3] Add power domain driver support for i.mx8m familyHi,
Quoted 1 line · Adam Ford
On Thu, Apr 18, 2019 at 9:43 AM Sudeep Holla <[email protected]>
Quoted 10 lines · wrote:
Quoted 10 lines · Leonard Crestez
Quoted 9 lines · Sudeep Holla
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
I don't yet buy the security argument. There are many more shared parts on the SoC, like the clock controller, that would need to be taken away from the non-secure world if one would want to run an untrusted OS kernel on a i.MX8M system.
To properly implement security on any i.MX8M based system the firmware would need to grow something like a full ARM SCPI implementation, so all shared critical peripherals are solely under
firmware control.
Quoted 7 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
It might be possible to rework this to use some form of SCMI-over-SMC instead of vendor-specific SMCCC SIP calls
I was just curious to know if there is any progress being made on this. The i.mx8mm-evk is missing functionality upstream and I think the power domain support would help enable some of these features.
Has there been any decision or action taken in this topic? Will the power domain driver as proposed in this patch be upstreamed at some time, or rather not?
I try to build a mainline BSP for i.MX8MM (ML U-Boot, ML TF-A, ML Linux) and I integrated display and graphics support from the downstream NXP kernel.
Quoted 7 lines
Quoted 5 lines
While most things already work fine, there's the issue of how to handle the power domains. Currently I need to ungate some clocks in the TF-A BL31 to get for example the GPU running. If I understand this correctly the proposed power domain driver could handle this in Linux otherwise.
the SCMI over SMC is still under review
Even if the SCMI over SMC is ready at some point, it's still unclear to me how you intend to abstract the GPC behind the SCMI interface in the TF-A. The power domains have dependencies both into the regulator and the clock framework. Both are currently under exclusive control of the rich OS. How do you intend to allow the TF-A to control the power supplies and necessary reset clocks without messing up any state in the rich OS?
Regards,
Lucas
Quoted 57 lines · Lucas Stach
Quoted 48 lines · Jacky Bai
Quoted 48 lines
-----Original Message-----
From: Schrempf Frieder <[email protected]>
Sent: Thursday, February 13, 2020 5:16 PM
To: Adam Ford <[email protected]>; Sudeep Holla <[email protected]>
Cc: Aisheng Dong <[email protected]>; [email protected]; Peng Fan <[email protected]>; Souvik Chakravarty <[email protected]>; Jacky Bai <[email protected]>; [email protected]; Clément Faure <[email protected]>; [email protected]; [email protected]; [email protected]; dl-linux-imx <[email protected]>; [email protected]; Andre Przywara <[email protected]>; Silvano Di Ninno <[email protected]>; Leonard Crestez <[email protected]>; [email protected]; [email protected]; Lucas Stach <[email protected]>
Subject: Re: [PATCH 0/3] Add power domain driver support for i.mx8m familyHi,
Quoted 1 line · Adam Ford
On Thu, Apr 18, 2019 at 9:43 AM Sudeep Holla <[email protected]>
Quoted 10 lines · wrote:
Quoted 10 lines · Leonard Crestez
Quoted 9 lines · Sudeep Holla
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
I don't yet buy the security argument. There are many more shared parts on the SoC, like the clock controller, that would need to be taken away from the non-secure world if one would want to run an untrusted OS kernel on a i.MX8M system.
To properly implement security on any i.MX8M based system the firmware would need to grow something like a full ARM SCPI implementation, so all shared critical peripherals are solely under
firmware control.
Quoted 7 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
It might be possible to rework this to use some form of SCMI-over-SMC instead of vendor-specific SMCCC SIP calls
I was just curious to know if there is any progress being made on this. The i.mx8mm-evk is missing functionality upstream and I think the power domain support would help enable some of these features.
Has there been any decision or action taken in this topic? Will the power domain driver as proposed in this patch be upstreamed at some time, or rather not?
I try to build a mainline BSP for i.MX8MM (ML U-Boot, ML TF-A, ML Linux) and I integrated display and graphics support from the downstream NXP kernel.
Quoted 7 lines
Quoted 5 lines
While most things already work fine, there's the issue of how to handle the power domains. Currently I need to ungate some clocks in the TF-A BL31 to get for example the GPU running. If I understand this correctly the proposed power domain driver could handle this in Linux otherwise.
the SCMI over SMC is still under review
Quoted 7 lines
Even if the SCMI over SMC is ready at some point, it's still unclear to me how you intend to abstract the GPC behind the SCMI interface in the TF-A. The power domains have dependencies both into the regulator and the clock framework. Both are currently under exclusive control of the rich OS. How do you intend to allow the TF-A to control the power supplies and necessary reset clocks without messing up any state in the rich OS?
This is indeed difficult, SCMI assumes that the responder has sufficient control over clocks to fully implement power domain handling, including over clocks and regulators.
Perhaps it might be possible to modify current gpcv2 driver to send SCMI messages for power only and keep handling regulators itself? It could switch based on whether it has a reference to a scmi channel as a DT property.
A full scmi-based implementation might use entirely very different bindings and take a long time. If people want to support their chips by implementing power domain support in the rich OS we shouldn't block them.
So it would be good to accept gpcv2 enhancement for 8mm and similar.
--
Regards,
Leonard
Quoted 66 lines · Leonard Crestez
Quoted 57 lines · Lucas Stach
Quoted 48 lines · Jacky Bai
Quoted 48 lines
-----Original Message-----
From: Schrempf Frieder <[email protected]>
Sent: Thursday, February 13, 2020 5:16 PM
To: Adam Ford <[email protected]>; Sudeep Holla <[email protected]>
Cc: Aisheng Dong <[email protected]>; [email protected]; Peng Fan <[email protected]>; Souvik Chakravarty <[email protected]>; Jacky Bai <[email protected]>; [email protected]; Clément Faure <[email protected]>; [email protected]; [email protected]; [email protected]; dl-linux-imx <[email protected]>; [email protected]; Andre Przywara <[email protected]>; Silvano Di Ninno <[email protected]>; Leonard Crestez <[email protected]>; [email protected]; [email protected]; Lucas Stach <[email protected]>
Subject: Re: [PATCH 0/3] Add power domain driver support for i.mx8m familyHi,
Quoted 1 line · Adam Ford
On Thu, Apr 18, 2019 at 9:43 AM Sudeep Holla <[email protected]>
Quoted 10 lines · wrote:
Quoted 10 lines · Leonard Crestez
Quoted 9 lines · Sudeep Holla
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
I don't yet buy the security argument. There are many more shared parts on the SoC, like the clock controller, that would need to be taken away from the non-secure world if one would want to run an untrusted OS kernel on a i.MX8M system.
To properly implement security on any i.MX8M based system the firmware would need to grow something like a full ARM SCPI implementation, so all shared critical peripherals are solely under
firmware control.
Quoted 7 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
It might be possible to rework this to use some form of SCMI-over-SMC instead of vendor-specific SMCCC SIP calls
I was just curious to know if there is any progress being made on this. The i.mx8mm-evk is missing functionality upstream and I think the power domain support would help enable some of these features.
Has there been any decision or action taken in this topic? Will the power domain driver as proposed in this patch be upstreamed at some time, or rather not?
I try to build a mainline BSP for i.MX8MM (ML U-Boot, ML TF-A, ML Linux) and I integrated display and graphics support from the downstream NXP kernel.
Quoted 7 lines
Quoted 5 lines
While most things already work fine, there's the issue of how to handle the power domains. Currently I need to ungate some clocks in the TF-A BL31 to get for example the GPU running. If I understand this correctly the proposed power domain driver could handle this in Linux otherwise.
the SCMI over SMC is still under review
Quoted 7 lines
Even if the SCMI over SMC is ready at some point, it's still unclear to me how you intend to abstract the GPC behind the SCMI interface in the TF-A. The power domains have dependencies both into the regulator and the clock framework. Both are currently under exclusive control of the rich OS. How do you intend to allow the TF-A to control the power supplies and necessary reset clocks without messing up any state in the rich OS?
Quoted 8 lines
This is indeed difficult, SCMI assumes that the responder has sufficient control over clocks to fully implement power domain handling, including over clocks and regulators.
Perhaps it might be possible to modify current gpcv2 driver to send SCMI messages for power only and keep handling regulators itself? It could switch based on whether it has a reference to a scmi channel as a DT property.
With such a split implementation I feel like we are getting worst of both worlds: more complexity as the implementation is split across multiple components (TF-A and kernel) and still the rich OS is able to mess up the power supply of a domain that it might not even own. This doesn't sound really enticing.
IMHO it only makes sense to push this functionality down into TF-A if it allows to abstract all the implementation details behind a standard interface like SCMI. But then the needed changes are much more invasive than just pushing down the GPC implementation.
Quoted 5 lines
A full scmi-based implementation might use entirely very different bindings and take a long time. If people want to support their chips by implementing power domain support in the rich OS we shouldn't block them.
So it would be good to accept gpcv2 enhancement for 8mm and similar.
I fully agree.
For a full SCMI based implementation I expect that much more than just the GPC functionality needs to be pushed down into the TF-A. Right now I see clocks, i2c and regulator handling, maybe there is more that escapes my mind.
We should not block a Linux based implementation of this functionality on the basis that we might want to replace this with a SCMI based one at a later point in time.
Regards,
Lucas
Quoted 91 lines · Lucas Stach
Quoted 66 lines · Leonard Crestez
Quoted 57 lines · Lucas Stach
Quoted 48 lines · Jacky Bai
Quoted 48 lines
-----Original Message-----
From: Schrempf Frieder <[email protected]>
Sent: Thursday, February 13, 2020 5:16 PM
To: Adam Ford <[email protected]>; Sudeep Holla <[email protected]>
Cc: Aisheng Dong <[email protected]>; [email protected]; Peng Fan <[email protected]>; Souvik Chakravarty <[email protected]>; Jacky Bai <[email protected]>; [email protected]; Clément Faure <[email protected]>; [email protected]; [email protected]; [email protected]; dl-linux-imx <[email protected]>; [email protected]; Andre Przywara <[email protected]>; Silvano Di Ninno <[email protected]>; Leonard Crestez <[email protected]>; [email protected]; [email protected]; Lucas Stach <[email protected]>
Subject: Re: [PATCH 0/3] Add power domain driver support for i.mx8m familyHi,
Quoted 1 line · Adam Ford
On Thu, Apr 18, 2019 at 9:43 AM Sudeep Holla <[email protected]>
Quoted 10 lines · wrote:
Quoted 10 lines · Leonard Crestez
Quoted 9 lines · Sudeep Holla
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
I don't yet buy the security argument. There are many more shared parts on the SoC, like the clock controller, that would need to be taken away from the non-secure world if one would want to run an untrusted OS kernel on a i.MX8M system.
To properly implement security on any i.MX8M based system the firmware would need to grow something like a full ARM SCPI implementation, so all shared critical peripherals are solely under
firmware control.
Quoted 7 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
It might be possible to rework this to use some form of SCMI-over-SMC instead of vendor-specific SMCCC SIP calls
I was just curious to know if there is any progress being made on this. The i.mx8mm-evk is missing functionality upstream and I think the power domain support would help enable some of these features.
Has there been any decision or action taken in this topic? Will the power domain driver as proposed in this patch be upstreamed at some time, or rather not?
I try to build a mainline BSP for i.MX8MM (ML U-Boot, ML TF-A, ML Linux) and I integrated display and graphics support from the downstream NXP kernel.
Quoted 7 lines
Quoted 5 lines
While most things already work fine, there's the issue of how to handle the power domains. Currently I need to ungate some clocks in the TF-A BL31 to get for example the GPU running. If I understand this correctly the proposed power domain driver could handle this in Linux otherwise.
the SCMI over SMC is still under review
Quoted 7 lines
Even if the SCMI over SMC is ready at some point, it's still unclear to me how you intend to abstract the GPC behind the SCMI interface in the TF-A. The power domains have dependencies both into the regulator and the clock framework. Both are currently under exclusive control of the rich OS. How do you intend to allow the TF-A to control the power supplies and necessary reset clocks without messing up any state in the rich OS?
Quoted 8 lines
This is indeed difficult, SCMI assumes that the responder has sufficient control over clocks to fully implement power domain handling, including over clocks and regulators.
Perhaps it might be possible to modify current gpcv2 driver to send SCMI messages for power only and keep handling regulators itself? It could switch based on whether it has a reference to a scmi channel as a DT property.
With such a split implementation I feel like we are getting worst of both worlds: more complexity as the implementation is split across multiple components (TF-A and kernel) and still the rich OS is able to mess up the power supply of a domain that it might not even own. This doesn't sound really enticing.
IMHO it only makes sense to push this functionality down into TF-A if it allows to abstract all the implementation details behind a standard interface like SCMI. But then the needed changes are much more invasive than just pushing down the GPC implementation.
Quoted 4 lines
A full scmi-based implementation might use entirely very different bindings and take a long time. If people want to support their chips by implementing power domain support in the rich OS we shouldn't block them.
Quoted 8 lines
Quoted 1 line
So it would be good to accept gpcv2 enhancement for 8mm and similar.
I fully agree.
For a full SCMI based implementation I expect that much more than just the GPC functionality needs to be pushed down into the TF-A. Right now I see clocks, i2c and regulator handling, maybe there is more that escapes my mind.
I2C regulator handling inside TF-A sounds very difficult. Not only would upstream TF-A likely object but on imx8m EVK boards the i2c bus for regulators is shared with other devices (like camera).
So if we do this maybe SCMI dt bindings could be expanded to at least allow regulators on a per-domain basis?
Quoted 3 lines
We should not block a Linux based implementation of this functionality on the basis that we might want to replace this with a SCMI based one at a later point in time.
Quoted 96 lines · Leonard Crestez
Quoted 95 lines · Lucas Stach
Quoted 66 lines · Leonard Crestez
Quoted 57 lines · Lucas Stach
Quoted 48 lines · Jacky Bai
Quoted 48 lines
-----Original Message-----
From: Schrempf Frieder <[email protected]>
Sent: Thursday, February 13, 2020 5:16 PM
To: Adam Ford <[email protected]>; Sudeep Holla <[email protected]>
Cc: Aisheng Dong <[email protected]>; [email protected]; Peng Fan <[email protected]>; Souvik Chakravarty <[email protected]>; Jacky Bai <[email protected]>; [email protected]; Clément Faure <[email protected]>; [email protected]; [email protected]; [email protected]; dl-linux-imx <[email protected]>; [email protected]; Andre Przywara <[email protected]>; Silvano Di Ninno <[email protected]>; Leonard Crestez <[email protected]>; [email protected]; [email protected]; Lucas Stach <[email protected]>
Subject: Re: [PATCH 0/3] Add power domain driver support for i.mx8m familyHi,
Quoted 1 line · Adam Ford
On Thu, Apr 18, 2019 at 9:43 AM Sudeep Holla <[email protected]>
Quoted 10 lines · wrote:
Quoted 10 lines · Leonard Crestez
Quoted 9 lines · Sudeep Holla
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
I don't yet buy the security argument. There are many more shared parts on the SoC, like the clock controller, that would need to be taken away from the non-secure world if one would want to run an untrusted OS kernel on a i.MX8M system.
To properly implement security on any i.MX8M based system the firmware would need to grow something like a full ARM SCPI implementation, so all shared critical peripherals are solely under
firmware control.
Quoted 7 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
It might be possible to rework this to use some form of SCMI-over-SMC instead of vendor-specific SMCCC SIP calls
I was just curious to know if there is any progress being made on this. The i.mx8mm-evk is missing functionality upstream and I think the power domain support would help enable some of these features.
Has there been any decision or action taken in this topic? Will the power domain driver as proposed in this patch be upstreamed at some time, or rather not?
I try to build a mainline BSP for i.MX8MM (ML U-Boot, ML TF-A, ML Linux) and I integrated display and graphics support from the downstream NXP kernel.
Quoted 7 lines
Quoted 5 lines
While most things already work fine, there's the issue of how to handle the power domains. Currently I need to ungate some clocks in the TF-A BL31 to get for example the GPU running. If I understand this correctly the proposed power domain driver could handle this in Linux otherwise.
the SCMI over SMC is still under review
Quoted 7 lines
Even if the SCMI over SMC is ready at some point, it's still unclear to me how you intend to abstract the GPC behind the SCMI interface in the TF-A. The power domains have dependencies both into the regulator and the clock framework. Both are currently under exclusive control of the rich OS. How do you intend to allow the TF-A to control the power supplies and necessary reset clocks without messing up any state in the rich OS?
Quoted 8 lines
This is indeed difficult, SCMI assumes that the responder has sufficient control over clocks to fully implement power domain handling, including over clocks and regulators.
Perhaps it might be possible to modify current gpcv2 driver to send SCMI messages for power only and keep handling regulators itself? It could switch based on whether it has a reference to a scmi channel as a DT property.
With such a split implementation I feel like we are getting worst of both worlds: more complexity as the implementation is split across multiple components (TF-A and kernel) and still the rich OS is able to mess up the power supply of a domain that it might not even own. This doesn't sound really enticing.
IMHO it only makes sense to push this functionality down into TF-A if it allows to abstract all the implementation details behind a standard interface like SCMI. But then the needed changes are much more invasive than just pushing down the GPC implementation.
Quoted 5 lines
A full scmi-based implementation might use entirely very different bindings and take a long time. If people want to support their chips by implementing power domain support in the rich OS we shouldn't block them.
So it would be good to accept gpcv2 enhancement for 8mm and similar.
I fully agree.
Quoted 8 lines
Quoted 4 lines
For a full SCMI based implementation I expect that much more than just the GPC functionality needs to be pushed down into the TF-A. Right now I see clocks, i2c and regulator handling, maybe there is more that escapes my mind.
I2C regulator handling inside TF-A sounds very difficult. Not only would upstream TF-A likely object but on imx8m EVK boards the i2c bus for regulators is shared with other devices (like camera).
And that's exactly the point where trying to push things into lower layers starts to crumble. It only really makes sense if you manage to establish a nice abstraction of what is happening in those lower layers. If you need to punch through those abstractions due to system design limitations, the benefit of those abstractions is wiped away. The only thing you gain is more complexity due to more components being involved in a specific task.
If you want to be able to partition the system (and as far as I understand it that's the main motivation for pushing GPC functionality into TF-A) you need to design the system (starting on the HW level) to make this possible. Trying to force such a model on a system that hasn't really been designed for this is IMHO doomed to fail.
Quoted 2 lines
So if we do this maybe SCMI dt bindings could be expanded to at least allow regulators on a per-domain basis?
Maybe that is what needs to be done to allow at least a partial implementation of SCMI on the existing i.MX8M designs. However it doesn't really provide much of the benefits of SCMI.
So I'm all for having a pure Linux based implementation of the functionality, instead of waiting for the SCMI based implementation that may provide only questionable benefit.
Regards,
Lucas
Quoted 123 lines · Lucas Stach
Quoted 96 lines · Leonard Crestez
Quoted 95 lines · Lucas Stach
Quoted 66 lines · Leonard Crestez
Quoted 57 lines · Lucas Stach
Quoted 48 lines · Jacky Bai
Quoted 48 lines
-----Original Message-----
From: Schrempf Frieder <[email protected]>
Sent: Thursday, February 13, 2020 5:16 PM
To: Adam Ford <[email protected]>; Sudeep Holla <[email protected]>
Cc: Aisheng Dong <[email protected]>; [email protected]; Peng Fan <[email protected]>; Souvik Chakravarty <[email protected]>; Jacky Bai <[email protected]>; [email protected]; Clément Faure <[email protected]>; [email protected]; [email protected]; [email protected]; dl-linux-imx <[email protected]>; [email protected]; Andre Przywara <[email protected]>; Silvano Di Ninno <[email protected]>; Leonard Crestez <[email protected]>; [email protected]; [email protected]; Lucas Stach <[email protected]>
Subject: Re: [PATCH 0/3] Add power domain driver support for i.mx8m familyHi,
Quoted 1 line · Adam Ford
On Thu, Apr 18, 2019 at 9:43 AM Sudeep Holla <[email protected]>
Quoted 10 lines · wrote:
Quoted 10 lines · Leonard Crestez
Quoted 9 lines · Sudeep Holla
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
I don't yet buy the security argument. There are many more shared
parts on the SoC, like the clock controller, that would need to
be taken away from the non-secure world if one would want to run
an untrusted OS kernel on a i.MX8M system.To properly implement security on any i.MX8M based system the
firmware would need to grow something like a full ARM SCPI
implementation, so all shared critical peripherals are solely underfirmware control.
Quoted 7 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
It might be possible to rework this to use some form of SCMI-over-SMC instead of vendor-specific SMCCC SIP calls
I was just curious to know if there is any progress being made on this. The i.mx8mm-evk is missing functionality upstream and I think the power domain support would help enable some of these features.
Has there been any decision or action taken in this topic? Will the power domain driver as proposed in this patch be upstreamed at some time, or rather not?
I try to build a mainline BSP for i.MX8MM (ML U-Boot, ML TF-A, ML Linux) and I integrated display and graphics support from the downstream NXP kernel.
Quoted 7 lines
Quoted 5 lines
While most things already work fine, there's the issue of how to handle the power domains. Currently I need to ungate some clocks in the TF-A BL31 to get for example the GPU running. If I understand this correctly the proposed power domain driver could handle this in Linux otherwise.
the SCMI over SMC is still under review
Quoted 7 lines
Even if the SCMI over SMC is ready at some point, it's still unclear to me how you intend to abstract the GPC behind the SCMI interface in the TF-A. The power domains have dependencies both into the regulator and the clock framework. Both are currently under exclusive control of the rich OS. How do you intend to allow the TF-A to control the power supplies and necessary reset clocks without messing up any state in the rich OS?
Quoted 8 lines
This is indeed difficult, SCMI assumes that the responder has sufficient control over clocks to fully implement power domain handling, including over clocks and regulators.
Perhaps it might be possible to modify current gpcv2 driver to send SCMI messages for power only and keep handling regulators itself? It could switch based on whether it has a reference to a scmi channel as a DT property.
With such a split implementation I feel like we are getting worst of both worlds: more complexity as the implementation is split across multiple components (TF-A and kernel) and still the rich OS is able to mess up the power supply of a domain that it might not even own. This doesn't sound really enticing.
IMHO it only makes sense to push this functionality down into TF-A if it allows to abstract all the implementation details behind a standard interface like SCMI. But then the needed changes are much more invasive than just pushing down the GPC implementation.
Quoted 5 lines
A full scmi-based implementation might use entirely very different bindings and take a long time. If people want to support their chips by implementing power domain support in the rich OS we shouldn't block them.
So it would be good to accept gpcv2 enhancement for 8mm and similar.
I fully agree.
Quoted 8 lines
Quoted 4 lines
For a full SCMI based implementation I expect that much more than just the GPC functionality needs to be pushed down into the TF-A. Right now I see clocks, i2c and regulator handling, maybe there is more that escapes my mind.
I2C regulator handling inside TF-A sounds very difficult. Not only would upstream TF-A likely object but on imx8m EVK boards the i2c bus for regulators is shared with other devices (like camera).
And that's exactly the point where trying to push things into lower layers starts to crumble. It only really makes sense if you manage to establish a nice abstraction of what is happening in those lower layers. If you need to punch through those abstractions due to system design limitations, the benefit of those abstractions is wiped away. The only thing you gain is more complexity due to more components being involved in a specific task.
If you want to be able to partition the system (and as far as I understand it that's the main motivation for pushing GPC functionality into TF-A) you need to design the system (starting on the HW level) to make this possible. Trying to force such a model on a system that hasn't really been designed for this is IMHO doomed to fail.
Quoted 2 lines
So if we do this maybe SCMI dt bindings could be expanded to at least allow regulators on a per-domain basis?
Quoted 7 lines
Maybe that is what needs to be done to allow at least a partial implementation of SCMI on the existing i.MX8M designs. However it doesn't really provide much of the benefits of SCMI.
So I'm all for having a pure Linux based implementation of the functionality, instead of waiting for the SCMI based implementation that may provide only questionable benefit.
After reading through the thread and other resources - with still very limited knowledge - I tend to support Lucas' argument.
We want to provide a mainline BSP for our i.MX8MM hardware and it seems like pushing more and more functionality from Linux into firmware will increase complexity even further and also delay or block the upstreaming of missing components, that would otherwise be rather easy to get running.
Quoted 52 lines · Lucas Stach
Am Mittwoch, den 17.04.2019, 11:16 +0000 schrieb Aisheng Dong:
Quoted 34 lines
Quoted 25 lines
From: Jacky Bai
Sent: Wednesday, April 17, 2019 1:27 PMThe i.MX8M family is a set of NXP product focus on delivering the latest and greatest video and audio experience combining state-of-the-art media-specific features with high-performance processing while optimized for lowest power consumption.
i.MX8MQ, i.MX8MM, i.MX8MN, even the furture i.MX8MP are all belong to this family.The GPC module is used to manage the PU power domains' power on/off. For the whole i.MX8M family, different SoC has differnt power domain design. the power up sequence has significant difference.
all the power sequence must be guaranteed by SW. Some domains' power up sequence need to access the SRC module or sub-system specific GPR. the SRC register & SS's register are not in in the GPC's memory range.it makes us hard to use the GPCv2 driver to cover all the different power up requirement. Each time, a new SoC is added, we must modify the GPCv2 driver to make it resuable for it. a lot of code need to be added in GPCv2 to support it. we need to access the SRC & SS' GPR, then the GPCv2 driver can NOT be self-contained. Accessing the non-driver specific module's register is a bad practice. Although, the GPC module provided the similar function for PU power domain, but it is not 100% compatible with GPCv2.
Quoted 8 lines
The most important thing is that the GPC & SRC module is a security critical resource that security permission must be considered when building the security system. The GPC module is not only used by PU power domain power on/off. It is also used by the TF-A PSCI code to do the CPU core power management. the SRC module control the CPU CORE reset and the CPU reset vector address. if we give the non-secure world write permission to SRC. System can be easily induced to malicious code.
Quoted 7 lines
Considering the security issue, it looks to me a right direction to move GPC power handling into ATF.
It also helps build a more generic driver and ease other OS integration needed by customers (e.g. QNX, Win10).Lucas,
How do you think of it?I don't yet buy the security argument. There are many more shared parts on the SoC, like the clock controller, that would need to be taken away from the non-secure world if one would want to run an untrusted OS kernel on a i.MX8M system.
To properly implement security on any i.MX8M based system the firmware would need to grow something like a full ARM SCPI implementation, so all shared critical peripherals are solely under firmware control.
Quoted 8 lines
I agree that it might make sense to move some parts into the firmware and have much simpler OS level drivers, but I don't agree on the implementation direction taken here. Growing custom PSCI extension interfaces will only get us so far, without solving the system security issue in a holistic way. It is my strong believe that only a complete rearchitecture of the OS support on top of a ARM SCPI firmware interface can solve this properly.
+1 for all the above.
For me, though the intention looks good, this implementation is half cooked and just creating more mess with lots of custom SMC extensions. You can use them in products, but I would not like in upstream which is more focused on long term maintenance.
--
Regards,
Sudeep
--
Regards,
Sudeep
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
Quoted 1 line · Sudeep Holla
[...]
Quoted 1 line
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
Sorry, the above disclaimer was completely unintentional. I must have done something by mistake
for this to happen once in series of replies on this thread.