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:
Philip Elcan
2019-06-10 17:52:19 -04:00
committed by mobile promotions
parent fe3be6431e
commit 9705c86b98
25 changed files with 65 additions and 16 deletions

View File

@@ -439,7 +439,8 @@ init:
children:
nvgpu:
safe: yes
sources: [ common/init/nvgpu_init.c ]
sources: [ common/init/nvgpu_init.c,
include/nvgpu/nvgpu_init.h ]
mm:
owner: Alex W

View File

@@ -46,6 +46,7 @@
#include <nvgpu/gk20a.h>
#include <nvgpu/channel_sync.h>
#include <nvgpu/gr/gr.h>
#include <nvgpu/nvgpu_init.h>
#ifdef CONFIG_NVGPU_TRACE
#include <trace/events/gk20a.h>

View File

@@ -31,6 +31,7 @@
#include <nvgpu/log2.h>
#include <nvgpu/gk20a.h>
#include <nvgpu/string.h>
#include <nvgpu/nvgpu_init.h>
/* dumb allocator... */
static int generate_as_share_id(struct gk20a_as *as)

View File

@@ -28,6 +28,7 @@
#include <nvgpu/enabled.h>
#include <nvgpu/utils.h>
#include <nvgpu/gk20a.h>
#include <nvgpu/nvgpu_init.h>
#include <nvgpu/pmu/allocator.h>
#include <nvgpu/pmu/fw.h>
#include <nvgpu/pmu/pmu_pg.h>

View File

@@ -29,6 +29,7 @@
#include <nvgpu/falcon.h>
#include <nvgpu/engine_fb_queue.h>
#include <nvgpu/gk20a.h>
#include <nvgpu/nvgpu_init.h>
#include <nvgpu/string.h>
#include <nvgpu/pmu/seq.h>
#include <nvgpu/pmu/queue.h>

View File

@@ -26,6 +26,7 @@
#include <nvgpu/pmu/msg.h>
#include <nvgpu/string.h>
#include <nvgpu/gk20a.h>
#include <nvgpu/nvgpu_init.h>
#include <nvgpu/pmu/lsfm.h>
#include <nvgpu/pmu/super_surface.h>
#include <nvgpu/pmu/pmu_perfmon.h>

View File

@@ -35,6 +35,7 @@
#include <nvgpu/fbp.h>
#include <nvgpu/cyclestats_snapshot.h>
#include <nvgpu/gr/gr.h>
#include <nvgpu/nvgpu_init.h>
#include "init_vgpu.h"
#include "init_hal_vgpu.h"

View File

@@ -44,6 +44,7 @@
#include <nvgpu/pmu/pmu_perfmon.h>
#endif
#include <nvgpu/gr/fecs_trace.h>
#include <nvgpu/nvgpu_init.h>
#include "hal/mm/mm_gk20a.h"
#include "hal/mm/mm_gm20b.h"

View File

@@ -44,6 +44,7 @@
#ifdef CONFIG_NVGPU_LS_PMU
#include <nvgpu/pmu/pmu_perfmon.h>
#endif
#include <nvgpu/nvgpu_init.h>
#include "hal/mm/mm_gk20a.h"
#include "hal/mm/mm_gm20b.h"

View File

@@ -165,6 +165,7 @@
#include <nvgpu/gr/setup.h>
#include <nvgpu/gr/fecs_trace.h>
#include <nvgpu/gr/gr_intr.h>
#include <nvgpu/nvgpu_init.h>
#include <nvgpu/hw/gv11b/hw_pwr_gv11b.h>

View File

@@ -204,6 +204,7 @@
#include <nvgpu/gr/gr.h>
#include <nvgpu/gr/gr_intr.h>
#include <nvgpu/pmu/pmu_perfmon.h>
#include <nvgpu/nvgpu_init.h>
#include <nvgpu/hw/tu104/hw_pwr_tu104.h>

View File

