[PATCH v6 4/4] misc: fastrpc: add support for gdsp remoteproc

Ling Xu posted 4 patches 3 months ago
There is a newer version of this series
[PATCH v6 4/4] misc: fastrpc: add support for gdsp remoteproc
Posted by Ling Xu 3 months ago
The fastrpc driver has support for 5 types of remoteprocs. There are
some products which support GDSP remoteprocs. GDSP is General Purpose
DSP where tasks can be offloaded. This patch extends the driver to
support GDSP remoteprocs.

Signed-off-by: Ling Xu <quic_lxu5@quicinc.com>
---
 drivers/misc/fastrpc.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c
index 85b6eb16b616..d05969de406e 100644
--- a/drivers/misc/fastrpc.c
+++ b/drivers/misc/fastrpc.c
@@ -27,6 +27,7 @@
 #define MDSP_DOMAIN_ID (1)
 #define SDSP_DOMAIN_ID (2)
 #define CDSP_DOMAIN_ID (3)
+#define GDSP_DOMAIN_ID (4)
 #define FASTRPC_MAX_SESSIONS	14
 #define FASTRPC_MAX_VMIDS	16
 #define FASTRPC_ALIGN		128
@@ -2249,6 +2250,8 @@ static int fastrpc_get_domain_id(const char *domain)
 		return MDSP_DOMAIN_ID;
 	else if (!strncmp(domain, "sdsp", 4))
 		return SDSP_DOMAIN_ID;
+	else if (!strncmp(domain, "gdsp", 4))
+		return GDSP_DOMAIN_ID;
 
 	return -EINVAL;
 }
@@ -2323,13 +2326,14 @@ static int fastrpc_rpmsg_probe(struct rpmsg_device *rpdev)
 	case ADSP_DOMAIN_ID:
 	case MDSP_DOMAIN_ID:
 	case SDSP_DOMAIN_ID:
-		/* Unsigned PD offloading is only supported on CDSP */
+		/* Unsigned PD offloading is only supported on CDSP and GDSP */
 		data->unsigned_support = false;
 		err = fastrpc_device_register(rdev, data, secure_dsp, domain);
 		if (err)
 			goto err_free_data;
 		break;
 	case CDSP_DOMAIN_ID:
+	case GDSP_DOMAIN_ID:
 		data->unsigned_support = true;
 		/* Create both device nodes so that we can allow both Signed and Unsigned PD */
 		err = fastrpc_device_register(rdev, data, true, domain);
-- 
2.34.1
Re: [PATCH v6 4/4] misc: fastrpc: add support for gdsp remoteproc
Posted by Ling Xu 3 months ago
在 7/9/2025 1:47 PM, Ling Xu 写道:
> The fastrpc driver has support for 5 types of remoteprocs. There are
> some products which support GDSP remoteprocs. GDSP is General Purpose
> DSP where tasks can be offloaded. This patch extends the driver to
> support GDSP remoteprocs.
> 

sorry, please ignore this patch.
I haven't change commit message here.
"Extend the driver to support GDSP remoteprocs."

