Add Intel Stratix10 FPGA manager and service layer
Subsystems (5)
v10 cover Add Intel Stratix10 FPGA manager and service layer
From: Richard Gong <[email protected]>
This is the 10th submission of Intel Stratix10 service layer and FPGA manager driver patches. In this submission I have moved Stratix10 service layer driver .c file to drivers/firmware and header files to include/linux/firmware/intel. I have added Stratix10 service layer document to other firmware interface.
Stratix10 service layer patches have been reviewed internally by Alan Tull and other colleagues at Intel.
Some features of the Intel Stratix10 SoC require a level of privilege higher than the kernel is granted. Such secure features include FPGA programming, remote status update, read and write the secure registers. In terms of the ARMv8 architecture, the kernel runs at Exception Level 1 (EL1), access to the features requires Exception Level 3 (EL3).
The Intel Stratix10 service layer provides kernel APIs for drivers to request access to the secure features. The requests are queued and processed one by one. ARM’s SMCCC is used to pass the execution of the requests on to a secure monitor (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 and kfifo_out with kfifo_in_spinlocked and 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.
v3: change all exported functions with "intel_svc_" as the prefix.
increase timeout values for claiming back submitted buffer(s). rename struct intel_command_reconfig_payload to
struct intel_svc_command_reconfig_payload.
add pr_err() to provide the error return value.
change to put fpga_mgr node under firmware/svc node.
change to FPGA manager to align the update of service client APIs, and the update of fpga_mgr device node.
Other corrections/changes.
v4: s/intel/stratix10/ on some variables, structs, functions, and file
names intel-service.c -> stratix10-svc.c
intel-smc.h -> stratix10-smc.h
intel-service-client.h -> stratix10-svc-client.h.
remove non-kernel-doc formatting.
s/fpga-mgr@0/fpga-mgr/ to remove unit_address at fpga_mgr node. add Rob's Reviewed-by.
add Richard's signed-off-by.
v5: add a new API statix10_svc_done() which is called by service client
when client request is completed or error occurs during request process. Which allows service layer to free its resources. remove dummy client from service layer client header and service layer source file.
add Rob's Reviewed-by.
add a new file stratix10-svc.rst and add that to driver-api/index.rst. kernel-doc fixes.
v6: replace kthread_create_on_cpu() with kthread_create_on_node().
extend stratix_svc_send() to support service client which doesn't use memory allocated by service layer.
add S10_RECONFIG_TIMEOUT.
rename s/S10_BUF_TIMEOUT/S10_BUFFER_TIMEOUT/.
fix service layer and FPGA manager Klocwork errors.
v7: add remote status update client support.
s/pr_debug/dev_dbg, s/dev_info/dev_dbg.
add unlock buffer if s10_svc_send_msg() fails.
add release channel if fpga_mgr_create() fails.
handle invalid pointer at svc if the client passed an invalid name.
v8: move stratix10-smc.h to include/linux from driver/misc.
revert version 7 error code & smc function ID value changes at stratix10-smc.h.
add a goto and common error handling at the end of fpga driver's. probe function.
v9: remove a patch on defconfig for enable service layer and FPGA manager.
resolve a issue found at git-bisect test.
remove kernel-doc markups that aren't being built.
v10:move stratix10-smc.h and stratix10-svc-client.h to
include/linux/firmware/intel.
move stratix10-svc.c to drivers/firmware. s/STRATIX10_SERVICE/INTEL_STRATIX10_SERVICE, fix a Klocwork error at service layer driver. s/stratix10_svc_command_reconfig_payload/ stratix10_svc_command_config_type.
add stratix10 service layer document to other firmware interface. update path for the included header in Stratix10 FPGA manager driver.
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 (5):
dt-bindings, firmware: add Intel Stratix10 service layer binding
arm64: dts: stratix10: add stratix10 service driver binding to base
dtsi
firmware: add Intel Stratix10 service layer driver
Documentation: driver-api: add stratix10 service layer
firmware: add remote status update client support
.../bindings/firmware/intel,stratix10-svc.txt | 57 ++ .../bindings/fpga/intel-stratix10-soc-fpga-mgr.txt | 17 + .../driver-api/firmware/other_interfaces.rst | 30 + arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi | 33 + drivers/firmware/Kconfig | 12 + drivers/firmware/Makefile | 1 + drivers/firmware/stratix10-svc.c | 1044 ++++++++++++++++++++ drivers/fpga/Kconfig | 6 + drivers/fpga/Makefile | 1 + drivers/fpga/stratix10-soc.c | 535 ++++++++++ include/linux/firmware/intel/stratix10-smc.h | 312 ++++++ .../linux/firmware/intel/stratix10-svc-client.h | 217 ++++ 12 files changed, 2265 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/firmware/stratix10-svc.c create mode 100644 drivers/fpga/stratix10-soc.c create mode 100644 include/linux/firmware/intel/stratix10-smc.h create mode 100644 include/linux/firmware/intel/stratix10-svc-client.h
Signature · 1 line
2.7.4
PATCH v10 1/8 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"
v3: no change
v4: add Rob's Reviewed-by
v5: no change
v6: add Moritz's Acked-by
v7: no change
v8: no change
v9: no chnage
v10: no change
--- .../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
@@ -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@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
PATCH v10 2/8 arm64: dts: stratix10: add stratix10 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"
v3: no change
v4: s/service driver/stratix10 service driver/ in subject line
v5: no change
v6: add Moritz's Acked-by
v7: no change
v8: no change
v9: no change
v10: no change
--- arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+)
arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi +21 -0
@@ -24,6 +24,19 @@ #address-cells = <2>; #size-cells = <2>; + 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; + }; + }; + cpus { #address-cells = <1>; #size-cells = <0>;
@@ -534,5 +547,13 @@ status = "disabled"; }; + + firmware { + svc { + compatible = "intel,stratix10-svc"; + method = "smc"; + memory-region = <&service_reserved>; + }; + }; }; };
Signature · 1 line
2.7.4
PATCH v10 3/8 firmware: add Intel Stratix10 service layer driver
In reply to [email protected]From: Richard Gong <[email protected]>
Some features of the Intel Stratix10 SoC require a level of privilege higher than the kernel is granted. Such secure features include FPGA programming. In terms of the ARMv8 architecture, the kernel runs at Exception Level 1 (EL1), access to the features requires Exception Level 3 (EL3).
The Intel Stratix10 SoC service layer provides an in kernel API for drivers to request access to the secure features. The requests are queued and processed one by one. ARM’s SMCCC is used to pass the execution of the requests on to a secure monitor (EL3).
The header file stratix10-sve-client.h defines the interface between service providers (FPGA manager is one of them) and service layer.
The header file stratix10-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).
---
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
v3: change all exported functions with "intel_svc_" as the prefix
increase timeout values for claiming back submitted buffer(s) rename struct intel_command_reconfig_payload to
struct intel_svc_command_reconfig_payload
add pr_err() to provide the error return value
other corrections/changes
v4: s/intel/stratix10/ on some variables, structs, functions, and file names
intel-service.c -> stratix10-svc.c
intel-smc.h -> stratix10-smc.h
intel-service-client.h -> stratix10-svc-client.h
remove non-kernel-doc formattingv5: add a new API statix10_svc_done() which is called by service client
when client request is completed or error occurs during request process. Which allows service layer to free its resources. remove dummy client from service layer client header and service layer source file.
kernel-doc fixes
v6: replace kthread_create_on_cpu() with kthread_create_on_node()
extend stratix_svc_send() to support service client which doesn't use memory allocated by service layer
fix several Klocwork errors
v7: handle invalid pointer if the client passed an invalid name
v8: move stratix10-smc.h to include/linux
revert version 7 error code & smc function ID value changes
at stratix10-smc.h
v9: remove handle for COMMAND_RSU_UPDATE at stratix10-svc.c
remove RSU related definitions at stratix10-smc.h
v10: s/stratix10_svc_command_reconfig_payload/stratix10_svc_command_config_type
move stratix10-smc.h and stratix10-svc-client.h to include/linux/firmware/intel
move stratix10-svc.c to drivers/firmware s/STRATIX10_SERVICE/INTEL_STRATIX10_SERVICE
fix a Klocwork error
--- drivers/firmware/Kconfig | 12 + drivers/firmware/Makefile | 1 + drivers/firmware/stratix10-svc.c | 1013 ++++++++++++++++++++ include/linux/firmware/intel/stratix10-smc.h | 265 +++++ .../linux/firmware/intel/stratix10-svc-client.h | 201 ++++ 5 files changed, 1492 insertions(+) create mode 100644 drivers/firmware/stratix10-svc.c create mode 100644 include/linux/firmware/intel/stratix10-smc.h create mode 100644 include/linux/firmware/intel/stratix10-svc-client.h
drivers/firmware/Kconfig +12 -0
@@ -216,6 +216,18 @@ config FW_CFG_SYSFS_CMDLINE WARNING: Using incorrect parameters (base address in particular) may crash your system. +config INTEL_STRATIX10_SERVICE + tristate "Intel Stratix10 Service Layer" + depends on HAVE_ARM_SMCCC + default n + help + Intel Stratix10 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 Stratix10 service layer support. + config QCOM_SCM bool depends on ARM || ARM64
drivers/firmware/Makefile +1 -0
@@ -12,6 +12,7 @@ obj-$(CONFIG_DMI_SYSFS) += dmi-sysfs.o obj-$(CONFIG_EDD) += edd.o obj-$(CONFIG_EFI_PCDP) += pcdp.o obj-$(CONFIG_DMIID) += dmi-id.o +obj-$(CONFIG_INTEL_STRATIX10_SERVICE) += stratix10-svc.o obj-$(CONFIG_ISCSI_IBFT_FIND) += iscsi_ibft_find.o obj-$(CONFIG_ISCSI_IBFT) += iscsi_ibft.o obj-$(CONFIG_FIRMWARE_MEMMAP) += memmap.o
drivers/firmware/stratix10-svc.c new file +1013 -0
1,013 lines not on this page · raw message
include/linux/firmware/intel/stratix10-smc.h new file +265 -0
265 lines not on this page · raw message
include/linux/firmware/intel/stratix10-svc-client.h new file +201 -0
201 lines not on this page · raw message
Signature · 1 line
2.7.4
PATCH v10 4/8 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
v3: change to put fpga_mgr node under firmware/svc node
v4: s/fpga-mgr@0/fpga-mgr/ to remove unit_address
add Richard's signed-off-by
v5: add Reviewed-by Rob Herring
v6: no change
v7: no change
v8: no change
v9: no change
v10: no change
--- .../bindings/fpga/intel-stratix10-soc-fpga-mgr.txt | 17 +++++++++++++++++ 1 file changed, 17 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 +17 -0
@@ -0,0 +1,17 @@ +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" + +Example: + + firmware { + svc { + fpga_mgr: fpga-mgr { + compatible = "intel,stratix10-soc-fpga-mgr"; + }; + }; + };
Signature · 1 line
2.7.4
PATCH v10 5/8 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
v3: change to put fpga_mgr node under firmware/svc node
v4: s/fpga-mgr@0/fpga-mgr/ to remove unit_address
add Richard's signed-off-by
v5: no change
v6: no change
v7: no change
v8: no change
v9: no change
v10: no change
--- arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi | 12 ++++++++++++ 1 file changed, 12 insertions(+)
arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi +12 -0
@@ -106,6 +106,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@ffd10000 { compatible = "intel,stratix10-clkmgr"; reg = <0xffd10000 0x1000>;
@@ -553,6 +561,10 @@ compatible = "intel,stratix10-svc"; method = "smc"; memory-region = <&service_reserved>; + + fpga_mgr: fpga-mgr { + compatible = "intel,stratix10-soc-fpga-mgr"; + }; }; }; };
Signature · 1 line
2.7.4
PATCH v10 6/8 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
v3: change to align to the update of service client APIs, and the
update of fpga_mgr device node
v4: changes to align with stratix10-svc-client API updates
add Richard's signed-off-by
v5: update to align changes at service layer to minimize service
layer thread usages
v6: add S10_RECONFIG_TIMEOUT
rename s/S10_BUF_TIMEOUT/S10_BUFFER_TIMEOUT/
fix klocwork errors
v7: s/pr_debug/dev_dbg, s/dev_info/dev_dbg
add unlock buffer if s10_svc_send_msg() fails
add release channel if fpga_mgr_create() fails
v8: add a goto and common error handling at the end of s10_probe
function
add Moritz's Acked-by
v9: remove kernel-doc markups that aren't being built
v10: s/STRATIX10_SERVICE/INTEL_STRATIX10_SERVICE
s/stratix10_svc_command_reconfig_payload/stratix10_svc_command_config_type update path for the included header file stratix10-svc-client.h
--- drivers/fpga/Kconfig | 6 + drivers/fpga/Makefile | 1 + drivers/fpga/stratix10-soc.c | 535 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 542 insertions(+) create mode 100644 drivers/fpga/stratix10-soc.c
drivers/fpga/Kconfig +6 -0
@@ -56,6 +56,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_STRATIX10_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
@@ -13,6 +13,7 @@ obj-$(CONFIG_FPGA_MGR_ICE40_SPI) += ice40-spi.o obj-$(CONFIG_FPGA_MGR_MACHXO2_SPI) += machxo2-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 +535 -0
535 lines not on this page · raw message
Signature · 1 line
2.7.4
PATCH v10 7/8 Documentation: driver-api: add stratix10 service layer
In reply to [email protected]From: Richard Gong <[email protected]>
Add new file stratix10-svc.rst
Add stratix10-svc.rst to driver-api/index.rst
---
v5: this patch is added in patch set version 5
v6: no change
v7: no change
v8: no change
v9: no change
v10: add stratix10 service layer document to other firmware
interface, and then remove stratix10-svc.rst file
--- .../driver-api/firmware/other_interfaces.rst | 30 ++++++++++++++++++++++ 1 file changed, 30 insertions(+)
Documentation/driver-api/firmware/other_interfaces.rst +30 -0
@@ -13,3 +13,33 @@ EDD Interfaces .. kernel-doc:: drivers/firmware/edd.c :internal: +Intel Stratix10 SoC Service Layer +--------------------------------- +Some features of the Intel Stratix10 SoC require a level of privilege +higher than the kernel is granted. Such secure features include +FPGA programming. In terms of the ARMv8 architecture, the kernel runs +at Exception Level 1 (EL1), access to the features requires +Exception Level 3 (EL3). + +The Intel Stratix10 SoC service layer provides an in kernel API for +drivers to request access to the secure features. The requests are queued +and processed one by one. ARM’s SMCCC is used to pass the execution +of the requests on to a secure monitor (EL3). + +.. kernel-doc:: include/linux/firmware/intel/stratix10-svc-client.h + :functions: stratix10_svc_command_code + +.. kernel-doc:: include/linux/firmware/intel/stratix10-svc-client.h + :functions: stratix10_svc_client_msg + +.. kernel-doc:: include/linux/firmware/intel/stratix10-svc-client.h + :functions: stratix10_svc_command_reconfig_payload + +.. kernel-doc:: include/linux/firmware/intel/stratix10-svc-client.h + :functions: stratix10_svc_cb_data + +.. kernel-doc:: include/linux/firmware/intel/stratix10-svc-client.h + :functions: stratix10_svc_client + +.. kernel-doc:: drivers/firmware/stratix10-svc.c + :export:
Signature · 1 line
2.7.4
PATCH v10 8/8 firmware: add remote status update client support
In reply to [email protected]From: Richard Gong <[email protected]>
Extend Intel Stratix10 service layer to support the second service layer client, Remote Status Update (RSU).
RSU is used to provide our customers with protection against loading bas bitstreams onto their devices when those device are booting from flash.
---
v7: this patch is added in patch set version 7
v8: no change
v9: add case for COMMAND_RSU_UPDATE at svc_thread_recv_status_ok() at
stratix10-svc.c file
add RSU related definitions at stratix10-smc.h file
v10: s/misc/firmware at commit header
--- drivers/firmware/stratix10-svc.c | 35 +++++++++++++++- include/linux/firmware/intel/stratix10-smc.h | 47 ++++++++++++++++++++++ .../linux/firmware/intel/stratix10-svc-client.h | 20 ++++++++- 3 files changed, 98 insertions(+), 4 deletions(-)
drivers/firmware/stratix10-svc.c +33 -2
@@ -34,7 +34,7 @@* timeout is set to 30 seconds (30 * 1000) at Intel Stratix10 SoC. */ #define SVC_NUM_DATA_IN_FIFO 32 -#define SVC_NUM_CHANNEL 1 +#define SVC_NUM_CHANNEL 2#define FPGA_CONFIG_DATA_CLAIM_TIMEOUT_MS 200#define FPGA_CONFIG_STATUS_TIMEOUT_SEC 30
@@ -271,7 +271,7 @@ static void svc_thread_cmd_config_status(struct stratix10_svc_controller *ctrl,* @cb_data: pointer to callback data structure to service client * @res: result from SMC or HVC call * -* Send back the correspond status to the service client (FPGA manager etc). +* Send back the correspond status to the service clients. */ static void svc_thread_recv_status_ok(struct stratix10_svc_data *p_data, struct stratix10_svc_cb_data *cb_data,
@@ -295,6 +295,9 @@ static void svc_thread_recv_status_ok(struct stratix10_svc_data *p_data,case COMMAND_RECONFIG_STATUS : cb_data->status =BIT (SVC_STATUS_RECONFIG_COMPLETED );break ; +case COMMAND_RSU_UPDATE : + cb_data->status =BIT (SVC_STATUS_RSU_OK ); +break ;default :pr_warn ("it shouldn't happen\n" );break ;
@@ -373,6 +376,16 @@ static int svc_normal_to_secure_thread(void *data) a1 =0 ; a2 =0 ;break ; +case COMMAND_RSU_STATUS : + a0 =INTEL_SIP_SMC_RSU_STATUS ; + a1 =0 ; + a2 =0 ; +break ; +case COMMAND_RSU_UPDATE : + a0 =INTEL_SIP_SMC_RSU_UPDATE ; + a1 = pdata->arg[0 ]; + a2 =0 ; +break ;default :pr_warn ("it shouldn't happen\n" );break ;
@@ -389,6 +402,19 @@ static int svc_normal_to_secure_thread(void *data) (unsigned int)res.a1, (unsigned int)res.a2);pr_debug (" res.a3=0x%016x\n" , (unsigned int )res.a3); +if (pdata->command ==COMMAND_RSU_STATUS ) { +if (res.a0 ==INTEL_SIP_SMC_RSU_ERROR ) + cbdata->status =BIT (SVC_STATUS_RSU_ERROR ); +else + cbdata->status =BIT (SVC_STATUS_RSU_OK ); + + cbdata->kaddr1 = &res; + cbdata->kaddr2 =NULL ; + cbdata->kaddr3 =NULL ; + pdata->chan->scl->receive_cb (pdata->chan->scl, cbdata); +continue ; + } +switch (res.a0) {case INTEL_SIP_SMC_STATUS_OK :svc_thread_recv_status_ok (pdata, cbdata, res);
@@ -941,6 +967,11 @@ static int stratix10_svc_drv_probe(struct platform_device *pdev) chans[0 ].name =SVC_CLIENT_FPGA ;spin_lock_init (&chans[0 ].lock); + chans[1 ].scl =NULL ; + chans[1 ].ctrl = controller; + chans[1 ].name =SVC_CLIENT_RSU ; +spin_lock_init (&chans[1 ].lock); +list_add_tail (&controller->node, &svc_ctrl);platform_set_drvdata (pdev, controller);
include/linux/firmware/intel/stratix10-smc.h +47 -0
63 lines not on this page · raw message
include/linux/firmware/intel/stratix10-svc-client.h +18 -2
@@ -10,8 +10,10 @@* Service layer driver supports client names * * fpga: for FPGA configuration +* rsu: for remote status update */ #define SVC_CLIENT_FPGA "fpga" +#define SVC_CLIENT_RSU "rsu"/** * Status of the sent command, in bit number
@@ -36,6 +38,9 @@* * SVC_COMMAND_STATUS_RECONFIG_ERROR: * Error encountered during FPGA configuration. +* +* SVC_STATUS_RSU_OK: +* Secure firmware accepts the request of remote status update (RSU). */ #define SVC_STATUS_RECONFIG_REQUEST_OK 0#define SVC_STATUS_RECONFIG_BUFFER_SUBMITTED 1
@@ -43,7 +48,8 @@#define SVC_STATUS_RECONFIG_COMPLETED 3#define SVC_STATUS_RECONFIG_BUSY 4#define SVC_STATUS_RECONFIG_ERROR 5 - +#define SVC_STATUS_RSU_OK 6 +#define SVC_STATUS_RSU_ERROR 7/** * Flag bit for COMMAND_RECONFIG *
@@ -56,9 +62,11 @@/** * Timeout settings for service clients: * timeout value used in Stratix10 FPGA manager driver. +* timeout value used in RSU driver */ #define SVC_RECONFIG_REQUEST_TIMEOUT_MS 100#define SVC_RECONFIG_BUFFER_TIMEOUT_MS 240 +#define SVC_RSU_REQUEST_TIMEOUT_MS 300struct stratix10_svc_chan ;
@@ -81,13 +89,21 @@ struct stratix10_svc_chan;* @COMMAND_RECONFIG_STATUS: check the status of the configuration, return * status is SVC_STATUS_RECONFIG_COMPLETED, or SVC_STATUS_RECONFIG_BUSY, or * SVC_STATUS_RECONFIG_ERROR +* +* @COMMAND_RSU_STATUS: request remote system update boot log, return status +* is log data or SVC_STATUS_RSU_ERROR +* +* @COMMAND_RSU_UPDATE: set the offset of the bitstream to boot after reboot, +* return status is SVC_STATUS_RSU_OK or SVC_STATUS_RSU_ERROR */ enum stratix10_svc_command_code {COMMAND_NOOP =0 ,COMMAND_RECONFIG ,COMMAND_RECONFIG_DATA_SUBMIT ,COMMAND_RECONFIG_DATA_CLAIM , -COMMAND_RECONFIG_STATUS +COMMAND_RECONFIG_STATUS , +COMMAND_RSU_STATUS , +COMMAND_RSU_UPDATE };/**
Signature · 1 line
2.7.4
Randy Dunlap
reviewerRe: [PATCHv10 3/8] firmware: add Intel Stratix10 service layer driver
In reply to [email protected]Quoted 9 lines · richard.gong at linux.intel.com
drivers/firmware/Kconfig +1
-0@@ -216,6 +216,18 @@ config FW_CFG_SYSFS_CMDLINE WARNING: Using incorrect parameters (base address in particular) may crash your system. +config INTEL_STRATIX10_SERVICE
drivers/firmware/Kconfig config FW_CFG_SYSFS_CMDLINE · line 229
Quoted 10 lines
drivers/firmware/Kconfig +10
-0+ tristate "Intel Stratix10 Service Layer" + depends on HAVE_ARM_SMCCC + default n + help + Intel Stratix10 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 Stratix10 service layer support.
from Documentation/process/coding-style.rst:
Lines under a ``config`` definition are indented with one tab, while help text is indented an additional two spaces.
thanks.
Signature · 1 line
~Randy
Moritz Fischer
maintainerRe: [PATCHv10 8/8] firmware: add remote status update client support
In reply to [email protected]Hi Richard,
Quoted 6 lines · richard.gong at linux.intel.com
From: Richard Gong <[email protected]>
Extend Intel Stratix10 service layer to support the second service layer client, Remote Status Update (RSU).
RSU is used to provide our customers with protection against loading bas
Nit: 'bas' -> 'bad'
Quoted 241 lines
bitstreams onto their devices when those device are booting from flash.
Signed-off-by Richard Gong <[email protected]>Signed-off-by Alan Tull <[email protected]>---
v7: this patch is added in patch set version 7
v8: no change
v9: add case forCOMMAND_RSU_UPDATEatsvc_thread_recv_status_ok()at
stratix10-svc.cfile
add RSU related definitions atstratix10-smc.hfile
v10: s/misc/firmware at commit header--- drivers/firmware/stratix10-svc.c | 35 +++++++++++++++- include/linux/firmware/intel/stratix10-smc.h | 47 ++++++++++++++++++++++ .../linux/firmware/intel/stratix10-svc-client.h | 20 ++++++++- 3 files changed, 98 insertions(+), 4 deletions(-)drivers/firmware/stratix10-svc.c +33
-2@@ -34,7 +34,7 @@* timeout is set to 30 seconds (30 * 1000) at Intel Stratix10 SoC. */ #define SVC_NUM_DATA_IN_FIFO 32 -#define SVC_NUM_CHANNEL 1 +#define SVC_NUM_CHANNEL 2#define FPGA_CONFIG_DATA_CLAIM_TIMEOUT_MS 200#define FPGA_CONFIG_STATUS_TIMEOUT_SEC 30@@ -271,7 +271,7 @@ static void svc_thread_cmd_config_status(struct stratix10_svc_controller *ctrl,* @cb_data: pointer to callback data structure to service client * @res: result from SMC or HVC call * -* Send back the correspond status to the service client (FPGA manager etc). +* Send back the correspond status to the service clients. */ static void svc_thread_recv_status_ok(struct stratix10_svc_data *p_data, struct stratix10_svc_cb_data *cb_data,@@ -295,6 +295,9 @@ static void svc_thread_recv_status_ok(struct stratix10_svc_data *p_data,case COMMAND_RECONFIG_STATUS : cb_data->status =BIT (SVC_STATUS_RECONFIG_COMPLETED );break ; +case COMMAND_RSU_UPDATE : + cb_data->status =BIT (SVC_STATUS_RSU_OK ); +break ;default :pr_warn ("it shouldn't happen\n" );break ;@@ -373,6 +376,16 @@ static int svc_normal_to_secure_thread(void *data) a1 =0 ; a2 =0 ;break ; +case COMMAND_RSU_STATUS : + a0 =INTEL_SIP_SMC_RSU_STATUS ; + a1 =0 ; + a2 =0 ; +break ; +case COMMAND_RSU_UPDATE : + a0 =INTEL_SIP_SMC_RSU_UPDATE ; + a1 = pdata->arg[0 ]; + a2 =0 ; +break ;default :pr_warn ("it shouldn't happen\n" );break ;@@ -389,6 +402,19 @@ static int svc_normal_to_secure_thread(void *data) (unsigned int)res.a1, (unsigned int)res.a2);pr_debug (" res.a3=0x%016x\n" , (unsigned int )res.a3); +if (pdata->command ==COMMAND_RSU_STATUS ) { +if (res.a0 ==INTEL_SIP_SMC_RSU_ERROR ) + cbdata->status =BIT (SVC_STATUS_RSU_ERROR ); +else + cbdata->status =BIT (SVC_STATUS_RSU_OK ); + + cbdata->kaddr1 = &res; + cbdata->kaddr2 =NULL ; + cbdata->kaddr3 =NULL ; + pdata->chan->scl->receive_cb (pdata->chan->scl, cbdata); +continue ; + } +switch (res.a0) {case INTEL_SIP_SMC_STATUS_OK :svc_thread_recv_status_ok (pdata, cbdata, res);@@ -941,6 +967,11 @@ static int stratix10_svc_drv_probe(struct platform_device *pdev) chans[0 ].name =SVC_CLIENT_FPGA ;spin_lock_init (&chans[0 ].lock); + chans[1 ].scl =NULL ; + chans[1 ].ctrl = controller; + chans[1 ].name =SVC_CLIENT_RSU ; +spin_lock_init (&chans[1 ].lock); +list_add_tail (&controller->node, &svc_ctrl);platform_set_drvdata (pdev, controller);include/linux/firmware/intel/stratix10-smc.h +47
-0@@ -67,6 +67,12 @@* * INTEL_SIP_SMC_FPGA_CONFIG_STATUS_ERROR: * There is error during the FPGA configuration process. +* +* INTEL_SIP_SMC_REG_ERROR: +* There is error during a read or write operation of the protected registers. +* +* INTEL_SIP_SMC_RSU_ERROR: +* There is error during a remote status update. */ #define INTEL_SIP_SMC_RETURN_UNKNOWN_FUNCTION 0xFFFFFFFF#define INTEL_SIP_SMC_STATUS_OK 0x0@@ -74,6 +80,7 @@#define INTEL_SIP_SMC_FPGA_CONFIG_STATUS_REJECTED 0x2#define INTEL_SIP_SMC_FPGA_CONFIG_STATUS_ERROR 0x4#define INTEL_SIP_SMC_REG_ERROR 0x5 +#define INTEL_SIP_SMC_RSU_ERROR 0x7/** * Request INTEL_SIP_SMC_FPGA_CONFIG_START @@ -262,4 +269,44 @@ INTEL_SIP_SMC_FAST_CALL_VAL(INTEL_SIP_SMC_FUNCID_FPGA_CONFIG_COMPLETED_WRITE)#define INTEL_SIP_SMC_REG_UPDATE \ INTEL_SIP_SMC_FAST_CALL_VAL(INTEL_SIP_SMC_FUNCID_REG_UPDATE) +/* +* Request INTEL_SIP_SMC_RSU_STATUS +* +* Request remote status update boot log, call is synchronous. +* +* Call register usage: +* a0 INTEL_SIP_SMC_RSU_STATUS +* a1-7 not used +* +* Return status +* a0: Current Image +* a1: Last Failing Image +* a2: Version | State +* a3: Error details | Error location +* +* Or +* +* a0: INTEL_SIP_SMC_RSU_ERROR +*/ +#define INTEL_SIP_SMC_FUNCID_RSU_STATUS 11 +#define INTEL_SIP_SMC_RSU_STATUS \ + INTEL_SIP_SMC_FAST_CALL_VAL(INTEL_SIP_SMC_FUNCID_RSU_STATUS) + +/* +* Request INTEL_SIP_SMC_RSU_UPDATE +* +* Request to set the offset of the bitstream to boot after reboot, call +* is synchronous. +* +* Call register usage: +* a0 INTEL_SIP_SMC_RSU_UPDATE +* a1 64bit physical address of the configuration data memory in flash +* a2-7 not used +* +* Return status +* a0 INTEL_SIP_SMC_STATUS_OK +*/ +#define INTEL_SIP_SMC_FUNCID_RSU_UPDATE 12 +#define INTEL_SIP_SMC_RSU_UPDATE \ + INTEL_SIP_SMC_FAST_CALL_VAL(INTEL_SIP_SMC_FUNCID_RSU_UPDATE)#endif include/linux/firmware/intel/stratix10-svc-client.h +18
-2@@ -10,8 +10,10 @@* Service layer driver supports client names * * fpga: for FPGA configuration +* rsu: for remote status update */ #define SVC_CLIENT_FPGA "fpga" +#define SVC_CLIENT_RSU "rsu"/** * Status of the sent command, in bit number @@ -36,6 +38,9 @@* * SVC_COMMAND_STATUS_RECONFIG_ERROR: * Error encountered during FPGA configuration. +* +* SVC_STATUS_RSU_OK: +* Secure firmware accepts the request of remote status update (RSU). */ #define SVC_STATUS_RECONFIG_REQUEST_OK 0#define SVC_STATUS_RECONFIG_BUFFER_SUBMITTED 1@@ -43,7 +48,8 @@#define SVC_STATUS_RECONFIG_COMPLETED 3#define SVC_STATUS_RECONFIG_BUSY 4#define SVC_STATUS_RECONFIG_ERROR 5 - +#define SVC_STATUS_RSU_OK 6 +#define SVC_STATUS_RSU_ERROR 7/** * Flag bit for COMMAND_RECONFIG * @@ -56,9 +62,11 @@/** * Timeout settings for service clients: * timeout value used in Stratix10 FPGA manager driver. +* timeout value used in RSU driver */ #define SVC_RECONFIG_REQUEST_TIMEOUT_MS 100#define SVC_RECONFIG_BUFFER_TIMEOUT_MS 240 +#define SVC_RSU_REQUEST_TIMEOUT_MS 300struct stratix10_svc_chan ;@@ -81,13 +89,21 @@ struct stratix10_svc_chan;* @COMMAND_RECONFIG_STATUS: check the status of the configuration, return * status is SVC_STATUS_RECONFIG_COMPLETED, or SVC_STATUS_RECONFIG_BUSY, or * SVC_STATUS_RECONFIG_ERROR +* +* @COMMAND_RSU_STATUS: request remote system update boot log, return status +* is log data or SVC_STATUS_RSU_ERROR +* +* @COMMAND_RSU_UPDATE: set the offset of the bitstream to boot after reboot, +* return status is SVC_STATUS_RSU_OK or SVC_STATUS_RSU_ERROR */ enum stratix10_svc_command_code {COMMAND_NOOP =0 ,COMMAND_RECONFIG ,COMMAND_RECONFIG_DATA_SUBMIT ,COMMAND_RECONFIG_DATA_CLAIM , -COMMAND_RECONFIG_STATUS +COMMAND_RECONFIG_STATUS , +COMMAND_RSU_STATUS , +COMMAND_RSU_UPDATE };/** Signature · 1 line
2.7.4
Thanks,
Moritz
Re: [PATCHv10 4/8] dt-bindings: fpga: add Stratix10 SoC FPGA manager binding
In reply to [email protected]Hi Richard,
Quoted 7 lines · richard.gong at linux.intel.com
From: Alan Tull <[email protected]>
Add a Device Tree binding for the Intel Stratix10 SoC FPGA manager.
Signed-off-by Alan Tull <[email protected]>Signed-off-by Richard Gong <[email protected]>Reviewed-by Rob Herring <[email protected]>
Quoted 42 lines
---
v2: this patch is added in patch set version 2
v3: change to putfpga_mgrnode underfirmware/svcnode
v4: s/fpga-mgr at 0/fpga-mgr/ to removeunit_address
add Richard's signed-off-by
v5: add Reviewed-by Rob Herring
v6: no change
v7: no change
v8: no change
v9: no change
v10: no change--- .../bindings/fpga/intel-stratix10-soc-fpga-mgr.txt | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 Documentation/devicetree/bindings/fpga/intel-stratix10-soc-fpga-mgr.txtDocumentation/devicetree/bindings/fpga/intel-stratix10-soc-fpga-mgr.txt new file +17
-0@@ -0,0 +1,17 @@ +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" + +Example: + + firmware { + svc { + fpga_mgr: fpga-mgr { + compatible = "intel,stratix10-soc-fpga-mgr"; + }; + }; + };Signature · 1 line
2.7.4
Thanks,
Moritz
Re: [PATCHv10 3/8] firmware: add Intel Stratix10 service layer driver
In reply to Randy DunlapHi Randy,
Quoted 23 lines · Randy Dunlap
Quoted 9 lines · On 11/6/18 8:52 AM, [email protected] wrote:
drivers/firmware/Kconfig +1
-0@@ -216,6 +216,18 @@ config FW_CFG_SYSFS_CMDLINE WARNING: Using incorrect parameters (base address in particular) may crash your system. +config INTEL_STRATIX10_SERVICEdrivers/firmware/Kconfig config FW_CFG_SYSFS_CMDLINE · line 229
Quoted 10 lines
drivers/firmware/Kconfig +10
-0+ tristate "Intel Stratix10 Service Layer" + depends on HAVE_ARM_SMCCC + default n + help + Intel Stratix10 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 Stratix10 service layer support.from
Documentation/process/coding-style.rst:
Quoted 4 lines
Lines under a ``config`` definition are indented with one tab, while help text is indented an additional two spaces.
I will correct that in the next submission.
Quoted 2 lines
thanks.
Regards,
Richard
Re: [PATCHv10 8/8] firmware: add remote status update client support
In reply to Moritz FischerHi Moritz,
Quoted 12 lines · Moritz Fischer
Hi Richard,
Quoted 6 lines · On Tue, Nov 06, 2018 at 10:52:52AM -0600, [email protected] wrote:
From: Richard Gong <[email protected]>
Extend Intel Stratix10 service layer to support the second service layer client, Remote Status Update (RSU).
RSU is used to provide our customers with protection against loading bas
Nit: 'bas' -> 'bad'
Quoted 2 lines
bitstreams onto their devices when those device are booting from flash.
I will correct that in the next submission.
Quoted 235 lines
Quoted 235 lines
Signed-off-by Richard Gong <[email protected]>Signed-off-by Alan Tull <[email protected]>---
v7: this patch is added in patch set version 7
v8: no change
v9: add case forCOMMAND_RSU_UPDATEatsvc_thread_recv_status_ok()at
stratix10-svc.cfile
add RSU related definitions atstratix10-smc.hfile
v10: s/misc/firmware at commit header--- drivers/firmware/stratix10-svc.c | 35 +++++++++++++++- include/linux/firmware/intel/stratix10-smc.h | 47 ++++++++++++++++++++++ .../linux/firmware/intel/stratix10-svc-client.h | 20 ++++++++- 3 files changed, 98 insertions(+), 4 deletions(-)drivers/firmware/stratix10-svc.c +33
-2@@ -34,7 +34,7 @@* timeout is set to 30 seconds (30 * 1000) at Intel Stratix10 SoC. */ #define SVC_NUM_DATA_IN_FIFO 32 -#define SVC_NUM_CHANNEL 1 +#define SVC_NUM_CHANNEL 2#define FPGA_CONFIG_DATA_CLAIM_TIMEOUT_MS 200#define FPGA_CONFIG_STATUS_TIMEOUT_SEC 30@@ -271,7 +271,7 @@ static void svc_thread_cmd_config_status(struct stratix10_svc_controller *ctrl,* @cb_data: pointer to callback data structure to service client * @res: result from SMC or HVC call * -* Send back the correspond status to the service client (FPGA manager etc). +* Send back the correspond status to the service clients. */ static void svc_thread_recv_status_ok(struct stratix10_svc_data *p_data, struct stratix10_svc_cb_data *cb_data,@@ -295,6 +295,9 @@ static void svc_thread_recv_status_ok(struct stratix10_svc_data *p_data,case COMMAND_RECONFIG_STATUS : cb_data->status =BIT (SVC_STATUS_RECONFIG_COMPLETED );break ; +case COMMAND_RSU_UPDATE : + cb_data->status =BIT (SVC_STATUS_RSU_OK ); +break ;default :pr_warn ("it shouldn't happen\n" );break ;@@ -373,6 +376,16 @@ static int svc_normal_to_secure_thread(void *data) a1 =0 ; a2 =0 ;break ; +case COMMAND_RSU_STATUS : + a0 =INTEL_SIP_SMC_RSU_STATUS ; + a1 =0 ; + a2 =0 ; +break ; +case COMMAND_RSU_UPDATE : + a0 =INTEL_SIP_SMC_RSU_UPDATE ; + a1 = pdata->arg[0 ]; + a2 =0 ; +break ;default :pr_warn ("it shouldn't happen\n" );break ;@@ -389,6 +402,19 @@ static int svc_normal_to_secure_thread(void *data) (unsigned int)res.a1, (unsigned int)res.a2);pr_debug (" res.a3=0x%016x\n" , (unsigned int )res.a3); +if (pdata->command ==COMMAND_RSU_STATUS ) { +if (res.a0 ==INTEL_SIP_SMC_RSU_ERROR ) + cbdata->status =BIT (SVC_STATUS_RSU_ERROR ); +else + cbdata->status =BIT (SVC_STATUS_RSU_OK ); + + cbdata->kaddr1 = &res; + cbdata->kaddr2 =NULL ; + cbdata->kaddr3 =NULL ; + pdata->chan->scl->receive_cb (pdata->chan->scl, cbdata); +continue ; + } +switch (res.a0) {case INTEL_SIP_SMC_STATUS_OK :svc_thread_recv_status_ok (pdata, cbdata, res);@@ -941,6 +967,11 @@ static int stratix10_svc_drv_probe(struct platform_device *pdev) chans[0 ].name =SVC_CLIENT_FPGA ;spin_lock_init (&chans[0 ].lock); + chans[1 ].scl =NULL ; + chans[1 ].ctrl = controller; + chans[1 ].name =SVC_CLIENT_RSU ; +spin_lock_init (&chans[1 ].lock); +list_add_tail (&controller->node, &svc_ctrl);platform_set_drvdata (pdev, controller);include/linux/firmware/intel/stratix10-smc.h +47
-0@@ -67,6 +67,12 @@* * INTEL_SIP_SMC_FPGA_CONFIG_STATUS_ERROR: * There is error during the FPGA configuration process. +* +* INTEL_SIP_SMC_REG_ERROR: +* There is error during a read or write operation of the protected registers. +* +* INTEL_SIP_SMC_RSU_ERROR: +* There is error during a remote status update. */ #define INTEL_SIP_SMC_RETURN_UNKNOWN_FUNCTION 0xFFFFFFFF#define INTEL_SIP_SMC_STATUS_OK 0x0@@ -74,6 +80,7 @@#define INTEL_SIP_SMC_FPGA_CONFIG_STATUS_REJECTED 0x2#define INTEL_SIP_SMC_FPGA_CONFIG_STATUS_ERROR 0x4#define INTEL_SIP_SMC_REG_ERROR 0x5 +#define INTEL_SIP_SMC_RSU_ERROR 0x7/** * Request INTEL_SIP_SMC_FPGA_CONFIG_START @@ -262,4 +269,44 @@ INTEL_SIP_SMC_FAST_CALL_VAL(INTEL_SIP_SMC_FUNCID_FPGA_CONFIG_COMPLETED_WRITE)#define INTEL_SIP_SMC_REG_UPDATE \ INTEL_SIP_SMC_FAST_CALL_VAL(INTEL_SIP_SMC_FUNCID_REG_UPDATE) +/* +* Request INTEL_SIP_SMC_RSU_STATUS +* +* Request remote status update boot log, call is synchronous. +* +* Call register usage: +* a0 INTEL_SIP_SMC_RSU_STATUS +* a1-7 not used +* +* Return status +* a0: Current Image +* a1: Last Failing Image +* a2: Version | State +* a3: Error details | Error location +* +* Or +* +* a0: INTEL_SIP_SMC_RSU_ERROR +*/ +#define INTEL_SIP_SMC_FUNCID_RSU_STATUS 11 +#define INTEL_SIP_SMC_RSU_STATUS \ + INTEL_SIP_SMC_FAST_CALL_VAL(INTEL_SIP_SMC_FUNCID_RSU_STATUS) + +/* +* Request INTEL_SIP_SMC_RSU_UPDATE +* +* Request to set the offset of the bitstream to boot after reboot, call +* is synchronous. +* +* Call register usage: +* a0 INTEL_SIP_SMC_RSU_UPDATE +* a1 64bit physical address of the configuration data memory in flash +* a2-7 not used +* +* Return status +* a0 INTEL_SIP_SMC_STATUS_OK +*/ +#define INTEL_SIP_SMC_FUNCID_RSU_UPDATE 12 +#define INTEL_SIP_SMC_RSU_UPDATE \ + INTEL_SIP_SMC_FAST_CALL_VAL(INTEL_SIP_SMC_FUNCID_RSU_UPDATE)#endif include/linux/firmware/intel/stratix10-svc-client.h +18
-2@@ -10,8 +10,10 @@* Service layer driver supports client names * * fpga: for FPGA configuration +* rsu: for remote status update */ #define SVC_CLIENT_FPGA "fpga" +#define SVC_CLIENT_RSU "rsu"/** * Status of the sent command, in bit number @@ -36,6 +38,9 @@* * SVC_COMMAND_STATUS_RECONFIG_ERROR: * Error encountered during FPGA configuration. +* +* SVC_STATUS_RSU_OK: +* Secure firmware accepts the request of remote status update (RSU). */ #define SVC_STATUS_RECONFIG_REQUEST_OK 0#define SVC_STATUS_RECONFIG_BUFFER_SUBMITTED 1@@ -43,7 +48,8 @@#define SVC_STATUS_RECONFIG_COMPLETED 3#define SVC_STATUS_RECONFIG_BUSY 4#define SVC_STATUS_RECONFIG_ERROR 5 - +#define SVC_STATUS_RSU_OK 6 +#define SVC_STATUS_RSU_ERROR 7/** * Flag bit for COMMAND_RECONFIG * @@ -56,9 +62,11 @@/** * Timeout settings for service clients: * timeout value used in Stratix10 FPGA manager driver. +* timeout value used in RSU driver */ #define SVC_RECONFIG_REQUEST_TIMEOUT_MS 100#define SVC_RECONFIG_BUFFER_TIMEOUT_MS 240 +#define SVC_RSU_REQUEST_TIMEOUT_MS 300struct stratix10_svc_chan ;@@ -81,13 +89,21 @@ struct stratix10_svc_chan;* @COMMAND_RECONFIG_STATUS: check the status of the configuration, return * status is SVC_STATUS_RECONFIG_COMPLETED, or SVC_STATUS_RECONFIG_BUSY, or * SVC_STATUS_RECONFIG_ERROR +* +* @COMMAND_RSU_STATUS: request remote system update boot log, return status +* is log data or SVC_STATUS_RSU_ERROR +* +* @COMMAND_RSU_UPDATE: set the offset of the bitstream to boot after reboot, +* return status is SVC_STATUS_RSU_OK or SVC_STATUS_RSU_ERROR */ enum stratix10_svc_command_code {COMMAND_NOOP =0 ,COMMAND_RECONFIG ,COMMAND_RECONFIG_DATA_SUBMIT ,COMMAND_RECONFIG_DATA_CLAIM , -COMMAND_RECONFIG_STATUS +COMMAND_RECONFIG_STATUS , +COMMAND_RSU_STATUS , +COMMAND_RSU_UPDATE };
Quoted 8 lines
Quoted 4 lines
include/linux/firmware/intel/stratix10-svc-client.h +0
-0/** Signature · 1 line
2.7.4Thanks,
Moritz
Regards,
Richard