summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nvkm/falcon/msgqueue_0137c63d.c
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2020-01-14 21:34:22 +0100
committerBen Skeggs <bskeggs@redhat.com>2020-01-15 01:50:28 +0100
commitacc466ab46574f0d9de65606f0796cff07c9a7d5 (patch)
tree587805bae5fb67680dba9e2ccd90d4d6f44effe1 /drivers/gpu/drm/nouveau/nvkm/falcon/msgqueue_0137c63d.c
parentdrm/nouveau/flcn/qmgr: explicitly create queue manager from subdevs (diff)
downloadlinux-acc466ab46574f0d9de65606f0796cff07c9a7d5.tar.xz
linux-acc466ab46574f0d9de65606f0796cff07c9a7d5.zip
drm/nouveau/flcn/cmdq: explicitly create command queue(s) from subdevs
Code to interface with LS firmwares is being moved to the subdevs where it belongs, rather than living in the common falcon code. This is an incremental step towards that goal. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nvkm/falcon/msgqueue_0137c63d.c')
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/falcon/msgqueue_0137c63d.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/drivers/gpu/drm/nouveau/nvkm/falcon/msgqueue_0137c63d.c b/drivers/gpu/drm/nouveau/nvkm/falcon/msgqueue_0137c63d.c
index 68de203d80a8..fd6303b62aa4 100644
--- a/drivers/gpu/drm/nouveau/nvkm/falcon/msgqueue_0137c63d.c
+++ b/drivers/gpu/drm/nouveau/nvkm/falcon/msgqueue_0137c63d.c
@@ -22,14 +22,11 @@
*/
#include "msgqueue.h"
#include <engine/falcon.h>
+#include <subdev/pmu.h>
#include <subdev/secboot.h>
/* Queues identifiers */
enum {
- /* High Priority Command Queue for Host -> PMU communication */
- MSGQUEUE_0137C63D_COMMAND_QUEUE_HPQ = 0,
- /* Low Priority Command Queue for Host -> PMU communication */
- MSGQUEUE_0137C63D_COMMAND_QUEUE_LPQ = 1,
/* Message queue for PMU -> Host communication */
MSGQUEUE_0137C63D_MESSAGE_QUEUE = 4,
MSGQUEUE_0137C63D_NUM_QUEUES = 5,
@@ -61,9 +58,9 @@ msgqueue_0137c63d_cmd_queue(struct nvkm_msgqueue *queue,
switch (priority) {
case MSGQUEUE_MSG_PRIORITY_HIGH:
- return &priv->queue[MSGQUEUE_0137C63D_COMMAND_QUEUE_HPQ];
+ return subdev->device->pmu->hpq;
case MSGQUEUE_MSG_PRIORITY_LOW:
- return &priv->queue[MSGQUEUE_0137C63D_COMMAND_QUEUE_LPQ];
+ return subdev->device->pmu->lpq;
default:
nvkm_error(subdev, "invalid command queue!\n");
return ERR_PTR(-EINVAL);
@@ -138,6 +135,7 @@ init_callback(struct nvkm_msgqueue *_queue, struct nvkm_msgqueue_hdr *hdr)
} *init = (void *)hdr;
const struct nvkm_falcon_func *func = _queue->falcon->func;
const struct nvkm_subdev *subdev = _queue->falcon->owner;
+ struct nvkm_pmu *pmu = subdev->device->pmu;
int i;
if (init->base.hdr.unit_id != MSGQUEUE_0137C63D_UNIT_INIT) {
@@ -159,12 +157,7 @@ init_callback(struct nvkm_msgqueue *_queue, struct nvkm_msgqueue_hdr *hdr)
queue->offset = init->queue_info[i].offset;
queue->size = init->queue_info[i].size;
- if (i != MSGQUEUE_0137C63D_MESSAGE_QUEUE) {
- queue->head_reg = func->cmdq.head + queue->index *
- func->cmdq.stride;
- queue->tail_reg = func->cmdq.tail + queue->index *
- func->cmdq.stride;
- } else {
+ if (i == MSGQUEUE_0137C63D_MESSAGE_QUEUE) {
queue->head_reg = func->msgq.head;
queue->tail_reg = func->msgq.tail;
}
@@ -174,6 +167,13 @@ init_callback(struct nvkm_msgqueue *_queue, struct nvkm_msgqueue_hdr *hdr)
i, queue->index, queue->offset, queue->size);
}
+ nvkm_falcon_cmdq_init(pmu->hpq, init->queue_info[0].index,
+ init->queue_info[0].offset,
+ init->queue_info[0].size);
+ nvkm_falcon_cmdq_init(pmu->lpq, init->queue_info[1].index,
+ init->queue_info[1].offset,
+ init->queue_info[1].size);
+
/* Complete initialization by initializing WPR region */
return acr_init_wpr(&priv->base);
}