[Nouveau] [PATCH 0/8] Falcon library
Alexandre Courbot
acourbot at nvidia.com
Tue Dec 6 05:35:37 UTC 2016
This was the first step of the secure boot refactoring - as Ben asked for some
fixes, I now submit it as its own series to make it easier to review (and also
because rebasing secure boot on top of this takes time and I don't want to do
it until this is validated!).
This series attempts to factorize the duplicate falcon-related code into a
single library, using the existing nvkm_falcon structure as a basis. Note that
this currently makes struct nvkm_falcon used for two different purposes: this
fact is acknowledged, and temporary. It just makes it easier to review this
first step.
Using the library, falcons are now acquired by a given subdev using
nvkm_falcon_get(), and released with nvkm_falcon_put(). This allows different
engines to share a falcon (as devinit, secboot and pmu will need to do), but
forces us to think about falcon ownership and handling them to the next engine
properly.
A falcon's features are detected using its version and secure registers, and
a set of ops are assigned to it. Then the caller can work with higher-level
functions to load and execure code, and not care about implementation details.
This series also updates gr and secboot use the falcon library as an example.
Converting other engines is trivial and should make our use of falcons generally
safer.
Alexandre Courbot (8):
core: constify nv*_printk macros
mc: add nvkm_mc_enabled() function
core: add falcon library functions
secboot: use falcon library definitions
secboot: use falcon library
gr/gf100: split gf100_gr_init_ctxctl()
gr/gf100: use falcon library
secboot: remove nvkm_secboot_start()
drm/nouveau/include/nvkm/core/client.h | 4 +-
drm/nouveau/include/nvkm/core/device.h | 5 +-
drm/nouveau/include/nvkm/core/subdev.h | 2 +-
drm/nouveau/include/nvkm/engine/falcon.h | 77 +++++++-
drm/nouveau/include/nvkm/subdev/mc.h | 1 +-
drm/nouveau/include/nvkm/subdev/secboot.h | 16 +-
drm/nouveau/nvkm/Kbuild | 1 +-
drm/nouveau/nvkm/engine/device/base.c | 5 +-
drm/nouveau/nvkm/engine/gr/gf100.c | 262 +++++++++++------------
drm/nouveau/nvkm/engine/gr/gf100.h | 2 +-
drm/nouveau/nvkm/engine/gr/gm200.c | 6 +-
drm/nouveau/nvkm/falcon/Kbuild | 2 +-
drm/nouveau/nvkm/falcon/base.c | 259 +++++++++++++++++++++++-
drm/nouveau/nvkm/falcon/falcon_v1.c | 212 +++++++++++++++++++-
drm/nouveau/nvkm/falcon/priv.h | 31 +++-
drm/nouveau/nvkm/subdev/mc/base.c | 10 +-
drm/nouveau/nvkm/subdev/secboot/base.c | 173 +---------------
drm/nouveau/nvkm/subdev/secboot/gm200.c | 182 ++++------------
drm/nouveau/nvkm/subdev/secboot/gm20b.c | 5 +-
drm/nouveau/nvkm/subdev/secboot/priv.h | 10 +-
20 files changed, 808 insertions(+), 457 deletions(-)
create mode 100644 drm/nouveau/nvkm/falcon/Kbuild
create mode 100644 drm/nouveau/nvkm/falcon/base.c
create mode 100644 drm/nouveau/nvkm/falcon/falcon_v1.c
create mode 100644 drm/nouveau/nvkm/falcon/priv.h
--
git-series 0.8.10
More information about the Nouveau
mailing list