forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-11 04dd17822334871b23ea2862f7798fb0e0007777
kernel/drivers/gpu/drm/nouveau/nvkm/subdev/pmu/priv.h
....@@ -1,16 +1,15 @@
1
-/* SPDX-License-Identifier: GPL-2.0 */
1
+/* SPDX-License-Identifier: MIT */
22 #ifndef __NVKM_PMU_PRIV_H__
33 #define __NVKM_PMU_PRIV_H__
44 #define nvkm_pmu(p) container_of((p), struct nvkm_pmu, subdev)
55 #include <subdev/pmu.h>
66 #include <subdev/pmu/fuc/os.h>
7
-
8
-int nvkm_pmu_ctor(const struct nvkm_pmu_func *, struct nvkm_device *,
9
- int index, struct nvkm_pmu *);
10
-int nvkm_pmu_new_(const struct nvkm_pmu_func *, struct nvkm_device *,
11
- int index, struct nvkm_pmu **);
7
+enum nvkm_acr_lsf_id;
8
+struct nvkm_acr_lsfw;
129
1310 struct nvkm_pmu_func {
11
+ const struct nvkm_falcon_func *flcn;
12
+
1413 struct {
1514 u32 *data;
1615 u32 size;
....@@ -29,9 +28,11 @@
2928 int (*send)(struct nvkm_pmu *, u32 reply[2], u32 process,
3029 u32 message, u32 data0, u32 data1);
3130 void (*recv)(struct nvkm_pmu *);
31
+ int (*initmsg)(struct nvkm_pmu *);
3232 void (*pgob)(struct nvkm_pmu *, bool);
3333 };
3434
35
+extern const struct nvkm_falcon_func gt215_pmu_flcn;
3536 int gt215_pmu_init(struct nvkm_pmu *);
3637 void gt215_pmu_fini(struct nvkm_pmu *);
3738 void gt215_pmu_intr(struct nvkm_pmu *);
....@@ -40,6 +41,32 @@
4041
4142 bool gf100_pmu_enabled(struct nvkm_pmu *);
4243 void gf100_pmu_reset(struct nvkm_pmu *);
44
+void gp102_pmu_reset(struct nvkm_pmu *pmu);
4345
4446 void gk110_pmu_pgob(struct nvkm_pmu *, bool);
47
+
48
+extern const struct nvkm_falcon_func gm200_pmu_flcn;
49
+
50
+void gm20b_pmu_acr_bld_patch(struct nvkm_acr *, u32, s64);
51
+void gm20b_pmu_acr_bld_write(struct nvkm_acr *, u32, struct nvkm_acr_lsfw *);
52
+int gm20b_pmu_acr_boot(struct nvkm_falcon *);
53
+int gm20b_pmu_acr_bootstrap_falcon(struct nvkm_falcon *, enum nvkm_acr_lsf_id);
54
+void gm20b_pmu_recv(struct nvkm_pmu *);
55
+int gm20b_pmu_initmsg(struct nvkm_pmu *);
56
+
57
+struct nvkm_pmu_fwif {
58
+ int version;
59
+ int (*load)(struct nvkm_pmu *, int ver, const struct nvkm_pmu_fwif *);
60
+ const struct nvkm_pmu_func *func;
61
+ const struct nvkm_acr_lsf_func *acr;
62
+};
63
+
64
+int gf100_pmu_nofw(struct nvkm_pmu *, int, const struct nvkm_pmu_fwif *);
65
+int gm200_pmu_nofw(struct nvkm_pmu *, int, const struct nvkm_pmu_fwif *);
66
+int gm20b_pmu_load(struct nvkm_pmu *, int, const struct nvkm_pmu_fwif *);
67
+
68
+int nvkm_pmu_ctor(const struct nvkm_pmu_fwif *, struct nvkm_device *,
69
+ int index, struct nvkm_pmu *);
70
+int nvkm_pmu_new_(const struct nvkm_pmu_fwif *, struct nvkm_device *,
71
+ int index, struct nvkm_pmu **);
4572 #endif