summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDeepak Nibade <dnibade@nvidia.com>2016-09-06 06:43:31 -0400
committerDeepak Nibade <dnibade@nvidia.com>2016-12-27 04:56:19 -0500
commitbb6923908a2873b079ad67d22c9fcb014c00af28 (patch)
tree94a990e130547150ea61d5d476fb14633784984c /drivers
parent5544272474d7b1e3103eed76fbaf91ba7a739345 (diff)
gpu: nvgpu: select target based on aperture
For bar2 and pmu instance blocks, use gk20a_aperture_mask() to select target address (i.e. if address is in sysmem or vidmem) based on aperture Also add target accessors for gr_fecs_new_ctx and gr_fecs_arb_ctx_ptr Jira DNVGPU-22 Change-Id: Ieaa80bd83a4191fe57b7fba6e0f9cdaeb195a077 Signed-off-by: Deepak Nibade <dnibade@nvidia.com> Reviewed-on: http://git-master/r/1216138 (cherry picked from commit 7a9f4175abc5dddf0879215de4637b7b6eb0ab7b) Reviewed-on: http://git-master/r/1219712 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/nvgpu/gp106/hw_gr_gp106.h16
-rw-r--r--drivers/gpu/nvgpu/gp106/sec2_gp106.c8
-rw-r--r--drivers/gpu/nvgpu/gp10b/hw_gr_gp10b.h16
-rw-r--r--drivers/gpu/nvgpu/gp10b/mm_gp10b.c6
4 files changed, 41 insertions, 5 deletions
diff --git a/drivers/gpu/nvgpu/gp106/hw_gr_gp106.h b/drivers/gpu/nvgpu/gp106/hw_gr_gp106.h
index e5e1c527..bb1f9fa9 100644
--- a/drivers/gpu/nvgpu/gp106/hw_gr_gp106.h
+++ b/drivers/gpu/nvgpu/gp106/hw_gr_gp106.h
@@ -1342,6 +1342,14 @@ static inline u32 gr_fecs_new_ctx_target_v(u32 r)
1342{ 1342{
1343 return (r >> 28) & 0x3; 1343 return (r >> 28) & 0x3;
1344} 1344}
1345static inline u32 gr_fecs_new_ctx_target_vid_mem_f(void)
1346{
1347 return 0x0;
1348}
1349static inline u32 gr_fecs_new_ctx_target_sys_mem_ncoh_f(void)
1350{
1351 return 0x30000000;
1352}
1345static inline u32 gr_fecs_new_ctx_valid_s(void) 1353static inline u32 gr_fecs_new_ctx_valid_s(void)
1346{ 1354{
1347 return 1; 1355 return 1;
@@ -1394,6 +1402,14 @@ static inline u32 gr_fecs_arb_ctx_ptr_target_v(u32 r)
1394{ 1402{
1395 return (r >> 28) & 0x3; 1403 return (r >> 28) & 0x3;
1396} 1404}
1405static inline u32 gr_fecs_arb_ctx_ptr_target_vid_mem_f(void)
1406{
1407 return 0x0;
1408}
1409static inline u32 gr_fecs_arb_ctx_ptr_target_sys_mem_ncoh_f(void)
1410{
1411 return 0x30000000;
1412}
1397static inline u32 gr_fecs_arb_ctx_cmd_r(void) 1413static inline u32 gr_fecs_arb_ctx_cmd_r(void)
1398{ 1414{
1399 return 0x00409a10; 1415 return 0x00409a10;
diff --git a/drivers/gpu/nvgpu/gp106/sec2_gp106.c b/drivers/gpu/nvgpu/gp106/sec2_gp106.c
index f8b32f8f..8f34edd1 100644
--- a/drivers/gpu/nvgpu/gp106/sec2_gp106.c
+++ b/drivers/gpu/nvgpu/gp106/sec2_gp106.c
@@ -169,7 +169,9 @@ int bl_bootstrap_sec2(struct pmu_gk20a *pmu,
169 pwr_pmu_new_instblk_ptr_f( 169 pwr_pmu_new_instblk_ptr_f(
170 gk20a_mm_inst_block_addr(g, &mm->pmu.inst_block) >> 12) | 170 gk20a_mm_inst_block_addr(g, &mm->pmu.inst_block) >> 12) |
171 pwr_pmu_new_instblk_valid_f(1) | 171 pwr_pmu_new_instblk_valid_f(1) |
172 pwr_pmu_new_instblk_target_sys_coh_f()); 172 gk20a_aperture_mask(g, &mm->pmu.inst_block,
173 pwr_pmu_new_instblk_target_sys_coh_f(),
174 pwr_pmu_new_instblk_target_fb_f()));
173 175
174 data = gk20a_readl(g, psec_falcon_debug1_r()); 176 data = gk20a_readl(g, psec_falcon_debug1_r());
175 data |= psec_falcon_debug1_ctxsw_mode_m(); 177 data |= psec_falcon_debug1_ctxsw_mode_m();
@@ -313,7 +315,9 @@ void init_pmu_setup_hw1(struct gk20a *g)
313 pwr_pmu_new_instblk_ptr_f( 315 pwr_pmu_new_instblk_ptr_f(
314 gk20a_mm_inst_block_addr(g, &mm->pmu.inst_block) >> 12) | 316 gk20a_mm_inst_block_addr(g, &mm->pmu.inst_block) >> 12) |
315 pwr_pmu_new_instblk_valid_f(1) | 317 pwr_pmu_new_instblk_valid_f(1) |
316 pwr_pmu_new_instblk_target_sys_coh_f()); 318 gk20a_aperture_mask(g, &mm->pmu.inst_block,
319 pwr_pmu_new_instblk_target_sys_coh_f(),
320 pwr_pmu_new_instblk_target_fb_f()));
317 321
318 /*Copying pmu cmdline args*/ 322 /*Copying pmu cmdline args*/
319 g->ops.pmu_ver.set_pmu_cmdline_args_cpu_freq(pmu, 323 g->ops.pmu_ver.set_pmu_cmdline_args_cpu_freq(pmu,
diff --git a/drivers/gpu/nvgpu/gp10b/hw_gr_gp10b.h b/drivers/gpu/nvgpu/gp10b/hw_gr_gp10b.h
index 00f2ac5e..9e3137e7 100644
--- a/drivers/gpu/nvgpu/gp10b/hw_gr_gp10b.h
+++ b/drivers/gpu/nvgpu/gp10b/hw_gr_gp10b.h
@@ -1414,6 +1414,14 @@ static inline u32 gr_fecs_new_ctx_target_v(u32 r)
1414{ 1414{
1415 return (r >> 28) & 0x3; 1415 return (r >> 28) & 0x3;
1416} 1416}
1417static inline u32 gr_fecs_new_ctx_target_vid_mem_f(void)
1418{
1419 return 0x0;
1420}
1421static inline u32 gr_fecs_new_ctx_target_sys_mem_ncoh_f(void)
1422{
1423 return 0x30000000;
1424}
1417static inline u32 gr_fecs_new_ctx_valid_s(void) 1425static inline u32 gr_fecs_new_ctx_valid_s(void)
1418{ 1426{
1419 return 1; 1427 return 1;
@@ -1466,6 +1474,14 @@ static inline u32 gr_fecs_arb_ctx_ptr_target_v(u32 r)
1466{ 1474{
1467 return (r >> 28) & 0x3; 1475 return (r >> 28) & 0x3;
1468} 1476}
1477static inline u32 gr_fecs_arb_ctx_ptr_target_vid_mem_f(void)
1478{
1479 return 0x0;
1480}
1481static inline u32 gr_fecs_arb_ctx_ptr_target_sys_mem_ncoh_f(void)
1482{
1483 return 0x30000000;
1484}
1469static inline u32 gr_fecs_arb_ctx_cmd_r(void) 1485static inline u32 gr_fecs_arb_ctx_cmd_r(void)
1470{ 1486{
1471 return 0x00409a10; 1487 return 0x00409a10;
diff --git a/drivers/gpu/nvgpu/gp10b/mm_gp10b.c b/drivers/gpu/nvgpu/gp10b/mm_gp10b.c
index c9da4c93..048a4662 100644
--- a/drivers/gpu/nvgpu/gp10b/mm_gp10b.c
+++ b/drivers/gpu/nvgpu/gp10b/mm_gp10b.c
@@ -105,9 +105,9 @@ static int gb10b_init_bar2_mm_hw_setup(struct gk20a *g)
105 gk20a_dbg_info("bar2 inst block ptr: 0x%08x", (u32)inst_pa); 105 gk20a_dbg_info("bar2 inst block ptr: 0x%08x", (u32)inst_pa);
106 106
107 gk20a_writel(g, bus_bar2_block_r(), 107 gk20a_writel(g, bus_bar2_block_r(),
108 (g->mm.vidmem_is_vidmem ? 108 gk20a_aperture_mask(g, inst_block,
109 bus_bar2_block_target_sys_mem_ncoh_f() : 109 bus_bar2_block_target_sys_mem_ncoh_f(),
110 bus_bar2_block_target_vid_mem_f()) | 110 bus_bar2_block_target_vid_mem_f()) |
111 bus_bar2_block_mode_virtual_f() | 111 bus_bar2_block_mode_virtual_f() |
112 bus_bar2_block_ptr_f(inst_pa)); 112 bus_bar2_block_ptr_f(inst_pa));
113 113