summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/common/clock_gating/gv11b_gating_reglist.c
diff options
context:
space:
mode:
authorDeepak Nibade <dnibade@nvidia.com>2019-07-09 05:42:32 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2019-11-04 09:10:39 -0500
commit0ffc5fa5e44c623b6fde3d6bed5369b9674ee089 (patch)
tree5fcf39cd05d2128dd05837c36bdd89a24f4ac631 /drivers/gpu/nvgpu/common/clock_gating/gv11b_gating_reglist.c
parentaa43252d1a60db5d317a71787e2aee3b0d7cb8a8 (diff)
gpu: nvgpu: add clock gating support for HSHUB
Add BLCG and SLCG clock gating support for HSHUB unit on gv11b Register list for BLCG and SLCG is auto generated with scripts. Add HAL operations to enable/disable HSHUB clock gating Re-generate gv11b reglist so that all the manually commented registers are automatically deleted. Some of the unicast registers are also deleted. We already have corresponding broadcast registers present. Cherry-pick/manually port from dev-main Bug 2526212 Change-Id: I2654f158daa802bcf992e103ed4a44675aa5fd4d Signed-off-by: Deepak Nibade <dnibade@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/2150199 (cherry picked from commit e34b6f76d38ad5641c1ed7c3a4b36752d9dd4750) Reviewed-on: https://git-master.nvidia.com/r/2224708 Reviewed-by: Seshendra Gadagottu <sgadagottu@nvidia.com> GVS: Gerrit_Virtual_Submit Tested-by: Peter Daifuku <pdaifuku@nvidia.com> Reviewed-by: Luis Dib <ldib@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/common/clock_gating/gv11b_gating_reglist.c')
-rw-r--r--drivers/gpu/nvgpu/common/clock_gating/gv11b_gating_reglist.c67
1 files changed, 47 insertions, 20 deletions
diff --git a/drivers/gpu/nvgpu/common/clock_gating/gv11b_gating_reglist.c b/drivers/gpu/nvgpu/common/clock_gating/gv11b_gating_reglist.c
index 418f2c12..57b1443b 100644
--- a/drivers/gpu/nvgpu/common/clock_gating/gv11b_gating_reglist.c
+++ b/drivers/gpu/nvgpu/common/clock_gating/gv11b_gating_reglist.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (c) 2014-2018, NVIDIA CORPORATION. All rights reserved. 2 * Copyright (c) 2014-2019, NVIDIA CORPORATION. All rights reserved.
3 * 3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a 4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"), 5 * copy of this software and associated documentation files (the "Software"),
@@ -43,9 +43,7 @@ static const struct gating_desc gv11b_slcg_ce2[] = {
43 43
44/* slcg chiplet */ 44/* slcg chiplet */
45static const struct gating_desc gv11b_slcg_chiplet[] = { 45static const struct gating_desc gv11b_slcg_chiplet[] = {
46 {.addr = 0x0010c07cU, .prod = 0x00000000U, .disable = 0x00000007U},
47 {.addr = 0x0010e07cU, .prod = 0x00000000U, .disable = 0x00000007U}, 46 {.addr = 0x0010e07cU, .prod = 0x00000000U, .disable = 0x00000007U},
48 {.addr = 0x0010d07cU, .prod = 0x00000000U, .disable = 0x00000007U},
49 {.addr = 0x0010e17cU, .prod = 0x00000000U, .disable = 0x00000007U}, 47 {.addr = 0x0010e17cU, .prod = 0x00000000U, .disable = 0x00000007U},
50}; 48};
51 49
@@ -70,22 +68,15 @@ static const struct gating_desc gv11b_slcg_gr[] = {
70 {.addr = 0x00405864U, .prod = 0x00000000U, .disable = 0x000001feU}, 68 {.addr = 0x00405864U, .prod = 0x00000000U, .disable = 0x000001feU},
71 {.addr = 0x00405910U, .prod = 0xfffffff0U, .disable = 0xfffffffeU}, 69 {.addr = 0x00405910U, .prod = 0xfffffff0U, .disable = 0xfffffffeU},
72 {.addr = 0x00408044U, .prod = 0x00000000U, .disable = 0x000007feU}, 70 {.addr = 0x00408044U, .prod = 0x00000000U, .disable = 0x000007feU},
73 /* fix priv error */
74 /*{.addr = 0x00407004U, .prod = 0x00000000U, .disable = 0x000001feU},*/
75 /*{.addr = 0x00405bf4U, .prod = 0x00000000U, .disable = 0x00000002U},*/
76 {.addr = 0x0041a134U, .prod = 0x00020008U, .disable = 0x0003fffeU}, 71 {.addr = 0x0041a134U, .prod = 0x00020008U, .disable = 0x0003fffeU},
77 {.addr = 0x0041a894U, .prod = 0x00000000U, .disable = 0x0000fffeU}, 72 {.addr = 0x0041a894U, .prod = 0x00000000U, .disable = 0x0000fffeU},
78 {.addr = 0x00418504U, .prod = 0x00000000U, .disable = 0x0007fffeU}, 73 {.addr = 0x00418504U, .prod = 0x00000000U, .disable = 0x0007fffeU},
79 /* fix priv error */
80 /*{.addr = 0x0041860cU, .prod = 0x00000000U, .disable = 0x000001feU},*/
81 {.addr = 0x0041868cU, .prod = 0x00000000U, .disable = 0x0000001eU}, 74 {.addr = 0x0041868cU, .prod = 0x00000000U, .disable = 0x0000001eU},
82 {.addr = 0x0041871cU, .prod = 0x00000000U, .disable = 0x000003feU}, 75 {.addr = 0x0041871cU, .prod = 0x00000000U, .disable = 0x000003feU},
83 {.addr = 0x00418388U, .prod = 0x00000000U, .disable = 0x00000001U}, 76 {.addr = 0x00418388U, .prod = 0x00000000U, .disable = 0x00000001U},
84 {.addr = 0x0041882cU, .prod = 0x00000000U, .disable = 0x0001fffeU}, 77 {.addr = 0x0041882cU, .prod = 0x00000000U, .disable = 0x0001fffeU},
85 {.addr = 0x00418bc0U, .prod = 0x00000000U, .disable = 0x000001feU}, 78 {.addr = 0x00418bc0U, .prod = 0x00000000U, .disable = 0x000001feU},
86 {.addr = 0x00418974U, .prod = 0x00000000U, .disable = 0x0001fffeU}, 79 {.addr = 0x00418974U, .prod = 0x00000000U, .disable = 0x0001fffeU},
87 /* fix priv error */
88 /*{.addr = 0x00418c74U, .prod = 0xffffff80U, .disable = 0xfffffffeU},*/
89 {.addr = 0x00418cf4U, .prod = 0xfffffff8U, .disable = 0xfffffffeU}, 80 {.addr = 0x00418cf4U, .prod = 0xfffffff8U, .disable = 0xfffffffeU},
90 {.addr = 0x00418d74U, .prod = 0xffffffe0U, .disable = 0xfffffffeU}, 81 {.addr = 0x00418d74U, .prod = 0xffffffe0U, .disable = 0xfffffffeU},
91 {.addr = 0x00418f10U, .prod = 0xffffffe0U, .disable = 0xfffffffeU}, 82 {.addr = 0x00418f10U, .prod = 0xffffffe0U, .disable = 0xfffffffeU},
@@ -95,8 +86,6 @@ static const struct gating_desc gv11b_slcg_gr[] = {
95 {.addr = 0x00419d24U, .prod = 0x00000000U, .disable = 0x000000ffU}, 86 {.addr = 0x00419d24U, .prod = 0x00000000U, .disable = 0x000000ffU},
96 {.addr = 0x0041986cU, .prod = 0x00000104U, .disable = 0x00fffffeU}, 87 {.addr = 0x0041986cU, .prod = 0x00000104U, .disable = 0x00fffffeU},
97 {.addr = 0x00419c74U, .prod = 0x0000001eU, .disable = 0x0000001eU}, 88 {.addr = 0x00419c74U, .prod = 0x0000001eU, .disable = 0x0000001eU},
98 /* fix priv error */
99 /*{.addr = 0x00419c84U, .prod = 0x0003fff8U, .disable = 0x0003fffeU},*/
100 {.addr = 0x00419c8cU, .prod = 0xffffff84U, .disable = 0xfffffffeU}, 89 {.addr = 0x00419c8cU, .prod = 0xffffff84U, .disable = 0xfffffffeU},
101 {.addr = 0x00419c94U, .prod = 0x00080040U, .disable = 0x000ffffeU}, 90 {.addr = 0x00419c94U, .prod = 0x00080040U, .disable = 0x000ffffeU},
102 {.addr = 0x00419ca4U, .prod = 0x00003ffeU, .disable = 0x00003ffeU}, 91 {.addr = 0x00419ca4U, .prod = 0x00003ffeU, .disable = 0x00003ffeU},
@@ -110,8 +99,6 @@ static const struct gating_desc gv11b_slcg_gr[] = {
110 {.addr = 0x00419a84U, .prod = 0x0000000cU, .disable = 0x0000000eU}, 99 {.addr = 0x00419a84U, .prod = 0x0000000cU, .disable = 0x0000000eU},
111 {.addr = 0x0041be2cU, .prod = 0x04115fc0U, .disable = 0xfffffffeU}, 100 {.addr = 0x0041be2cU, .prod = 0x04115fc0U, .disable = 0xfffffffeU},
112 {.addr = 0x0041bfecU, .prod = 0xfffffff0U, .disable = 0xfffffffeU}, 101 {.addr = 0x0041bfecU, .prod = 0xfffffff0U, .disable = 0xfffffffeU},
113 /* fix priv error */
114 /*{.addr = 0x0041bed4U, .prod = 0xfffffff8U, .disable = 0xfffffffeU},*/
115 {.addr = 0x00408814U, .prod = 0x00000000U, .disable = 0x0001fffeU}, 102 {.addr = 0x00408814U, .prod = 0x00000000U, .disable = 0x0001fffeU},
116 {.addr = 0x00408a84U, .prod = 0x00000000U, .disable = 0x0001fffeU}, 103 {.addr = 0x00408a84U, .prod = 0x00000000U, .disable = 0x0001fffeU},
117 {.addr = 0x004089acU, .prod = 0x00000000U, .disable = 0x0001fffeU}, 104 {.addr = 0x004089acU, .prod = 0x00000000U, .disable = 0x0001fffeU},
@@ -130,8 +117,6 @@ static const struct gating_desc gv11b_slcg_perf[] = {
130 {.addr = 0x00248018U, .prod = 0xffffffffU, .disable = 0x00000000U}, 117 {.addr = 0x00248018U, .prod = 0xffffffffU, .disable = 0x00000000U},
131 {.addr = 0x00246018U, .prod = 0xffffffffU, .disable = 0x00000000U}, 118 {.addr = 0x00246018U, .prod = 0xffffffffU, .disable = 0x00000000U},
132 {.addr = 0x00246018U, .prod = 0xffffffffU, .disable = 0x00000000U}, 119 {.addr = 0x00246018U, .prod = 0xffffffffU, .disable = 0x00000000U},
133 {.addr = 0x00246018U, .prod = 0xffffffffU, .disable = 0x00000000U},
134 {.addr = 0x00244018U, .prod = 0xffffffffU, .disable = 0x00000000U},
135 {.addr = 0x00244018U, .prod = 0xffffffffU, .disable = 0x00000000U}, 120 {.addr = 0x00244018U, .prod = 0xffffffffU, .disable = 0x00000000U},
136 {.addr = 0x00244018U, .prod = 0xffffffffU, .disable = 0x00000000U}, 121 {.addr = 0x00244018U, .prod = 0xffffffffU, .disable = 0x00000000U},
137 {.addr = 0x0024a124U, .prod = 0x00000001U, .disable = 0x00000000U}, 122 {.addr = 0x0024a124U, .prod = 0x00000001U, .disable = 0x00000000U},
@@ -168,7 +153,13 @@ static const struct gating_desc gv11b_slcg_xbar[] = {
168 {.addr = 0x0013dc08U, .prod = 0x00000000U, .disable = 0xfffffffeU}, 153 {.addr = 0x0013dc08U, .prod = 0x00000000U, .disable = 0xfffffffeU},
169 {.addr = 0x0013c924U, .prod = 0x00000000U, .disable = 0x7ffffffeU}, 154 {.addr = 0x0013c924U, .prod = 0x00000000U, .disable = 0x7ffffffeU},
170 {.addr = 0x0013cbe4U, .prod = 0x00000000U, .disable = 0x1ffffffeU}, 155 {.addr = 0x0013cbe4U, .prod = 0x00000000U, .disable = 0x1ffffffeU},
171 {.addr = 0x0013cc04U, .prod = 0x00000000U, .disable = 0x1ffffffeU}, 156};
157
158/* slcg Hshub */
159static const struct gating_desc gv11b_slcg_hshub[] = {
160 {.addr = 0x001fb3f4U, .prod = 0x00000000U, .disable = 0xfffffffeU},
161 {.addr = 0x001fb7f4U, .prod = 0x00000000U, .disable = 0xfffffffeU},
162 {.addr = 0x001fbbf4U, .prod = 0x00000000U, .disable = 0xfffffffeU},
172}; 163};
173 164
174/* blcg bus */ 165/* blcg bus */
@@ -191,8 +182,6 @@ static const struct gating_desc gv11b_blcg_fb[] = {
191 {.addr = 0x00100d30U, .prod = 0x0000c242U, .disable = 0x00000000U}, 182 {.addr = 0x00100d30U, .prod = 0x0000c242U, .disable = 0x00000000U},
192 {.addr = 0x00100d3cU, .prod = 0x00000242U, .disable = 0x00000000U}, 183 {.addr = 0x00100d3cU, .prod = 0x00000242U, .disable = 0x00000000U},
193 {.addr = 0x00100d48U, .prod = 0x0000c242U, .disable = 0x00000000U}, 184 {.addr = 0x00100d48U, .prod = 0x0000c242U, .disable = 0x00000000U},
194 /* fix priv error */
195 /*{.addr = 0x00100d1cU, .prod = 0x00000042U, .disable = 0x00000000U},*/
196 {.addr = 0x00100c98U, .prod = 0x00004242U, .disable = 0x00000000U}, 185 {.addr = 0x00100c98U, .prod = 0x00004242U, .disable = 0x00000000U},
197}; 186};
198 187
@@ -279,7 +268,13 @@ static const struct gating_desc gv11b_blcg_xbar[] = {
279 {.addr = 0x0013dc04U, .prod = 0x0001004aU, .disable = 0x00000000U}, 268 {.addr = 0x0013dc04U, .prod = 0x0001004aU, .disable = 0x00000000U},
280 {.addr = 0x0013c920U, .prod = 0x0000004aU, .disable = 0x00000000U}, 269 {.addr = 0x0013c920U, .prod = 0x0000004aU, .disable = 0x00000000U},
281 {.addr = 0x0013cbe0U, .prod = 0x00000042U, .disable = 0x00000000U}, 270 {.addr = 0x0013cbe0U, .prod = 0x00000042U, .disable = 0x00000000U},
282 {.addr = 0x0013cc00U, .prod = 0x00000042U, .disable = 0x00000000U}, 271};
272
273/* blcg Hshub */
274static const struct gating_desc gv11b_blcg_hshub[] = {
275 {.addr = 0x001fb3f0U, .prod = 0x0000c242U, .disable = 0x00000000U},
276 {.addr = 0x001fb7f0U, .prod = 0x0000c242U, .disable = 0x00000000U},
277 {.addr = 0x001fbbf0U, .prod = 0x0000c242U, .disable = 0x00000000U},
283}; 278};
284 279
285/* pg gr */ 280/* pg gr */
@@ -502,6 +497,22 @@ void gv11b_slcg_xbar_load_gating_prod(struct gk20a *g,
502 } 497 }
503} 498}
504 499
500void gv11b_slcg_hshub_load_gating_prod(struct gk20a *g,
501 bool prod)
502{
503 u32 i;
504 u32 size = (u32)(sizeof(gv11b_slcg_hshub) / GATING_DESC_SIZE);
505
506 if (nvgpu_is_enabled(g, NVGPU_GPU_CAN_SLCG)) {
507 for (i = 0; i < size; i++) {
508 u32 reg = gv11b_slcg_hshub[i].addr;
509 u32 val = prod ? gv11b_slcg_hshub[i].prod :
510 gv11b_slcg_hshub[i].disable;
511 gk20a_writel(g, reg, val);
512 }
513 }
514}
515
505void gv11b_blcg_bus_load_gating_prod(struct gk20a *g, 516void gv11b_blcg_bus_load_gating_prod(struct gk20a *g,
506 bool prod) 517 bool prod)
507{ 518{
@@ -662,6 +673,22 @@ void gv11b_blcg_xbar_load_gating_prod(struct gk20a *g,
662 } 673 }
663} 674}
664 675
676void gv11b_blcg_hshub_load_gating_prod(struct gk20a *g,
677 bool prod)
678{
679 u32 i;
680 u32 size = (u32)(sizeof(gv11b_blcg_hshub) / GATING_DESC_SIZE);
681
682 if (nvgpu_is_enabled(g, NVGPU_GPU_CAN_BLCG)) {
683 for (i = 0; i < size; i++) {
684 u32 reg = gv11b_blcg_hshub[i].addr;
685 u32 val = prod ? gv11b_blcg_hshub[i].prod :
686 gv11b_blcg_hshub[i].disable;
687 gk20a_writel(g, reg, val);
688 }
689 }
690}
691
665void gr_gv11b_pg_gr_load_gating_prod(struct gk20a *g, 692void gr_gv11b_pg_gr_load_gating_prod(struct gk20a *g,
666 bool prod) 693 bool prod)
667{ 694{