drm/nouveau/core: add falcon library functions
authorAlexandre Courbot <acourbot@nvidia.com>
Tue, 13 Dec 2016 08:11:19 +0000 (17:11 +0900)
committerBen Skeggs <bskeggs@redhat.com>
Fri, 17 Feb 2017 05:14:30 +0000 (15:14 +1000)
commit31214108ad08766075bf111df90c1f26520b0159
treef3f593340f0e794464e81c1b9887ba21399f96bd
parentc599dd4b70d3d8a485be6b80d8b190beb3df874b
drm/nouveau/core: add falcon library functions

Falcon processors are used in various places of GPU chips. Although there
exist different versions of the falcon, and some variants exist, the
base set of actions performed on them is the same, which results in lots
of duplicated code.

This patch consolidates the current nvkm_falcon structure and extends it
with the following features:

* Ability for an engine to obtain and later release a given falcon,
* Abstractions for basic operations (IMEM/DMEM access, start, etc)
* Abstractions for secure operations if a falcon is secure

Abstractions make it easy to e.g. start a falcon, without having to care
about its details. For instance, falcons in secure mode need to be
started by writing to a different register.

Right now the abstractions variants only cover secure vs. non-secure
falcon, but more will come as e.g. SEC2 support is added.

This is still a WIP as other functions previously done by
engine/falcon.c need to be reimplemented. However this first step allows
to keep things simple and to discuss basic design.

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/include/nvkm/engine/falcon.h
drivers/gpu/drm/nouveau/nvkm/Kbuild
drivers/gpu/drm/nouveau/nvkm/falcon/Kbuild [new file with mode: 0644]
drivers/gpu/drm/nouveau/nvkm/falcon/base.c [new file with mode: 0644]
drivers/gpu/drm/nouveau/nvkm/falcon/priv.h [new file with mode: 0644]
drivers/gpu/drm/nouveau/nvkm/falcon/v1.c [new file with mode: 0644]