diff options
author | Seema Khowala <seemaj@nvidia.com> | 2016-07-08 19:12:44 -0400 |
---|---|---|
committer | Seshendra Gadagottu <sgadagottu@nvidia.com> | 2016-07-27 17:32:54 -0400 |
commit | d64e2015147c4dc48c0d3b8d6ee612dd8addf04c (patch) | |
tree | 68753a49ca7da2264ff007c675b1dfa32f6da3bd /drivers/gpu/nvgpu/gk20a/gr_gk20a.c | |
parent | 9ca4c6b596fe50c652907193bb167ee29c208b4b (diff) |
gpu: nvgpu: add check for is_fmodel
is_fmodel flag will be set in gk20a_probe().
Updated code for is_fmodel check, instead of
check for supported simulated platforms.
Bug 1735760
Change-Id: I7cbac2196130fe5ce4c1a910504879e6948c13da
Signed-off-by: Seema Khowala <seemaj@nvidia.com>
Reviewed-on: http://git-master/r/1177869
Reviewed-by: Seshendra Gadagottu <sgadagottu@nvidia.com>
Tested-by: Seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-by: Adeel Raza <araza@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/gr_gk20a.c')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gr_gk20a.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c index 6fc52ad0..979f69ba 100644 --- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c | |||
@@ -372,8 +372,9 @@ static int gr_gk20a_wait_fe_idle(struct gk20a *g, unsigned long end_jiffies, | |||
372 | { | 372 | { |
373 | u32 val; | 373 | u32 val; |
374 | u32 delay = expect_delay; | 374 | u32 delay = expect_delay; |
375 | struct gk20a_platform *platform = dev_get_drvdata(g->dev); | ||
375 | 376 | ||
376 | if (tegra_platform_is_linsim()) | 377 | if (platform->is_fmodel) |
377 | return 0; | 378 | return 0; |
378 | 379 | ||
379 | gk20a_dbg_fn(""); | 380 | gk20a_dbg_fn(""); |
@@ -1491,6 +1492,7 @@ static int gr_gk20a_init_golden_ctx_image(struct gk20a *g, | |||
1491 | msecs_to_jiffies(gk20a_get_gr_idle_timeout(g)); | 1492 | msecs_to_jiffies(gk20a_get_gr_idle_timeout(g)); |
1492 | u32 last_method_data = 0; | 1493 | u32 last_method_data = 0; |
1493 | int retries = FE_PWR_MODE_TIMEOUT_MAX / FE_PWR_MODE_TIMEOUT_DEFAULT; | 1494 | int retries = FE_PWR_MODE_TIMEOUT_MAX / FE_PWR_MODE_TIMEOUT_DEFAULT; |
1495 | struct gk20a_platform *platform = dev_get_drvdata(g->dev); | ||
1494 | 1496 | ||
1495 | gk20a_dbg_fn(""); | 1497 | gk20a_dbg_fn(""); |
1496 | 1498 | ||
@@ -1502,7 +1504,7 @@ static int gr_gk20a_init_golden_ctx_image(struct gk20a *g, | |||
1502 | if (gr->ctx_vars.golden_image_initialized) | 1504 | if (gr->ctx_vars.golden_image_initialized) |
1503 | goto clean_up; | 1505 | goto clean_up; |
1504 | 1506 | ||
1505 | if (!tegra_platform_is_linsim()) { | 1507 | if (!platform->is_fmodel) { |
1506 | gk20a_writel(g, gr_fe_pwr_mode_r(), | 1508 | gk20a_writel(g, gr_fe_pwr_mode_r(), |
1507 | gr_fe_pwr_mode_req_send_f() | gr_fe_pwr_mode_mode_force_on_f()); | 1509 | gr_fe_pwr_mode_req_send_f() | gr_fe_pwr_mode_mode_force_on_f()); |
1508 | do { | 1510 | do { |
@@ -1542,7 +1544,7 @@ static int gr_gk20a_init_golden_ctx_image(struct gk20a *g, | |||
1542 | gk20a_readl(g, gr_fecs_ctxsw_reset_ctl_r()); | 1544 | gk20a_readl(g, gr_fecs_ctxsw_reset_ctl_r()); |
1543 | udelay(10); | 1545 | udelay(10); |
1544 | 1546 | ||
1545 | if (!tegra_platform_is_linsim()) { | 1547 | if (!platform->is_fmodel) { |
1546 | gk20a_writel(g, gr_fe_pwr_mode_r(), | 1548 | gk20a_writel(g, gr_fe_pwr_mode_r(), |
1547 | gr_fe_pwr_mode_req_send_f() | gr_fe_pwr_mode_mode_auto_f()); | 1549 | gr_fe_pwr_mode_req_send_f() | gr_fe_pwr_mode_mode_auto_f()); |
1548 | 1550 | ||
@@ -1903,6 +1905,7 @@ int gr_gk20a_load_golden_ctx_image(struct gk20a *g, | |||
1903 | u32 v, data; | 1905 | u32 v, data; |
1904 | int ret = 0; | 1906 | int ret = 0; |
1905 | struct mem_desc *mem = &ch_ctx->gr_ctx->mem; | 1907 | struct mem_desc *mem = &ch_ctx->gr_ctx->mem; |
1908 | struct gk20a_platform *platform = dev_get_drvdata(g->dev); | ||
1906 | 1909 | ||
1907 | gk20a_dbg_fn(""); | 1910 | gk20a_dbg_fn(""); |
1908 | 1911 | ||
@@ -1990,7 +1993,7 @@ int gr_gk20a_load_golden_ctx_image(struct gk20a *g, | |||
1990 | 1993 | ||
1991 | gk20a_mem_end(g, mem); | 1994 | gk20a_mem_end(g, mem); |
1992 | 1995 | ||
1993 | if (tegra_platform_is_linsim()) { | 1996 | if (platform->is_fmodel) { |
1994 | u32 mdata = fecs_current_ctx_data(g, &c->inst_block); | 1997 | u32 mdata = fecs_current_ctx_data(g, &c->inst_block); |
1995 | 1998 | ||
1996 | ret = gr_gk20a_submit_fecs_method_op(g, | 1999 | ret = gr_gk20a_submit_fecs_method_op(g, |
@@ -2416,10 +2419,11 @@ static void gr_gk20a_load_falcon_with_bootloader(struct gk20a *g) | |||
2416 | int gr_gk20a_load_ctxsw_ucode(struct gk20a *g) | 2419 | int gr_gk20a_load_ctxsw_ucode(struct gk20a *g) |
2417 | { | 2420 | { |
2418 | int err; | 2421 | int err; |
2422 | struct gk20a_platform *platform = dev_get_drvdata(g->dev); | ||
2419 | 2423 | ||
2420 | gk20a_dbg_fn(""); | 2424 | gk20a_dbg_fn(""); |
2421 | 2425 | ||
2422 | if (tegra_platform_is_linsim()) { | 2426 | if (platform->is_fmodel) { |
2423 | gk20a_writel(g, gr_fecs_ctxsw_mailbox_r(7), | 2427 | gk20a_writel(g, gr_fecs_ctxsw_mailbox_r(7), |
2424 | gr_fecs_ctxsw_mailbox_value_f(0xc0de7777)); | 2428 | gr_fecs_ctxsw_mailbox_value_f(0xc0de7777)); |
2425 | gk20a_writel(g, gr_gpccs_ctxsw_mailbox_r(7), | 2429 | gk20a_writel(g, gr_gpccs_ctxsw_mailbox_r(7), |
@@ -4211,6 +4215,7 @@ void gr_gk20a_init_blcg_mode(struct gk20a *g, u32 mode, u32 engine) | |||
4211 | void gr_gk20a_init_elcg_mode(struct gk20a *g, u32 mode, u32 engine) | 4215 | void gr_gk20a_init_elcg_mode(struct gk20a *g, u32 mode, u32 engine) |
4212 | { | 4216 | { |
4213 | u32 gate_ctrl, idle_filter; | 4217 | u32 gate_ctrl, idle_filter; |
4218 | struct gk20a_platform *platform = dev_get_drvdata(g->dev); | ||
4214 | 4219 | ||
4215 | gate_ctrl = gk20a_readl(g, therm_gate_ctrl_r(engine)); | 4220 | gate_ctrl = gk20a_readl(g, therm_gate_ctrl_r(engine)); |
4216 | 4221 | ||
@@ -4239,7 +4244,7 @@ void gr_gk20a_init_elcg_mode(struct gk20a *g, u32 mode, u32 engine) | |||
4239 | "invalid elcg mode %d", mode); | 4244 | "invalid elcg mode %d", mode); |
4240 | } | 4245 | } |
4241 | 4246 | ||
4242 | if (tegra_platform_is_linsim()) { | 4247 | if (platform->is_fmodel) { |
4243 | gate_ctrl = set_field(gate_ctrl, | 4248 | gate_ctrl = set_field(gate_ctrl, |
4244 | therm_gate_ctrl_eng_delay_after_m(), | 4249 | therm_gate_ctrl_eng_delay_after_m(), |
4245 | therm_gate_ctrl_eng_delay_after_f(4)); | 4250 | therm_gate_ctrl_eng_delay_after_f(4)); |