linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] MAINTAINERS: add a git repo for the Stratix10 Service driver
@ 2022-02-23 14:49 Dinh Nguyen
  2022-02-23 14:49 ` [PATCH 2/2] firmware: stratix10-svc: extend SVC driver to get the firmware version Dinh Nguyen
  2022-03-15 11:09 ` [PATCH 1/2] MAINTAINERS: add a git repo for the Stratix10 Service driver Tom Rix
  0 siblings, 2 replies; 5+ messages in thread
From: Dinh Nguyen @ 2022-02-23 14:49 UTC (permalink / raw)
  To: gregkh; +Cc: dinguyen, linux-kernel, linux-fpga

Add a git repo entry for the Stratix10 Service driver.

Signed-off-by: Dinh Nguyen <dinguyen@kernel.org>
---
 MAINTAINERS | 1 +
 1 file changed, 1 insertion(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index ea3e6c914384..5752236bea80 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -9890,6 +9890,7 @@ F:	drivers/firmware/stratix10-rsu.c
 F:	drivers/firmware/stratix10-svc.c
 F:	include/linux/firmware/intel/stratix10-smc.h
 F:	include/linux/firmware/intel/stratix10-svc-client.h
+T:	git git://git.kernel.org/pub/scm/linux/kernel/git/dinguyen/linux.git
 
 INTEL TELEMETRY DRIVER
 M:	Rajneesh Bhardwaj <irenic.rajneesh@gmail.com>
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/2] firmware: stratix10-svc: extend SVC driver to get the firmware version
  2022-02-23 14:49 [PATCH 1/2] MAINTAINERS: add a git repo for the Stratix10 Service driver Dinh Nguyen
@ 2022-02-23 14:49 ` Dinh Nguyen
  2022-03-15 11:09 ` [PATCH 1/2] MAINTAINERS: add a git repo for the Stratix10 Service driver Tom Rix
  1 sibling, 0 replies; 5+ messages in thread
From: Dinh Nguyen @ 2022-02-23 14:49 UTC (permalink / raw)
  To: gregkh; +Cc: dinguyen, linux-kernel, linux-fpga, Richard Gong, Moritz Fischr

From: Richard Gong <richard.gong@intel.com>

Extend Intel service layer driver to get the firmware version running at
FPGA device. Therefore FPGA manager driver, one of Intel service layer
driver's client, can decide whether to handle the newly added bitstream
authentication function based on the retrieved firmware version.

Link: https://lore.kernel.org/lkml/1617114785-22211-2-git-send-email-richard.gong@linux.intel.com
Acked-by: Moritz Fischr <mdf@kernel.org>
Signed-off-by: Richard Gong <richard.gong@intel.com>
Signed-off-by: Dinh Nguyen <dinguyen@kernel.org>
---
 drivers/firmware/stratix10-svc.c              |  9 +++++++-
 include/linux/firmware/intel/stratix10-smc.h  | 21 +++++++++++++++++--
 .../firmware/intel/stratix10-svc-client.h     |  4 ++++
 3 files changed, 31 insertions(+), 3 deletions(-)