> Signed-off-by: Ling Xu <quic_lxu5@quicinc.com>
> ---
>  drivers/misc/fastrpc.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c
> index 85b6eb16b616..d05969de406e 100644
> --- a/drivers/misc/fastrpc.c
> +++ b/drivers/misc/fastrpc.c
> @@ -27,6 +27,7 @@
>  #define MDSP_DOMAIN_ID (1)
>  #define SDSP_DOMAIN_ID (2)
>  #define CDSP_DOMAIN_ID (3)
> +#define GDSP_DOMAIN_ID (4)
>  #define FASTRPC_MAX_SESSIONS	14
>  #define FASTRPC_MAX_VMIDS	16
>  #define FASTRPC_ALIGN		128
> @@ -2249,6 +2250,8 @@ static int fastrpc_get_domain_id(const char *domain)
>  		return MDSP_DOMAIN_ID;
>  	else if (!strncmp(domain, "sdsp", 4))
>  		return SDSP_DOMAIN_ID;
> +	else if (!strncmp(domain, "gdsp", 4))
> +		return GDSP_DOMAIN_ID;
>  
>  	return -EINVAL;
>  }
> @@ -2323,13 +2326,14 @@ static int fastrpc_rpmsg_probe(struct rpmsg_device *rpdev)
>  	case ADSP_DOMAIN_ID:
>  	case MDSP_DOMAIN_ID:
>  	case SDSP_DOMAIN_ID:
> -		/* Unsigned PD offloading is only supported on CDSP */
> +		/* Unsigned PD offloading is only supported on CDSP and GDSP */
>  		data->unsigned_support = false;
>  		err = fastrpc_device_register(rdev, data, secure_dsp, domain);
>  		if (err)
>  			goto err_free_data;
>  		break;
>  	case CDSP_DOMAIN_ID:
> +	case GDSP_DOMAIN_ID:
>  		data->unsigned_support = true;
>  		/* Create both device nodes so that we can allow both Signed and Unsigned PD */
>  		err = fastrpc_device_register(rdev, data, true, domain);

-- 
Thx and BRs,
Ling Xu

Re: [PATCH v6 4/4] misc: fastrpc: add support for gdsp remoteproc
Posted by Konrad Dybcio 2 months, 4 weeks ago
On 7/9/25 7:52 AM, Ling Xu wrote:
> 在 7/9/2025 1:47 PM, Ling Xu 写道:
>> The fastrpc driver has support for 5 types of remoteprocs. There are
>> some products which support GDSP remoteprocs. GDSP is General Purpose
>> DSP where tasks can be offloaded. This patch extends the driver to
>> support GDSP remoteprocs.
>>
> 
> sorry, please ignore this patch.
> I haven't change commit message here.
> "Extend the driver to support GDSP remoteprocs."

How about this instead:

Some platforms (like SMabcd) feature one or more GPDSPs (General
Purpose DSPs). Similar to other kinds of Hexagon DSPs, they provide a
FastRPC implementation, allowing code execution in both signed and
unsigned protection domains.

Extend the checks to allow domain names starting with "gdsp"
(possibly followed by an index).

Konrad

