Skip to contentSkip to conversation

Add Intel Stratix10 FPGA manager and service layer

PATCH Superseded [email protected] 4 participants 16 messages Mar 2, 2018 – Mar 16, 2018

Subsystems (4)

v2 of 11 Superseded Latest is v11 →

lore
Share & tools
lore
#0 lore raw

v2 cover Add Intel Stratix10 FPGA manager and service layer

From: Richard Gong <[email protected]>

This is the 2nd submission of Intel service layer patches. Intel Stratix10 FPGA manager, which is 1st service layer client, is included in this submission.

Service layer patches have been reviewed internally by Alan Tull and other colleagues at Intel.

Intel Stratix10 SoC is composed of a 64 bit quad-core ARM Cortex A53 hard processor system (HPS) and Secure Device Manager (SDM). SDM is the hardware which does the FPGA configuration, QSPI, Crypto and warm reset.

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 Level 3) can interface with SDM. All software entities running on other exception levels must channel through the EL3 software whenever it needs service from SDM.

Intel Stratix10 service layer driver is added to provide the service for FPGA configuration. Running at privileged exception level (EL1, Exception Level 1), Intel Stratix10 service layer driver interfaces with the service provider at EL1 (Intel Stratix10 FPGA Manager) and manages secure monitor call (SMC) to communicate with secure monitor software at secure monitor exception level (EL3).

Later the Intel Stratix10 service layer driver will be extended to provide services for QSPI, Crypto and warm reset.

v2: add patches for FPGA manager, FPGA manager binding, dts and defconfig
remove intel-service subdirectory and intel-service.h, move intel-smc.h and intel-service.c to driver/misc subdirectory
remove global variables
change service layer driver be 'default n'
correct SPDX markers
add timeout for do..while() loop
add kernel-doc for the functions and structs, correct multiline comments replace kfifo_in/kfifo_out with kfifo_in_spinlocked/kfifo_out_spinlocked rename struct intel_svc_data (at client header) to intel_svc_client_msg rename struct intel_svc_private_mem to intel_svc_data
other corrections/changes from Intel internal code reviews

Alan Tull (3):
dt-bindings: fpga: add Stratix10 SoC FPGA manager binding
arm64: dts: stratix10: add fpga manager and region
fpga: add intel stratix10 soc fpga manager driver

Richard Gong (4):
dt-bindings, firmware: add Intel Stratix10 service layer binding
arm64: dts: stratix10: add service driver binding to base dtsi driver, misc: add Intel Stratix10 service layer driver
defconfig: enable fpga and service layer

 .../bindings/firmware/intel,stratix10-svc.txt      |  57 ++
 .../bindings/fpga/intel-stratix10-soc-fpga-mgr.txt |  10 +
 arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi  |  34 +
 arch/arm64/configs/defconfig                       |   5 +
 drivers/fpga/Kconfig                               |   6 +
 drivers/fpga/Makefile                              |   1 +
 drivers/fpga/stratix10-soc.c                       | 503 +++++++++++
 drivers/misc/Kconfig                               |  12 +
 drivers/misc/Makefile                              |   1 +
 drivers/misc/intel-service.c                       | 960 +++++++++++++++++++++
 drivers/misc/intel-smc.h                           | 205 +++++
 include/linux/intel-service-client.h               | 188 ++++
 12 files changed, 1982 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/firmware/intel,stratix10-svc.txt
 create mode 100644 Documentation/devicetree/bindings/fpga/intel-stratix10-soc-fpga-mgr.txt
 create mode 100644 drivers/fpga/stratix10-soc.c
 create mode 100644 drivers/misc/intel-service.c
 create mode 100644 drivers/misc/intel-smc.h
 create mode 100644 include/linux/intel-service-client.h
Signature · 1 line
2.7.4
#1 lore raw

PATCH v2 1/7 dt-bindings, firmware: add Intel Stratix10 service layer binding

From: Richard Gong <[email protected]>

