linux/drivers/gpu/drm/nouveau/nvkm/subdev/pmu/priv.h
<<
>>
Prefs
   1/* SPDX-License-Identifier: MIT */
   2#ifndef __NVKM_PMU_PRIV_H__
   3#define __NVKM_PMU_PRIV_H__
   4#define nvkm_pmu(p) container_of((p), struct nvkm_pmu, subdev)
   5#include <subdev/pmu.h>
   6#include <subdev/pmu/fuc/os.h>
   7enum nvkm_acr_lsf_id;
   8struct nvkm_acr_lsfw;
   9
  10struct nvkm_pmu_func {
  11        const struct nvkm_falcon_func *flcn;
  12
  13        struct {
  14                u32 *data;
  15                u32  size;
  16        } code;
  17
  18        struct {
  19                u32 *data;
  20                u32  size;
  21        } data;
  22
  23        bool (*enabled)(struct nvkm_pmu *);
  24        void (*reset)(struct nvkm_pmu *);
  25        int (*init)(struct nvkm_pmu *);
  26        void (*fini)(struct nvkm_pmu *);
  27        void (*intr)(struct nvkm_pmu *);
  28        int (*send)(struct nvkm_pmu *, u32 reply[2], u32 process,
  29                    u32 message, u32 data0, u32 data1);
  30        void (*recv)(struct nvkm_pmu *);
  31        int (*initmsg)(struct nvkm_pmu *);
  32        void (*pgob)(struct nvkm_pmu *, bool);
  33};
  34
  35extern const struct nvkm_falcon_func gt215_pmu_flcn;
  36int gt215_pmu_init(struct nvkm_pmu *);
  37void gt215_pmu_fini(struct nvkm_pmu *);
  38void gt215_pmu_intr(struct nvkm_pmu *);
  39void gt215_pmu_recv(struct nvkm_pmu *);
  40int gt215_pmu_send(struct nvkm_pmu *, u32[2], u32, u32, u32, u32);
  41
  42bool gf100_pmu_enabled(struct nvkm_pmu *);
  43void gf100_pmu_reset(struct nvkm_pmu *);
  44
  45void gk110_pmu_pgob(struct nvkm_pmu *, bool);
  46
  47void gm20b_pmu_acr_bld_patch(struct nvkm_acr *, u32, s64);
  48void gm20b_pmu_acr_bld_write(struct nvkm_acr *, u32, struct nvkm_acr_lsfw *);
  49int gm20b_pmu_acr_boot(struct nvkm_falcon *);
  50int gm20b_pmu_acr_bootstrap_falcon(struct nvkm_falcon *, enum nvkm_acr_lsf_id);
  51void gm20b_pmu_recv(struct nvkm_pmu *);
  52int gm20b_pmu_initmsg(struct nvkm_pmu *);
  53
  54struct nvkm_pmu_fwif {
  55        int version;
  56        int (*load)(struct nvkm_pmu *, int ver, const struct nvkm_pmu_fwif *);
  57        const struct nvkm_pmu_func *func;
  58        const struct nvkm_acr_lsf_func *acr;
  59};
  60
  61int gf100_pmu_nofw(struct nvkm_pmu *, int, const struct nvkm_pmu_fwif *);
  62int gm200_pmu_nofw(struct nvkm_pmu *, int, const struct nvkm_pmu_fwif *);
  63int gm20b_pmu_load(struct nvkm_pmu *, int, const struct nvkm_pmu_fwif *);
  64
  65int nvkm_pmu_ctor(const struct nvkm_pmu_fwif *, struct nvkm_device *, enum nvkm_subdev_type, int,
  66                  struct nvkm_pmu *);
  67int nvkm_pmu_new_(const struct nvkm_pmu_fwif *, struct nvkm_device *, enum nvkm_subdev_type, int,
  68                  struct nvkm_pmu **);
  69#endif
  70