Store the falcon's DMEM size in the secboot structure so it can be
retrieved later. This is needed to load the PMU LS firmware's argument
at the end of DMEM, where the LS firmware expects it to be.

Signed-off-by: Alexandre Courbot <acour...@nvidia.com>
---
 drm/nouveau/nvkm/subdev/secboot/acr.h  | 2 ++
 drm/nouveau/nvkm/subdev/secboot/base.c | 3 +++
 2 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drm/nouveau/nvkm/subdev/secboot/acr.h 
b/drm/nouveau/nvkm/subdev/secboot/acr.h
index 7ce11379f6f7..175f14fbda61 100644
--- a/drm/nouveau/nvkm/subdev/secboot/acr.h
+++ b/drm/nouveau/nvkm/subdev/secboot/acr.h
@@ -51,6 +51,7 @@ struct nvkm_acr_func {
  * @boot_falcon: ID of the falcon that will perform secure boot
  * @managed_falcons: bitfield of falcons managed by this ACR
  * @start_address: virtual start address of the HS bootloader
+ * @dmem_size: size of DMEM of the managing falcon
  */
 struct nvkm_acr {
        const struct nvkm_acr_func *func;
@@ -59,6 +60,7 @@ struct nvkm_acr {
        enum nvkm_falconidx boot_falcon;
        unsigned long managed_falcons;
        u32 start_address;
+       u32 dmem_size;
 };
 
 void *nvkm_acr_load_firmware(const struct nvkm_subdev *, const char *, size_t);
diff --git a/drm/nouveau/nvkm/subdev/secboot/base.c 
b/drm/nouveau/nvkm/subdev/secboot/base.c
index b393ae8b8b12..3e48eb93197d 100644
--- a/drm/nouveau/nvkm/subdev/secboot/base.c
+++ b/drm/nouveau/nvkm/subdev/secboot/base.c
@@ -330,6 +330,9 @@ nvkm_secboot_ctor(const struct nvkm_secboot_func *func, 
struct nvkm_acr *acr,
        sb->debug_mode = (val >> 20) & 0x1;
 
        val = nvkm_rd32(device, sb->base + 0x108);
+       sb->acr->dmem_size = ((val >> 9) & 0x1ff) << 8;
+
+       val = nvkm_rd32(device, sb->base + 0x108);
 
        nvkm_debug(&sb->subdev, "using %s falcon in %s mode\n",
                   nvkm_falcon_name[acr->boot_falcon],
-- 
git-series 0.8.10
_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/nouveau

Reply via email to