]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blame - drivers/gpu/drm/nouveau/nvkm/subdev/secboot/priv.h
drm/nouveau/mmu: implement new vmm frontend
[mirror_ubuntu-bionic-kernel.git] / drivers / gpu / drm / nouveau / nvkm / subdev / secboot / priv.h
CommitLineData
7d12388a
AC
1/*
2 * Copyright (c) 2015, NVIDIA CORPORATION. All rights reserved.
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 * DEALINGS IN THE SOFTWARE.
21 */
22
23#ifndef __NVKM_SECBOOT_PRIV_H__
24#define __NVKM_SECBOOT_PRIV_H__
25
26#include <subdev/secboot.h>
27#include <subdev/mmu.h>
f9463a4b 28struct nvkm_gpuobj;
7d12388a
AC
29
30struct nvkm_secboot_func {
808d6efd 31 int (*oneinit)(struct nvkm_secboot *);
7d12388a
AC
32 int (*fini)(struct nvkm_secboot *, bool suspend);
33 void *(*dtor)(struct nvkm_secboot *);
7defd1da
AC
34 int (*run_blob)(struct nvkm_secboot *, struct nvkm_gpuobj *,
35 struct nvkm_falcon *);
e781ff91
AC
36};
37
72e0642f
AC
38int nvkm_secboot_ctor(const struct nvkm_secboot_func *, struct nvkm_acr *,
39 struct nvkm_device *, int, struct nvkm_secboot *);
40int nvkm_secboot_falcon_reset(struct nvkm_secboot *);
41int nvkm_secboot_falcon_run(struct nvkm_secboot *);
e781ff91 42
9cc45521
AC
43struct flcn_u64 {
44 u32 lo;
45 u32 hi;
46};
8f491c89 47
9cc45521
AC
48static inline u64 flcn64_to_u64(const struct flcn_u64 f)
49{
50 return ((u64)f.hi) << 32 | f.lo;
51}
52
8f491c89
AC
53static inline struct flcn_u64 u64_to_flcn64(u64 u)
54{
55 struct flcn_u64 ret;
56
57 ret.hi = upper_32_bits(u);
58 ret.lo = lower_32_bits(u);
59
60 return ret;
61}
62
7d12388a 63#endif