Add a device tree binding for the Intel Stratix10 service layer driver

---
v2: Change to put service layer driver node under the firmware node
Change compatible to "intel, stratix10-svc"

---
 .../bindings/firmware/intel,stratix10-svc.txt      | 57 ++++++++++++++++++++++
 1 file changed, 57 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/firmware/intel,stratix10-svc.txt
Documentation/devicetree/bindings/firmware/intel,stratix10-svc.txt new file +57 -0
new file mode 100644
index 0000000..1fa6606
@@ -0,0 +1,57 @@
+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"
+- 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 at 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>;
+		};
+	};
Signature · 1 line
2.7.4
maintainer Reviewed-by on v2 1/7
#2 lore raw

Re: [PATCHv2 1/7] dt-bindings, firmware: add Intel Stratix10 service layer binding

Quoted 6 lines · richard.gong at linux.intel.com

From: Richard Gong <[email protected]>

Add a device tree binding for the Intel Stratix10 service layer driver

Quoted 7 lines

---
v2: Change to put service layer driver node under the firmware node
Change compatible to "intel, stratix10-svc"

---
 .../bindings/firmware/intel,stratix10-svc.txt      | 57 ++++++++++++++++++++++
 1 file changed, 57 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/firmware/intel,stratix10-svc.txt
#3 lore raw

PATCH v2 2/7 arm64: dts: stratix10: add service driver binding to base dtsi

In reply to [email protected]

From: Richard Gong <[email protected]>

Add Intel Stratix10 service layer to the device tree

---
v2: Change to put service layer driver node under the firmware node
Change compatible to "intel, stratix10-svc"

---
 arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi +22 -0
index 5a6a699..4395e76 100644
@@ -24,6 +24,20 @@
 	#address-cells = <2>;
 	#size-cells = <2>;
 
+	reserved-memory {
+		#address-cells = <2>;
+		#size-cells = <2>;
+		ranges;
+
+		service_reserved: svcbuffer at 0 {
+			compatible = "shared-dma-pool";
+			reg = <0x0 0x0 0x0 0x1000000>;
+			alignment = <0x1000>;
+			no-map;
+		};
+	};
+
+
 	cpus {
 		#address-cells = <1>;
 		#size-cells = <0>;
@@ -433,5 +447,13 @@
 			resets = <&rst WATCHDOG3_RESET>;
 			status = "disabled";
 		};
+
+		firmware {
+			svc {
+				compatible = "intel,stratix10-svc";
+				method = "smc";
+				memory-region = <&service_reserved>;
+			};
+		};
 	};
 };
Signature · 1 line
2.7.4
#4 lore raw

PATCH v2 3/7 driver, misc: add Intel Stratix10 service layer driver

In reply to [email protected]

From: Richard Gong <[email protected]>

Intel Stratix10 SoC is composed of a 64 bit quad-core ARM Cortex A53 hard processor system (HPS) and Secure Device Manager (SDM). SDM is the hardware which does the FPGA configuration, QSPI, Crypto and warm reset.

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 Level 3) can interface with SDM. All software entities running on other exception levels must channel through the EL3 software whenever it needs service from SDM.

Intel Stratix10 service layer driver is added to provide the service for FPGA configuration. Running at privileged exception level (EL1, Exception Level 1), Intel Stratix10 service layer driver interfaces with the service provider at EL1 (Intel Stratix10 FPGA Manager) and manages secure monitor call (SMC) to communicate with secure monitor software at secure monitor exception level (EL3).

Header file intel-service-client.h defines the interface between service providers (FPGA manager is one of them) and service layer.

Header file intel-smc.h defines the secure monitor call (SMC) message protocols used for service layer driver in normal world (EL1) to communicate with secure monitor SW in secure monitor exception level 3 (EL3). This file is shared with secure firmware (FW) which is out of kernel tree.

