diff --git a/drivers/gpu/nvgpu/Makefile.sources b/drivers/gpu/nvgpu/Makefile.sources index 9c303a28d..b3ed0cadc 100644 --- a/drivers/gpu/nvgpu/Makefile.sources +++ b/drivers/gpu/nvgpu/Makefile.sources @@ -229,7 +229,6 @@ srcs += common/utils/enabled.c \ hal/fb/intr/fb_intr_ecc_gv11b.c \ hal/fuse/fuse_gm20b.c \ hal/fuse/fuse_gp10b.c \ - hal/fuse/fuse_gp106.c \ hal/rc/rc_gk20a.c \ hal/rc/rc_gv11b.c \ hal/fifo/fifo_gk20a.c \ @@ -522,6 +521,7 @@ srcs += common/sec2/sec2.c \ hal/fifo/runlist_fifo_gv100.c \ hal/fifo/runlist_fifo_tu104.c \ hal/fifo/fifo_intr_gv100.c \ + hal/fuse/fuse_gp106.c \ hal/netlist/netlist_gv100.c \ hal/netlist/netlist_tu104.c \ hal/nvdec/nvdec_tu104.c \ diff --git a/drivers/gpu/nvgpu/common/acr/acr.c b/drivers/gpu/nvgpu/common/acr/acr.c index ca769f9da..07c7a1bff 100644 --- a/drivers/gpu/nvgpu/common/acr/acr.c +++ b/drivers/gpu/nvgpu/common/acr/acr.c @@ -25,7 +25,6 @@ #include #include #include -#include #include "acr_priv.h" #ifdef NVGPU_FEATURE_ACR_LEGACY diff --git a/drivers/gpu/nvgpu/common/acr/acr_sw_gv11b.c b/drivers/gpu/nvgpu/common/acr/acr_sw_gv11b.c index fa30e5277..dfd5c1533 100644 --- a/drivers/gpu/nvgpu/common/acr/acr_sw_gv11b.c +++ b/drivers/gpu/nvgpu/common/acr/acr_sw_gv11b.c @@ -24,7 +24,9 @@ #include #include #include +#ifdef NVGPU_FEATURE_LS_PMU #include +#endif #include "acr_wpr.h" #include "acr_priv.h" diff --git a/drivers/gpu/nvgpu/common/clk_arb/clk_arb.c b/drivers/gpu/nvgpu/common/clk_arb/clk_arb.c index e76ed2f5d..6c5f5b57c 100644 --- a/drivers/gpu/nvgpu/common/clk_arb/clk_arb.c +++ b/drivers/gpu/nvgpu/common/clk_arb/clk_arb.c @@ -34,9 +34,11 @@ #include #include #include +#ifdef NVGPU_FEATURE_LS_PMU #include #include #include +#endif #include int nvgpu_clk_notification_queue_alloc(struct gk20a *g, diff --git a/drivers/gpu/nvgpu/common/fifo/engines.c b/drivers/gpu/nvgpu/common/fifo/engines.c index a23a8dc32..037a3f966 100644 --- a/drivers/gpu/nvgpu/common/fifo/engines.c +++ b/drivers/gpu/nvgpu/common/fifo/engines.c @@ -25,8 +25,10 @@ #include #include #include +#ifdef NVGPU_FEATURE_LS_PMU #include #include +#endif #include #include #include diff --git a/drivers/gpu/nvgpu/common/fifo/runlist.c b/drivers/gpu/nvgpu/common/fifo/runlist.c index d7b688aae..6be0cd295 100644 --- a/drivers/gpu/nvgpu/common/fifo/runlist.c +++ b/drivers/gpu/nvgpu/common/fifo/runlist.c @@ -29,7 +29,9 @@ #include #include #include +#ifdef NVGPU_FEATURE_LS_PMU #include +#endif void nvgpu_runlist_lock_active_runlists(struct gk20a *g) { diff --git a/drivers/gpu/nvgpu/common/gr/gr_falcon.c b/drivers/gpu/nvgpu/common/gr/gr_falcon.c index a39ac4ac5..4157613df 100644 --- a/drivers/gpu/nvgpu/common/gr/gr_falcon.c +++ b/drivers/gpu/nvgpu/common/gr/gr_falcon.c @@ -30,8 +30,10 @@ #include #include #include +#ifdef NVGPU_FEATURE_LS_PMU #include #include +#endif #ifdef NVGPU_DGPU_SUPPORT #include #endif diff --git a/drivers/gpu/nvgpu/common/gr/obj_ctx.c b/drivers/gpu/nvgpu/common/gr/obj_ctx.c index dd783f72f..08d34ea7b 100644 --- a/drivers/gpu/nvgpu/common/gr/obj_ctx.c +++ b/drivers/gpu/nvgpu/common/gr/obj_ctx.c @@ -24,7 +24,9 @@ #include #include #include +#ifdef NVGPU_FEATURE_LS_PMU #include +#endif #include #include #include diff --git a/drivers/gpu/nvgpu/common/gr/zbc.c b/drivers/gpu/nvgpu/common/gr/zbc.c index 268720fa0..eee352dba 100644 --- a/drivers/gpu/nvgpu/common/gr/zbc.c +++ b/drivers/gpu/nvgpu/common/gr/zbc.c @@ -25,7 +25,9 @@ #include #include #include +#ifdef NVGPU_FEATURE_LS_PMU #include +#endif #include "zbc_priv.h" diff --git a/drivers/gpu/nvgpu/common/init/nvgpu_init.c b/drivers/gpu/nvgpu/common/init/nvgpu_init.c index a208ce090..20a51ff8f 100644 --- a/drivers/gpu/nvgpu/common/init/nvgpu_init.c +++ b/drivers/gpu/nvgpu/common/init/nvgpu_init.c @@ -48,7 +48,9 @@ #include #include +#ifdef NVGPU_FEATURE_LS_PMU #include +#endif bool is_nvgpu_gpu_state_valid(struct gk20a *g) { diff --git a/drivers/gpu/nvgpu/common/pmu/pmu.c b/drivers/gpu/nvgpu/common/pmu/pmu.c index 3c5fa7347..264423ecd 100644 --- a/drivers/gpu/nvgpu/common/pmu/pmu.c +++ b/drivers/gpu/nvgpu/common/pmu/pmu.c @@ -20,30 +20,32 @@ * DEALINGS IN THE SOFTWARE. */ -#include -#include -#include -#include +#include #include #include #include #include -#include #include #include +#include +#include +#include +#ifdef NVGPU_FEATURE_LS_PMU +#include +#include +#include #include -#ifdef NVGPU_DGPU_SUPPORT -#include -#endif #include #include #include #include #include -#include -#include #include -#include +#endif + +#ifdef NVGPU_DGPU_SUPPORT +#include +#endif #ifdef NVGPU_FEATURE_LS_PMU /* PMU locks used to sync with PMU-RTOS */ @@ -378,10 +380,11 @@ exit: void nvgpu_pmu_remove_support(struct gk20a *g, struct nvgpu_pmu *pmu) { if(pmu != NULL) { +#ifdef NVGPU_FEATURE_LS_PMU if (pmu->remove_support != NULL) { pmu->remove_support(g->pmu); } - +#endif nvgpu_kfree(g, g->pmu); g->pmu = NULL; } diff --git a/drivers/gpu/nvgpu/common/power_features/pg/pg.c b/drivers/gpu/nvgpu/common/power_features/pg/pg.c index e473fa7d6..aa232100e 100644 --- a/drivers/gpu/nvgpu/common/power_features/pg/pg.c +++ b/drivers/gpu/nvgpu/common/power_features/pg/pg.c @@ -21,8 +21,10 @@ */ #include +#ifdef NVGPU_FEATURE_LS_PMU #include #include +#endif #include bool nvgpu_pg_elpg_is_enabled(struct gk20a *g) diff --git a/drivers/gpu/nvgpu/hal/clk/clk_gm20b.c b/drivers/gpu/nvgpu/hal/clk/clk_gm20b.c index 72b674d21..640041ba5 100644 --- a/drivers/gpu/nvgpu/hal/clk/clk_gm20b.c +++ b/drivers/gpu/nvgpu/hal/clk/clk_gm20b.c @@ -32,6 +32,7 @@ #include #include #include +#include #include "clk_gm20b.h" diff --git a/drivers/gpu/nvgpu/hal/fifo/preempt_gk20a.c b/drivers/gpu/nvgpu/hal/fifo/preempt_gk20a.c index c1acbd10e..33c1139c1 100644 --- a/drivers/gpu/nvgpu/hal/fifo/preempt_gk20a.c +++ b/drivers/gpu/nvgpu/hal/fifo/preempt_gk20a.c @@ -32,7 +32,9 @@ #include #include #include +#ifdef NVGPU_FEATURE_LS_PMU #include +#endif #include "preempt_gk20a.h" diff --git a/drivers/gpu/nvgpu/hal/fifo/preempt_gv11b.c b/drivers/gpu/nvgpu/hal/fifo/preempt_gv11b.c index e52710089..be4ed1e77 100644 --- a/drivers/gpu/nvgpu/hal/fifo/preempt_gv11b.c +++ b/drivers/gpu/nvgpu/hal/fifo/preempt_gv11b.c @@ -37,7 +37,9 @@ #include #include #include +#ifdef NVGPU_FEATURE_LS_PMU #include +#endif #include "preempt_gv11b.h" diff --git a/drivers/gpu/nvgpu/hal/gr/falcon/gr_falcon_gm20b.c b/drivers/gpu/nvgpu/hal/gr/falcon/gr_falcon_gm20b.c index 73a395aef..98fc19145 100644 --- a/drivers/gpu/nvgpu/hal/gr/falcon/gr_falcon_gm20b.c +++ b/drivers/gpu/nvgpu/hal/gr/falcon/gr_falcon_gm20b.c @@ -27,6 +27,7 @@ #include #include #include +#include #include "gr_falcon_gm20b.h" #include "common/gr/gr_falcon_priv.h" diff --git a/drivers/gpu/nvgpu/hal/init/hal_gm20b.c b/drivers/gpu/nvgpu/hal/init/hal_gm20b.c index 68f6599be..4954ae21e 100644 --- a/drivers/gpu/nvgpu/hal/init/hal_gm20b.c +++ b/drivers/gpu/nvgpu/hal/init/hal_gm20b.c @@ -40,7 +40,9 @@ #include #include #include +#ifdef NVGPU_FEATURE_LS_PMU #include +#endif #include #include "hal/mm/mm_gk20a.h" @@ -105,7 +107,9 @@ #include "hal/fifo/channel_gk20a.h" #include "hal/fifo/channel_gm20b.h" +#ifdef NVGPU_FEATURE_LS_PMU #include "common/pmu/pg/pg_sw_gm20b.h" +#endif #include "hal_gm20b.h" #include "hal_gm20b_litter.h" diff --git a/drivers/gpu/nvgpu/hal/init/hal_gp10b.c b/drivers/gpu/nvgpu/hal/init/hal_gp10b.c index 5028c0c02..bd433c04e 100644 --- a/drivers/gpu/nvgpu/hal/init/hal_gp10b.c +++ b/drivers/gpu/nvgpu/hal/init/hal_gp10b.c @@ -41,7 +41,9 @@ #include #include #include +#ifdef NVGPU_FEATURE_LS_PMU #include +#endif #include "hal/mm/mm_gk20a.h" #include "hal/mm/mm_gm20b.h" @@ -112,9 +114,11 @@ #include "hal/gr/gr/gr_gk20a.h" #include "hal/gr/gr/gr_gp10b.h" #include "hal/gr/gr/gr_gm20b.h" +#ifdef NVGPU_FEATURE_LS_PMU #include "hal/pmu/pmu_gk20a.h" #include "hal/pmu/pmu_gm20b.h" #include "hal/pmu/pmu_gp10b.h" +#endif #include "hal/sync/syncpt_cmdbuf_gk20a.h" #include "hal/sync/sema_cmdbuf_gk20a.h" #include "hal/falcon/falcon_gk20a.h" @@ -123,9 +127,10 @@ #include "hal/top/top_gm20b.h" #include "hal/top/top_gp10b.h" #include "hal/pramin/pramin_init.h" - +#ifdef NVGPU_FEATURE_LS_PMU #include "common/pmu/pg/pg_sw_gm20b.h" #include "common/pmu/pg/pg_sw_gp10b.h" +#endif #include "hal/fifo/channel_gk20a.h" #include "hal/fifo/channel_gm20b.h" #include "common/clk_arb/clk_arb_gp10b.h" diff --git a/drivers/gpu/nvgpu/hal/init/hal_gv11b.c b/drivers/gpu/nvgpu/hal/init/hal_gv11b.c index 08856da33..1155f9bfd 100644 --- a/drivers/gpu/nvgpu/hal/init/hal_gv11b.c +++ b/drivers/gpu/nvgpu/hal/init/hal_gv11b.c @@ -28,7 +28,9 @@ #include #include #include +#ifdef NVGPU_FEATURE_LS_PMU #include +#endif #include "hal/mm/mm_gp10b.h" #include "hal/mm/mm_gv11b.h" @@ -124,10 +126,11 @@ #include "hal/gr/gr/gr_gp10b.h" #include "hal/gr/gr/gr_gv100.h" #include "hal/gr/gr/gr_gv11b.h" +#ifdef NVGPU_FEATURE_LS_PMU #include "hal/pmu/pmu_gk20a.h" #include "hal/pmu/pmu_gm20b.h" +#endif #include "hal/pmu/pmu_gp106.h" -#include "hal/pmu/pmu_gp10b.h" #include "hal/pmu/pmu_gv11b.h" #include "hal/sync/syncpt_cmdbuf_gv11b.h" #include "hal/sync/sema_cmdbuf_gv11b.h" @@ -138,10 +141,11 @@ #include "hal/top/top_gp10b.h" #include "hal/top/top_gv11b.h" - +#ifdef NVGPU_FEATURE_LS_PMU #include "common/pmu/pg/pg_sw_gm20b.h" #include "common/pmu/pg/pg_sw_gp106.h" #include "common/pmu/pg/pg_sw_gv11b.h" +#endif #include "hal/fifo/channel_gk20a.h" #include "hal/fifo/channel_gm20b.h" #include "hal/fifo/channel_gv11b.h" diff --git a/drivers/gpu/nvgpu/hal/pmu/pmu_gv11b.c b/drivers/gpu/nvgpu/hal/pmu/pmu_gv11b.c index 38297e346..ea783d74c 100644 --- a/drivers/gpu/nvgpu/hal/pmu/pmu_gv11b.c +++ b/drivers/gpu/nvgpu/hal/pmu/pmu_gv11b.c @@ -29,7 +29,9 @@ #include #include #include +#ifdef NVGPU_FEATURE_LS_PMU #include +#endif #include "pmu_gv11b.h" diff --git a/drivers/gpu/nvgpu/hal/rc/rc_gv11b.c b/drivers/gpu/nvgpu/hal/rc/rc_gv11b.c index 77a3ed862..72e4b6954 100644 --- a/drivers/gpu/nvgpu/hal/rc/rc_gv11b.c +++ b/drivers/gpu/nvgpu/hal/rc/rc_gv11b.c @@ -38,7 +38,9 @@ #include #include #include +#ifdef NVGPU_FEATURE_LS_PMU #include +#endif #include "rc_gv11b.h" diff --git a/drivers/gpu/nvgpu/include/nvgpu/pmu.h b/drivers/gpu/nvgpu/include/nvgpu/pmu.h index 69e8afdf8..c0dc733d8 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/pmu.h +++ b/drivers/gpu/nvgpu/include/nvgpu/pmu.h @@ -31,6 +31,7 @@ #include #include #include +#ifdef NVGPU_FEATURE_LS_PMU #include #include #include @@ -41,6 +42,7 @@ struct nvgpu_pmu_lsfm; struct pmu_super_surface; struct nvgpu_pmu_pg; struct nvgpu_pmu_perfmon; +#endif #define nvgpu_pmu_dbg(g, fmt, args...) \ nvgpu_log(g, gpu_dbg_pmu, fmt, ##args) @@ -87,6 +89,7 @@ struct nvgpu_clk_pmupstate; /* pmu load const defines */ #define PMU_BUSY_CYCLES_NORM_MAX (1000U) +#ifdef NVGPU_FEATURE_LS_PMU struct rpc_handler_payload { void *rpc_buff; bool is_mem_free_set; @@ -111,6 +114,7 @@ struct pmu_payload { struct pmu_in_out_payload_desc out; struct pmu_rpc_desc rpc; }; +#endif struct pmu_ucode_desc { u32 descriptor_size; @@ -150,6 +154,7 @@ struct nvgpu_pmu { bool isr_enabled; struct nvgpu_mutex isr_mutex; struct nvgpu_falcon *flcn; +#ifdef NVGPU_FEATURE_LS_PMU struct nvgpu_allocator dmem; struct nvgpu_mem trace_buf; struct pmu_sha1_gid gid_info; @@ -171,8 +176,10 @@ struct nvgpu_pmu { struct nv_pmu_rpc_header *rpc); void (*therm_event_handler)(struct gk20a *g, struct nvgpu_pmu *pmu, struct pmu_msg *msg, struct nv_pmu_rpc_header *rpc); +#endif }; +#ifdef NVGPU_FEATURE_LS_PMU /*! * Structure/object which single register write need to be done during PG init * sequence to set PROD values. @@ -187,11 +194,16 @@ int nvgpu_pmu_lock_acquire(struct gk20a *g, struct nvgpu_pmu *pmu, u32 id, u32 *token); int nvgpu_pmu_lock_release(struct gk20a *g, struct nvgpu_pmu *pmu, u32 id, u32 *token); +#endif /* PMU RTOS init/setup functions */ int nvgpu_pmu_early_init(struct gk20a *g, struct nvgpu_pmu **pmu_p); + +#ifdef NVGPU_FEATURE_LS_PMU int nvgpu_pmu_init(struct gk20a *g, struct nvgpu_pmu *pmu); int nvgpu_pmu_destroy(struct gk20a *g, struct nvgpu_pmu *pmu); +#endif + void nvgpu_pmu_remove_support(struct gk20a *g, struct nvgpu_pmu *pmu); /* PMU H/W error functions */ diff --git a/userspace/units/fuse/nvgpu-fuse-tu104.c b/userspace/units/fuse/nvgpu-fuse-tu104.c index 1f66cfc2b..06c327f0a 100644 --- a/userspace/units/fuse/nvgpu-fuse-tu104.c +++ b/userspace/units/fuse/nvgpu-fuse-tu104.c @@ -27,6 +27,7 @@ #include #include #include +#include #include "hal/fuse/fuse_gm20b.h" #include "nvgpu-fuse-priv.h"