]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
misc: fastrpc: add support for gdsp remoteproc
authorLing Xu <quic_lxu5@quicinc.com>
Fri, 12 Sep 2025 13:13:02 +0000 (14:13 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 12 Sep 2025 13:48:45 +0000 (15:48 +0200)
Some platforms (like lemans) 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).

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Reviewed-by: Ekansh Gupta <ekansh.gupta@oss.qualcomm.com>
Signed-off-by: Ling Xu <quic_lxu5@quicinc.com>
Signed-off-by: Srinivas Kandagatla <srini@kernel.org>
Link: https://lore.kernel.org/r/20250912131302.303199-5-srini@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/fastrpc.c

index 5fc7dec65ed8ad534482ab9f83c1e5c514998c51..8e1d9787342336174272bd96a7167725ee00255d 100644 (file)
@@ -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;
 }
@@ -2318,13 +2321,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);