summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2018-01-29 11:40:24 -0500
committermobile promotions <svcmobile_promotions@nvidia.com>2018-01-31 15:37:28 -0500
commitcb9f8bae1aeacf9da0d5fea2da36baa43e9a586b (patch)
tree51dfd30eb00d52354dc533fb780bbf80808582fd
parent6e5a3451d4cf4f28d1eb9086d46f32210df85986 (diff)
gpu: nvgpu: Unify querying stream id
Stream ID for gp10b is retrieved directly from DT headers in common code. Introduce instead a variable to store the stream ID and move the query to platform_gp10b_tegra.c. JIRA NVGPU-4 Change-Id: I123024e13e470283bb691883f8f963eb72c997d8 Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1648013 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
-rw-r--r--drivers/gpu/nvgpu/common/linux/driver_common.c8
-rw-r--r--drivers/gpu/nvgpu/common/linux/platform_gk20a.h3
-rw-r--r--drivers/gpu/nvgpu/common/linux/platform_gp10b_tegra.c4
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a.h1
-rw-r--r--drivers/gpu/nvgpu/gp10b/ltc_gp10b.c4
5 files changed, 17 insertions, 3 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/driver_common.c b/drivers/gpu/nvgpu/common/linux/driver_common.c
index f2373e00..b90574e0 100644
--- a/drivers/gpu/nvgpu/common/linux/driver_common.c
+++ b/drivers/gpu/nvgpu/common/linux/driver_common.c
@@ -170,6 +170,13 @@ static void nvgpu_init_vbios_vars(struct gk20a *g)
170 g->vbios_min_version = platform->vbios_min_version; 170 g->vbios_min_version = platform->vbios_min_version;
171} 171}
172 172
173static void nvgpu_init_ltc_vars(struct gk20a *g)
174{
175 struct gk20a_platform *platform = dev_get_drvdata(dev_from_gk20a(g));
176
177 g->ltc_streamid = platform->ltc_streamid;
178}
179
173static void nvgpu_init_mm_vars(struct gk20a *g) 180static void nvgpu_init_mm_vars(struct gk20a *g)
174{ 181{
175 struct gk20a_platform *platform = dev_get_drvdata(dev_from_gk20a(g)); 182 struct gk20a_platform *platform = dev_get_drvdata(dev_from_gk20a(g));
@@ -202,6 +209,7 @@ int nvgpu_probe(struct gk20a *g,
202 nvgpu_init_timeslice(g); 209 nvgpu_init_timeslice(g);
203 nvgpu_init_pm_vars(g); 210 nvgpu_init_pm_vars(g);
204 nvgpu_init_vbios_vars(g); 211 nvgpu_init_vbios_vars(g);
212 nvgpu_init_ltc_vars(g);
205 213
206 /* Initialize the platform interface. */ 214 /* Initialize the platform interface. */
207 err = platform->probe(dev); 215 err = platform->probe(dev);
diff --git a/drivers/gpu/nvgpu/common/linux/platform_gk20a.h b/drivers/gpu/nvgpu/common/linux/platform_gk20a.h
index 9325eab7..b0c089e6 100644
--- a/drivers/gpu/nvgpu/common/linux/platform_gk20a.h
+++ b/drivers/gpu/nvgpu/common/linux/platform_gk20a.h
@@ -239,6 +239,9 @@ struct gk20a_platform {
239 u32 ina3221_dcb_index; 239 u32 ina3221_dcb_index;
240 u32 ina3221_i2c_address; 240 u32 ina3221_i2c_address;
241 u32 ina3221_i2c_port; 241 u32 ina3221_i2c_port;
242
243 /* stream id to use */
244 u32 ltc_streamid;
242}; 245};
243 246
244static inline struct gk20a_platform *gk20a_get_platform( 247static inline struct gk20a_platform *gk20a_get_platform(
diff --git a/drivers/gpu/nvgpu/common/linux/platform_gp10b_tegra.c b/drivers/gpu/nvgpu/common/linux/platform_gp10b_tegra.c
index 8a964caf..00cbe48e 100644
--- a/drivers/gpu/nvgpu/common/linux/platform_gp10b_tegra.c
+++ b/drivers/gpu/nvgpu/common/linux/platform_gp10b_tegra.c
@@ -25,6 +25,8 @@
25#include <soc/tegra/tegra_bpmp.h> 25#include <soc/tegra/tegra_bpmp.h>
26#include <soc/tegra/tegra_powergate.h> 26#include <soc/tegra/tegra_powergate.h>
27 27
28#include <dt-bindings/memory/tegra-swgroup.h>
29
28#include <nvgpu/kmem.h> 30#include <nvgpu/kmem.h>
29#include <nvgpu/bug.h> 31#include <nvgpu/bug.h>
30#include <nvgpu/enabled.h> 32#include <nvgpu/enabled.h>
@@ -417,6 +419,8 @@ struct gk20a_platform gp10b_tegra_platform = {
417 .soc_name = "tegra18x", 419 .soc_name = "tegra18x",
418 420
419 .unified_memory = true, 421 .unified_memory = true,
422
423 .ltc_streamid = TEGRA_SID_GPUB,
420}; 424};
421 425
422 426
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h
index f187f730..8bddad11 100644
--- a/drivers/gpu/nvgpu/gk20a/gk20a.h
+++ b/drivers/gpu/nvgpu/gk20a/gk20a.h
@@ -1304,6 +1304,7 @@ struct gk20a {
1304 int irq_nonstall; 1304 int irq_nonstall;
1305 u32 max_ltc_count; 1305 u32 max_ltc_count;
1306 u32 ltc_count; 1306 u32 ltc_count;
1307 u32 ltc_streamid;
1307 1308
1308 struct gk20a_channel_worker { 1309 struct gk20a_channel_worker {
1309 struct nvgpu_thread poll_task; 1310 struct nvgpu_thread poll_task;
diff --git a/drivers/gpu/nvgpu/gp10b/ltc_gp10b.c b/drivers/gpu/nvgpu/gp10b/ltc_gp10b.c
index 7735d1ae..d52a10ad 100644
--- a/drivers/gpu/nvgpu/gp10b/ltc_gp10b.c
+++ b/drivers/gpu/nvgpu/gp10b/ltc_gp10b.c
@@ -24,8 +24,6 @@
24 24
25#include <trace/events/gk20a.h> 25#include <trace/events/gk20a.h>
26 26
27#include <dt-bindings/memory/tegra-swgroup.h>
28
29#include <nvgpu/ltc.h> 27#include <nvgpu/ltc.h>
30#include <nvgpu/log.h> 28#include <nvgpu/log.h>
31#include <nvgpu/enabled.h> 29#include <nvgpu/enabled.h>
@@ -299,7 +297,7 @@ void gp10b_ltc_init_fs_state(struct gk20a *g)
299 gm20b_ltc_init_fs_state(g); 297 gm20b_ltc_init_fs_state(g);
300 298
301 gk20a_writel(g, ltc_ltca_g_axi_pctrl_r(), 299 gk20a_writel(g, ltc_ltca_g_axi_pctrl_r(),
302 ltc_ltca_g_axi_pctrl_user_sid_f(TEGRA_SID_GPUB)); 300 ltc_ltca_g_axi_pctrl_user_sid_f(g->ltc_streamid));
303 301
304 /* Enable ECC interrupts */ 302 /* Enable ECC interrupts */
305 ltc_intr = gk20a_readl(g, ltc_ltcs_ltss_intr_r()); 303 ltc_intr = gk20a_readl(g, ltc_ltcs_ltss_intr_r());