Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2963a06a authored by Alexandre Courbot's avatar Alexandre Courbot Committed by Ben Skeggs
Browse files

drm/nouveau/secboot: pass instance to LS firmware loaders



Having access to the secboot instance loading a LS firmware can be
useful to LS firmware handlers. At least more useful than just having an
out-of-context subdev pointer.

GP10B's firmware will also need to know the WPR address, which can be
obtained from the secboot instance.

Signed-off-by: default avatarAlexandre Courbot <acourbot@nvidia.com>
Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent 598a8148
Loading
Loading
Loading
Loading
+3 −6
Original line number Diff line number Diff line
@@ -22,17 +22,14 @@

#ifndef __NVKM_CORE_MSGQUEUE_H
#define __NVKM_CORE_MSGQUEUE_H

#include <core/os.h>

struct nvkm_falcon;
#include <subdev/secboot.h>
struct nvkm_msgqueue;
enum nvkm_secboot_falcon;

/* Hopefully we will never have firmware arguments larger than that... */
#define NVKM_MSGQUEUE_CMDLINE_SIZE 0x100

int nvkm_msgqueue_new(u32, struct nvkm_falcon *, struct nvkm_msgqueue **);
int nvkm_msgqueue_new(u32, struct nvkm_falcon *, const struct nvkm_secboot *,
		      struct nvkm_msgqueue **);
void nvkm_msgqueue_del(struct nvkm_msgqueue **);
void nvkm_msgqueue_recv(struct nvkm_msgqueue *);
int nvkm_msgqueue_reinit(struct nvkm_msgqueue *);
+4 −3
Original line number Diff line number Diff line
@@ -491,17 +491,18 @@ nvkm_msgqueue_acr_boot_falcons(struct nvkm_msgqueue *queue,
}

int
nvkm_msgqueue_new(u32 version, struct nvkm_falcon *falcon, struct nvkm_msgqueue **queue)
nvkm_msgqueue_new(u32 version, struct nvkm_falcon *falcon,
		  const struct nvkm_secboot *sb, struct nvkm_msgqueue **queue)
{
	const struct nvkm_subdev *subdev = falcon->owner;
	int ret = -EINVAL;

	switch (version) {
	case 0x0137c63d:
		ret = msgqueue_0137c63d_new(falcon, queue);
		ret = msgqueue_0137c63d_new(falcon, sb, queue);
		break;
	case 0x0148cdec:
		ret = msgqueue_0148cdec_new(falcon, queue);
		ret = msgqueue_0148cdec_new(falcon, sb, queue);
		break;
	default:
		nvkm_error(subdev, "unhandled firmware version 0x%08x\n",
+4 −2
Original line number Diff line number Diff line
@@ -203,7 +203,9 @@ int nvkm_msgqueue_post(struct nvkm_msgqueue *, enum msgqueue_msg_priority,
void nvkm_msgqueue_process_msgs(struct nvkm_msgqueue *,
				struct nvkm_msgqueue_queue *);

int msgqueue_0137c63d_new(struct nvkm_falcon *, struct nvkm_msgqueue **);
int msgqueue_0148cdec_new(struct nvkm_falcon *, struct nvkm_msgqueue **);
int msgqueue_0137c63d_new(struct nvkm_falcon *, const struct nvkm_secboot *,
			  struct nvkm_msgqueue **);
int msgqueue_0148cdec_new(struct nvkm_falcon *, const struct nvkm_secboot *,
			  struct nvkm_msgqueue **);

#endif
+2 −1
Original line number Diff line number Diff line
@@ -307,7 +307,8 @@ msgqueue_0137c63d_func = {
};

int
msgqueue_0137c63d_new(struct nvkm_falcon *falcon, struct nvkm_msgqueue **queue)
msgqueue_0137c63d_new(struct nvkm_falcon *falcon, const struct nvkm_secboot *sb,
		      struct nvkm_msgqueue **queue)
{
	struct msgqueue_0137c63d *ret;

+2 −1
Original line number Diff line number Diff line
@@ -247,7 +247,8 @@ msgqueue_0148cdec_func = {
};

int
msgqueue_0148cdec_new(struct nvkm_falcon *falcon, struct nvkm_msgqueue **queue)
msgqueue_0148cdec_new(struct nvkm_falcon *falcon, const struct nvkm_secboot *sb,
		      struct nvkm_msgqueue **queue)
{
	struct msgqueue_0148cdec *ret;

Loading