---
v2: Remove intel-service subdirectory and intel-service.h, move
intel-smc.h and intel-service.c to driver/misc subdirectory Correct SPDX markers
Change service layer driver be 'default n'
Remove global variables
Add timeout for do..while() loop
Add kernel-doc for the functions and structs, correct multiline comments Replace kfifo_in/kfifo_out with kfifo_in_spinlocked/kfifo_out_spinlocked rename struct intel_svc_data (at client header) to intel_svc_client_msg rename struct intel_svc_private_mem to intel_svc_data
Other corrections/changes from Intel internal code reviews

---
 drivers/misc/Kconfig                 |  12 +
 drivers/misc/Makefile                |   1 +
 drivers/misc/intel-service.c         | 960 +++++++++++++++++++++++++++++++++++
 drivers/misc/intel-smc.h             | 205 ++++++++
 include/linux/intel-service-client.h | 188 +++++++
 5 files changed, 1366 insertions(+)
 create mode 100644 drivers/misc/intel-service.c
 create mode 100644 drivers/misc/intel-smc.h
 create mode 100644 include/linux/intel-service-client.h
drivers/misc/Kconfig +12 -0
index 03605f8..ec225fa7 100644
@@ -139,6 +139,18 @@ config INTEL_MID_PTI
 	  an Intel Atom (non-netbook) mobile device containing a MIPI
 	  P1149.7 standard implementation.
 
+config INTEL_SERVICE
+	tristate "Intel Service Layer"
+	depends on HAVE_ARM_SMCCC
+	default n
+	help
+	 Intel service layer runs at privileged exception level, interfaces with
+	 the service providers (FPGA manager is one of them) and manages secure
+	 monitor call to communicate with secure monitor software at secure monitor
+	 exception level.
+
+	 Say Y here if you want Intel service layer support.
+
 config SGI_IOC4
 	tristate "SGI IOC4 Base IO support"
 	depends on PCI
drivers/misc/Makefile +1 -0
index c3c8624..3857fc2 100644
@@ -8,6 +8,7 @@ obj-$(CONFIG_AD525X_DPOT)	+= ad525x_dpot.o
 obj-$(CONFIG_AD525X_DPOT_I2C)	+= ad525x_dpot-i2c.o
 obj-$(CONFIG_AD525X_DPOT_SPI)	+= ad525x_dpot-spi.o
 obj-$(CONFIG_INTEL_MID_PTI)	+= pti.o
+obj-$(CONFIG_INTEL_SERVICE)     += intel-service.o
 obj-$(CONFIG_ATMEL_SSC)		+= atmel-ssc.o
 obj-$(CONFIG_ATMEL_TCLIB)	+= atmel_tclib.o
 obj-$(CONFIG_DUMMY_IRQ)		+= dummy-irq.o
drivers/misc/intel-service.c new file +960 -0

960 lines not on this page · raw message

drivers/misc/intel-smc.h new file +205 -0

205 lines not on this page · raw message

include/linux/intel-service-client.h new file +188 -0

188 lines not on this page · raw message

Signature · 1 line
2.7.4
maintainer
#5 lore raw

Re: [PATCHv2 3/7] driver, misc: add Intel Stratix10 service layer driver

Quoted 1 line · richard.gong at linux.intel.com

+EXPORT_SYMBOL_GPL(request_svc_channel_byname);

All of your global symbols should have the same prefix, not a verb. So this should be:
svc_channel_request_by_name(), right?

Quoted 1 line

+EXPORT_SYMBOL_GPL(free_svc_channel);

svc_channel_free()?

Quoted 1 line

+EXPORT_SYMBOL_GPL(intel_svc_send);

Wait, why doesn't the first ones have "intel_svc" in them?

What is the difference here?

Should they all just have "intel_svc_" as the prefix?

Stick to one thing for all exported functions/variables please, it's the only way we can attempt to keep our namespace "sane".

Also, why would a 'misc' driver be exporting things that something else uses? Why not just put this in the fpga directory next to the users of this code?

thanks,

greg k-h

#6 lore raw