@@ -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_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);
#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);
#endif
int nvgpu_can_busy(struct gk20a *g);
int gk20a_wait_for_idle(struct gk20a *g);
#define NVGPU_GPU_ARCHITECTURE_SHIFT 4U
/* 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_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);
struct gk20a * __must_check gk20a_get(struct gk20a *g);
void gk20a_put(struct gk20a *g);
bool nvgpu_has_syncpoints(struct gk20a *g);
#endif /* GK20A_H */

View 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 */

View File

@@ -29,6 +29,7 @@
#include <nvgpu/gk20a.h>
#include <nvgpu/power_features/pg.h>
#include <nvgpu/nvgpu_init.h>
#include <linux/debugfs.h>
#include <linux/seq_file.h>

View File

@@ -28,6 +28,7 @@
#include <nvgpu/nvgpu_mem.h>
#include <nvgpu/page_allocator.h>
#include <nvgpu/gk20a.h>
#include <nvgpu/nvgpu_init.h>
#include <nvgpu/linux/vm.h>
#include <nvgpu/linux/dma.h>

View File

@@ -30,6 +30,7 @@
#include <nvgpu/channel.h>
#include <nvgpu/gr/fecs_trace.h>
#include <nvgpu/string.h>
#include <nvgpu/nvgpu_init.h>
#include "platform_gk20a.h"
#include "os_linux.h"

View File

@@ -47,6 +47,7 @@
#include <nvgpu/fence.h>
#include <nvgpu/preempt.h>
#include <nvgpu/profile.h>
#include <nvgpu/nvgpu_init.h>
#include "platform_gk20a.h"
#include "ioctl_channel.h"

View File

@@ -48,6 +48,7 @@
#include <nvgpu/fence.h>
#include <nvgpu/channel_sync_syncpt.h>
#include <nvgpu/soc.h>
#include <nvgpu/nvgpu_init.h>
#include "ioctl_ctrl.h"
#include "ioctl_dbg.h"

View File

@@ -40,6 +40,7 @@
#include <nvgpu/gr/ctx.h>
#include <nvgpu/gr/gr.h>
#include <nvgpu/power_features/pg.h>
#include <nvgpu/nvgpu_init.h>
#include <nvgpu/linux/vm.h>

View File

@@ -32,6 +32,7 @@
#include <nvgpu/channel.h>
#include <nvgpu/tsg.h>
#include <nvgpu/fifo.h>
#include <nvgpu/nvgpu_init.h>
#include "platform_gk20a.h"
#include "ioctl_tsg.h"

View File

@@ -14,6 +14,7 @@
#include <nvgpu/io.h>
#include <nvgpu/types.h>
#include <nvgpu/gk20a.h>
#include <nvgpu/nvgpu_init.h>
#include "os_linux.h"

View File

@@ -55,6 +55,7 @@
#include <nvgpu/gr/gr_utils.h>
#include <nvgpu/pmu/pmu_pstate.h>
#include <nvgpu/cyclestats_snapshot.h>
#include <nvgpu/nvgpu_init.h>
#include "platform_gk20a.h"
#include "sysfs.h"

View File

@@ -30,6 +30,7 @@
#include <nvgpu/gk20a.h>
#include <nvgpu/string.h>
#include <nvgpu/gr/gr.h>
#include <nvgpu/nvgpu_init.h>
#include "nvlink.h"
#include "module.h"

View File

@@ -26,6 +26,7 @@
#include <nvgpu/gk20a.h>
#include <nvgpu/string.h>
#include <nvgpu/gr/ctx.h>
#include <nvgpu/nvgpu_init.h>
#include "sched.h"
#include "os_linux.h"

View File

@@ -35,6 +35,7 @@
#include <nvgpu/regops.h>
#include <nvgpu/clk_arb.h>
#include <nvgpu/gr/gr.h>
#include <nvgpu/nvgpu_init.h>
#include <nvgpu/vgpu/os_init_hal_vgpu.h>