drm/nouveau/core: define ACR subdev
authorBen Skeggs <bskeggs@redhat.com>
Tue, 14 Jan 2020 20:34:21 +0000 (06:34 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Wed, 15 Jan 2020 00:50:26 +0000 (10:50 +1000)
This will replace the current SECBOOT subdev for handling firmware on
secure falcons.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/include/nvkm/core/device.h
drivers/gpu/drm/nouveau/include/nvkm/subdev/acr.h [new file with mode: 0644]
drivers/gpu/drm/nouveau/nvkm/core/subdev.c
drivers/gpu/drm/nouveau/nvkm/engine/device/base.c
drivers/gpu/drm/nouveau/nvkm/engine/device/priv.h
drivers/gpu/drm/nouveau/nvkm/subdev/Kbuild
drivers/gpu/drm/nouveau/nvkm/subdev/acr/Kbuild [new file with mode: 0644]

index 6d55cd0..3d42139 100644 (file)
@@ -23,6 +23,7 @@ enum nvkm_devidx {
        NVKM_SUBDEV_MMU,
        NVKM_SUBDEV_BAR,
        NVKM_SUBDEV_FAULT,
+       NVKM_SUBDEV_ACR,
        NVKM_SUBDEV_PMU,
        NVKM_SUBDEV_VOLT,
        NVKM_SUBDEV_ICCSENSE,
@@ -129,6 +130,7 @@ struct nvkm_device {
                struct notifier_block nb;
        } acpi;
 
+       struct nvkm_acr *acr;
        struct nvkm_bar *bar;
        struct nvkm_bios *bios;
        struct nvkm_bus *bus;
@@ -202,6 +204,7 @@ struct nvkm_device_quirk {
 struct nvkm_device_chip {
        const char *name;
 
+       int (*acr     )(struct nvkm_device *, int idx, struct nvkm_acr **);
        int (*bar     )(struct nvkm_device *, int idx, struct nvkm_bar **);
        int (*bios    )(struct nvkm_device *, int idx, struct nvkm_bios **);
        int (*bus     )(struct nvkm_device *, int idx, struct nvkm_bus **);
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/subdev/acr.h b/drivers/gpu/drm/nouveau/include/nvkm/subdev/acr.h
new file mode 100644 (file)
index 0000000..e293239
--- /dev/null
@@ -0,0 +1,10 @@
+/* SPDX-License-Identifier: MIT */
+#ifndef __NVKM_ACR_H__
+#define __NVKM_ACR_H__
+#define nvkm_acr(p) container_of((p), struct nvkm_acr, subdev)
+#include <core/subdev.h>
+
+struct nvkm_acr {
+       struct nvkm_subdev subdev;
+};
+#endif
index 245990d..aecb484 100644 (file)
@@ -30,6 +30,7 @@ static struct lock_class_key nvkm_subdev_lock_class[NVKM_SUBDEV_NR];
 
 const char *
 nvkm_subdev_name[NVKM_SUBDEV_NR] = {
+       [NVKM_SUBDEV_ACR     ] = "acr",
        [NVKM_SUBDEV_BAR     ] = "bar",
        [NVKM_SUBDEV_VBIOS   ] = "bios",
        [NVKM_SUBDEV_BUS     ] = "bus",
index eba450e..401323d 100644 (file)
@@ -2638,6 +2638,7 @@ nvkm_device_subdev(struct nvkm_device *device, int index)
 
        switch (index) {
 #define _(n,p,m) case NVKM_SUBDEV_##n: if (p) return (m); break
+       _(ACR     , device->acr     , &device->acr->subdev);
        _(BAR     , device->bar     , &device->bar->subdev);
        _(VBIOS   , device->bios    , &device->bios->subdev);
        _(BUS     , device->bus     , &device->bus->subdev);
@@ -3144,6 +3145,7 @@ nvkm_device_ctor(const struct nvkm_device_func *func,
        }                                                                      \
        break
                switch (i) {
+               _(NVKM_SUBDEV_ACR     ,      acr);
                _(NVKM_SUBDEV_BAR     ,      bar);
                _(NVKM_SUBDEV_VBIOS   ,     bios);
                _(NVKM_SUBDEV_BUS     ,      bus);
index d8be2f7..0f83ca3 100644 (file)
@@ -3,6 +3,7 @@
 #define __NVKM_DEVICE_PRIV_H__
 #include <core/device.h>
 
+#include <subdev/acr.h>
 #include <subdev/bar.h>
 #include <subdev/bios.h>
 #include <subdev/bus.h>
index 4e136f3..bb3e53f 100644 (file)
@@ -1,4 +1,5 @@
 # SPDX-License-Identifier: MIT
+include $(src)/nvkm/subdev/acr/Kbuild
 include $(src)/nvkm/subdev/bar/Kbuild
 include $(src)/nvkm/subdev/bios/Kbuild
 include $(src)/nvkm/subdev/bus/Kbuild
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/acr/Kbuild b/drivers/gpu/drm/nouveau/nvkm/subdev/acr/Kbuild
new file mode 100644 (file)
index 0000000..548d2d4
--- /dev/null
@@ -0,0 +1 @@
+# SPDX-License-Identifier: MIT