Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

firmware: stratix10-svc: Add support for FCS

Extend Intel service layer driver to support FPGA Crypto service(FCS)
features on Intel Soc platforms. Adding an additional channel and FCS
platform driver ("intel_fcs") as part of the probe method.
FCS driver uses the driver to send crypto operations' commands to
the secure device manager(SDM) on Intel Soc platforms Stratix10 and
Agilex.

Signed-off-by: Ang Tien Sung <tien.sung.ang@intel.com>
Signed-off-by: Dinh Nguyen <dinguyen@kernel.org>
Link: https://lore.kernel.org/r/20220711223140.2307945-1-dinguyen@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Ang Tien Sung and committed by
Greg Kroah-Hartman
e6281c26 6c93c6f3

+26 -5
+25 -5
drivers/firmware/stratix10-svc.c
··· 34 34 * timeout is set to 30 seconds (30 * 1000) at Intel Stratix10 SoC. 35 35 */ 36 36 #define SVC_NUM_DATA_IN_FIFO 32 37 - #define SVC_NUM_CHANNEL 2 37 + #define SVC_NUM_CHANNEL 3 38 38 #define FPGA_CONFIG_DATA_CLAIM_TIMEOUT_MS 200 39 39 #define FPGA_CONFIG_STATUS_TIMEOUT_SEC 30 40 40 41 41 /* stratix10 service layer clients */ 42 42 #define STRATIX10_RSU "stratix10-rsu" 43 + #define INTEL_FCS "intel-fcs" 43 44 44 45 typedef void (svc_invoke_fn)(unsigned long, unsigned long, unsigned long, 45 46 unsigned long, unsigned long, unsigned long, ··· 54 53 */ 55 54 struct stratix10_svc { 56 55 struct platform_device *stratix10_svc_rsu; 56 + struct platform_device *intel_svc_fcs; 57 57 }; 58 58 59 59 /** ··· 1038 1036 chans[1].name = SVC_CLIENT_RSU; 1039 1037 spin_lock_init(&chans[1].lock); 1040 1038 1039 + chans[2].scl = NULL; 1040 + chans[2].ctrl = controller; 1041 + chans[2].name = SVC_CLIENT_FCS; 1042 + spin_lock_init(&chans[2].lock); 1043 + 1041 1044 list_add_tail(&controller->node, &svc_ctrl); 1042 1045 platform_set_drvdata(pdev, controller); 1043 1046 ··· 1061 1054 } 1062 1055 1063 1056 ret = platform_device_add(svc->stratix10_svc_rsu); 1064 - if (ret) 1065 - goto err_put_device; 1057 + if (ret) { 1058 + platform_device_put(svc->stratix10_svc_rsu); 1059 + return ret; 1060 + } 1061 + 1062 + svc->intel_svc_fcs = platform_device_alloc(INTEL_FCS, 1); 1063 + if (!svc->intel_svc_fcs) { 1064 + dev_err(dev, "failed to allocate %s device\n", INTEL_FCS); 1065 + return -ENOMEM; 1066 + } 1067 + 1068 + ret = platform_device_add(svc->intel_svc_fcs); 1069 + if (ret) { 1070 + platform_device_put(svc->intel_svc_fcs); 1071 + return ret; 1072 + } 1066 1073 1067 1074 dev_set_drvdata(dev, svc); 1068 1075 ··· 1084 1063 1085 1064 return 0; 1086 1065 1087 - err_put_device: 1088 - platform_device_put(svc->stratix10_svc_rsu); 1089 1066 err_free_kfifo: 1090 1067 kfifo_free(&controller->svc_fifo); 1091 1068 return ret; ··· 1094 1075 struct stratix10_svc *svc = dev_get_drvdata(&pdev->dev); 1095 1076 struct stratix10_svc_controller *ctrl = platform_get_drvdata(pdev); 1096 1077 1078 + platform_device_unregister(svc->intel_svc_fcs); 1097 1079 platform_device_unregister(svc->stratix10_svc_rsu); 1098 1080 1099 1081 kfifo_free(&ctrl->svc_fifo);
+1
include/linux/firmware/intel/stratix10-svc-client.h
··· 14 14 */ 15 15 #define SVC_CLIENT_FPGA "fpga" 16 16 #define SVC_CLIENT_RSU "rsu" 17 + #define SVC_CLIENT_FCS "fcs" 17 18 18 19 /* 19 20 * Status of the sent command, in bit number