Re: [PATCHv2 3/7] driver, misc: add Intel Stratix10 service layer driver

Hi Greg,

Thanks for review.

Quoted 10 lines · Greg KH
Quoted 1 line · On Thu, Mar 01, 2018 at 06:19:31PM -0600,[email protected] wrote:

+EXPORT_SYMBOL_GPL(request_svc_channel_byname);

All of your global symbols should have the same prefix, not a verb. So this should be:
svc_channel_request_by_name(), right?

Quoted 1 line

+EXPORT_SYMBOL_GPL(free_svc_channel);

svc_channel_free()?

Quoted 1 line

+EXPORT_SYMBOL_GPL(intel_svc_send);

Quoted 8 lines

Wait, why doesn't the first ones have "intel_svc" in them?

What is the difference here?

Should they all just have "intel_svc_" as the prefix?

Stick to one thing for all exported functions/variables please, it's the only way we can attempt to keep our namespace "sane".

Sure, I will make changes so that all exported functions will have "intel_svc_" as the prefix.

Quoted 3 lines

Also, why would a 'misc' driver be exporting things that something else uses? Why not just put this in the fpga directory next to the users of this code?

Intel Stratix10 service layer driver, running at privileged exception level (EL1), interfaces with the service providers and providers the services for FPGA configuration, QSPI, Crypto, ECC, and warm reset. Service layer driver also manages secure monitor call to communicate with secure monitor code running at EL3.

FPGA manager is the first service provider. Later we will add several service providers, and extend service layer driver to provide the services for QSPI, Crypto, ECC and warm reset.

Regards,
Richard

Quoted 3 lines

thanks,

greg k-h

#7 lore raw

PATCH v2 4/7 dt-bindings: fpga: add Stratix10 SoC FPGA manager binding

In reply to [email protected]

From: Alan Tull <[email protected]>

Add a Device Tree binding for the Intel Stratix10 SoC FPGA manager.

---
v2: this patch is added in patch set version 2

---
 .../devicetree/bindings/fpga/intel-stratix10-soc-fpga-mgr.txt  | 10 ++++++++++
 1 file changed, 10 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/fpga/intel-stratix10-soc-fpga-mgr.txt
Documentation/devicetree/bindings/fpga/intel-stratix10-soc-fpga-mgr.txt new file +10 -0
new file mode 100644
index 0000000..78de689
@@ -0,0 +1,10 @@
+Intel Stratix10 SoC FPGA Manager
+
+Required properties:
+- compatible : should contain "intel,stratix10-soc-fpga-mgr"
+
+Example:
+
+	fpga_mgr: fpga-mgr at 0 {
+		compatible = "intel,stratix10-soc-fpga-mgr";
+	};
Signature · 1 line
2.7.4
maintainer
#8 lore raw

Re: [PATCHv2 4/7] dt-bindings: fpga: add Stratix10 SoC FPGA manager binding

Quoted 18 lines · richard.gong at linux.intel.com

From: Alan Tull <[email protected]>

Add a Device Tree binding for the Intel Stratix10 SoC FPGA manager.

---
v2: this patch is added in patch set version 2

---
 .../devicetree/bindings/fpga/intel-stratix10-soc-fpga-mgr.txt  | 10 ++++++++++
 1 file changed, 10 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/fpga/intel-stratix10-soc-fpga-mgr.txt
Documentation/devicetree/bindings/fpga/intel-stratix10-soc-fpga-mgr.txt new file +0 -0
new file mode 100644
index 0000000..78de689

Documentation/devicetree/bindings/fpga/intel-stratix10-soc-fpga-mgr.txt line 9

