* [PATCH v3 1/3] dt-bindings: fpga: stratix10: Convert to json-schema
2025-02-04 12:58 [PATCH v3 0/3] stratix10: miscellaneous changes and fix for child driver probing Mahesh Rao
@ 2025-02-04 12:58 ` Mahesh Rao
2025-02-04 12:58 ` [PATCH v3 2/3] dt-bindings: firmware: " Mahesh Rao
` (2 subsequent siblings)
3 siblings, 0 replies; 7+ messages in thread
From: Mahesh Rao @ 2025-02-04 12:58 UTC (permalink / raw)
To: Moritz Fischer, Xu Yilun, Tom Rix, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Dinh Nguyen,
Krzysztof Kozlowski, Wu Hao, Ho Yin, Niravkumar L Rabara
Cc: linux-fpga, devicetree, linux-kernel, Mahesh Rao, Mahesh Rao
Convert intel,stratix10-soc fpga manager devicetree
binding file from freeform format to json-schema.
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Signed-off-by: Mahesh Rao <mahesh.rao@intel.com>
---
.../fpga/intel,stratix10-soc-fpga-mgr.yaml | 36 ++++++++++++++++++++++
.../bindings/fpga/intel-stratix10-soc-fpga-mgr.txt | 18 -----------
2 files changed, 36 insertions(+), 18 deletions(-)
diff --git a/Documentation/devicetree/bindings/fpga/intel,stratix10-soc-fpga-mgr.yaml b/Documentation/devicetree/bindings/fpga/intel,stratix10-soc-fpga-mgr.yaml
new file mode 100644
index 0000000000000000000000000000000000000000..6e536d6b28a9732c492da5d57f89df648dba7f4b
--- /dev/null
+++ b/Documentation/devicetree/bindings/fpga/intel,stratix10-soc-fpga-mgr.yaml
@@ -0,0 +1,36 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/fpga/intel,stratix10-soc-fpga-mgr.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Intel Stratix10 SoC FPGA Manager
+
+maintainers:
+ - Mahesh Rao <mahesh.rao@altera.com>
+ - Adrian Ng Ho Yin <adrian.ho.yin.ng@altera.com>
+ - Niravkumar L Rabara <nirav.rabara@altera.com>
+
+description:
+ The Intel Stratix10 SoC consists of a 64-bit quad-core ARM Cortex A53 hard
+ processor system (HPS) and a Secure Device Manager (SDM). The Stratix10
+ SoC FPGA Manager driver is used to configure/reconfigure the FPGA fabric
+ on the die.The driver communicates with SDM/ATF via the stratix10-svc
+ platform driver for performing its operations.
+
+properties:
+ compatible:
+ enum:
+ - intel,stratix10-soc-fpga-mgr
+ - intel,agilex-soc-fpga-mgr
+
+required:
+ - compatible
+
+additionalProperties: false
+
+examples:
+ - |
+ fpga-mgr {
+ compatible = "intel,stratix10-soc-fpga-mgr";
+ };
diff --git a/Documentation/devicetree/bindings/fpga/intel-stratix10-soc-fpga-mgr.txt b/Documentation/devicetree/bindings/fpga/intel-stratix10-soc-fpga-mgr.txt
deleted file mode 100644
index 0f874137ca4697820341b23eddb882634bb131d1..0000000000000000000000000000000000000000
--- a/Documentation/devicetree/bindings/fpga/intel-stratix10-soc-fpga-mgr.txt
+++ /dev/null
@@ -1,18 +0,0 @@
-Intel Stratix10 SoC FPGA Manager
-
-Required properties:
-The fpga_mgr node has the following mandatory property, must be located under
-firmware/svc node.
-
-- compatible : should contain "intel,stratix10-soc-fpga-mgr" or
- "intel,agilex-soc-fpga-mgr"
-
-Example:
-
- firmware {
- svc {
- fpga_mgr: fpga-mgr {
- compatible = "intel,stratix10-soc-fpga-mgr";
- };
- };
- };
--
2.35.3
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH v3 2/3] dt-bindings: firmware: stratix10: Convert to json-schema
2025-02-04 12:58 [PATCH v3 0/3] stratix10: miscellaneous changes and fix for child driver probing Mahesh Rao
2025-02-04 12:58 ` [PATCH v3 1/3] dt-bindings: fpga: stratix10: Convert to json-schema Mahesh Rao
@ 2025-02-04 12:58 ` Mahesh Rao
2025-02-04 19:50 ` Conor Dooley
2025-02-04 12:58 ` [PATCH v3 3/3] firmware: stratix10-svc: Add of_platform_default_populate() Mahesh Rao
2025-02-20 2:26 ` [PATCH v3 0/3] stratix10: miscellaneous changes and fix for child driver probing Dinh Nguyen
3 siblings, 1 reply; 7+ messages in thread
From: Mahesh Rao @ 2025-02-04 12:58 UTC (permalink / raw)
To: Moritz Fischer, Xu Yilun, Tom Rix, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Dinh Nguyen,
Krzysztof Kozlowski, Wu Hao, Ho Yin, Niravkumar L Rabara
Cc: linux-fpga, devicetree, linux-kernel, Mahesh Rao, Mahesh Rao
Convert intel,stratix10-svc service layer devicetree
binding file from freeform format to json-schema.
Also added DT binding for optional stratix10-soc
FPGA manager child node.
Signed-off-by: Mahesh Rao <mahesh.rao@intel.com>
---
.../bindings/firmware/intel,stratix10-svc.txt | 57 -------------
.../bindings/firmware/intel,stratix10-svc.yaml | 93 ++++++++++++++++++++++
2 files changed, 93 insertions(+), 57 deletions(-)
diff --git a/Documentation/devicetree/bindings/firmware/intel,stratix10-svc.txt b/Documentation/devicetree/bindings/firmware/intel,stratix10-svc.txt
deleted file mode 100644
index 6eff1afd8daf91714d6a18859667d2607e707da7..0000000000000000000000000000000000000000
--- a/Documentation/devicetree/bindings/firmware/intel,stratix10-svc.txt
+++ /dev/null
@@ -1,57 +0,0 @@
-Intel Service Layer Driver for Stratix10 SoC
-============================================
-Intel Stratix10 SoC is composed of a 64 bit quad-core ARM Cortex A53 hard
-processor system (HPS) and Secure Device Manager (SDM). When the FPGA is
-configured from HPS, there needs to be a way for HPS to notify SDM the
-location and size of the configuration data. Then SDM will get the
-configuration data from that location and perform the FPGA configuration.
-
-To meet the whole system security needs and support virtual machine requesting
-communication with SDM, only the secure world of software (EL3, Exception
-Layer 3) can interface with SDM. All software entities running on other
-exception layers must channel through the EL3 software whenever it needs
-service from SDM.
-
-Intel Stratix10 service layer driver, running at privileged exception level
-(EL1, Exception Layer 1), interfaces with the service providers and provides
-the services for FPGA configuration, QSPI, Crypto and warm reset. Service layer
-driver also manages secure monitor call (SMC) to communicate with secure monitor
-code running in EL3.
-
-Required properties:
--------------------
-The svc node has the following mandatory properties, must be located under
-the firmware node.
-
-- compatible: "intel,stratix10-svc" or "intel,agilex-svc"
-- method: smc or hvc
- smc - Secure Monitor Call
- hvc - Hypervisor Call
-- memory-region:
- phandle to the reserved memory node. See
- Documentation/devicetree/bindings/reserved-memory/reserved-memory.txt
- for details
-
-Example:
--------
-
- reserved-memory {
- #address-cells = <2>;
- #size-cells = <2>;
- ranges;
-
- service_reserved: svcbuffer@0 {
- compatible = "shared-dma-pool";
- reg = <0x0 0x0 0x0 0x1000000>;
- alignment = <0x1000>;
- no-map;
- };
- };
-
- firmware {
- svc {
- compatible = "intel,stratix10-svc";
- method = "smc";
- memory-region = <&service_reserved>;
- };
- };
diff --git a/Documentation/devicetree/bindings/firmware/intel,stratix10-svc.yaml b/Documentation/devicetree/bindings/firmware/intel,stratix10-svc.yaml
new file mode 100644
index 0000000000000000000000000000000000000000..fac1e955852e4f9b966c991dcfac56222c5f7315
--- /dev/null
+++ b/Documentation/devicetree/bindings/firmware/intel,stratix10-svc.yaml
@@ -0,0 +1,93 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/firmware/intel,stratix10-svc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Intel Service Layer Driver for Stratix10 SoC
+
+maintainers:
+ - Dinh Nguyen <dinguyen@kernel.org>
+ - Mahesh Rao <mahesh.rao@altera.com>
+
+description: >
+ Intel Stratix10 SoC is composed of a 64 bit quad-core ARM Cortex A53 hard
+ processor system (HPS) and Secure Device Manager (SDM). When the FPGA is
+ configured from HPS, there needs to be a way for HPS to notify SDM the
+ location and size of the configuration data. Then SDM will get the
+ configuration data from that location and perform the FPGA configuration.
+
+ To meet the whole system security needs and support virtual machine requesting
+ communication with SDM, only the secure world of software (EL3, Exception
+ Layer 3) can interface with SDM. All software entities running on other
+ exception layers must channel through the EL3 software whenever it needs
+ service from SDM.
+
+ Intel Stratix10 service layer driver, running at privileged exception level
+ (EL1, Exception Layer 1), interfaces with the service providers and provides
+ the services for FPGA configuration, QSPI, Crypto and warm reset. Service layer
+ driver also manages secure monitor call (SMC) to communicate with secure monitor
+ code running in EL3.
+
+properties:
+ compatible:
+ enum:
+ - intel,stratix10-svc
+ - intel,agilex-svc
+
+ method:
+ description: |
+ Supervisory call method to be used to communicate with the
+ secure service layer.
+ Permitted values are:
+ - "smc" : SMC #0, following the SMCCC
+ - "hvc" : HVC #0, following the SMCCC
+
+ $ref: /schemas/types.yaml#/definitions/string-array
+ enum:
+ - smc
+ - hvc
+
+ memory-region:
+ maxItems: 1
+ description:
+ reserved memory region for the service layer driver to
+ communicate with the secure device manager.
+
+ fpga-mgr:
+ $ref: /schemas/fpga/intel,stratix10-soc-fpga-mgr.yaml
+ description: Optional child node for fpga manager to perform fabric configuration.
+
+required:
+ - compatible
+ - method
+ - memory-region
+
+additionalProperties: false
+
+examples:
+ - |
+ reserved-memory {
+ #address-cells = <2>;
+ #size-cells = <2>;
+
+ service_reserved: svcbuffer@0 {
+ compatible = "shared-dma-pool";
+ reg = <0x0 0x0 0x0 0x1000000>;
+ alignment = <0x1000>;
+ no-map;
+ };
+ };
+
+ firmware {
+ svc {
+ compatible = "intel,stratix10-svc";
+ method = "smc";
+ memory-region = <&service_reserved>;
+
+ fpga-mgr {
+ compatible = "intel,stratix10-soc-fpga-mgr";
+ };
+ };
+ };
+
--
2.35.3
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH v3 2/3] dt-bindings: firmware: stratix10: Convert to json-schema
2025-02-04 12:58 ` [PATCH v3 2/3] dt-bindings: firmware: " Mahesh Rao
@ 2025-02-04 19:50 ` Conor Dooley
0 siblings, 0 replies; 7+ messages in thread
From: Conor Dooley @ 2025-02-04 19:50 UTC (permalink / raw)
To: Mahesh Rao
Cc: Moritz Fischer, Xu Yilun, Tom Rix, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Dinh Nguyen,
Krzysztof Kozlowski, Wu Hao, Ho Yin, Niravkumar L Rabara,
linux-fpga, devicetree, linux-kernel, Mahesh Rao
[-- Attachment #1: Type: text/plain, Size: 365 bytes --]
On Tue, Feb 04, 2025 at 08:58:06PM +0800, Mahesh Rao wrote:
> Convert intel,stratix10-svc service layer devicetree
> binding file from freeform format to json-schema.
>
> Also added DT binding for optional stratix10-soc
> FPGA manager child node.
>
> Signed-off-by: Mahesh Rao <mahesh.rao@intel.com>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v3 3/3] firmware: stratix10-svc: Add of_platform_default_populate()
2025-02-04 12:58 [PATCH v3 0/3] stratix10: miscellaneous changes and fix for child driver probing Mahesh Rao
2025-02-04 12:58 ` [PATCH v3 1/3] dt-bindings: fpga: stratix10: Convert to json-schema Mahesh Rao
2025-02-04 12:58 ` [PATCH v3 2/3] dt-bindings: firmware: " Mahesh Rao
@ 2025-02-04 12:58 ` Mahesh Rao
2025-02-06 7:06 ` Xu Yilun
2025-02-20 2:26 ` [PATCH v3 0/3] stratix10: miscellaneous changes and fix for child driver probing Dinh Nguyen
3 siblings, 1 reply; 7+ messages in thread
From: Mahesh Rao @ 2025-02-04 12:58 UTC (permalink / raw)
To: Moritz Fischer, Xu Yilun, Tom Rix, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Dinh Nguyen,
Krzysztof Kozlowski, Wu Hao, Ho Yin, Niravkumar L Rabara
Cc: linux-fpga, devicetree, linux-kernel, Mahesh Rao, Mahesh Rao
Add of_platform_default_populate() to stratix10-svc
driver as the firmware/svc node was moved out of soc.
This fixes the failed probing of child drivers of
svc node.
Fixes: 23c3ebed382a ("arm64: dts: socfpga: agilex: move firmware out of soc node")
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Mahesh Rao <mahesh.rao@intel.com>
---
drivers/firmware/stratix10-svc.c | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/drivers/firmware/stratix10-svc.c b/drivers/firmware/stratix10-svc.c
index 3c52cb73237a43aac6984e497d75bab389e3eb9d..e3f990d888d71829f0ab22b8a59aa7af0316bea0 100644
--- a/drivers/firmware/stratix10-svc.c
+++ b/drivers/firmware/stratix10-svc.c
@@ -1224,22 +1224,28 @@ static int stratix10_svc_drv_probe(struct platform_device *pdev)
if (!svc->intel_svc_fcs) {
dev_err(dev, "failed to allocate %s device\n", INTEL_FCS);
ret = -ENOMEM;
- goto err_unregister_dev;
+ goto err_unregister_rsu_dev;
}
ret = platform_device_add(svc->intel_svc_fcs);
if (ret) {
platform_device_put(svc->intel_svc_fcs);
- goto err_unregister_dev;
+ goto err_unregister_rsu_dev;
}
+ ret = of_platform_default_populate(dev_of_node(dev), NULL, dev);
+ if (ret)
+ goto err_unregister_fcs_dev;
+
dev_set_drvdata(dev, svc);
pr_info("Intel Service Layer Driver Initialized\n");
return 0;
-err_unregister_dev:
+err_unregister_fcs_dev:
+ platform_device_unregister(svc->intel_svc_fcs);
+err_unregister_rsu_dev:
platform_device_unregister(svc->stratix10_svc_rsu);
err_free_kfifo:
kfifo_free(&controller->svc_fifo);
@@ -1253,6 +1259,8 @@ static void stratix10_svc_drv_remove(struct platform_device *pdev)
struct stratix10_svc *svc = dev_get_drvdata(&pdev->dev);
struct stratix10_svc_controller *ctrl = platform_get_drvdata(pdev);
+ of_platform_depopulate(ctrl->dev);
+
platform_device_unregister(svc->intel_svc_fcs);
platform_device_unregister(svc->stratix10_svc_rsu);
--
2.35.3
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH v3 3/3] firmware: stratix10-svc: Add of_platform_default_populate()
2025-02-04 12:58 ` [PATCH v3 3/3] firmware: stratix10-svc: Add of_platform_default_populate() Mahesh Rao
@ 2025-02-06 7:06 ` Xu Yilun
0 siblings, 0 replies; 7+ messages in thread
From: Xu Yilun @ 2025-02-06 7:06 UTC (permalink / raw)
To: Mahesh Rao
Cc: Moritz Fischer, Xu Yilun, Tom Rix, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Dinh Nguyen,
Krzysztof Kozlowski, Wu Hao, Ho Yin, Niravkumar L Rabara,
linux-fpga, devicetree, linux-kernel, Mahesh Rao
On Tue, Feb 04, 2025 at 08:58:07PM +0800, Mahesh Rao wrote:
> Add of_platform_default_populate() to stratix10-svc
> driver as the firmware/svc node was moved out of soc.
> This fixes the failed probing of child drivers of
> svc node.
>
> Fixes: 23c3ebed382a ("arm64: dts: socfpga: agilex: move firmware out of soc node")
> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> Signed-off-by: Mahesh Rao <mahesh.rao@intel.com>
> ---
> drivers/firmware/stratix10-svc.c | 14 +++++++++++---
> 1 file changed, 11 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/firmware/stratix10-svc.c b/drivers/firmware/stratix10-svc.c
> index 3c52cb73237a43aac6984e497d75bab389e3eb9d..e3f990d888d71829f0ab22b8a59aa7af0316bea0 100644
> --- a/drivers/firmware/stratix10-svc.c
> +++ b/drivers/firmware/stratix10-svc.c
> @@ -1224,22 +1224,28 @@ static int stratix10_svc_drv_probe(struct platform_device *pdev)
> if (!svc->intel_svc_fcs) {
> dev_err(dev, "failed to allocate %s device\n", INTEL_FCS);
> ret = -ENOMEM;
> - goto err_unregister_dev;
> + goto err_unregister_rsu_dev;
> }
>
> ret = platform_device_add(svc->intel_svc_fcs);
> if (ret) {
> platform_device_put(svc->intel_svc_fcs);
> - goto err_unregister_dev;
> + goto err_unregister_rsu_dev;
> }
>
> + ret = of_platform_default_populate(dev_of_node(dev), NULL, dev);
I checked of_platform_populate/of_platform_bus_create() and see these
functions will not error out if some sub device registration fails. So
LGTM.
Reviewed-by: Xu Yilun <yilun.xu@intel.com>
> + if (ret)
> + goto err_unregister_fcs_dev;
> +
> dev_set_drvdata(dev, svc);
>
> pr_info("Intel Service Layer Driver Initialized\n");
>
> return 0;
>
> -err_unregister_dev:
> +err_unregister_fcs_dev:
> + platform_device_unregister(svc->intel_svc_fcs);
> +err_unregister_rsu_dev:
> platform_device_unregister(svc->stratix10_svc_rsu);
> err_free_kfifo:
> kfifo_free(&controller->svc_fifo);
> @@ -1253,6 +1259,8 @@ static void stratix10_svc_drv_remove(struct platform_device *pdev)
> struct stratix10_svc *svc = dev_get_drvdata(&pdev->dev);
> struct stratix10_svc_controller *ctrl = platform_get_drvdata(pdev);
>
> + of_platform_depopulate(ctrl->dev);
> +
> platform_device_unregister(svc->intel_svc_fcs);
> platform_device_unregister(svc->stratix10_svc_rsu);
>
>
> --
> 2.35.3
>
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v3 0/3] stratix10: miscellaneous changes and fix for child driver probing
2025-02-04 12:58 [PATCH v3 0/3] stratix10: miscellaneous changes and fix for child driver probing Mahesh Rao
` (2 preceding siblings ...)
2025-02-04 12:58 ` [PATCH v3 3/3] firmware: stratix10-svc: Add of_platform_default_populate() Mahesh Rao
@ 2025-02-20 2:26 ` Dinh Nguyen
3 siblings, 0 replies; 7+ messages in thread
From: Dinh Nguyen @ 2025-02-20 2:26 UTC (permalink / raw)
To: Mahesh Rao, Moritz Fischer, Xu Yilun, Tom Rix, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Krzysztof Kozlowski, Wu Hao,
Ho Yin, Niravkumar L Rabara
Cc: linux-fpga, devicetree, linux-kernel, Mahesh Rao
On 2/4/25 06:58, Mahesh Rao wrote:
> The patch set includes the following changes:
>
> - Conversion of the devicetree binding file to JSON-schema for the Stratix10
> SVC driver and its child stratix10 fpga manager driver.
> - Addition of support for probing the child driver. This fixes the failure
> of child driver probing as the SVC driver node has been moved out of the
> SoC node.
>
> Signed-off-by: Mahesh Rao <mahesh.rao@intel.com>
> ---
> Changes in v3:
> * Updated reserved-memory node as per dt-schema.
> * Adjusted the indentation and corrected usage for
> multi-paragraph description in stratix10-svc
> binding file.
>
> - Link to v2: https://lore.kernel.org/r/20250131-socfpga_sip_svc_misc-v2-0-eeed4ebc35f9@intel.com
>
>
All patches applied!
^ permalink raw reply [flat|nested] 7+ messages in thread