diff --git a/drivers/firmware/stratix10-svc.c b/drivers/firmware/stratix10-svc.c
index 29c0a616b317..4bd57a908efe 100644
--- a/drivers/firmware/stratix10-svc.c
+++ b/drivers/firmware/stratix10-svc.c
@@ -306,6 +306,7 @@ static void svc_thread_recv_status_ok(struct stratix10_svc_data *p_data,
 		break;
 	case COMMAND_RSU_RETRY:
 	case COMMAND_RSU_MAX_RETRY:
+	case COMMAND_FIRMWARE_VERSION:
 		cb_data->status = BIT(SVC_STATUS_OK);
 		cb_data->kaddr1 = &res.a1;
 		break;
@@ -422,6 +423,11 @@ static int svc_normal_to_secure_thread(void *data)
 			a1 = 0;
 			a2 = 0;
 			break;
+		case COMMAND_FIRMWARE_VERSION:
+			a0 = INTEL_SIP_SMC_FIRMWARE_VERSION;
+			a1 = 0;
+			a2 = 0;
+			break;
 		default:
 			pr_warn("it shouldn't happen\n");
 			break;
@@ -491,7 +497,8 @@ static int svc_normal_to_secure_thread(void *data)
 			 */
 			if ((pdata->command == COMMAND_RSU_RETRY) ||
 			    (pdata->command == COMMAND_RSU_MAX_RETRY) ||
-				(pdata->command == COMMAND_RSU_NOTIFY)) {
+			    (pdata->command == COMMAND_RSU_NOTIFY) ||
+			    (pdata->command == COMMAND_FIRMWARE_VERSION)) {
 				cbdata->status =
 					BIT(SVC_STATUS_NO_SUPPORT);
 				cbdata->kaddr1 = NULL;
diff --git a/include/linux/firmware/intel/stratix10-smc.h b/include/linux/firmware/intel/stratix10-smc.h
index c3e5ab014caf..aad497a9ad8b 100644
--- a/include/linux/firmware/intel/stratix10-smc.h
+++ b/include/linux/firmware/intel/stratix10-smc.h
@@ -321,8 +321,6 @@ INTEL_SIP_SMC_FAST_CALL_VAL(INTEL_SIP_SMC_FUNCID_FPGA_CONFIG_COMPLETED_WRITE)
 #define INTEL_SIP_SMC_ECC_DBE \
 	INTEL_SIP_SMC_FAST_CALL_VAL(INTEL_SIP_SMC_FUNCID_ECC_DBE)
 
-#endif
-
 /**
  * Request INTEL_SIP_SMC_RSU_NOTIFY
  *
@@ -404,3 +402,22 @@ INTEL_SIP_SMC_FAST_CALL_VAL(INTEL_SIP_SMC_FUNCID_FPGA_CONFIG_COMPLETED_WRITE)
 #define INTEL_SIP_SMC_FUNCID_RSU_MAX_RETRY 18
 #define INTEL_SIP_SMC_RSU_MAX_RETRY \
 	INTEL_SIP_SMC_FAST_CALL_VAL(INTEL_SIP_SMC_FUNCID_RSU_MAX_RETRY)
+
+/**
+ * Request INTEL_SIP_SMC_FIRMWARE_VERSION
+ *
+ * Sync call used to query the version of running firmware
+ *
+ * Call register usage:
+ * a0 INTEL_SIP_SMC_FIRMWARE_VERSION
+ * a1-a7 not used
+ *
+ * Return status:
+ * a0 INTEL_SIP_SMC_STATUS_OK or INTEL_SIP_SMC_STATUS_ERROR
+ * a1 running firmware version
+ */
+#define INTEL_SIP_SMC_FUNCID_FIRMWARE_VERSION 31
+#define INTEL_SIP_SMC_FIRMWARE_VERSION \
+        INTEL_SIP_SMC_FAST_CALL_VAL(INTEL_SIP_SMC_FUNCID_FIRMWARE_VERSION)
+
+#endif
diff --git a/include/linux/firmware/intel/stratix10-svc-client.h b/include/linux/firmware/intel/stratix10-svc-client.h
index 19781b0f6429..18c1841fdb1f 100644
--- a/include/linux/firmware/intel/stratix10-svc-client.h
+++ b/include/linux/firmware/intel/stratix10-svc-client.h
@@ -104,6 +104,9 @@ struct stratix10_svc_chan;
  *
  * @COMMAND_RSU_DCMF_VERSION: query firmware for the DCMF version, return status
  * is SVC_STATUS_OK or SVC_STATUS_ERROR
+ *
+ * @COMMAND_FIRMWARE_VERSION: query running firmware version, return status
+ * is SVC_STATUS_OK or SVC_STATUS_ERROR
  */
 enum stratix10_svc_command_code {
 	COMMAND_NOOP = 0,
@@ -117,6 +120,7 @@ enum stratix10_svc_command_code {
 	COMMAND_RSU_RETRY,
 	COMMAND_RSU_MAX_RETRY,
 	COMMAND_RSU_DCMF_VERSION,
+	COMMAND_FIRMWARE_VERSION,
 };
 
 /**
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] MAINTAINERS: add a git repo for the Stratix10 Service driver
  2022-02-23 14:49 [PATCH 1/2] MAINTAINERS: add a git repo for the Stratix10 Service driver Dinh Nguyen
  2022-02-23 14:49 ` [PATCH 2/2] firmware: stratix10-svc: extend SVC driver to get the firmware version Dinh Nguyen
@ 2022-03-15 11:09 ` Tom Rix
  2022-03-18  7:25   ` Dinh Nguyen
  1 sibling, 1 reply; 5+ messages in thread
From: Tom Rix @ 2022-03-15 11:09 UTC (permalink / raw)
  To: Dinh Nguyen, gregkh; +Cc: linux-kernel, linux-fpga


On 2/23/22 6:49 AM, Dinh Nguyen wrote:
> Add a git repo entry for the Stratix10 Service driver.
>
> Signed-off-by: Dinh Nguyen <dinguyen@kernel.org>
> ---
>   MAINTAINERS | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/MAINTAINERS b/MAINTAINERS
> index ea3e6c914384..5752236bea80 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -9890,6 +9890,7 @@ F:	drivers/firmware/stratix10-rsu.c
>   F:	drivers/firmware/stratix10-svc.c
>   F:	include/linux/firmware/intel/stratix10-smc.h
>   F:	include/linux/firmware/intel/stratix10-svc-client.h
> +T:	git git://git.kernel.org/pub/scm/linux/kernel/git/dinguyen/linux.git

Can you check if your tree is ok ?

Tom


 > git clone 
git://git.kernel.org/pub/scm/linux/kernel/git/dinguyen/linux.git

Cloning into 'linux'...
remote: Enumerating objects: 185, done.
remote: Counting objects: 100% (185/185), done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 8723742 (delta 182), reused 181 (delta 181), pack-reused 
8723557
Receiving objects: 100% (8723742/8723742), 2.41 GiB | 2.78 MiB/s, done.
Resolving deltas: 100% (7135708/7135708), done.
warning: remote HEAD refers to nonexistent ref, unable to checkout.

>   
>   INTEL TELEMETRY DRIVER
>   M:	Rajneesh Bhardwaj <irenic.rajneesh@gmail.com>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] MAINTAINERS: add a git repo for the Stratix10 Service driver
  2022-03-15 11:09 ` [PATCH 1/2] MAINTAINERS: add a git repo for the Stratix10 Service driver Tom Rix
@ 2022-03-18  7:25   ` Dinh Nguyen
  2022-03-18  7:38     ` Dinh Nguyen
  0 siblings, 1 reply; 5+ messages in thread
From: Dinh Nguyen @ 2022-03-18  7:25 UTC (permalink / raw)
  To: Tom Rix, gregkh; +Cc: linux-kernel, linux-fpga



On 3/15/22 06:09, Tom Rix wrote:
> 
> On 2/23/22 6:49 AM, Dinh Nguyen wrote:
>> Add a git repo entry for the Stratix10 Service driver.
>>
>> Signed-off-by: Dinh Nguyen <dinguyen@kernel.org>
>> ---
>>   MAINTAINERS | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/MAINTAINERS b/MAINTAINERS
>> index ea3e6c914384..5752236bea80 100644
>> --- a/MAINTAINERS
>> +++ b/MAINTAINERS
>> @@ -9890,6 +9890,7 @@ F:    drivers/firmware/stratix10-rsu.c
>>   F:    drivers/firmware/stratix10-svc.c
>>   F:    include/linux/firmware/intel/stratix10-smc.h
>>   F:    include/linux/firmware/intel/stratix10-svc-client.h
>> +T:    git 
>> git://git.kernel.org/pub/scm/linux/kernel/git/dinguyen/linux.git
> 
> Can you check if your tree is ok ?
> 
> Tom
> 
> 
>  > git clone 
> git://git.kernel.org/pub/scm/linux/kernel/git/dinguyen/linux.git
> 
> Cloning into 'linux'...
> remote: Enumerating objects: 185, done.
> remote: Counting objects: 100% (185/185), done.
> remote: Compressing objects: 100% (4/4), done.
> remote: Total 8723742 (delta 182), reused 181 (delta 181), pack-reused 
> 8723557
> Receiving objects: 100% (8723742/8723742), 2.41 GiB | 2.78 MiB/s, done.
> Resolving deltas: 100% (7135708/7135708), done.
> warning: remote HEAD refers to nonexistent ref, unable to checkout.
> 


Hmm...seeing the issue. Not sure what's going on, will troubleshoot.

Dinh

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] MAINTAINERS: add a git repo for the Stratix10 Service driver
  2022-03-18  7:25   ` Dinh Nguyen
@ 2022-03-18  7:38     ` Dinh Nguyen
  0 siblings, 0 replies; 5+ messages in thread
From: Dinh Nguyen @ 2022-03-18  7:38 UTC (permalink / raw)
  To: Tom Rix, gregkh; +Cc: linux-kernel, linux-fpga



On 3/18/22 02:25, Dinh Nguyen wrote:
> 
> 
> On 3/15/22 06:09, Tom Rix wrote:
>>
>> On 2/23/22 6:49 AM, Dinh Nguyen wrote:
>>> Add a git repo entry for the Stratix10 Service driver.
>>>
>>> Signed-off-by: Dinh Nguyen <dinguyen@kernel.org>
>>> ---
>>>   MAINTAINERS | 1 +
>>>   1 file changed, 1 insertion(+)
>>>
>>> diff --git a/MAINTAINERS b/MAINTAINERS
>>> index ea3e6c914384..5752236bea80 100644
>>> --- a/MAINTAINERS
>>> +++ b/MAINTAINERS
>>> @@ -9890,6 +9890,7 @@ F:    drivers/firmware/stratix10-rsu.c
>>>   F:    drivers/firmware/stratix10-svc.c
>>>   F:    include/linux/firmware/intel/stratix10-smc.h
>>>   F:    include/linux/firmware/intel/stratix10-svc-client.h
>>> +T:    git 
>>> git://git.kernel.org/pub/scm/linux/kernel/git/dinguyen/linux.git
>>
>> Can you check if your tree is ok ?
>>
>> Tom
>>
>>
>>  > git clone 
>> git://git.kernel.org/pub/scm/linux/kernel/git/dinguyen/linux.git
>>
>> Cloning into 'linux'...
>> remote: Enumerating objects: 185, done.
>> remote: Counting objects: 100% (185/185), done.
>> remote: Compressing objects: 100% (4/4), done.
>> remote: Total 8723742 (delta 182), reused 181 (delta 181), pack-reused 
>> 8723557
>> Receiving objects: 100% (8723742/8723742), 2.41 GiB | 2.78 MiB/s, done.
>> Resolving deltas: 100% (7135708/7135708), done.
>> warning: remote HEAD refers to nonexistent ref, unable to checkout.
>>
> 
> 
> Hmm...seeing the issue. Not sure what's going on, will troubleshoot.
> 


Looks like I just fixed it, please try again. I didn't have a 'master' 
branch.

Dinh

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-03-18  7:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-23 14:49 [PATCH 1/2] MAINTAINERS: add a git repo for the Stratix10 Service driver Dinh Nguyen
2022-02-23 14:49 ` [PATCH 2/2] firmware: stratix10-svc: extend SVC driver to get the firmware version Dinh Nguyen
2022-03-15 11:09 ` [PATCH 1/2] MAINTAINERS: add a git repo for the Stratix10 Service driver Tom Rix
2022-03-18  7:25   ` Dinh Nguyen
2022-03-18  7:38     ` Dinh Nguyen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).