mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-22 09:12:24 +03:00
gpu: nvgpu: init: move functions from gk20a.h to own header
This moves the nvgpu.common.init function prototypes from gk20a.h to a new unit-specific header nvgpu_init.h JIRA NVGPU-2385 Change-Id: I48c0b0e02a8064be0eda89f26cf55189ffd55803 Signed-off-by: Philip Elcan <pelcan@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/2133845 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
fe3be6431e
commit
9705c86b98
@@ -439,7 +439,8 @@ init:
|
|||||||
children:
|
children:
|
||||||
nvgpu:
|
nvgpu:
|
||||||
safe: yes
|
safe: yes
|
||||||
sources: [ common/init/nvgpu_init.c ]
|
sources: [ common/init/nvgpu_init.c,
|
||||||
|
include/nvgpu/nvgpu_init.h ]
|
||||||
|
|
||||||
mm:
|
mm:
|
||||||
owner: Alex W
|
owner: Alex W
|
||||||
|
|||||||
@@ -46,6 +46,7 @@
|
|||||||
#include <nvgpu/gk20a.h>
|
#include <nvgpu/gk20a.h>
|
||||||
#include <nvgpu/channel_sync.h>
|
#include <nvgpu/channel_sync.h>
|
||||||
#include <nvgpu/gr/gr.h>
|
#include <nvgpu/gr/gr.h>
|
||||||
|
#include <nvgpu/nvgpu_init.h>
|
||||||
|
|
||||||
#ifdef CONFIG_NVGPU_TRACE
|
#ifdef CONFIG_NVGPU_TRACE
|
||||||
#include <trace/events/gk20a.h>
|
#include <trace/events/gk20a.h>
|
||||||
|
|||||||
@@ -31,6 +31,7 @@
|
|||||||
#include <nvgpu/log2.h>
|
#include <nvgpu/log2.h>
|
||||||
#include <nvgpu/gk20a.h>
|
#include <nvgpu/gk20a.h>
|
||||||
#include <nvgpu/string.h>
|
#include <nvgpu/string.h>
|
||||||
|
#include <nvgpu/nvgpu_init.h>
|
||||||
|
|
||||||
/* dumb allocator... */
|
/* dumb allocator... */
|
||||||
static int generate_as_share_id(struct gk20a_as *as)
|
static int generate_as_share_id(struct gk20a_as *as)
|
||||||
|
|||||||
@@ -28,6 +28,7 @@
|
|||||||
#include <nvgpu/enabled.h>
|
#include <nvgpu/enabled.h>
|
||||||
#include <nvgpu/utils.h>
|
#include <nvgpu/utils.h>
|
||||||
#include <nvgpu/gk20a.h>
|
#include <nvgpu/gk20a.h>
|
||||||
|
#include <nvgpu/nvgpu_init.h>
|
||||||
#include <nvgpu/pmu/allocator.h>
|
#include <nvgpu/pmu/allocator.h>
|
||||||
#include <nvgpu/pmu/fw.h>
|
#include <nvgpu/pmu/fw.h>
|
||||||
#include <nvgpu/pmu/pmu_pg.h>
|
#include <nvgpu/pmu/pmu_pg.h>
|
||||||
|
|||||||
@@ -29,6 +29,7 @@
|
|||||||
#include <nvgpu/falcon.h>
|
#include <nvgpu/falcon.h>
|
||||||
#include <nvgpu/engine_fb_queue.h>
|
#include <nvgpu/engine_fb_queue.h>
|
||||||
#include <nvgpu/gk20a.h>
|
#include <nvgpu/gk20a.h>
|
||||||
|
#include <nvgpu/nvgpu_init.h>
|
||||||
#include <nvgpu/string.h>
|
#include <nvgpu/string.h>
|
||||||
#include <nvgpu/pmu/seq.h>
|
#include <nvgpu/pmu/seq.h>
|
||||||
#include <nvgpu/pmu/queue.h>
|
#include <nvgpu/pmu/queue.h>
|
||||||
|
|||||||
@@ -26,6 +26,7 @@
|
|||||||
#include <nvgpu/pmu/msg.h>
|
#include <nvgpu/pmu/msg.h>
|
||||||
#include <nvgpu/string.h>
|
#include <nvgpu/string.h>
|
||||||
#include <nvgpu/gk20a.h>
|
#include <nvgpu/gk20a.h>
|
||||||
|
#include <nvgpu/nvgpu_init.h>
|
||||||
#include <nvgpu/pmu/lsfm.h>
|
#include <nvgpu/pmu/lsfm.h>
|
||||||
#include <nvgpu/pmu/super_surface.h>
|
#include <nvgpu/pmu/super_surface.h>
|
||||||
#include <nvgpu/pmu/pmu_perfmon.h>
|
#include <nvgpu/pmu/pmu_perfmon.h>
|
||||||
|
|||||||
@@ -35,6 +35,7 @@
|
|||||||
#include <nvgpu/fbp.h>
|
#include <nvgpu/fbp.h>
|
||||||
#include <nvgpu/cyclestats_snapshot.h>
|
#include <nvgpu/cyclestats_snapshot.h>
|
||||||
#include <nvgpu/gr/gr.h>
|
#include <nvgpu/gr/gr.h>
|
||||||
|
#include <nvgpu/nvgpu_init.h>
|
||||||
|
|
||||||
#include "init_vgpu.h"
|
#include "init_vgpu.h"
|
||||||
#include "init_hal_vgpu.h"
|
#include "init_hal_vgpu.h"
|
||||||
|
|||||||
@@ -44,6 +44,7 @@
|
|||||||
#include <nvgpu/pmu/pmu_perfmon.h>
|
#include <nvgpu/pmu/pmu_perfmon.h>
|
||||||
#endif
|
#endif
|
||||||
#include <nvgpu/gr/fecs_trace.h>
|
#include <nvgpu/gr/fecs_trace.h>
|
||||||
|
#include <nvgpu/nvgpu_init.h>
|
||||||
|
|
||||||
#include "hal/mm/mm_gk20a.h"
|
#include "hal/mm/mm_gk20a.h"
|
||||||
#include "hal/mm/mm_gm20b.h"
|
#include "hal/mm/mm_gm20b.h"
|
||||||
|
|||||||
@@ -44,6 +44,7 @@
|
|||||||
#ifdef CONFIG_NVGPU_LS_PMU
|
#ifdef CONFIG_NVGPU_LS_PMU
|
||||||
#include <nvgpu/pmu/pmu_perfmon.h>
|
#include <nvgpu/pmu/pmu_perfmon.h>
|
||||||
#endif
|
#endif
|
||||||
|
#include <nvgpu/nvgpu_init.h>
|
||||||
|
|
||||||
#include "hal/mm/mm_gk20a.h"
|
#include "hal/mm/mm_gk20a.h"
|
||||||
#include "hal/mm/mm_gm20b.h"
|
#include "hal/mm/mm_gm20b.h"
|
||||||
|
|||||||
@@ -165,6 +165,7 @@
|
|||||||
#include <nvgpu/gr/setup.h>
|
#include <nvgpu/gr/setup.h>
|
||||||
#include <nvgpu/gr/fecs_trace.h>
|
#include <nvgpu/gr/fecs_trace.h>
|
||||||
#include <nvgpu/gr/gr_intr.h>
|
#include <nvgpu/gr/gr_intr.h>
|
||||||
|
#include <nvgpu/nvgpu_init.h>
|
||||||
|
|
||||||
#include <nvgpu/hw/gv11b/hw_pwr_gv11b.h>
|
#include <nvgpu/hw/gv11b/hw_pwr_gv11b.h>
|
||||||
|
|
||||||
|
|||||||
@@ -204,6 +204,7 @@
|
|||||||
#include <nvgpu/gr/gr.h>
|
#include <nvgpu/gr/gr.h>
|
||||||
#include <nvgpu/gr/gr_intr.h>
|
#include <nvgpu/gr/gr_intr.h>
|
||||||
#include <nvgpu/pmu/pmu_perfmon.h>
|
#include <nvgpu/pmu/pmu_perfmon.h>
|
||||||
|
#include <nvgpu/nvgpu_init.h>
|
||||||
|
|
||||||
#include <nvgpu/hw/tu104/hw_pwr_tu104.h>
|
#include <nvgpu/hw/tu104/hw_pwr_tu104.h>
|
||||||
|
|
||||||
|
|||||||
@@ -2225,10 +2225,6 @@ static inline u32 nvgpu_get_poll_timeout(struct gk20a *g)
|
|||||||
#define GK20A_NONSTALL_OPS_WAKEUP_SEMAPHORE BIT32(0)
|
#define GK20A_NONSTALL_OPS_WAKEUP_SEMAPHORE BIT32(0)
|
||||||
#define GK20A_NONSTALL_OPS_POST_EVENTS BIT32(1)
|
#define GK20A_NONSTALL_OPS_POST_EVENTS BIT32(1)
|
||||||
|
|
||||||
/* register accessors */
|
|
||||||
void nvgpu_check_gpu_state(struct gk20a *g);
|
|
||||||
void gk20a_warn_on_no_regs(void);
|
|
||||||
|
|
||||||
bool is_nvgpu_gpu_state_valid(struct gk20a *g);
|
bool is_nvgpu_gpu_state_valid(struct gk20a *g);
|
||||||
|
|
||||||
#define GK20A_BAR0_IORESOURCE_MEM 0U
|
#define GK20A_BAR0_IORESOURCE_MEM 0U
|
||||||
@@ -2244,9 +2240,6 @@ int gk20a_do_idle_impl(struct gk20a *g, bool force_reset);
|
|||||||
int gk20a_do_unidle_impl(struct gk20a *g);
|
int gk20a_do_unidle_impl(struct gk20a *g);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int nvgpu_can_busy(struct gk20a *g);
|
|
||||||
int gk20a_wait_for_idle(struct gk20a *g);
|
|
||||||
|
|
||||||
#define NVGPU_GPU_ARCHITECTURE_SHIFT 4U
|
#define NVGPU_GPU_ARCHITECTURE_SHIFT 4U
|
||||||
|
|
||||||
/* constructs unique and compact GPUID from nvgpu_gpu_characteristics
|
/* constructs unique and compact GPUID from nvgpu_gpu_characteristics
|
||||||
@@ -2261,16 +2254,8 @@ int gk20a_wait_for_idle(struct gk20a *g);
|
|||||||
#define NVGPU_GPUID_GV100 0x00000140U
|
#define NVGPU_GPUID_GV100 0x00000140U
|
||||||
#define NVGPU_GPUID_TU104 0x00000164U
|
#define NVGPU_GPUID_TU104 0x00000164U
|
||||||
|
|
||||||
void gk20a_init_gpu_characteristics(struct gk20a *g);
|
|
||||||
|
|
||||||
int gk20a_prepare_poweroff(struct gk20a *g);
|
|
||||||
int gk20a_finalize_poweron(struct gk20a *g);
|
|
||||||
|
|
||||||
void nvgpu_wait_for_deferred_interrupts(struct gk20a *g);
|
void nvgpu_wait_for_deferred_interrupts(struct gk20a *g);
|
||||||
|
|
||||||
struct gk20a * __must_check gk20a_get(struct gk20a *g);
|
|
||||||
void gk20a_put(struct gk20a *g);
|
|
||||||
|
|
||||||
bool nvgpu_has_syncpoints(struct gk20a *g);
|
bool nvgpu_has_syncpoints(struct gk20a *g);
|
||||||
|
|
||||||
#endif /* GK20A_H */
|
#endif /* GK20A_H */
|
||||||
|
|||||||
41
drivers/gpu/nvgpu/include/nvgpu/nvgpu_init.h
Normal file
41
drivers/gpu/nvgpu/include/nvgpu/nvgpu_init.h
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
|
* copy of this software and associated documentation files (the "Software"),
|
||||||
|
* to deal in the Software without restriction, including without limitation
|
||||||
|
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||||
|
* and/or sell copies of the Software, and to permit persons to whom the
|
||||||
|
* Software is furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in
|
||||||
|
* all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||||
|
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||||
|
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
|
* DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef NVGPU_INIT_H
|
||||||
|
#define NVGPU_INIT_H
|
||||||
|
|
||||||
|
int gk20a_finalize_poweron(struct gk20a *g);
|
||||||
|
int gk20a_prepare_poweroff(struct gk20a *g);
|
||||||
|
|
||||||
|
int nvgpu_can_busy(struct gk20a *g);
|
||||||
|
int gk20a_wait_for_idle(struct gk20a *g);
|
||||||
|
|
||||||
|
struct gk20a * __must_check gk20a_get(struct gk20a *g);
|
||||||
|
void gk20a_put(struct gk20a *g);
|
||||||
|
|
||||||
|
/* register accessors */
|
||||||
|
void nvgpu_check_gpu_state(struct gk20a *g);
|
||||||
|
void gk20a_warn_on_no_regs(void);
|
||||||
|
|
||||||
|
void gk20a_init_gpu_characteristics(struct gk20a *g);
|
||||||
|
|
||||||
|
#endif /* NVGPU_INIT_H */
|
||||||
@@ -29,6 +29,7 @@
|
|||||||
|
|
||||||
#include <nvgpu/gk20a.h>
|
#include <nvgpu/gk20a.h>
|
||||||
#include <nvgpu/power_features/pg.h>
|
#include <nvgpu/power_features/pg.h>
|
||||||
|
#include <nvgpu/nvgpu_init.h>
|
||||||
|
|
||||||
#include <linux/debugfs.h>
|
#include <linux/debugfs.h>
|
||||||
#include <linux/seq_file.h>
|
#include <linux/seq_file.h>
|
||||||
|
|||||||
@@ -28,6 +28,7 @@
|
|||||||
#include <nvgpu/nvgpu_mem.h>
|
#include <nvgpu/nvgpu_mem.h>
|
||||||
#include <nvgpu/page_allocator.h>
|
#include <nvgpu/page_allocator.h>
|
||||||
#include <nvgpu/gk20a.h>
|
#include <nvgpu/gk20a.h>
|
||||||
|
#include <nvgpu/nvgpu_init.h>
|
||||||
|
|
||||||
#include <nvgpu/linux/vm.h>
|
#include <nvgpu/linux/vm.h>
|
||||||
#include <nvgpu/linux/dma.h>
|
#include <nvgpu/linux/dma.h>
|
||||||
|
|||||||
@@ -30,6 +30,7 @@
|
|||||||
#include <nvgpu/channel.h>
|
#include <nvgpu/channel.h>
|
||||||
#include <nvgpu/gr/fecs_trace.h>
|
#include <nvgpu/gr/fecs_trace.h>
|
||||||
#include <nvgpu/string.h>
|
#include <nvgpu/string.h>
|
||||||
|
#include <nvgpu/nvgpu_init.h>
|
||||||
|
|
||||||
#include "platform_gk20a.h"
|
#include "platform_gk20a.h"
|
||||||
#include "os_linux.h"
|
#include "os_linux.h"
|
||||||
|
|||||||
@@ -47,6 +47,7 @@
|
|||||||
#include <nvgpu/fence.h>
|
#include <nvgpu/fence.h>
|
||||||
#include <nvgpu/preempt.h>
|
#include <nvgpu/preempt.h>
|
||||||
#include <nvgpu/profile.h>
|
#include <nvgpu/profile.h>
|
||||||
|
#include <nvgpu/nvgpu_init.h>
|
||||||
|
|
||||||
#include "platform_gk20a.h"
|
#include "platform_gk20a.h"
|
||||||
#include "ioctl_channel.h"
|
#include "ioctl_channel.h"
|
||||||
|
|||||||
@@ -48,6 +48,7 @@
|
|||||||
#include <nvgpu/fence.h>
|
#include <nvgpu/fence.h>
|
||||||
#include <nvgpu/channel_sync_syncpt.h>
|
#include <nvgpu/channel_sync_syncpt.h>
|
||||||
#include <nvgpu/soc.h>
|
#include <nvgpu/soc.h>
|
||||||
|
#include <nvgpu/nvgpu_init.h>
|
||||||
|
|
||||||
#include "ioctl_ctrl.h"
|
#include "ioctl_ctrl.h"
|
||||||
#include "ioctl_dbg.h"
|
#include "ioctl_dbg.h"
|
||||||
|
|||||||
@@ -40,6 +40,7 @@
|
|||||||
#include <nvgpu/gr/ctx.h>
|
#include <nvgpu/gr/ctx.h>
|
||||||
#include <nvgpu/gr/gr.h>
|
#include <nvgpu/gr/gr.h>
|
||||||
#include <nvgpu/power_features/pg.h>
|
#include <nvgpu/power_features/pg.h>
|
||||||
|
#include <nvgpu/nvgpu_init.h>
|
||||||
|
|
||||||
#include <nvgpu/linux/vm.h>
|
#include <nvgpu/linux/vm.h>
|
||||||
|
|
||||||
|
|||||||
@@ -32,6 +32,7 @@
|
|||||||
#include <nvgpu/channel.h>
|
#include <nvgpu/channel.h>
|
||||||
#include <nvgpu/tsg.h>
|
#include <nvgpu/tsg.h>
|
||||||
#include <nvgpu/fifo.h>
|
#include <nvgpu/fifo.h>
|
||||||
|
#include <nvgpu/nvgpu_init.h>
|
||||||
|
|
||||||
#include "platform_gk20a.h"
|
#include "platform_gk20a.h"
|
||||||
#include "ioctl_tsg.h"
|
#include "ioctl_tsg.h"
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
#include <nvgpu/io.h>
|
#include <nvgpu/io.h>
|
||||||
#include <nvgpu/types.h>
|
#include <nvgpu/types.h>
|
||||||
#include <nvgpu/gk20a.h>
|
#include <nvgpu/gk20a.h>
|
||||||
|
#include <nvgpu/nvgpu_init.h>
|
||||||
|
|
||||||
#include "os_linux.h"
|
#include "os_linux.h"
|
||||||
|
|
||||||
|
|||||||
@@ -55,6 +55,7 @@
|
|||||||
#include <nvgpu/gr/gr_utils.h>
|
#include <nvgpu/gr/gr_utils.h>
|
||||||
#include <nvgpu/pmu/pmu_pstate.h>
|
#include <nvgpu/pmu/pmu_pstate.h>
|
||||||
#include <nvgpu/cyclestats_snapshot.h>
|
#include <nvgpu/cyclestats_snapshot.h>
|
||||||
|
#include <nvgpu/nvgpu_init.h>
|
||||||
|
|
||||||
#include "platform_gk20a.h"
|
#include "platform_gk20a.h"
|
||||||
#include "sysfs.h"
|
#include "sysfs.h"
|
||||||
|
|||||||
@@ -30,6 +30,7 @@
|
|||||||
#include <nvgpu/gk20a.h>
|
#include <nvgpu/gk20a.h>
|
||||||
#include <nvgpu/string.h>
|
#include <nvgpu/string.h>
|
||||||
#include <nvgpu/gr/gr.h>
|
#include <nvgpu/gr/gr.h>
|
||||||
|
#include <nvgpu/nvgpu_init.h>
|
||||||
|
|
||||||
#include "nvlink.h"
|
#include "nvlink.h"
|
||||||
#include "module.h"
|
#include "module.h"
|
||||||
|
|||||||
@@ -26,6 +26,7 @@
|
|||||||
#include <nvgpu/gk20a.h>
|
#include <nvgpu/gk20a.h>
|
||||||
#include <nvgpu/string.h>
|
#include <nvgpu/string.h>
|
||||||
#include <nvgpu/gr/ctx.h>
|
#include <nvgpu/gr/ctx.h>
|
||||||
|
#include <nvgpu/nvgpu_init.h>
|
||||||
|
|
||||||
#include "sched.h"
|
#include "sched.h"
|
||||||
#include "os_linux.h"
|
#include "os_linux.h"
|
||||||
|
|||||||
@@ -35,6 +35,7 @@
|
|||||||
#include <nvgpu/regops.h>
|
#include <nvgpu/regops.h>
|
||||||
#include <nvgpu/clk_arb.h>
|
#include <nvgpu/clk_arb.h>
|
||||||
#include <nvgpu/gr/gr.h>
|
#include <nvgpu/gr/gr.h>
|
||||||
|
#include <nvgpu/nvgpu_init.h>
|
||||||
|
|
||||||
#include <nvgpu/vgpu/os_init_hal_vgpu.h>
|
#include <nvgpu/vgpu/os_init_hal_vgpu.h>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user