HPASS (High Performance Audio Subsystem) is a distinct audio
hardware block from the LPASS-class ADSP used on earlier targets,
with its own shared resources, audio interface block, and additional
integrated processing hardware such as HVX (Hexagon Vector
eXtensions), described in the devicetree with its own "hpass" label.
Add a HPASS_DOMAIN_ID and map the "hpass" DT label to it.

Signed-off-by: Anandu Krishnan E <[email protected]>
---
 drivers/misc/fastrpc.c | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c
index 9e760f68bcaf..c515097c3d3b 100644
--- a/drivers/misc/fastrpc.c
+++ b/drivers/misc/fastrpc.c
@@ -35,6 +35,7 @@
 #define SDSP_DOMAIN_ID (2)
 #define CDSP_DOMAIN_ID (3)
 #define GDSP_DOMAIN_ID (4)
+#define HPASS_DOMAIN_ID (5)
 #define FASTRPC_MAX_SESSIONS   14
 /*
  * Extra ADSP sessions duplicated from the last CB, as each CB supports
@@ -2497,6 +2498,8 @@ static int fastrpc_get_domain_id(const char *domain)
                return SDSP_DOMAIN_ID;
        else if (!strncmp(domain, "gdsp", 4))
                return GDSP_DOMAIN_ID;
+       else if (!strncmp(domain, "hpass", 5))
+               return HPASS_DOMAIN_ID;
 
        return -EINVAL;
 }
@@ -2655,8 +2658,9 @@ static int fastrpc_init_reserved_mem(struct 
fastrpc_channel_ctx *cctx,
        u64 src_perms;
        int err;
 
-       /* Only SDSP and ADSP domains use a reserved remote heap region */
-       if (domain_id != SDSP_DOMAIN_ID && domain_id != ADSP_DOMAIN_ID)
+       /* Only SDSP, ADSP and HPASS domains use a reserved remote heap region 
*/
+       if (domain_id != SDSP_DOMAIN_ID && domain_id != ADSP_DOMAIN_ID &&
+           domain_id != HPASS_DOMAIN_ID)
                return 0;
 
        err = of_reserved_mem_region_to_resource(rdev->of_node, 0, &res);
@@ -2670,11 +2674,11 @@ static int fastrpc_init_reserved_mem(struct 
fastrpc_channel_ctx *cctx,
        }
 
        /*
-        * Audio PD (ADSP) is a static PD: cache the region so its lifetime
-        * is tied to the rpmsg channel instead of being controlled by
-        * userspace.
+        * Audio PD (ADSP/HPASS) is a static PD: cache the region so its
+        * lifetime is tied to the rpmsg channel instead of being controlled
+        * by userspace.
         */
-       if (domain_id == ADSP_DOMAIN_ID) {
+       if (domain_id == ADSP_DOMAIN_ID || domain_id == HPASS_DOMAIN_ID) {
                cctx->remote_heap_addr = res.start;
                cctx->remote_heap_size = resource_size(&res);
 
@@ -2761,6 +2765,7 @@ static int fastrpc_rpmsg_probe(struct rpmsg_device *rpdev)
        case ADSP_DOMAIN_ID:
        case MDSP_DOMAIN_ID:
        case SDSP_DOMAIN_ID:
+       case HPASS_DOMAIN_ID:
                /* Unsigned PD offloading is only supported on CDSP and GDSP */
                data->unsigned_support = false;
                err = fastrpc_device_register(rdev, data, secure_dsp, domain);

-- 
2.34.1

Reply via email to