Quoted 9 lines
Documentation/devicetree/bindings/fpga/intel-stratix10-soc-fpga-mgr.txt new file +9 -0
@@ -0,0 +1,10 @@
+Intel Stratix10 SoC FPGA Manager
+
+Required properties:
+- compatible : should contain "intel,stratix10-soc-fpga-mgr"
+
+Example:
+
+	fpga_mgr: fpga-mgr at 0 {
+		compatible = "intel,stratix10-soc-fpga-mgr";

No reg or anything else? Is that because it all goes thru the service layer firmware? Just get the service layer driver to instantiate a device for this driver or get rid of the 2 layers if that's all the firmware interface does. DT is not a Linux driver instantiation mechanism.

And build your dts files with "W=1" because there's an error in this example.

Rob

#9 lore raw

Re: [PATCHv2 4/7] dt-bindings: fpga: add Stratix10 SoC FPGA manager binding

Quoted 23 lines · Rob Herring
Quoted 22 lines · richard.gong at linux.intel.com

From: Alan Tull <[email protected]>

Add a Device Tree binding for the Intel Stratix10 SoC FPGA manager.

---
v2: this patch is added in patch set version 2

---
 .../devicetree/bindings/fpga/intel-stratix10-soc-fpga-mgr.txt  | 10 ++++++++++
 1 file changed, 10 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/fpga/intel-stratix10-soc-fpga-mgr.txt
Documentation/devicetree/bindings/fpga/intel-stratix10-soc-fpga-mgr.txt new file +4 -0
new file mode 100644
index 0000000..78de689
@@ -0,0 +1,10 @@
+Intel Stratix10 SoC FPGA Manager
+
+Required properties:
+- compatible : should contain "intel,stratix10-soc-fpga-mgr"
Quoted 8 lines

Documentation/devicetree/bindings/fpga/intel-stratix10-soc-fpga-mgr.txt line 9

Quoted 5 lines
Documentation/devicetree/bindings/fpga/intel-stratix10-soc-fpga-mgr.txt new file +5 -0
+
+Example:
+
+     fpga_mgr: fpga-mgr at 0 {
+             compatible = "intel,stratix10-soc-fpga-mgr";

No reg or anything else? Is that because it all goes thru the service layer firmware?

Yes.

There will be a few more clients of the service layer: QSPI, Crypto and warm reset.

Quoted 4 lines

Just get the service layer driver to instantiate a device for this driver or get rid of the 2 layers if that's all the firmware interface does. DT is not a Linux driver instantiation mechanism.

Right, this should be describing hardware.

I could add this to the service layer binding:

firmware {
        svc {
                compatible = "intel,stratix10-svc";
                method = "smc";
                memory-region = <&service_reserved>;
                fpga-mgr {
                        compatible = "intel,stratix10-soc-fpga-mgr";
                };
        };
};
Quoted 3 lines

And build your dts files with "W=1" because there's an error in this example.

Ouch. Yes.

Warning (unit_address_vs_reg): Node /soc/fpga-mgr at 0 has a unit name, but no reg property

Thanks for the review,
Alan

Quoted 2 lines

Rob

maintainer
#10 lore raw

Re: [PATCHv2 4/7] dt-bindings: fpga: add Stratix10 SoC FPGA manager binding

Quoted 47 lines · Alan Tull
Quoted 23 lines · Rob Herring
Quoted 22 lines · richard.gong at linux.intel.com

From: Alan Tull <[email protected]>

Add a Device Tree binding for the Intel Stratix10 SoC FPGA manager.

---
v2: this patch is added in patch set version 2

---
 .../devicetree/bindings/fpga/intel-stratix10-soc-fpga-mgr.txt  | 10 ++++++++++
 1 file changed, 10 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/fpga/intel-stratix10-soc-fpga-mgr.txt
Documentation/devicetree/bindings/fpga/intel-stratix10-soc-fpga-mgr.txt new file +4 -0
new file mode 100644
index 0000000..78de689
@@ -0,0 +1,10 @@
+Intel Stratix10 SoC FPGA Manager
+
+Required properties:
+- compatible : should contain "intel,stratix10-soc-fpga-mgr"
Quoted 8 lines

Documentation/devicetree/bindings/fpga/intel-stratix10-soc-fpga-mgr.txt line 9

Quoted 5 lines
Documentation/devicetree/bindings/fpga/intel-stratix10-soc-fpga-mgr.txt new file +5 -0
+
+Example:
+
+     fpga_mgr: fpga-mgr at 0 {
+             compatible = "intel,stratix10-soc-fpga-mgr";

No reg or anything else? Is that because it all goes thru the service layer firmware?

Yes.

There will be a few more clients of the service layer: QSPI, Crypto and warm reset.

Quoted 4 lines

Just get the service layer driver to instantiate a device for this driver or get rid of the 2 layers if that's all the firmware interface does. DT is not a Linux driver instantiation mechanism.

Right, this should be describing hardware.

I could add this to the service layer binding:

Quoted 7 lines
firmware {
        svc {
                compatible = "intel,stratix10-svc";
                method = "smc";
                memory-region = <&service_reserved>;
                fpga-mgr {
                        compatible = "intel,stratix10-soc-fpga-mgr";

Still, why do you need this node? If you don't have any other cross tree connections, then the service layer can instantiate the device(s).

OTOH, QSPI would need a node because you'll need to describe its bus.

Rob

#11 lore raw

Re: [PATCHv2 4/7] dt-bindings: fpga: add Stratix10 SoC FPGA manager binding

Quoted 46 lines · Rob Herring
Quoted 45 lines · Alan Tull
Quoted 23 lines · Rob Herring
Quoted 22 lines · richard.gong at linux.intel.com

From: Alan Tull <[email protected]>

Add a Device Tree binding for the Intel Stratix10 SoC FPGA manager.

---
v2: this patch is added in patch set version 2

---
 .../devicetree/bindings/fpga/intel-stratix10-soc-fpga-mgr.txt  | 10 ++++++++++
 1 file changed, 10 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/fpga/intel-stratix10-soc-fpga-mgr.txt
Documentation/devicetree/bindings/fpga/intel-stratix10-soc-fpga-mgr.txt new file +4 -0
new file mode 100644
index 0000000..78de689
@@ -0,0 +1,10 @@
+Intel Stratix10 SoC FPGA Manager
+
+Required properties:
+- compatible : should contain "intel,stratix10-soc-fpga-mgr"
Quoted 8 lines

Documentation/devicetree/bindings/fpga/intel-stratix10-soc-fpga-mgr.txt line 9

Quoted 5 lines
Documentation/devicetree/bindings/fpga/intel-stratix10-soc-fpga-mgr.txt new file +5 -0
+
+Example:
+
+     fpga_mgr: fpga-mgr at 0 {
+             compatible = "intel,stratix10-soc-fpga-mgr";

No reg or anything else? Is that because it all goes thru the service layer firmware?

Yes.

There will be a few more clients of the service layer: QSPI, Crypto and warm reset.

Quoted 4 lines

Just get the service layer driver to instantiate a device for this driver or get rid of the 2 layers if that's all the firmware interface does. DT is not a Linux driver instantiation mechanism.

Right, this should be describing hardware.

Quoted 8 lines
Quoted 8 lines

I could add this to the service layer binding:

firmware {
        svc {
                compatible = "intel,stratix10-svc";
                method = "smc";
                memory-region = <&service_reserved>;
                fpga-mgr {

Actually, add a label.

                  fpga_mgr: fpga-mgr {
Quoted 5 lines
Quoted 1 line
                        compatible = "intel,stratix10-soc-fpga-mgr";

Still, why do you need this node? If you don't have any other cross tree connections, then the service layer can instantiate the device(s).

It's used for the FPGA region to know what mgr can program the region.

Quoted 4 lines

OTOH, QSPI would need a node because you'll need to describe its bus.

Rob

maintainer
#12 lore raw

Re: [PATCHv2 4/7] dt-bindings: fpga: add Stratix10 SoC FPGA manager binding

Quoted 60 lines · Alan Tull
Quoted 46 lines · Rob Herring
Quoted 45 lines · Alan Tull
Quoted 23 lines · Rob Herring
Quoted 22 lines · richard.gong at linux.intel.com

From: Alan Tull <[email protected]>

Add a Device Tree binding for the Intel Stratix10 SoC FPGA manager.

---
v2: this patch is added in patch set version 2

---
 .../devicetree/bindings/fpga/intel-stratix10-soc-fpga-mgr.txt  | 10 ++++++++++
 1 file changed, 10 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/fpga/intel-stratix10-soc-fpga-mgr.txt
Documentation/devicetree/bindings/fpga/intel-stratix10-soc-fpga-mgr.txt new file +4 -0
new file mode 100644
index 0000000..78de689
@@ -0,0 +1,10 @@
+Intel Stratix10 SoC FPGA Manager
+
+Required properties:
+- compatible : should contain "intel,stratix10-soc-fpga-mgr"
Quoted 8 lines

Documentation/devicetree/bindings/fpga/intel-stratix10-soc-fpga-mgr.txt line 9

Quoted 5 lines
Documentation/devicetree/bindings/fpga/intel-stratix10-soc-fpga-mgr.txt new file +5 -0
+
+Example:
+
+     fpga_mgr: fpga-mgr at 0 {
+             compatible = "intel,stratix10-soc-fpga-mgr";

No reg or anything else? Is that because it all goes thru the service layer firmware?

Yes.

There will be a few more clients of the service layer: QSPI, Crypto and warm reset.

Quoted 4 lines

Just get the service layer driver to instantiate a device for this driver or get rid of the 2 layers if that's all the firmware interface does. DT is not a Linux driver instantiation mechanism.

Right, this should be describing hardware.

Quoted 8 lines
Quoted 8 lines

I could add this to the service layer binding:

firmware {
        svc {
                compatible = "intel,stratix10-svc";
                method = "smc";
                memory-region = <&service_reserved>;
                fpga-mgr {

Actually, add a label.

                  fpga_mgr: fpga-mgr {
Quoted 7 lines
Quoted 5 lines
Quoted 1 line
                        compatible = "intel,stratix10-soc-fpga-mgr";

Still, why do you need this node? If you don't have any other cross tree connections, then the service layer can instantiate the device(s).

It's used for the FPGA region to know what mgr can program the region.

Ah yes, that's probably good enough reason.

Rob

#13 lore raw

PATCH v2 5/7 arm64: dts: stratix10: add fpga manager and region

In reply to [email protected]

From: Alan Tull <[email protected]>

Add the Stratix10 FPGA manager and a FPGA region to the device tree.

---
v2: this patch is added in patch set version 2

---
 arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi | 12 ++++++++++++
 1 file changed, 12 insertions(+)
arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi +12 -0
index 4395e76..2f0067e 100644
@@ -107,6 +107,14 @@
 		interrupt-parent = <&intc>;
 		ranges = <0 0 0 0xffffffff>;
 
+		base_fpga_region {
+			#address-cells = <0x1>;
+			#size-cells = <0x1>;
+
+			compatible = "fpga-region";
+			fpga-mgr = <&fpga_mgr>;
+		};
+
 		clkmgr: clock-controller at ffd10000 {
 			compatible = "intel,stratix10-clkmgr";
 			reg = <0xffd10000 0x1000>;
@@ -138,6 +146,10 @@
 			};
 		};
 
+		fpga_mgr: fpga-mgr at 0 {
+			compatible = "intel,stratix10-soc-fpga-mgr";
+		};
+
 		gmac0: ethernet at ff800000 {
 			compatible = "altr,socfpga-stmmac", "snps,dwmac-3.74a", "snps,dwmac";
 			reg = <0xff800000 0x2000>;
Signature · 1 line
2.7.4
#14 lore raw

PATCH v2 6/7 fpga: add intel stratix10 soc fpga manager driver

In reply to [email protected]

From: Alan Tull <[email protected]>

Add driver for reconfiguring Intel Stratix10 SoC FPGA devices. This driver communicates through the Intel Service Driver which does communication with privileged hardware (that does the FPGA programming) through a secure mailbox.

---
v2: this patch is added in patch set version 2

---
 drivers/fpga/Kconfig         |   6 +
 drivers/fpga/Makefile        |   1 +
 drivers/fpga/stratix10-soc.c | 503 +++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 510 insertions(+)
 create mode 100644 drivers/fpga/stratix10-soc.c
drivers/fpga/Kconfig +6 -0
index f47ef84..cbcbced 100644
@@ -57,6 +57,12 @@ config FPGA_MGR_ZYNQ_FPGA
 	help
 	  FPGA manager driver support for Xilinx Zynq FPGAs.
 
+config FPGA_MGR_STRATIX10_SOC
+	tristate "Intel Stratix10 SoC FPGA Manager"
+	depends on (ARCH_STRATIX10 && INTEL_SERVICE)
+	help
+	  FPGA manager driver support for the Intel Stratix10 SoC.
+
 config FPGA_MGR_XILINX_SPI
 	tristate "Xilinx Configuration over Slave Serial (SPI)"
 	depends on SPI
drivers/fpga/Makefile +1 -0
index 3cb276a..6eef670 100644
@@ -12,6 +12,7 @@ obj-$(CONFIG_FPGA_MGR_ALTERA_PS_SPI)	+= altera-ps-spi.o
 obj-$(CONFIG_FPGA_MGR_ICE40_SPI)	+= ice40-spi.o
 obj-$(CONFIG_FPGA_MGR_SOCFPGA)		+= socfpga.o
 obj-$(CONFIG_FPGA_MGR_SOCFPGA_A10)	+= socfpga-a10.o
+obj-$(CONFIG_FPGA_MGR_STRATIX10_SOC)	+= stratix10-soc.o
 obj-$(CONFIG_FPGA_MGR_TS73XX)		+= ts73xx-fpga.o
 obj-$(CONFIG_FPGA_MGR_XILINX_SPI)	+= xilinx-spi.o
 obj-$(CONFIG_FPGA_MGR_ZYNQ_FPGA)	+= zynq-fpga.o
drivers/fpga/stratix10-soc.c new file +503 -0

503 lines not on this page · raw message

Signature · 1 line
2.7.4
#15 lore raw

PATCH v2 7/7 defconfig: enable fpga and service layer

In reply to [email protected]

From: Richard Gong <[email protected]>

Enable fpga framework, Stratix 10 SoC FPGA manager, and Intel Service Layer

---
v2: this patch is added in patch set version 2

---
 arch/arm64/configs/defconfig | 5 +++++
 1 file changed, 5 insertions(+)
arch/arm64/configs/defconfig +5 -0
index 634b373..44b226b 100644
@@ -169,6 +169,7 @@ CONFIG_BLK_DEV_LOOP=y
 CONFIG_BLK_DEV_NBD=m
 CONFIG_VIRTIO_BLK=y
 CONFIG_BLK_DEV_NVME=m
+CONFIG_INTEL_SERVICE=y
 CONFIG_SRAM=y
 CONFIG_EEPROM_AT25=m
 # CONFIG_SCSI_PROC_FS is not set
@@ -559,6 +560,10 @@ CONFIG_PHY_ROCKCHIP_INNO_USB2=y
 CONFIG_PHY_ROCKCHIP_EMMC=y
 CONFIG_PHY_ROCKCHIP_PCIE=m
 CONFIG_PHY_XGENE=y
+CONFIG_FPGA=y
+CONFIG_FPGA_REGION=y
+CONFIG_FPGA_MGR_STRATIX10_SOC=y
+CONFIG_FPGA_BRIDGE=y
 CONFIG_PHY_TEGRA_XUSB=y
 CONFIG_QCOM_L2_PMU=y
 CONFIG_QCOM_L3_PMU=y
Signature · 1 line
2.7.4