> 
>> Signed-off-by: Ling Xu <quic_lxu5@quicinc.com>
>> ---
>>  drivers/misc/fastrpc.c | 6 +++++-
>>  1 file changed, 5 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c
>> index 85b6eb16b616..d05969de406e 100644
>> --- a/drivers/misc/fastrpc.c
>> +++ b/drivers/misc/fastrpc.c
>> @@ -27,6 +27,7 @@
>>  #define MDSP_DOMAIN_ID (1)
>>  #define SDSP_DOMAIN_ID (2)
>>  #define CDSP_DOMAIN_ID (3)
>> +#define GDSP_DOMAIN_ID (4)
>>  #define FASTRPC_MAX_SESSIONS	14
>>  #define FASTRPC_MAX_VMIDS	16
>>  #define FASTRPC_ALIGN		128
>> @@ -2249,6 +2250,8 @@ static int fastrpc_get_domain_id(const char *domain)
>>  		return MDSP_DOMAIN_ID;
>>  	else if (!strncmp(domain, "sdsp", 4))
>>  		return SDSP_DOMAIN_ID;
>> +	else if (!strncmp(domain, "gdsp", 4))
>> +		return GDSP_DOMAIN_ID;
>>  
>>  	return -EINVAL;
>>  }
>> @@ -2323,13 +2326,14 @@ static int fastrpc_rpmsg_probe(struct rpmsg_device *rpdev)
>>  	case ADSP_DOMAIN_ID:
>>  	case MDSP_DOMAIN_ID:
>>  	case SDSP_DOMAIN_ID:
>> -		/* Unsigned PD offloading is only supported on CDSP */
>> +		/* Unsigned PD offloading is only supported on CDSP and GDSP */
>>  		data->unsigned_support = false;
>>  		err = fastrpc_device_register(rdev, data, secure_dsp, domain);
>>  		if (err)
>>  			goto err_free_data;
>>  		break;
>>  	case CDSP_DOMAIN_ID:
>> +	case GDSP_DOMAIN_ID:
>>  		data->unsigned_support = true;
>>  		/* Create both device nodes so that we can allow both Signed and Unsigned PD */
>>  		err = fastrpc_device_register(rdev, data, true, domain);
> 
Re: [PATCH v6 4/4] misc: fastrpc: add support for gdsp remoteproc
Posted by Ling Xu 2 months, 4 weeks ago
在 7/10/2025 3:19 AM, Konrad Dybcio 写道:
> On 7/9/25 7:52 AM, Ling Xu wrote:
>> 在 7/9/2025 1:47 PM, Ling Xu 写道:
>>> The fastrpc driver has support for 5 types of remoteprocs. There are
>>> some products which support GDSP remoteprocs. GDSP is General Purpose
>>> DSP where tasks can be offloaded. This patch extends the driver to
>>> support GDSP remoteprocs.
>>>
>>
>> sorry, please ignore this patch.
>> I haven't change commit message here.
>> "Extend the driver to support GDSP remoteprocs."
> 
> How about this instead:
> 
> Some platforms (like SMabcd) feature one or more GPDSPs (General
> Purpose DSPs). Similar to other kinds of Hexagon DSPs, they provide a
> FastRPC implementation, allowing code execution in both signed and
> unsigned protection domains.
> 
> Extend the checks to allow domain names starting with "gdsp"
> (possibly followed by an index).
> 
Thanks very much.
I will update in next patch.
> Konrad
> 
>>
>>> Signed-off-by: Ling Xu <quic_lxu5@quicinc.com>
>>> ---
>>>  drivers/misc/fastrpc.c | 6 +++++-
>>>  1 file changed, 5 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c
>>> index 85b6eb16b616..d05969de406e 100644
>>> --- a/drivers/misc/fastrpc.c
>>> +++ b/drivers/misc/fastrpc.c
>>> @@ -27,6 +27,7 @@
>>>  #define MDSP_DOMAIN_ID (1)
>>>  #define SDSP_DOMAIN_ID (2)
>>>  #define CDSP_DOMAIN_ID (3)
>>> +#define GDSP_DOMAIN_ID (4)
>>>  #define FASTRPC_MAX_SESSIONS	14
>>>  #define FASTRPC_MAX_VMIDS	16
>>>  #define FASTRPC_ALIGN		128
>>> @@ -2249,6 +2250,8 @@ static int fastrpc_get_domain_id(const char *domain)
>>>  		return MDSP_DOMAIN_ID;
>>>  	else if (!strncmp(domain, "sdsp", 4))
>>>  		return SDSP_DOMAIN_ID;
>>> +	else if (!strncmp(domain, "gdsp", 4))
>>> +		return GDSP_DOMAIN_ID;
>>>  
>>>  	return -EINVAL;
>>>  }
>>> @@ -2323,13 +2326,14 @@ static int fastrpc_rpmsg_probe(struct rpmsg_device *rpdev)
>>>  	case ADSP_DOMAIN_ID:
>>>  	case MDSP_DOMAIN_ID:
>>>  	case SDSP_DOMAIN_ID:
>>> -		/* Unsigned PD offloading is only supported on CDSP */
>>> +		/* Unsigned PD offloading is only supported on CDSP and GDSP */
>>>  		data->unsigned_support = false;
>>>  		err = fastrpc_device_register(rdev, data, secure_dsp, domain);
>>>  		if (err)
>>>  			goto err_free_data;
>>>  		break;
>>>  	case CDSP_DOMAIN_ID:
>>> +	case GDSP_DOMAIN_ID:
>>>  		data->unsigned_support = true;
>>>  		/* Create both device nodes so that we can allow both Signed and Unsigned PD */
>>>  		err = fastrpc_device_register(rdev, data, true, domain);
>>

-- 
Thx and BRs,
Ling Xu