mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-23 09:57:08 +03:00
gpu: nvgpu: vgpu: add vgpu_finalize_poweron_common
move common code across OSes to vgpu_finalize_poweron_common. Jira GVSCI-82 Change-Id: Ie7a6ade4354ed6c149306a7f608a7561118c98f5 Signed-off-by: Richard Zhao <rizhao@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1987235 Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com> Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com> Reviewed-by: Aparna Das <aparnad@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Nirav Patel <nipatel@nvidia.com> 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
907e8d7409
commit
b5d787083c
@@ -102,5 +102,6 @@ int vgpu_gp10b_init_hal(struct gk20a *g);
|
|||||||
int vgpu_gv11b_init_hal(struct gk20a *g);
|
int vgpu_gv11b_init_hal(struct gk20a *g);
|
||||||
|
|
||||||
bool vgpu_is_reduced_bar1(struct gk20a *g);
|
bool vgpu_is_reduced_bar1(struct gk20a *g);
|
||||||
|
int vgpu_finalize_poweron_common(struct gk20a *g);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -185,50 +185,10 @@ int vgpu_pm_finalize_poweron(struct device *dev)
|
|||||||
|
|
||||||
g->power_on = true;
|
g->power_on = true;
|
||||||
|
|
||||||
vgpu_detect_chip(g);
|
err = vgpu_finalize_poweron_common(g);
|
||||||
err = vgpu_init_hal(g);
|
|
||||||
if (err)
|
if (err)
|
||||||
goto done;
|
goto done;
|
||||||
|
|
||||||
if (g->ops.ltc.init_fs_state)
|
|
||||||
g->ops.ltc.init_fs_state(g);
|
|
||||||
|
|
||||||
err = nvgpu_init_ltc_support(g);
|
|
||||||
if (err) {
|
|
||||||
nvgpu_err(g, "failed to init ltc");
|
|
||||||
goto done;
|
|
||||||
}
|
|
||||||
|
|
||||||
err = vgpu_init_mm_support(g);
|
|
||||||
if (err) {
|
|
||||||
nvgpu_err(g, "failed to init gk20a mm");
|
|
||||||
goto done;
|
|
||||||
}
|
|
||||||
|
|
||||||
err = vgpu_init_fifo_support(g);
|
|
||||||
if (err) {
|
|
||||||
nvgpu_err(g, "failed to init gk20a fifo");
|
|
||||||
goto done;
|
|
||||||
}
|
|
||||||
|
|
||||||
err = vgpu_init_gr_support(g);
|
|
||||||
if (err) {
|
|
||||||
nvgpu_err(g, "failed to init gk20a gr");
|
|
||||||
goto done;
|
|
||||||
}
|
|
||||||
|
|
||||||
err = nvgpu_clk_arb_init_arbiter(g);
|
|
||||||
if (err) {
|
|
||||||
nvgpu_err(g, "failed to init clk arb");
|
|
||||||
goto done;
|
|
||||||
}
|
|
||||||
|
|
||||||
err = g->ops.chip_init_gpu_characteristics(g);
|
|
||||||
if (err) {
|
|
||||||
nvgpu_err(g, "failed to init gk20a gpu characteristics");
|
|
||||||
goto done;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Initialize linux specific flags */
|
/* Initialize linux specific flags */
|
||||||
gk20a_init_linux_characteristics(g);
|
gk20a_init_linux_characteristics(g);
|
||||||
|
|
||||||
@@ -236,11 +196,7 @@ int vgpu_pm_finalize_poweron(struct device *dev)
|
|||||||
if (err)
|
if (err)
|
||||||
goto done;
|
goto done;
|
||||||
|
|
||||||
#ifdef CONFIG_GK20A_CTXSW_TRACE
|
|
||||||
gk20a_ctxsw_trace_init(g);
|
|
||||||
#endif
|
|
||||||
gk20a_sched_ctrl_init(g);
|
gk20a_sched_ctrl_init(g);
|
||||||
gk20a_channel_resume(g);
|
|
||||||
|
|
||||||
g->sw_ready = true;
|
g->sw_ready = true;
|
||||||
|
|
||||||
|
|||||||
@@ -29,6 +29,8 @@
|
|||||||
#include <nvgpu/channel.h>
|
#include <nvgpu/channel.h>
|
||||||
#include <nvgpu/clk_arb.h>
|
#include <nvgpu/clk_arb.h>
|
||||||
#include <nvgpu/string.h>
|
#include <nvgpu/string.h>
|
||||||
|
#include <nvgpu/ltc.h>
|
||||||
|
#include <nvgpu/ctxsw_trace.h>
|
||||||
|
|
||||||
#include "fecs_trace_vgpu.h"
|
#include "fecs_trace_vgpu.h"
|
||||||
|
|
||||||
@@ -399,3 +401,63 @@ int vgpu_get_constants(struct gk20a *g)
|
|||||||
priv->constants = *p;
|
priv->constants = *p;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int vgpu_finalize_poweron_common(struct gk20a *g)
|
||||||
|
{
|
||||||
|
int err;
|
||||||
|
|
||||||
|
nvgpu_log_fn(g, " ");
|
||||||
|
|
||||||
|
vgpu_detect_chip(g);
|
||||||
|
err = vgpu_init_hal(g);
|
||||||
|
if (err != 0) {
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (g->ops.ltc.init_fs_state != NULL) {
|
||||||
|
g->ops.ltc.init_fs_state(g);
|
||||||
|
}
|
||||||
|
|
||||||
|
err = nvgpu_init_ltc_support(g);
|
||||||
|
if (err != 0) {
|
||||||
|
nvgpu_err(g, "failed to init ltc");
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
|
err = vgpu_init_mm_support(g);
|
||||||
|
if (err != 0) {
|
||||||
|
nvgpu_err(g, "failed to init gk20a mm");
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
|
err = vgpu_init_fifo_support(g);
|
||||||
|
if (err != 0) {
|
||||||
|
nvgpu_err(g, "failed to init gk20a fifo");
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
|
err = vgpu_init_gr_support(g);
|
||||||
|
if (err != 0) {
|
||||||
|
nvgpu_err(g, "failed to init gk20a gr");
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
|
err = nvgpu_clk_arb_init_arbiter(g);
|
||||||
|
if (err != 0) {
|
||||||
|
nvgpu_err(g, "failed to init clk arb");
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
|
err = g->ops.chip_init_gpu_characteristics(g);
|
||||||
|
if (err != 0) {
|
||||||
|
nvgpu_err(g, "failed to init gk20a gpu characteristics");
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef CONFIG_GK20A_CTXSW_TRACE
|
||||||
|
gk20a_ctxsw_trace_init(g);
|
||||||
|
#endif
|
||||||
|
g->ops.fifo.channel_resume(g);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user