summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gv11b/fifo_gv11b.c
diff options
context:
space:
mode:
authorSeema Khowala <seemaj@nvidia.com>2017-03-21 13:00:44 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-03-28 12:39:13 -0400
commit1bce980d09995947ff59b6d7f39cfaff51a70c74 (patch)
tree4d0ad1e516ac800c9edb6bfdb8d6844a6b1d2180 /drivers/gpu/nvgpu/gv11b/fifo_gv11b.c
parentb076c349b26a471776b8c487a702f791e13fb3a4 (diff)
gpu: nvgpu: gv11b: init and implement reset_enable_hw
-implement gv11b specific reset_enable_hw fifo ops -timeout period in fifo_fb_timeout_r() is set to init instead of max This register specifies the number of microseconds Host should wait for a response from FB before initiating a timeout interrupt. For bringup, this value should be set to a lower value than usual, such as ~.5 milliseconds (500), to help find out bugs in the memory subsystem. -timeout period in pbdma_timeout_r() is set to init instead of max This register contains a value used for detecting timeouts. The timeout value is in microsecond ticks. The timeouts that use this value are: GPfifo fetch timeouts to FB for acks, reqs, rdats. PBDMA connection to LB. GPfifo processor timeouts to FB for acks, reqs, rdats. Method processor timeouts to FB for acks, reqs, rdats. The init value is changed to 64K us based on bug 1816557. JIRA GPUT19X-74 JIRA GPUT19X-47 Change-Id: I6f818e129c3ea67571d206c5e735607cbfcf6ec6 Signed-off-by: Seema Khowala <seemaj@nvidia.com> Reviewed-on: http://git-master/r/1325352 Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gv11b/fifo_gv11b.c')
-rw-r--r--drivers/gpu/nvgpu/gv11b/fifo_gv11b.c88
1 files changed, 88 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gv11b/fifo_gv11b.c b/drivers/gpu/nvgpu/gv11b/fifo_gv11b.c
index 1bbf09ec..bb9def35 100644
--- a/drivers/gpu/nvgpu/gv11b/fifo_gv11b.c
+++ b/drivers/gpu/nvgpu/gv11b/fifo_gv11b.c
@@ -29,6 +29,7 @@
29#include <nvgpu/hw/gv11b/hw_usermode_gv11b.h> 29#include <nvgpu/hw/gv11b/hw_usermode_gv11b.h>
30#include <nvgpu/hw/gv11b/hw_top_gv11b.h> 30#include <nvgpu/hw/gv11b/hw_top_gv11b.h>
31#include <nvgpu/hw/gv11b/hw_gmmu_gv11b.h> 31#include <nvgpu/hw/gv11b/hw_gmmu_gv11b.h>
32#include <nvgpu/hw/gv11b/hw_mc_gv11b.h>
32 33
33#include "fifo_gv11b.h" 34#include "fifo_gv11b.h"
34#include "subctx_gv11b.h" 35#include "subctx_gv11b.h"
@@ -684,6 +685,92 @@ static void gv11b_fifo_init_pbdma_intr_descs(struct fifo_gk20a *f)
684 pbdma_intr_0_device_pending_f(); 685 pbdma_intr_0_device_pending_f();
685} 686}
686 687
688static u32 gv11b_fifo_intr_0_en_mask(struct gk20a *g)
689{
690 u32 intr_0_en_mask;
691
692 intr_0_en_mask = g->ops.fifo.intr_0_error_mask(g);
693
694 intr_0_en_mask |= fifo_intr_0_runlist_event_pending_f() |
695 fifo_intr_0_pbdma_intr_pending_f();
696
697 return intr_0_en_mask;
698}
699
700int gv11b_init_fifo_reset_enable_hw(struct gk20a *g)
701{
702 u32 intr_stall;
703 u32 mask;
704 u32 timeout;
705 unsigned int i;
706 u32 host_num_pbdma = nvgpu_get_litter_value(g, GPU_LIT_HOST_NUM_PBDMA);
707
708 gk20a_dbg_fn("");
709
710 /* enable pmc pfifo */
711 g->ops.mc.reset(g, mc_enable_pfifo_enabled_f());
712
713 if (g->ops.clock_gating.slcg_ce2_load_gating_prod)
714 g->ops.clock_gating.slcg_ce2_load_gating_prod(g,
715 g->slcg_enabled);
716 if (g->ops.clock_gating.slcg_fifo_load_gating_prod)
717 g->ops.clock_gating.slcg_fifo_load_gating_prod(g,
718 g->slcg_enabled);
719 if (g->ops.clock_gating.blcg_fifo_load_gating_prod)
720 g->ops.clock_gating.blcg_fifo_load_gating_prod(g,
721 g->blcg_enabled);
722
723 /* enable pbdma */
724 mask = 0;
725 for (i = 0; i < host_num_pbdma; ++i)
726 mask |= mc_enable_pb_sel_f(mc_enable_pb_0_enabled_v(), i);
727 gk20a_writel(g, mc_enable_pb_r(), mask);
728
729
730 timeout = gk20a_readl(g, fifo_fb_timeout_r());
731 timeout = set_field(timeout, fifo_fb_timeout_period_m(),
732 fifo_fb_timeout_period_init_f());
733 gk20a_dbg_info("fifo_fb_timeout reg val = 0x%08x", timeout);
734 gk20a_writel(g, fifo_fb_timeout_r(), timeout);
735
736 /* write pbdma timeout value */
737 for (i = 0; i < host_num_pbdma; i++) {
738 timeout = gk20a_readl(g, pbdma_timeout_r(i));
739 timeout = set_field(timeout, pbdma_timeout_period_m(),
740 pbdma_timeout_period_init_f());
741 gk20a_dbg_info("pbdma_timeout reg val = 0x%08x", timeout);
742 gk20a_writel(g, pbdma_timeout_r(i), timeout);
743 }
744 /* clear and enable pbdma interrupt */
745 for (i = 0; i < host_num_pbdma; i++) {
746 gk20a_writel(g, pbdma_intr_0_r(i), 0xFFFFFFFF);
747 gk20a_writel(g, pbdma_intr_1_r(i), 0xFFFFFFFF);
748
749 intr_stall = gk20a_readl(g, pbdma_intr_stall_r(i));
750 gk20a_dbg_info("pbdma id:%u, intr_en_0 0x%08x", i, intr_stall);
751 gk20a_writel(g, pbdma_intr_en_0_r(i), intr_stall);
752
753 intr_stall = gk20a_readl(g, pbdma_intr_stall_1_r(i));
754 gk20a_dbg_info("pbdma id:%u, intr_en_1 0x%08x", i, intr_stall);
755 gk20a_writel(g, pbdma_intr_en_1_r(i), intr_stall);
756 }
757
758 /* clear runlist interrupts */
759 gk20a_writel(g, fifo_intr_runlist_r(), ~0);
760
761 /* clear and enable pfifo interrupt */
762 gk20a_writel(g, fifo_intr_0_r(), 0xFFFFFFFF);
763 mask = gv11b_fifo_intr_0_en_mask(g);
764 gk20a_dbg_info("fifo_intr_en_0 0x%08x", mask);
765 gk20a_writel(g, fifo_intr_en_0_r(), mask);
766 gk20a_dbg_info("fifo_intr_en_1 = 0x80000000");
767 gk20a_writel(g, fifo_intr_en_1_r(), 0x80000000);
768
769 gk20a_dbg_fn("done");
770
771 return 0;
772}
773
687void gv11b_init_fifo(struct gpu_ops *gops) 774void gv11b_init_fifo(struct gpu_ops *gops)
688{ 775{
689 gp10b_init_fifo(gops); 776 gp10b_init_fifo(gops);
@@ -712,4 +799,5 @@ void gv11b_init_fifo(struct gpu_ops *gops)
712 gops->fifo.is_preempt_pending = gv11b_fifo_is_preempt_pending; 799 gops->fifo.is_preempt_pending = gv11b_fifo_is_preempt_pending;
713 gops->fifo.preempt_ch_tsg = gv11b_fifo_preempt_ch_tsg; 800 gops->fifo.preempt_ch_tsg = gv11b_fifo_preempt_ch_tsg;
714 gops->fifo.init_pbdma_intr_descs = gv11b_fifo_init_pbdma_intr_descs; 801 gops->fifo.init_pbdma_intr_descs = gv11b_fifo_init_pbdma_intr_descs;
802 gops->fifo.reset_enable_hw = gv11b_init_fifo_reset_enable_hw;
715} 803}