From 55a5c57bc1fd532cc6d041fdfb70d90286894b35 Mon Sep 17 00:00:00 2001 From: Seshendra Gadagottu Date: Thu, 7 Apr 2016 16:57:18 -0700 Subject: gpu: nvgpu: gv11b: added initial source code Bug 1735757 Change-Id: Iea7488551a437afa0dfc005c87ad1b9ab9673b6c Signed-off-by: Seshendra Gadagottu Reviewed-on: http://git-master/r/1122123 GVS: Gerrit_Virtual_Submit Reviewed-by: Ken Adams --- drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c | 149 +++++++++++++++++++++++++ 1 file changed, 149 insertions(+) create mode 100644 drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c (limited to 'drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c') diff --git a/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c b/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c new file mode 100644 index 00000000..322bebc8 --- /dev/null +++ b/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c @@ -0,0 +1,149 @@ +/* + * GV11B Tegra Platform Interface + * + * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "gk20a/platform_gk20a.h" +#include "gk20a/gk20a.h" +#include "platform_tegra.h" +#include "gr_gv11b.h" +#include "hw_gr_gv11b.h" + +/* + * gv11b_tegra_get_clocks() + * + * This function finds clocks in tegra platform and populates + * the clock information to gv11b platform data. + */ + +static int gv11b_tegra_get_clocks(struct device *dev) +{ + /* TODO */ + return 0; +} + +static int gv11b_tegra_probe(struct device *dev) +{ + struct gk20a_platform *platform = dev_get_drvdata(dev); + struct device_node *np = dev->of_node; + struct device_node *host1x_node; + struct platform_device *host1x_pdev; + const __be32 *host1x_ptr; + + host1x_ptr = of_get_property(np, "nvidia,host1x", NULL); + if (!host1x_ptr) { + gk20a_err(dev, "host1x device not available"); + return -ENOSYS; + } + + host1x_node = of_find_node_by_phandle(be32_to_cpup(host1x_ptr)); + host1x_pdev = of_find_device_by_node(host1x_node); + if (!host1x_pdev) { + gk20a_err(dev, "host1x device not available"); + return -ENOSYS; + } + + platform->g->host1x_dev = host1x_pdev; + platform->bypass_smmu = !device_is_iommuable(dev); + platform->disable_bigpage = platform->bypass_smmu; + + platform->g->gr.t18x.ctx_vars.dump_ctxsw_stats_on_channel_close + = false; + platform->g->gr.t18x.ctx_vars.dump_ctxsw_stats_on_channel_close + = false; + + platform->g->gr.t18x.ctx_vars.force_preemption_gfxp = false; + platform->g->gr.t18x.ctx_vars.force_preemption_cilp = false; + + + gv11b_tegra_get_clocks(dev); + + return 0; +} + +static int gv11b_tegra_late_probe(struct device *dev) +{ + /* Make gk20a power domain a subdomain of host1x */ + nvhost_register_client_domain(dev_to_genpd(dev)); + return 0; +} + +static int gv11b_tegra_remove(struct device *dev) +{ + /* remove gk20a power subdomain from host1x */ + nvhost_unregister_client_domain(dev_to_genpd(dev)); + + return 0; + +} + +static bool gv11b_tegra_is_railgated(struct device *dev) +{ + bool ret = false; + + return ret; +} + +static int gv11b_tegra_railgate(struct device *dev) +{ + return 0; +} + +static int gv11b_tegra_unrailgate(struct device *dev) +{ + int ret = 0; + return ret; +} + +static int gv11b_tegra_suspend(struct device *dev) +{ + return 0; +} + +struct gk20a_platform t19x_gpu_tegra_platform = { + .has_syncpoints = false, + + /* power management configuration */ + + /* ptimer src frequency in hz*/ + .ptimer_src_freq = 31250000, + + .probe = gv11b_tegra_probe, + .late_probe = gv11b_tegra_late_probe, + .remove = gv11b_tegra_remove, + + /* power management callbacks */ + .suspend = gv11b_tegra_suspend, + .railgate = gv11b_tegra_railgate, + .unrailgate = gv11b_tegra_unrailgate, + .is_railgated = gv11b_tegra_is_railgated, + + .busy = gk20a_tegra_busy, + .idle = gk20a_tegra_idle, + + .dump_platform_dependencies = gk20a_tegra_debug_dump, + + .default_big_page_size = SZ_64K, + +}; -- cgit v1.2.2 From e19ee13cc77c4770fabc6917b421f24cdaefec8c Mon Sep 17 00:00:00 2001 From: Seshendra Gadagottu Date: Tue, 19 Apr 2016 14:03:52 -0700 Subject: gpu: nvgpu: gv11b: set soc memory aperture type For gv11b, set platform data for soc memory aperture type to sysmem instead of vidmem. Bug 1749338 Change-Id: I6632e79e3ca68c437e5b04f6865f8f0b6f2943ce Signed-off-by: Seshendra Gadagottu Reviewed-on: http://git-master/r/1129169 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Ken Adams --- drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c') diff --git a/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c b/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c index 322bebc8..37b49106 100644 --- a/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c +++ b/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c @@ -76,6 +76,8 @@ static int gv11b_tegra_probe(struct device *dev) platform->g->gr.t18x.ctx_vars.force_preemption_gfxp = false; platform->g->gr.t18x.ctx_vars.force_preemption_cilp = false; + /* soc memory accessed as system memory aperture */ + platform->g->mm.vidmem_is_vidmem = platform->vidmem_is_vidmem; gv11b_tegra_get_clocks(dev); @@ -146,4 +148,8 @@ struct gk20a_platform t19x_gpu_tegra_platform = { .default_big_page_size = SZ_64K, + .soc_name = "tegra19x", + + .vidmem_is_vidmem = true, + }; -- cgit v1.2.2 From b551c5effb6bb47ee21c04d9a78b195c201e92bd Mon Sep 17 00:00:00 2001 From: Lakshmanan M Date: Wed, 29 Jun 2016 16:16:31 +0530 Subject: gpu: nvgpu: Add control flag to allow kernel to create privileged CE channels Added control flag for nvgpu infra to allow kernel to create privileged CE channels for page migration and clearing support between sysmem and videmem. JIRA DNVGPU-53 Change-Id: I2d1faf034e194b7a850ac33aec4f6c315c7e552b Signed-off-by: Lakshmanan M Reviewed-on: http://git-master/r/1173093 GVS: Gerrit_Virtual_Submit Reviewed-by: Vijayakumar Subbu --- drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c') diff --git a/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c b/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c index 37b49106..d9754a81 100644 --- a/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c +++ b/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c @@ -148,6 +148,8 @@ struct gk20a_platform t19x_gpu_tegra_platform = { .default_big_page_size = SZ_64K, + .has_ce = true, + .soc_name = "tegra19x", .vidmem_is_vidmem = true, -- cgit v1.2.2 From da1695ae5c1319e19afe8e7890b51de67ec8c052 Mon Sep 17 00:00:00 2001 From: seshendra Gadagottu Date: Wed, 13 Jul 2016 18:29:17 -0700 Subject: gpu: nvgpu: gv11b: avoid host1x device dependency gpu is completely out from host1x block and no need to create device nodes under host1x. Bug 1735760 Change-Id: I2df861b07b38ce6931a86a928184ad164095948a Signed-off-by: seshendra Gadagottu Reviewed-on: http://git-master/r/1181063 GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom --- drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) (limited to 'drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c') diff --git a/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c b/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c index d9754a81..1f36e59c 100644 --- a/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c +++ b/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c @@ -46,25 +46,7 @@ static int gv11b_tegra_get_clocks(struct device *dev) static int gv11b_tegra_probe(struct device *dev) { struct gk20a_platform *platform = dev_get_drvdata(dev); - struct device_node *np = dev->of_node; - struct device_node *host1x_node; - struct platform_device *host1x_pdev; - const __be32 *host1x_ptr; - - host1x_ptr = of_get_property(np, "nvidia,host1x", NULL); - if (!host1x_ptr) { - gk20a_err(dev, "host1x device not available"); - return -ENOSYS; - } - - host1x_node = of_find_node_by_phandle(be32_to_cpup(host1x_ptr)); - host1x_pdev = of_find_device_by_node(host1x_node); - if (!host1x_pdev) { - gk20a_err(dev, "host1x device not available"); - return -ENOSYS; - } - - platform->g->host1x_dev = host1x_pdev; + platform->bypass_smmu = !device_is_iommuable(dev); platform->disable_bigpage = platform->bypass_smmu; -- cgit v1.2.2 From 4b09997772f406d16945016ff4581c7c992faeab Mon Sep 17 00:00:00 2001 From: Alex Waterman Date: Thu, 12 Jan 2017 13:01:36 -0800 Subject: nvgpu: gpu: HW header update for Volta Similar HW header update as has been done for all the other chips. HW header files are located under: drivers/gpu/nvgpu/include/nvgpu/hw/gv11b/ And can be included like so: #include Bug 1799159 Change-Id: If39bd71480a34f85bf25f4c36aec0f8f6de4dc9f Signed-off-by: Alex Waterman Reviewed-on: http://git-master/r/1284433 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c') diff --git a/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c b/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c index 1f36e59c..8fd6583e 100644 --- a/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c +++ b/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c @@ -1,7 +1,7 @@ /* * GV11B Tegra Platform Interface * - * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -18,17 +18,19 @@ #include #include #include -#include #include #include #include #include #include + +#include + #include "gk20a/platform_gk20a.h" #include "gk20a/gk20a.h" #include "platform_tegra.h" + #include "gr_gv11b.h" -#include "hw_gr_gv11b.h" /* * gv11b_tegra_get_clocks() -- cgit v1.2.2 From a04aa3e3f014bcd4bdfd7c7f10fc0ec53ffede0a Mon Sep 17 00:00:00 2001 From: Laxman Dewangan Date: Tue, 7 Feb 2017 18:52:01 +0530 Subject: nvgpu: gpu: gv11b: Remove inclusion of unused header The driver file includes but does not use anything from this header. Remove this unnecessarily inclusion of header file. bug 200257351 Change-Id: Ibbc3c382c31a8c566ed4018fd36d1ffed08bf29e Signed-off-by: Laxman Dewangan Reviewed-on: http://git-master/r/1300556 Reviewed-by: svccoveritychecker Reviewed-by: Terje Bergstrom GVS: Gerrit_Virtual_Submit --- drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c | 1 - 1 file changed, 1 deletion(-) (limited to 'drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c') diff --git a/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c b/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c index 8fd6583e..3afd751a 100644 --- a/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c +++ b/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c @@ -16,7 +16,6 @@ #include #include #include -#include #include #include #include -- cgit v1.2.2 From ed7b35ef60b38818e3d4d40869fe22c41ca80054 Mon Sep 17 00:00:00 2001 From: Seema Khowala Date: Tue, 31 Jan 2017 13:35:37 -0800 Subject: gpu: nvgpu: gv11b : init gpu clocks gp10b_tegra_get_clocks called from gv11b_tegra_probe. Also gv11b_tegra_probe is called from nvgpu_probe via function ptr platform->probe JIRA GV11B-34 Change-Id: I782286e191eef84ce41bc65440fbe5ae00995af3 Signed-off-by: Seema Khowala Reviewed-on: http://git-master/r/1296840 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) (limited to 'drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c') diff --git a/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c b/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c index 3afd751a..e50a8add 100644 --- a/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c +++ b/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c @@ -27,22 +27,12 @@ #include "gk20a/platform_gk20a.h" #include "gk20a/gk20a.h" -#include "platform_tegra.h" -#include "gr_gv11b.h" +#include "gp10b/platform_gp10b.h" -/* - * gv11b_tegra_get_clocks() - * - * This function finds clocks in tegra platform and populates - * the clock information to gv11b platform data. - */ +#include "platform_tegra.h" +#include "gr_gv11b.h" -static int gv11b_tegra_get_clocks(struct device *dev) -{ - /* TODO */ - return 0; -} static int gv11b_tegra_probe(struct device *dev) { @@ -62,7 +52,7 @@ static int gv11b_tegra_probe(struct device *dev) /* soc memory accessed as system memory aperture */ platform->g->mm.vidmem_is_vidmem = platform->vidmem_is_vidmem; - gv11b_tegra_get_clocks(dev); + gp10b_tegra_get_clocks(dev); return 0; } -- cgit v1.2.2 From 83c09ff6821fc8f549e857c2c4a2ef6b494497f9 Mon Sep 17 00:00:00 2001 From: Seema Khowala Date: Tue, 31 Jan 2017 16:08:13 -0800 Subject: gpu: nvgpu: gv11b : enable reset Init below fields in t19x_gpu_tegra_platform -reset_assert = gp10b_tegra_reset_assert -reset_deassert = gp10b_tegra_reset_deassert JIRA GV11B-34 Change-Id: I69cff5621d7fa7de830567f4cce87f79934809e2 Signed-off-by: Seema Khowala Reviewed-on: http://git-master/r/1296909 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c') diff --git a/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c b/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c index e50a8add..ab87d66f 100644 --- a/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c +++ b/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c @@ -127,4 +127,6 @@ struct gk20a_platform t19x_gpu_tegra_platform = { .vidmem_is_vidmem = true, + .reset_assert = gp10b_tegra_reset_assert, + .reset_deassert = gp10b_tegra_reset_deassert, }; -- cgit v1.2.2 From 09126db3e4bec8fd65afb4386a2a24fe307ed1b7 Mon Sep 17 00:00:00 2001 From: Konsta Holtta Date: Wed, 22 Mar 2017 14:38:47 +0200 Subject: gpu: nvgpu: gv11b: remove .late_probe and .remove The calls to nvhost_{register,unregister}_client_domain don't do anything, so remove the platform device's late_probe and remove ops that serve no other purpose than calling those empty functions. Remove also the corresponding #includes which are now unused. Bug 1853519 Change-Id: I67149d1575be5b3cacc60e6c28e6f2debfabf71c Signed-off-by: Konsta Holtta Reviewed-on: http://git-master/r/1326126 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: svccoveritychecker Reviewed-by: Seshendra Gadagottu GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom --- drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c | 20 -------------------- 1 file changed, 20 deletions(-) (limited to 'drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c') diff --git a/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c b/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c index ab87d66f..75b72992 100644 --- a/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c +++ b/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c @@ -14,12 +14,10 @@ */ #include -#include #include #include #include #include -#include #include #include @@ -57,22 +55,6 @@ static int gv11b_tegra_probe(struct device *dev) return 0; } -static int gv11b_tegra_late_probe(struct device *dev) -{ - /* Make gk20a power domain a subdomain of host1x */ - nvhost_register_client_domain(dev_to_genpd(dev)); - return 0; -} - -static int gv11b_tegra_remove(struct device *dev) -{ - /* remove gk20a power subdomain from host1x */ - nvhost_unregister_client_domain(dev_to_genpd(dev)); - - return 0; - -} - static bool gv11b_tegra_is_railgated(struct device *dev) { bool ret = false; @@ -105,8 +87,6 @@ struct gk20a_platform t19x_gpu_tegra_platform = { .ptimer_src_freq = 31250000, .probe = gv11b_tegra_probe, - .late_probe = gv11b_tegra_late_probe, - .remove = gv11b_tegra_remove, /* power management callbacks */ .suspend = gv11b_tegra_suspend, -- cgit v1.2.2 From b83f2e282a8f12e2713a7ee0a2e6ef21069b2e84 Mon Sep 17 00:00:00 2001 From: Konsta Holtta Date: Wed, 22 Mar 2017 14:38:39 +0200 Subject: gpu: nvgpu: gv11b: remove unnecessary tegra_edp header Drop one #include, its contents are not used. Bug 1853519 Change-Id: I51480b1d75b36c993af3a5005ee9b7fc6dee8a54 Signed-off-by: Konsta Holtta Reviewed-on: http://git-master/r/1326127 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c | 1 - 1 file changed, 1 deletion(-) (limited to 'drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c') diff --git a/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c b/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c index 75b72992..87fd304f 100644 --- a/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c +++ b/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c @@ -15,7 +15,6 @@ #include #include -#include #include #include #include -- cgit v1.2.2 From 2dae0acaef95d959c3aee3d862f66d26562d2d0b Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Tue, 21 Mar 2017 10:13:37 -0700 Subject: gpu: nvgpu: Enable CE always All GPUs have a copy engine. So delete the flag has_ce, because it's always true. JIRA NVGPU-16 Change-Id: I6daa77ff70ccc0195352109916cb98b43a2109de Signed-off-by: Terje Bergstrom Reviewed-on: http://git-master/r/1325357 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c') diff --git a/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c b/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c index 87fd304f..b8479b89 100644 --- a/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c +++ b/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c @@ -100,8 +100,6 @@ struct gk20a_platform t19x_gpu_tegra_platform = { .default_big_page_size = SZ_64K, - .has_ce = true, - .soc_name = "tegra19x", .vidmem_is_vidmem = true, -- cgit v1.2.2 From 90d029fd28c25904bb84f929f1a65075a8d9b6e4 Mon Sep 17 00:00:00 2001 From: Seema Khowala Date: Tue, 18 Apr 2017 16:08:54 -0700 Subject: gpu: nvgpu: gv11b: enable big pages Do not depend on bypass_smmu to set disable_bigpage Bug 1805409 Change-Id: Ie602e3567162896acbc6a2da5f7f2db5cfb8021f Signed-off-by: Seema Khowala Reviewed-on: http://git-master/r/1465071 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: svccoveritychecker GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom --- drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c') diff --git a/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c b/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c index b8479b89..892fa442 100644 --- a/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c +++ b/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c @@ -36,7 +36,7 @@ static int gv11b_tegra_probe(struct device *dev) struct gk20a_platform *platform = dev_get_drvdata(dev); platform->bypass_smmu = !device_is_iommuable(dev); - platform->disable_bigpage = platform->bypass_smmu; + platform->disable_bigpage = false; platform->g->gr.t18x.ctx_vars.dump_ctxsw_stats_on_channel_close = false; -- cgit v1.2.2 From e1c27d4e84d518bef88305d1ca848deb07433677 Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Fri, 14 Apr 2017 16:15:50 -0700 Subject: gpu: nvgpu: gv11b: Use new clk HAL Use the new clk HAL to request clock rate instead of direct calls to Clock Framework. This cuts one direct dependency to Linux APIs. Also change the HAL to not clear clk ops after they've been initialized. JIRA NVGPU-16 Change-Id: I1ab3eac8268f1f3f3305d49782c6a0eb57c6d617 Signed-off-by: Terje Bergstrom Reviewed-on: http://git-master/r/1463536 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: svccoveritychecker GVS: Gerrit_Virtual_Submit Reviewed-by: Alex Waterman --- drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c') diff --git a/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c b/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c index 892fa442..a2a6cfd3 100644 --- a/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c +++ b/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c @@ -24,6 +24,7 @@ #include "gk20a/platform_gk20a.h" #include "gk20a/gk20a.h" +#include "tegra/linux/clk.h" #include "gp10b/platform_gp10b.h" @@ -50,6 +51,7 @@ static int gv11b_tegra_probe(struct device *dev) platform->g->mm.vidmem_is_vidmem = platform->vidmem_is_vidmem; gp10b_tegra_get_clocks(dev); + nvgpu_linux_init_clk_support(platform->g); return 0; } -- cgit v1.2.2 From 2fc607eb3ba8151099ef7a851081a9355af92b6b Mon Sep 17 00:00:00 2001 From: seshendra Gadagottu Date: Wed, 3 May 2017 16:01:46 -0700 Subject: gpu: nvgpu: gv11b: fix sparse warning Fixed following sparse warning by including relevant header: $TOP/kernel/nvgpu-t19x/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c:82:23: warning: symbol 't19x_gpu_tegra_platform' was not declared. Should it be static? Bug 200299572 Change-Id: Ibf7b69da9b76e72d610571135bd412c865b69a5f Signed-off-by: seshendra Gadagottu Reviewed-on: http://git-master/r/1474940 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: svccoveritychecker GVS: Gerrit_Virtual_Submit Reviewed-by: Sachin Nikam Reviewed-by: Amit Sharma (SW-TEGRA) Reviewed-by: Terje Bergstrom Tested-by: Terje Bergstrom --- drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c') diff --git a/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c b/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c index a2a6cfd3..07e3d8cf 100644 --- a/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c +++ b/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c @@ -30,6 +30,7 @@ #include "platform_tegra.h" #include "gr_gv11b.h" +#include "nvgpu_gpuid_t19x.h" static int gv11b_tegra_probe(struct device *dev) -- cgit v1.2.2 From 0c1f5c457410adb0b0f417c0a77521409731986b Mon Sep 17 00:00:00 2001 From: Seema Khowala Date: Thu, 4 May 2017 09:27:23 -0700 Subject: Revert "gpu: nvgpu: gv11b: enable big pages" This reverts commit 90d029fd28c25904bb84f929f1a65075a8d9b6e4. Bug 200305653 Change-Id: I2baa4b286e14ce57e68ab1e9cc15630ee24f5bc9 Signed-off-by: Seema Khowala Reviewed-on: http://git-master/r/1475515 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c') diff --git a/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c b/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c index 07e3d8cf..b9efc683 100644 --- a/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c +++ b/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c @@ -38,7 +38,7 @@ static int gv11b_tegra_probe(struct device *dev) struct gk20a_platform *platform = dev_get_drvdata(dev); platform->bypass_smmu = !device_is_iommuable(dev); - platform->disable_bigpage = false; + platform->disable_bigpage = platform->bypass_smmu; platform->g->gr.t18x.ctx_vars.dump_ctxsw_stats_on_channel_close = false; -- cgit v1.2.2 From 8c257ec5e24c658b375ff2118efdb6396ccdffce Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Fri, 14 Apr 2017 16:16:45 -0700 Subject: gpu: nvgpu: gv11b: Fix path for platform_tegra.h platform_tegra.h got moved under tegra/linux, so fix the path. JIRA NVGPU-16 Change-Id: I18d4e35e4ea781b6d67f7999e4470862752aafaf Signed-off-by: Terje Bergstrom Reviewed-on: http://git-master/r/1463537 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: svccoveritychecker GVS: Gerrit_Virtual_Submit Reviewed-by: Konsta Holtta --- drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c') diff --git a/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c b/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c index b9efc683..97845035 100644 --- a/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c +++ b/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c @@ -28,7 +28,7 @@ #include "gp10b/platform_gp10b.h" -#include "platform_tegra.h" +#include "tegra/linux/platform_gk20a_tegra.h" #include "gr_gv11b.h" #include "nvgpu_gpuid_t19x.h" -- cgit v1.2.2 From ffc37e50fa8e869e9a160b35f3cf414040e8a360 Mon Sep 17 00:00:00 2001 From: Lakshmanan M Date: Wed, 10 May 2017 12:38:08 +0530 Subject: gpu: nvgpu: gv11b: Add L1 tags parity support This CL covers the following parity support (corrected + uncorrected), 1) SM's L1 tags 2) SM's S2R's pixel PRF buffer 3) SM's L1 D-cache miss latency FIFOs Volta Resiliency Id - Volta-720, Volta-721, Volta-637 JIRA GPUT19X-85 JIRA GPUT19X-104 JIRA GPUT19X-100 JIRA GPUT19X-103 Bug 1825948 Bug 1825962 Bug 1775457 Change-Id: I53d7231a36b2c7c252395eca27b349eca80dec63 Signed-off-by: Lakshmanan M Reviewed-on: http://git-master/r/1478881 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c | 59 ++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) (limited to 'drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c') diff --git a/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c b/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c index 97845035..8ca9dd30 100644 --- a/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c +++ b/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c @@ -27,11 +27,13 @@ #include "tegra/linux/clk.h" #include "gp10b/platform_gp10b.h" +#include "tegra/linux/platform_gp10b_tegra.h" #include "tegra/linux/platform_gk20a_tegra.h" #include "gr_gv11b.h" #include "nvgpu_gpuid_t19x.h" +static void gr_gv11b_remove_sysfs(struct device *dev); static int gv11b_tegra_probe(struct device *dev) { @@ -57,6 +59,15 @@ static int gv11b_tegra_probe(struct device *dev) return 0; } +static int gv11b_tegra_remove(struct device *dev) +{ + gp10b_tegra_remove(dev); + + gr_gv11b_remove_sysfs(dev); + + return 0; +} + static bool gv11b_tegra_is_railgated(struct device *dev) { bool ret = false; @@ -89,6 +100,7 @@ struct gk20a_platform t19x_gpu_tegra_platform = { .ptimer_src_freq = 31250000, .probe = gv11b_tegra_probe, + .remove = gv11b_tegra_remove, /* power management callbacks */ .suspend = gv11b_tegra_suspend, @@ -110,3 +122,50 @@ struct gk20a_platform t19x_gpu_tegra_platform = { .reset_assert = gp10b_tegra_reset_assert, .reset_deassert = gp10b_tegra_reset_deassert, }; + +static struct device_attribute *dev_attr_sm_l1_tag_ecc_corrected_err_count_array; +static struct device_attribute *dev_attr_sm_l1_tag_ecc_uncorrected_err_count_array; + +void gr_gv11b_create_sysfs(struct device *dev) +{ + struct gk20a *g = get_gk20a(dev); + int error = 0; + /* This stat creation function is called on GR init. GR can get + initialized multiple times but we only need to create the ECC + stats once. Therefore, add the following check to avoid + creating duplicate stat sysfs nodes. */ + if (g->gr.t19x.ecc_stats.sm_l1_tag_corrected_err_count.counters != NULL) + return; + + gr_gp10b_create_sysfs(dev); + + error |= gr_gp10b_ecc_stat_create(dev, + 0, + "sm_l1_tag_ecc_corrected_err_count", + &g->gr.t19x.ecc_stats.sm_l1_tag_corrected_err_count, + dev_attr_sm_l1_tag_ecc_corrected_err_count_array); + + error |= gr_gp10b_ecc_stat_create(dev, + 0, + "sm_l1_tag_ecc_uncorrected_err_count", + &g->gr.t19x.ecc_stats.sm_l1_tag_uncorrected_err_count, + dev_attr_sm_l1_tag_ecc_uncorrected_err_count_array); + + if (error) + dev_err(dev, "Failed to create gv11b sysfs attributes!\n"); +} + +static void gr_gv11b_remove_sysfs(struct device *dev) +{ + struct gk20a *g = get_gk20a(dev); + + gr_gp10b_ecc_stat_remove(dev, + 0, + &g->gr.t19x.ecc_stats.sm_l1_tag_corrected_err_count, + dev_attr_sm_l1_tag_ecc_corrected_err_count_array); + + gr_gp10b_ecc_stat_remove(dev, + 0, + &g->gr.t19x.ecc_stats.sm_l1_tag_uncorrected_err_count, + dev_attr_sm_l1_tag_ecc_uncorrected_err_count_array); +} -- cgit v1.2.2 From d503a234440b0b5912f64314de68689b3211bbcd Mon Sep 17 00:00:00 2001 From: Lakshmanan M Date: Mon, 15 May 2017 15:32:21 +0530 Subject: gpu: nvgpu: gv11b: Add LRF + CBU parity support This CL covers the following parity support (uncorrected error), 1) SM's LRF 2) SM's CBU Volta Resiliency Id - Volta-637 JIRA GPUT19X-85 JIRA GPUT19X-110 Bug 1775457 Change-Id: I3befb1fe22719d06aa819ef27654aaf97f911a9b Signed-off-by: Lakshmanan M Reviewed-on: http://git-master/r/1481791 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c') diff --git a/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c b/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c index 8ca9dd30..d235b261 100644 --- a/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c +++ b/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c @@ -125,6 +125,8 @@ struct gk20a_platform t19x_gpu_tegra_platform = { static struct device_attribute *dev_attr_sm_l1_tag_ecc_corrected_err_count_array; static struct device_attribute *dev_attr_sm_l1_tag_ecc_uncorrected_err_count_array; +static struct device_attribute *dev_attr_sm_cbu_ecc_corrected_err_count_array; +static struct device_attribute *dev_attr_sm_cbu_ecc_uncorrected_err_count_array; void gr_gv11b_create_sysfs(struct device *dev) { @@ -151,6 +153,18 @@ void gr_gv11b_create_sysfs(struct device *dev) &g->gr.t19x.ecc_stats.sm_l1_tag_uncorrected_err_count, dev_attr_sm_l1_tag_ecc_uncorrected_err_count_array); + error |= gr_gp10b_ecc_stat_create(dev, + 0, + "sm_cbu_ecc_corrected_err_count", + &g->gr.t19x.ecc_stats.sm_cbu_corrected_err_count, + dev_attr_sm_cbu_ecc_corrected_err_count_array); + + error |= gr_gp10b_ecc_stat_create(dev, + 0, + "sm_cbu_ecc_uncorrected_err_count", + &g->gr.t19x.ecc_stats.sm_cbu_uncorrected_err_count, + dev_attr_sm_cbu_ecc_uncorrected_err_count_array); + if (error) dev_err(dev, "Failed to create gv11b sysfs attributes!\n"); } @@ -168,4 +182,15 @@ static void gr_gv11b_remove_sysfs(struct device *dev) 0, &g->gr.t19x.ecc_stats.sm_l1_tag_uncorrected_err_count, dev_attr_sm_l1_tag_ecc_uncorrected_err_count_array); + + gr_gp10b_ecc_stat_remove(dev, + 0, + &g->gr.t19x.ecc_stats.sm_cbu_corrected_err_count, + dev_attr_sm_cbu_ecc_corrected_err_count_array); + + gr_gp10b_ecc_stat_remove(dev, + 0, + &g->gr.t19x.ecc_stats.sm_cbu_uncorrected_err_count, + dev_attr_sm_cbu_ecc_uncorrected_err_count_array); + } -- cgit v1.2.2 From 5a08eafbe076fba98de62883636ee6b0751cf7e9 Mon Sep 17 00:00:00 2001 From: Lakshmanan M Date: Wed, 17 May 2017 11:42:24 +0530 Subject: gpu: nvgpu: gv11b: Add L1 DATA + iCACHE parity This CL covers the following parity support (uncorrected error), 1) SM's L1 DATA 2) SM's L0 && L1 icache Volta Resiliency Id - Volta-634 JIRA GPUT19X-113 JIRA GPUT19X-99 Bug 1807553 Change-Id: Iacbf492028983529dadc5753007e43510b8cb786 Signed-off-by: Lakshmanan M Reviewed-on: http://git-master/r/1483681 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c | 48 ++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) (limited to 'drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c') diff --git a/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c b/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c index d235b261..009e5716 100644 --- a/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c +++ b/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c @@ -127,6 +127,10 @@ static struct device_attribute *dev_attr_sm_l1_tag_ecc_corrected_err_count_array static struct device_attribute *dev_attr_sm_l1_tag_ecc_uncorrected_err_count_array; static struct device_attribute *dev_attr_sm_cbu_ecc_corrected_err_count_array; static struct device_attribute *dev_attr_sm_cbu_ecc_uncorrected_err_count_array; +static struct device_attribute *dev_attr_sm_l1_data_ecc_corrected_err_count_array; +static struct device_attribute *dev_attr_sm_l1_data_ecc_uncorrected_err_count_array; +static struct device_attribute *dev_attr_sm_icache_ecc_corrected_err_count_array; +static struct device_attribute *dev_attr_sm_icache_ecc_uncorrected_err_count_array; void gr_gv11b_create_sysfs(struct device *dev) { @@ -165,6 +169,30 @@ void gr_gv11b_create_sysfs(struct device *dev) &g->gr.t19x.ecc_stats.sm_cbu_uncorrected_err_count, dev_attr_sm_cbu_ecc_uncorrected_err_count_array); + error |= gr_gp10b_ecc_stat_create(dev, + 0, + "sm_l1_data_ecc_corrected_err_count", + &g->gr.t19x.ecc_stats.sm_l1_data_corrected_err_count, + dev_attr_sm_l1_data_ecc_corrected_err_count_array); + + error |= gr_gp10b_ecc_stat_create(dev, + 0, + "sm_l1_data_ecc_uncorrected_err_count", + &g->gr.t19x.ecc_stats.sm_l1_data_uncorrected_err_count, + dev_attr_sm_l1_data_ecc_uncorrected_err_count_array); + + error |= gr_gp10b_ecc_stat_create(dev, + 0, + "sm_icache_ecc_corrected_err_count", + &g->gr.t19x.ecc_stats.sm_icache_corrected_err_count, + dev_attr_sm_icache_ecc_corrected_err_count_array); + + error |= gr_gp10b_ecc_stat_create(dev, + 0, + "sm_icache_ecc_uncorrected_err_count", + &g->gr.t19x.ecc_stats.sm_icache_uncorrected_err_count, + dev_attr_sm_icache_ecc_uncorrected_err_count_array); + if (error) dev_err(dev, "Failed to create gv11b sysfs attributes!\n"); } @@ -193,4 +221,24 @@ static void gr_gv11b_remove_sysfs(struct device *dev) &g->gr.t19x.ecc_stats.sm_cbu_uncorrected_err_count, dev_attr_sm_cbu_ecc_uncorrected_err_count_array); + gr_gp10b_ecc_stat_remove(dev, + 0, + &g->gr.t19x.ecc_stats.sm_l1_data_corrected_err_count, + dev_attr_sm_l1_data_ecc_corrected_err_count_array); + + gr_gp10b_ecc_stat_remove(dev, + 0, + &g->gr.t19x.ecc_stats.sm_l1_data_uncorrected_err_count, + dev_attr_sm_l1_data_ecc_uncorrected_err_count_array); + + gr_gp10b_ecc_stat_remove(dev, + 0, + &g->gr.t19x.ecc_stats.sm_icache_corrected_err_count, + dev_attr_sm_icache_ecc_corrected_err_count_array); + + gr_gp10b_ecc_stat_remove(dev, + 0, + &g->gr.t19x.ecc_stats.sm_icache_uncorrected_err_count, + dev_attr_sm_icache_ecc_uncorrected_err_count_array); + } -- cgit v1.2.2 From 45ca7cb8c5774cfc15015973b1883faa1d93b9e6 Mon Sep 17 00:00:00 2001 From: Lakshmanan M Date: Fri, 19 May 2017 15:40:41 +0530 Subject: gpu: nvgpu: gv11b: Add GCC L1.5 parity support Add handling of GCC L1.5 parity exception. JIRA GPUT19X-86 Change-Id: Ie83fc306d3dff79b0ddaf2616dcf0ff71fccd4ca Signed-off-by: Lakshmanan M Reviewed-on: http://git-master/r/1485834 Reviewed-by: Terje Bergstrom Tested-by: Terje Bergstrom --- drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c') diff --git a/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c b/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c index 009e5716..39ae68eb 100644 --- a/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c +++ b/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c @@ -131,6 +131,8 @@ static struct device_attribute *dev_attr_sm_l1_data_ecc_corrected_err_count_arra static struct device_attribute *dev_attr_sm_l1_data_ecc_uncorrected_err_count_array; static struct device_attribute *dev_attr_sm_icache_ecc_corrected_err_count_array; static struct device_attribute *dev_attr_sm_icache_ecc_uncorrected_err_count_array; +static struct device_attribute *dev_attr_gcc_l15_ecc_corrected_err_count_array; +static struct device_attribute *dev_attr_gcc_l15_ecc_uncorrected_err_count_array; void gr_gv11b_create_sysfs(struct device *dev) { @@ -193,6 +195,18 @@ void gr_gv11b_create_sysfs(struct device *dev) &g->gr.t19x.ecc_stats.sm_icache_uncorrected_err_count, dev_attr_sm_icache_ecc_uncorrected_err_count_array); + error |= gr_gp10b_ecc_stat_create(dev, + 0, + "gcc_l15_ecc_corrected_err_count", + &g->gr.t19x.ecc_stats.gcc_l15_corrected_err_count, + dev_attr_gcc_l15_ecc_corrected_err_count_array); + + error |= gr_gp10b_ecc_stat_create(dev, + 0, + "gcc_l15_ecc_uncorrected_err_count", + &g->gr.t19x.ecc_stats.gcc_l15_uncorrected_err_count, + dev_attr_gcc_l15_ecc_uncorrected_err_count_array); + if (error) dev_err(dev, "Failed to create gv11b sysfs attributes!\n"); } @@ -241,4 +255,14 @@ static void gr_gv11b_remove_sysfs(struct device *dev) &g->gr.t19x.ecc_stats.sm_icache_uncorrected_err_count, dev_attr_sm_icache_ecc_uncorrected_err_count_array); + gr_gp10b_ecc_stat_remove(dev, + 0, + &g->gr.t19x.ecc_stats.gcc_l15_corrected_err_count, + dev_attr_gcc_l15_ecc_corrected_err_count_array); + + gr_gp10b_ecc_stat_remove(dev, + 0, + &g->gr.t19x.ecc_stats.gcc_l15_uncorrected_err_count, + dev_attr_gcc_l15_ecc_uncorrected_err_count_array); + } -- cgit v1.2.2 From c771d0b979cd9f42a21da520d5010873d2a6aa47 Mon Sep 17 00:00:00 2001 From: David Nieto Date: Thu, 18 May 2017 16:45:40 -0700 Subject: gpu: nvgpu: add GPC parity counters (1) Re-arrange the structure for ecc counters reporting so multiple units can be managed (2) Add counters and handling for additional GPC counters JIRA: GPUT19X-84 Change-Id: I74fd474d7daf7590fc7f7ddc9837bb692512d208 Signed-off-by: David Nieto Reviewed-on: http://git-master/r/1485277 Reviewed-by: svccoveritychecker GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom --- drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c | 94 ++++++++++++++++++++------ 1 file changed, 73 insertions(+), 21 deletions(-) (limited to 'drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c') diff --git a/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c b/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c index 39ae68eb..1cfa2ef2 100644 --- a/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c +++ b/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c @@ -134,6 +134,11 @@ static struct device_attribute *dev_attr_sm_icache_ecc_uncorrected_err_count_arr static struct device_attribute *dev_attr_gcc_l15_ecc_corrected_err_count_array; static struct device_attribute *dev_attr_gcc_l15_ecc_uncorrected_err_count_array; +static struct device_attribute *dev_attr_fecs_ecc_corrected_err_count_array; +static struct device_attribute *dev_attr_fecs_ecc_uncorrected_err_count_array; +static struct device_attribute *dev_attr_gpccs_ecc_corrected_err_count_array; +static struct device_attribute *dev_attr_gpccs_ecc_uncorrected_err_count_array; + void gr_gv11b_create_sysfs(struct device *dev) { struct gk20a *g = get_gk20a(dev); @@ -142,7 +147,7 @@ void gr_gv11b_create_sysfs(struct device *dev) initialized multiple times but we only need to create the ECC stats once. Therefore, add the following check to avoid creating duplicate stat sysfs nodes. */ - if (g->gr.t19x.ecc_stats.sm_l1_tag_corrected_err_count.counters != NULL) + if (g->ecc.gr.t19x.sm_l1_tag_corrected_err_count.counters != NULL) return; gr_gp10b_create_sysfs(dev); @@ -150,63 +155,91 @@ void gr_gv11b_create_sysfs(struct device *dev) error |= gr_gp10b_ecc_stat_create(dev, 0, "sm_l1_tag_ecc_corrected_err_count", - &g->gr.t19x.ecc_stats.sm_l1_tag_corrected_err_count, + &g->ecc.gr.t19x.sm_l1_tag_corrected_err_count, dev_attr_sm_l1_tag_ecc_corrected_err_count_array); error |= gr_gp10b_ecc_stat_create(dev, 0, "sm_l1_tag_ecc_uncorrected_err_count", - &g->gr.t19x.ecc_stats.sm_l1_tag_uncorrected_err_count, + &g->ecc.gr.t19x.sm_l1_tag_uncorrected_err_count, dev_attr_sm_l1_tag_ecc_uncorrected_err_count_array); error |= gr_gp10b_ecc_stat_create(dev, 0, "sm_cbu_ecc_corrected_err_count", - &g->gr.t19x.ecc_stats.sm_cbu_corrected_err_count, + &g->ecc.gr.t19x.sm_cbu_corrected_err_count, dev_attr_sm_cbu_ecc_corrected_err_count_array); error |= gr_gp10b_ecc_stat_create(dev, 0, "sm_cbu_ecc_uncorrected_err_count", - &g->gr.t19x.ecc_stats.sm_cbu_uncorrected_err_count, + &g->ecc.gr.t19x.sm_cbu_uncorrected_err_count, dev_attr_sm_cbu_ecc_uncorrected_err_count_array); error |= gr_gp10b_ecc_stat_create(dev, 0, "sm_l1_data_ecc_corrected_err_count", - &g->gr.t19x.ecc_stats.sm_l1_data_corrected_err_count, + &g->ecc.gr.t19x.sm_l1_data_corrected_err_count, dev_attr_sm_l1_data_ecc_corrected_err_count_array); error |= gr_gp10b_ecc_stat_create(dev, 0, "sm_l1_data_ecc_uncorrected_err_count", - &g->gr.t19x.ecc_stats.sm_l1_data_uncorrected_err_count, + &g->ecc.gr.t19x.sm_l1_data_uncorrected_err_count, dev_attr_sm_l1_data_ecc_uncorrected_err_count_array); error |= gr_gp10b_ecc_stat_create(dev, 0, "sm_icache_ecc_corrected_err_count", - &g->gr.t19x.ecc_stats.sm_icache_corrected_err_count, + &g->ecc.gr.t19x.sm_icache_corrected_err_count, dev_attr_sm_icache_ecc_corrected_err_count_array); error |= gr_gp10b_ecc_stat_create(dev, 0, "sm_icache_ecc_uncorrected_err_count", - &g->gr.t19x.ecc_stats.sm_icache_uncorrected_err_count, + &g->ecc.gr.t19x.sm_icache_uncorrected_err_count, dev_attr_sm_icache_ecc_uncorrected_err_count_array); error |= gr_gp10b_ecc_stat_create(dev, 0, "gcc_l15_ecc_corrected_err_count", - &g->gr.t19x.ecc_stats.gcc_l15_corrected_err_count, + &g->ecc.gr.t19x.gcc_l15_corrected_err_count, dev_attr_gcc_l15_ecc_corrected_err_count_array); error |= gr_gp10b_ecc_stat_create(dev, 0, "gcc_l15_ecc_uncorrected_err_count", - &g->gr.t19x.ecc_stats.gcc_l15_uncorrected_err_count, + &g->ecc.gr.t19x.gcc_l15_uncorrected_err_count, dev_attr_gcc_l15_ecc_uncorrected_err_count_array); + error |= gp10b_ecc_stat_create(dev, + 1, + "gpc", + "fecs_ecc_uncorrected_err_count", + &g->ecc.gr.t19x.fecs_uncorrected_err_count, + dev_attr_fecs_ecc_uncorrected_err_count_array); + + error |= gp10b_ecc_stat_create(dev, + 1, + "gpc", + "fecs_ecc_corrected_err_count", + &g->ecc.gr.t19x.fecs_corrected_err_count, + dev_attr_fecs_ecc_corrected_err_count_array); + + error |= gp10b_ecc_stat_create(dev, + g->gr.gpc_count, + "gpc", + "gpccs_ecc_uncorrected_err_count", + &g->ecc.gr.t19x.gpccs_uncorrected_err_count, + dev_attr_gpccs_ecc_uncorrected_err_count_array); + + error |= gp10b_ecc_stat_create(dev, + g->gr.gpc_count, + "gpc", + "gpccs_ecc_corrected_err_count", + &g->ecc.gr.t19x.gpccs_corrected_err_count, + dev_attr_gpccs_ecc_corrected_err_count_array); + if (error) dev_err(dev, "Failed to create gv11b sysfs attributes!\n"); } @@ -217,52 +250,71 @@ static void gr_gv11b_remove_sysfs(struct device *dev) gr_gp10b_ecc_stat_remove(dev, 0, - &g->gr.t19x.ecc_stats.sm_l1_tag_corrected_err_count, + &g->ecc.gr.t19x.sm_l1_tag_corrected_err_count, dev_attr_sm_l1_tag_ecc_corrected_err_count_array); gr_gp10b_ecc_stat_remove(dev, 0, - &g->gr.t19x.ecc_stats.sm_l1_tag_uncorrected_err_count, + &g->ecc.gr.t19x.sm_l1_tag_uncorrected_err_count, dev_attr_sm_l1_tag_ecc_uncorrected_err_count_array); gr_gp10b_ecc_stat_remove(dev, 0, - &g->gr.t19x.ecc_stats.sm_cbu_corrected_err_count, + &g->ecc.gr.t19x.sm_cbu_corrected_err_count, dev_attr_sm_cbu_ecc_corrected_err_count_array); gr_gp10b_ecc_stat_remove(dev, 0, - &g->gr.t19x.ecc_stats.sm_cbu_uncorrected_err_count, + &g->ecc.gr.t19x.sm_cbu_uncorrected_err_count, dev_attr_sm_cbu_ecc_uncorrected_err_count_array); gr_gp10b_ecc_stat_remove(dev, 0, - &g->gr.t19x.ecc_stats.sm_l1_data_corrected_err_count, + &g->ecc.gr.t19x.sm_l1_data_corrected_err_count, dev_attr_sm_l1_data_ecc_corrected_err_count_array); gr_gp10b_ecc_stat_remove(dev, 0, - &g->gr.t19x.ecc_stats.sm_l1_data_uncorrected_err_count, + &g->ecc.gr.t19x.sm_l1_data_uncorrected_err_count, dev_attr_sm_l1_data_ecc_uncorrected_err_count_array); gr_gp10b_ecc_stat_remove(dev, 0, - &g->gr.t19x.ecc_stats.sm_icache_corrected_err_count, + &g->ecc.gr.t19x.sm_icache_corrected_err_count, dev_attr_sm_icache_ecc_corrected_err_count_array); gr_gp10b_ecc_stat_remove(dev, 0, - &g->gr.t19x.ecc_stats.sm_icache_uncorrected_err_count, + &g->ecc.gr.t19x.sm_icache_uncorrected_err_count, dev_attr_sm_icache_ecc_uncorrected_err_count_array); gr_gp10b_ecc_stat_remove(dev, 0, - &g->gr.t19x.ecc_stats.gcc_l15_corrected_err_count, + &g->ecc.gr.t19x.gcc_l15_corrected_err_count, dev_attr_gcc_l15_ecc_corrected_err_count_array); gr_gp10b_ecc_stat_remove(dev, 0, - &g->gr.t19x.ecc_stats.gcc_l15_uncorrected_err_count, + &g->ecc.gr.t19x.gcc_l15_uncorrected_err_count, dev_attr_gcc_l15_ecc_uncorrected_err_count_array); + gp10b_ecc_stat_remove(dev, + 1, + &g->ecc.gr.t19x.fecs_uncorrected_err_count, + dev_attr_fecs_ecc_uncorrected_err_count_array); + + gp10b_ecc_stat_remove(dev, + 1, + &g->ecc.gr.t19x.fecs_corrected_err_count, + dev_attr_fecs_ecc_corrected_err_count_array); + + gp10b_ecc_stat_remove(dev, + g->gr.gpc_count, + &g->ecc.gr.t19x.gpccs_uncorrected_err_count, + dev_attr_gpccs_ecc_uncorrected_err_count_array); + + gp10b_ecc_stat_remove(dev, + g->gr.gpc_count, + &g->ecc.gr.t19x.gpccs_corrected_err_count, + dev_attr_gpccs_ecc_corrected_err_count_array); } -- cgit v1.2.2 From 1f78355c5c909e2f678a60420c0abd8ec5adbc98 Mon Sep 17 00:00:00 2001 From: seshendra Gadagottu Date: Tue, 22 Nov 2016 09:09:39 -0800 Subject: gpu: nvgpu: gv11b: add support for sync points In t19x, host1x supports sync point through memory mapped shim layer. So sync-point operations implemented through semphore methods signaling to this sync-point shim layer. Added relevant hal functions for this in fifo hal. JIRA GPUT19X-2 Change-Id: Ia514637d046ba093f4e5afa6cbd06673672fd189 Signed-off-by: seshendra Gadagottu Reviewed-on: http://git-master/r/1258235 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c | 38 ++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to 'drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c') diff --git a/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c b/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c index 1cfa2ef2..8733cae9 100644 --- a/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c +++ b/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c @@ -19,6 +19,9 @@ #include #include #include +#ifdef CONFIG_TEGRA_GK20A_NVHOST +#include +#endif #include @@ -37,7 +40,42 @@ static void gr_gv11b_remove_sysfs(struct device *dev); static int gv11b_tegra_probe(struct device *dev) { + int err = 0; struct gk20a_platform *platform = dev_get_drvdata(dev); + struct gk20a *g = platform->g; + struct device_node *np = dev->of_node; + struct device_node *host1x_node; + struct platform_device *host1x_pdev; + const __be32 *host1x_ptr; + +#ifdef CONFIG_TEGRA_GK20A_NVHOST + host1x_ptr = of_get_property(np, "nvidia,host1x", NULL); + if (!host1x_ptr) { + dev_err(dev, "host1x device not available"); + return -ENOSYS; + } + + host1x_node = of_find_node_by_phandle(be32_to_cpup(host1x_ptr)); + host1x_pdev = of_find_device_by_node(host1x_node); + if (!host1x_pdev) { + dev_err(dev, "host1x device not available"); + return -ENOSYS; + } + + platform->g->host1x_dev = host1x_pdev; + err = nvhost_syncpt_unit_interface_get_aperture( + g->host1x_dev, + &g->syncpt_unit_base, + &g->syncpt_unit_size); + if (err) { + dev_err(dev, "Failed to get syncpt interface"); + return -ENOSYS; + } + g->syncpt_size = nvhost_syncpt_unit_interface_get_byte_offset(1); + gk20a_dbg_info("syncpt_unit_base %llx syncpt_unit_size %zx size %x\n", + g->syncpt_unit_base, g->syncpt_unit_size, + g->syncpt_size); +#endif platform->bypass_smmu = !device_is_iommuable(dev); platform->disable_bigpage = platform->bypass_smmu; -- cgit v1.2.2 From 6bc36bded05ee497a474e5a718c49dc33eb235f1 Mon Sep 17 00:00:00 2001 From: David Nieto Date: Mon, 22 May 2017 16:38:49 -0700 Subject: gpu: nvgpu: L2 cache tag ECC support Adding support for L2 cache tag ECC error handling JIRA: GPUT19X-112 Change-Id: I9a8ebefe97814b341f57a024dfb126013adaac1c Signed-off-by: David Nieto Reviewed-on: http://git-master/r/1489029 Reviewed-by: svccoveritychecker GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom --- drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c | 27 ++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c') diff --git a/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c b/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c index 8733cae9..432af7c1 100644 --- a/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c +++ b/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c @@ -177,6 +177,9 @@ static struct device_attribute *dev_attr_fecs_ecc_uncorrected_err_count_array; static struct device_attribute *dev_attr_gpccs_ecc_corrected_err_count_array; static struct device_attribute *dev_attr_gpccs_ecc_uncorrected_err_count_array; +static struct device_attribute *dev_attr_l2_cache_ecc_corrected_err_count_array; +static struct device_attribute *dev_attr_l2_cache_ecc_uncorrected_err_count_array; + void gr_gv11b_create_sysfs(struct device *dev) { struct gk20a *g = get_gk20a(dev); @@ -250,6 +253,20 @@ void gr_gv11b_create_sysfs(struct device *dev) &g->ecc.gr.t19x.gcc_l15_uncorrected_err_count, dev_attr_gcc_l15_ecc_uncorrected_err_count_array); + error |= gp10b_ecc_stat_create(dev, + g->ltc_count, + "ltc", + "l2_cache_uncorrected_err_count", + &g->ecc.ltc.t19x.l2_cache_uncorrected_err_count, + dev_attr_l2_cache_ecc_uncorrected_err_count_array); + + error |= gp10b_ecc_stat_create(dev, + g->ltc_count, + "ltc", + "l2_cache_corrected_err_count", + &g->ecc.ltc.t19x.l2_cache_corrected_err_count, + dev_attr_l2_cache_ecc_corrected_err_count_array); + error |= gp10b_ecc_stat_create(dev, 1, "gpc", @@ -336,6 +353,16 @@ static void gr_gv11b_remove_sysfs(struct device *dev) &g->ecc.gr.t19x.gcc_l15_uncorrected_err_count, dev_attr_gcc_l15_ecc_uncorrected_err_count_array); + gp10b_ecc_stat_remove(dev, + g->ltc_count, + &g->ecc.ltc.t19x.l2_cache_uncorrected_err_count, + dev_attr_l2_cache_ecc_uncorrected_err_count_array); + + gp10b_ecc_stat_remove(dev, + g->ltc_count, + &g->ecc.ltc.t19x.l2_cache_corrected_err_count, + dev_attr_l2_cache_ecc_corrected_err_count_array); + gp10b_ecc_stat_remove(dev, 1, &g->ecc.gr.t19x.fecs_uncorrected_err_count, -- cgit v1.2.2 From 345eaef6a76771da9c3e8a5e375fc9d659fb1b2b Mon Sep 17 00:00:00 2001 From: David Nieto Date: Fri, 26 May 2017 08:31:46 -0700 Subject: gpu: nvgpu: GPC MMU ECC support Adding support for GPC MMU ECC error handling JIRA: GPUT19X-112 Change-Id: I62083bf2f144ff628ecd8c0aefc8d227a233ff36 Signed-off-by: David Nieto Reviewed-on: http://git-master/r/1490772 Reviewed-by: svccoveritychecker GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom --- drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c') diff --git a/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c b/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c index 432af7c1..c69e1478 100644 --- a/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c +++ b/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c @@ -171,6 +171,8 @@ static struct device_attribute *dev_attr_sm_icache_ecc_corrected_err_count_array static struct device_attribute *dev_attr_sm_icache_ecc_uncorrected_err_count_array; static struct device_attribute *dev_attr_gcc_l15_ecc_corrected_err_count_array; static struct device_attribute *dev_attr_gcc_l15_ecc_uncorrected_err_count_array; +static struct device_attribute *dev_attr_mmu_l1tlb_ecc_corrected_err_count_array; +static struct device_attribute *dev_attr_mmu_l1tlb_ecc_uncorrected_err_count_array; static struct device_attribute *dev_attr_fecs_ecc_corrected_err_count_array; static struct device_attribute *dev_attr_fecs_ecc_uncorrected_err_count_array; @@ -295,6 +297,19 @@ void gr_gv11b_create_sysfs(struct device *dev) &g->ecc.gr.t19x.gpccs_corrected_err_count, dev_attr_gpccs_ecc_corrected_err_count_array); + error |= gp10b_ecc_stat_create(dev, + g->gr.gpc_count, + "gpc", + "mmu_l1tlb_ecc_uncorrected_err_count", + &g->ecc.gr.t19x.mmu_l1tlb_uncorrected_err_count, + dev_attr_mmu_l1tlb_ecc_uncorrected_err_count_array); + + error |= gp10b_ecc_stat_create(dev, + g->gr.gpc_count, + "gpc", + "mmu_l1tlb_ecc_corrected_err_count", + &g->ecc.gr.t19x.mmu_l1tlb_corrected_err_count, + dev_attr_mmu_l1tlb_ecc_corrected_err_count_array); if (error) dev_err(dev, "Failed to create gv11b sysfs attributes!\n"); } @@ -382,4 +397,14 @@ static void gr_gv11b_remove_sysfs(struct device *dev) g->gr.gpc_count, &g->ecc.gr.t19x.gpccs_corrected_err_count, dev_attr_gpccs_ecc_corrected_err_count_array); + + gp10b_ecc_stat_remove(dev, + g->gr.gpc_count, + &g->ecc.gr.t19x.mmu_l1tlb_uncorrected_err_count, + dev_attr_mmu_l1tlb_ecc_uncorrected_err_count_array); + + gp10b_ecc_stat_remove(dev, + g->gr.gpc_count, + &g->ecc.gr.t19x.mmu_l1tlb_corrected_err_count, + dev_attr_mmu_l1tlb_ecc_corrected_err_count_array); } -- cgit v1.2.2 From 3dc28cb1ab934ebcda33933086d7d0ffc8d1f907 Mon Sep 17 00:00:00 2001 From: David Nieto Date: Fri, 26 May 2017 14:36:26 -0700 Subject: gpu: nvgpu: add chip specific ECC counters Add support for ECC counters for HUB MMU JIRA: GPUT19X-82 Change-Id: I691d5898d4db9fe2cd68f217baa646479ab5cb00 Signed-off-by: David Nieto Reviewed-on: http://git-master/r/1490825 Reviewed-by: svccoveritychecker GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom --- drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c | 80 ++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) (limited to 'drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c') diff --git a/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c b/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c index c69e1478..95bbfbd3 100644 --- a/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c +++ b/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c @@ -182,6 +182,13 @@ static struct device_attribute *dev_attr_gpccs_ecc_uncorrected_err_count_array; static struct device_attribute *dev_attr_l2_cache_ecc_corrected_err_count_array; static struct device_attribute *dev_attr_l2_cache_ecc_uncorrected_err_count_array; +static struct device_attribute *dev_attr_mmu_l2tlb_ecc_corrected_err_count_array; +static struct device_attribute *dev_attr_mmu_l2tlb_ecc_uncorrected_err_count_array; +static struct device_attribute *dev_attr_mmu_hubtlb_ecc_corrected_err_count_array; +static struct device_attribute *dev_attr_mmu_hubtlb_ecc_uncorrected_err_count_array; +static struct device_attribute *dev_attr_mmu_fillunit_ecc_corrected_err_count_array; +static struct device_attribute *dev_attr_mmu_fillunit_ecc_uncorrected_err_count_array; + void gr_gv11b_create_sysfs(struct device *dev) { struct gk20a *g = get_gk20a(dev); @@ -310,6 +317,49 @@ void gr_gv11b_create_sysfs(struct device *dev) "mmu_l1tlb_ecc_corrected_err_count", &g->ecc.gr.t19x.mmu_l1tlb_corrected_err_count, dev_attr_mmu_l1tlb_ecc_corrected_err_count_array); + + error |= gp10b_ecc_stat_create(dev, + 1, + "eng", + "mmu_l2tlb_ecc_uncorrected_err_count", + &g->ecc.eng.t19x.mmu_l2tlb_uncorrected_err_count, + dev_attr_mmu_l2tlb_ecc_uncorrected_err_count_array); + + error |= gp10b_ecc_stat_create(dev, + 1, + "eng", + "mmu_l2tlb_ecc_corrected_err_count", + &g->ecc.eng.t19x.mmu_l2tlb_corrected_err_count, + dev_attr_mmu_l2tlb_ecc_corrected_err_count_array); + + error |= gp10b_ecc_stat_create(dev, + 1, + "eng", + "mmu_hubtlb_ecc_uncorrected_err_count", + &g->ecc.eng.t19x.mmu_hubtlb_uncorrected_err_count, + dev_attr_mmu_hubtlb_ecc_uncorrected_err_count_array); + + error |= gp10b_ecc_stat_create(dev, + 1, + "eng", + "mmu_hubtlb_ecc_corrected_err_count", + &g->ecc.eng.t19x.mmu_hubtlb_corrected_err_count, + dev_attr_mmu_hubtlb_ecc_corrected_err_count_array); + + error |= gp10b_ecc_stat_create(dev, + 1, + "eng", + "mmu_fillunit_ecc_uncorrected_err_count", + &g->ecc.eng.t19x.mmu_fillunit_uncorrected_err_count, + dev_attr_mmu_fillunit_ecc_uncorrected_err_count_array); + + error |= gp10b_ecc_stat_create(dev, + 1, + "eng", + "mmu_fillunit_ecc_corrected_err_count", + &g->ecc.eng.t19x.mmu_fillunit_corrected_err_count, + dev_attr_mmu_fillunit_ecc_corrected_err_count_array); + if (error) dev_err(dev, "Failed to create gv11b sysfs attributes!\n"); } @@ -407,4 +457,34 @@ static void gr_gv11b_remove_sysfs(struct device *dev) g->gr.gpc_count, &g->ecc.gr.t19x.mmu_l1tlb_corrected_err_count, dev_attr_mmu_l1tlb_ecc_corrected_err_count_array); + + gp10b_ecc_stat_remove(dev, + 1, + &g->ecc.eng.t19x.mmu_l2tlb_uncorrected_err_count, + dev_attr_mmu_l2tlb_ecc_uncorrected_err_count_array); + + gp10b_ecc_stat_remove(dev, + 1, + &g->ecc.eng.t19x.mmu_l2tlb_corrected_err_count, + dev_attr_mmu_l2tlb_ecc_corrected_err_count_array); + + gp10b_ecc_stat_remove(dev, + 1, + &g->ecc.eng.t19x.mmu_hubtlb_uncorrected_err_count, + dev_attr_mmu_hubtlb_ecc_uncorrected_err_count_array); + + gp10b_ecc_stat_remove(dev, + 1, + &g->ecc.eng.t19x.mmu_hubtlb_corrected_err_count, + dev_attr_mmu_hubtlb_ecc_corrected_err_count_array); + + gp10b_ecc_stat_remove(dev, + 1, + &g->ecc.eng.t19x.mmu_fillunit_uncorrected_err_count, + dev_attr_mmu_fillunit_ecc_uncorrected_err_count_array); + + gp10b_ecc_stat_remove(dev, + 1, + &g->ecc.eng.t19x.mmu_fillunit_corrected_err_count, + dev_attr_mmu_fillunit_ecc_corrected_err_count_array); } -- cgit v1.2.2 From 8d63a519d99b619f13604461bbb58f82ebf87cc1 Mon Sep 17 00:00:00 2001 From: Deepak Nibade Date: Mon, 5 Jun 2017 14:39:14 +0530 Subject: gpu: nvgpu: pass correct parameter to gp10b_ecc_stat_create() We pass (struct device_attribute *) to gp10b_ecc_stat_create() and gr_gp10b_ecc_stat_create() and then assign a memory allocation to this pointer But since this pointer is local copy to function, static pointer variables are never set in gr_gp10b_create_sysfs() This also results in a resource leak since we never free the storage assigned to local variable Fix this by adding and passing correct parameter (struct device_attribute **) so that the address of the allocation is returned to the caller correctly Bug 200291879 Coverity id : 2567934 Change-Id: I1b1d329265f4d32739abbbe3a4e419a2af62b874 Signed-off-by: Deepak Nibade Reviewed-on: http://git-master/r/1495907 Reviewed-by: svccoveritychecker GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom --- drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c | 48 +++++++++++++------------- 1 file changed, 24 insertions(+), 24 deletions(-) (limited to 'drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c') diff --git a/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c b/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c index 95bbfbd3..8e68e6cb 100644 --- a/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c +++ b/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c @@ -206,159 +206,159 @@ void gr_gv11b_create_sysfs(struct device *dev) 0, "sm_l1_tag_ecc_corrected_err_count", &g->ecc.gr.t19x.sm_l1_tag_corrected_err_count, - dev_attr_sm_l1_tag_ecc_corrected_err_count_array); + &dev_attr_sm_l1_tag_ecc_corrected_err_count_array); error |= gr_gp10b_ecc_stat_create(dev, 0, "sm_l1_tag_ecc_uncorrected_err_count", &g->ecc.gr.t19x.sm_l1_tag_uncorrected_err_count, - dev_attr_sm_l1_tag_ecc_uncorrected_err_count_array); + &dev_attr_sm_l1_tag_ecc_uncorrected_err_count_array); error |= gr_gp10b_ecc_stat_create(dev, 0, "sm_cbu_ecc_corrected_err_count", &g->ecc.gr.t19x.sm_cbu_corrected_err_count, - dev_attr_sm_cbu_ecc_corrected_err_count_array); + &dev_attr_sm_cbu_ecc_corrected_err_count_array); error |= gr_gp10b_ecc_stat_create(dev, 0, "sm_cbu_ecc_uncorrected_err_count", &g->ecc.gr.t19x.sm_cbu_uncorrected_err_count, - dev_attr_sm_cbu_ecc_uncorrected_err_count_array); + &dev_attr_sm_cbu_ecc_uncorrected_err_count_array); error |= gr_gp10b_ecc_stat_create(dev, 0, "sm_l1_data_ecc_corrected_err_count", &g->ecc.gr.t19x.sm_l1_data_corrected_err_count, - dev_attr_sm_l1_data_ecc_corrected_err_count_array); + &dev_attr_sm_l1_data_ecc_corrected_err_count_array); error |= gr_gp10b_ecc_stat_create(dev, 0, "sm_l1_data_ecc_uncorrected_err_count", &g->ecc.gr.t19x.sm_l1_data_uncorrected_err_count, - dev_attr_sm_l1_data_ecc_uncorrected_err_count_array); + &dev_attr_sm_l1_data_ecc_uncorrected_err_count_array); error |= gr_gp10b_ecc_stat_create(dev, 0, "sm_icache_ecc_corrected_err_count", &g->ecc.gr.t19x.sm_icache_corrected_err_count, - dev_attr_sm_icache_ecc_corrected_err_count_array); + &dev_attr_sm_icache_ecc_corrected_err_count_array); error |= gr_gp10b_ecc_stat_create(dev, 0, "sm_icache_ecc_uncorrected_err_count", &g->ecc.gr.t19x.sm_icache_uncorrected_err_count, - dev_attr_sm_icache_ecc_uncorrected_err_count_array); + &dev_attr_sm_icache_ecc_uncorrected_err_count_array); error |= gr_gp10b_ecc_stat_create(dev, 0, "gcc_l15_ecc_corrected_err_count", &g->ecc.gr.t19x.gcc_l15_corrected_err_count, - dev_attr_gcc_l15_ecc_corrected_err_count_array); + &dev_attr_gcc_l15_ecc_corrected_err_count_array); error |= gr_gp10b_ecc_stat_create(dev, 0, "gcc_l15_ecc_uncorrected_err_count", &g->ecc.gr.t19x.gcc_l15_uncorrected_err_count, - dev_attr_gcc_l15_ecc_uncorrected_err_count_array); + &dev_attr_gcc_l15_ecc_uncorrected_err_count_array); error |= gp10b_ecc_stat_create(dev, g->ltc_count, "ltc", "l2_cache_uncorrected_err_count", &g->ecc.ltc.t19x.l2_cache_uncorrected_err_count, - dev_attr_l2_cache_ecc_uncorrected_err_count_array); + &dev_attr_l2_cache_ecc_uncorrected_err_count_array); error |= gp10b_ecc_stat_create(dev, g->ltc_count, "ltc", "l2_cache_corrected_err_count", &g->ecc.ltc.t19x.l2_cache_corrected_err_count, - dev_attr_l2_cache_ecc_corrected_err_count_array); + &dev_attr_l2_cache_ecc_corrected_err_count_array); error |= gp10b_ecc_stat_create(dev, 1, "gpc", "fecs_ecc_uncorrected_err_count", &g->ecc.gr.t19x.fecs_uncorrected_err_count, - dev_attr_fecs_ecc_uncorrected_err_count_array); + &dev_attr_fecs_ecc_uncorrected_err_count_array); error |= gp10b_ecc_stat_create(dev, 1, "gpc", "fecs_ecc_corrected_err_count", &g->ecc.gr.t19x.fecs_corrected_err_count, - dev_attr_fecs_ecc_corrected_err_count_array); + &dev_attr_fecs_ecc_corrected_err_count_array); error |= gp10b_ecc_stat_create(dev, g->gr.gpc_count, "gpc", "gpccs_ecc_uncorrected_err_count", &g->ecc.gr.t19x.gpccs_uncorrected_err_count, - dev_attr_gpccs_ecc_uncorrected_err_count_array); + &dev_attr_gpccs_ecc_uncorrected_err_count_array); error |= gp10b_ecc_stat_create(dev, g->gr.gpc_count, "gpc", "gpccs_ecc_corrected_err_count", &g->ecc.gr.t19x.gpccs_corrected_err_count, - dev_attr_gpccs_ecc_corrected_err_count_array); + &dev_attr_gpccs_ecc_corrected_err_count_array); error |= gp10b_ecc_stat_create(dev, g->gr.gpc_count, "gpc", "mmu_l1tlb_ecc_uncorrected_err_count", &g->ecc.gr.t19x.mmu_l1tlb_uncorrected_err_count, - dev_attr_mmu_l1tlb_ecc_uncorrected_err_count_array); + &dev_attr_mmu_l1tlb_ecc_uncorrected_err_count_array); error |= gp10b_ecc_stat_create(dev, g->gr.gpc_count, "gpc", "mmu_l1tlb_ecc_corrected_err_count", &g->ecc.gr.t19x.mmu_l1tlb_corrected_err_count, - dev_attr_mmu_l1tlb_ecc_corrected_err_count_array); + &dev_attr_mmu_l1tlb_ecc_corrected_err_count_array); error |= gp10b_ecc_stat_create(dev, 1, "eng", "mmu_l2tlb_ecc_uncorrected_err_count", &g->ecc.eng.t19x.mmu_l2tlb_uncorrected_err_count, - dev_attr_mmu_l2tlb_ecc_uncorrected_err_count_array); + &dev_attr_mmu_l2tlb_ecc_uncorrected_err_count_array); error |= gp10b_ecc_stat_create(dev, 1, "eng", "mmu_l2tlb_ecc_corrected_err_count", &g->ecc.eng.t19x.mmu_l2tlb_corrected_err_count, - dev_attr_mmu_l2tlb_ecc_corrected_err_count_array); + &dev_attr_mmu_l2tlb_ecc_corrected_err_count_array); error |= gp10b_ecc_stat_create(dev, 1, "eng", "mmu_hubtlb_ecc_uncorrected_err_count", &g->ecc.eng.t19x.mmu_hubtlb_uncorrected_err_count, - dev_attr_mmu_hubtlb_ecc_uncorrected_err_count_array); + &dev_attr_mmu_hubtlb_ecc_uncorrected_err_count_array); error |= gp10b_ecc_stat_create(dev, 1, "eng", "mmu_hubtlb_ecc_corrected_err_count", &g->ecc.eng.t19x.mmu_hubtlb_corrected_err_count, - dev_attr_mmu_hubtlb_ecc_corrected_err_count_array); + &dev_attr_mmu_hubtlb_ecc_corrected_err_count_array); error |= gp10b_ecc_stat_create(dev, 1, "eng", "mmu_fillunit_ecc_uncorrected_err_count", &g->ecc.eng.t19x.mmu_fillunit_uncorrected_err_count, - dev_attr_mmu_fillunit_ecc_uncorrected_err_count_array); + &dev_attr_mmu_fillunit_ecc_uncorrected_err_count_array); error |= gp10b_ecc_stat_create(dev, 1, "eng", "mmu_fillunit_ecc_corrected_err_count", &g->ecc.eng.t19x.mmu_fillunit_corrected_err_count, - dev_attr_mmu_fillunit_ecc_corrected_err_count_array); + &dev_attr_mmu_fillunit_ecc_corrected_err_count_array); if (error) dev_err(dev, "Failed to create gv11b sysfs attributes!\n"); -- cgit v1.2.2 From fa0cf69d0f8fe7275debef7b3fc87c9225f71f0b Mon Sep 17 00:00:00 2001 From: Konsta Holtta Date: Mon, 5 Jun 2017 17:44:58 +0300 Subject: gpu: nvgpu: split vidmem_is_vidmem Use the new honors_aperture and unified_memory flags instead of vidmem_is_vidmem. Jira NVGPU-86 Change-Id: I5df8b119d30b255fa8d841cec747a187ce3fa588 Signed-off-by: Konsta Holtta Reviewed-on: http://git-master/r/1496081 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c') diff --git a/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c b/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c index 8e68e6cb..4b600cdd 100644 --- a/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c +++ b/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c @@ -88,9 +88,6 @@ static int gv11b_tegra_probe(struct device *dev) platform->g->gr.t18x.ctx_vars.force_preemption_gfxp = false; platform->g->gr.t18x.ctx_vars.force_preemption_cilp = false; - /* soc memory accessed as system memory aperture */ - platform->g->mm.vidmem_is_vidmem = platform->vidmem_is_vidmem; - gp10b_tegra_get_clocks(dev); nvgpu_linux_init_clk_support(platform->g); @@ -155,7 +152,8 @@ struct gk20a_platform t19x_gpu_tegra_platform = { .soc_name = "tegra19x", - .vidmem_is_vidmem = true, + .honors_aperture = true, + .unified_memory = true, .reset_assert = gp10b_tegra_reset_assert, .reset_deassert = gp10b_tegra_reset_deassert, -- cgit v1.2.2 From 5205ab23a29d6bb2d94eecae67ba344f438c5045 Mon Sep 17 00:00:00 2001 From: Deepak Nibade Date: Fri, 2 Jun 2017 14:51:08 +0530 Subject: gpu: nvgpu: use nvgpu specific nvhost APIs Remove use of linux specifix header files and and use nvgpu specific header file instead This is needed to remove all Linux dependencies from nvgpu driver Replace all nvhost_*() calls by nvgpu_nvhost_*() calls from new nvgpu library Jira NVGPU-29 Change-Id: I32d59628ca5ab3ece80a10eb5aefa150b1da448b Signed-off-by: Deepak Nibade Reviewed-on: http://git-master/r/1494648 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: svccoveritychecker GVS: Gerrit_Virtual_Submit Reviewed-by: Bharat Nihalani --- drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c | 33 ++++++++------------------ 1 file changed, 10 insertions(+), 23 deletions(-) (limited to 'drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c') diff --git a/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c b/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c index 4b600cdd..2b6f8759 100644 --- a/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c +++ b/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c @@ -19,9 +19,8 @@ #include #include #include -#ifdef CONFIG_TEGRA_GK20A_NVHOST -#include -#endif +#include +#include #include @@ -40,38 +39,26 @@ static void gr_gv11b_remove_sysfs(struct device *dev); static int gv11b_tegra_probe(struct device *dev) { - int err = 0; struct gk20a_platform *platform = dev_get_drvdata(dev); - struct gk20a *g = platform->g; - struct device_node *np = dev->of_node; - struct device_node *host1x_node; - struct platform_device *host1x_pdev; - const __be32 *host1x_ptr; - #ifdef CONFIG_TEGRA_GK20A_NVHOST - host1x_ptr = of_get_property(np, "nvidia,host1x", NULL); - if (!host1x_ptr) { - dev_err(dev, "host1x device not available"); - return -ENOSYS; - } + struct gk20a *g = platform->g; + int err = 0; - host1x_node = of_find_node_by_phandle(be32_to_cpup(host1x_ptr)); - host1x_pdev = of_find_device_by_node(host1x_node); - if (!host1x_pdev) { + err = nvgpu_get_nvhost_dev(g); + if (err) { dev_err(dev, "host1x device not available"); - return -ENOSYS; + return err; } - platform->g->host1x_dev = host1x_pdev; - err = nvhost_syncpt_unit_interface_get_aperture( - g->host1x_dev, + err = nvgpu_nvhost_syncpt_unit_interface_get_aperture( + g->nvhost_dev, &g->syncpt_unit_base, &g->syncpt_unit_size); if (err) { dev_err(dev, "Failed to get syncpt interface"); return -ENOSYS; } - g->syncpt_size = nvhost_syncpt_unit_interface_get_byte_offset(1); + g->syncpt_size = nvgpu_nvhost_syncpt_unit_interface_get_byte_offset(1); gk20a_dbg_info("syncpt_unit_base %llx syncpt_unit_size %zx size %x\n", g->syncpt_unit_base, g->syncpt_unit_size, g->syncpt_size); -- cgit v1.2.2 From ca76b41a642209418562c1899fdb1f0b1af4b889 Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Mon, 19 Jun 2017 14:35:48 -0700 Subject: gpu: nvgpu: gv11b: Merge tegra/linux to common/linux tegra/linux path was created to separate Tegra kernel specific dependencies from common Linux specific dependencies. The split has not really worked, so merge tegra/linux to common/linux. JIRA NVGPU-38 Change-Id: I9efe078bfa5dfbef49408db9d8a3738dfda8bd1d Signed-off-by: Terje Bergstrom Reviewed-on: http://git-master/r/1505169 Reviewed-by: Alex Waterman GVS: Gerrit_Virtual_Submit --- drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c') diff --git a/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c b/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c index 2b6f8759..fee4ebbf 100644 --- a/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c +++ b/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c @@ -26,12 +26,12 @@ #include "gk20a/platform_gk20a.h" #include "gk20a/gk20a.h" -#include "tegra/linux/clk.h" +#include "common/linux/clk.h" #include "gp10b/platform_gp10b.h" -#include "tegra/linux/platform_gp10b_tegra.h" +#include "common/linux/platform_gp10b_tegra.h" -#include "tegra/linux/platform_gk20a_tegra.h" +#include "common/linux/platform_gk20a_tegra.h" #include "gr_gv11b.h" #include "nvgpu_gpuid_t19x.h" -- cgit v1.2.2 From b8c92ae1d8b7f2fcee006729fd55f5c315ba9349 Mon Sep 17 00:00:00 2001 From: Seema Khowala Date: Mon, 24 Apr 2017 22:58:53 -0700 Subject: gpu: nvgpu: gv11b: enable sync point support JIRA GPUT19X-2 Change-Id: If69567af3f6de6cd65429086578715fb4d6dfeb5 Signed-off-by: seshendra Gadagottu Signed-off-by: Seema Khowala Reviewed-on: https://git-master/r/1323440 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c') diff --git a/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c b/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c index fee4ebbf..acec2d3a 100644 --- a/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c +++ b/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c @@ -114,7 +114,7 @@ static int gv11b_tegra_suspend(struct device *dev) } struct gk20a_platform t19x_gpu_tegra_platform = { - .has_syncpoints = false, + .has_syncpoints = true, /* power management configuration */ -- cgit v1.2.2 From c865b16337bf37959f6b7e8ff1970d8c3d3a927e Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Fri, 23 Jun 2017 13:26:52 -0700 Subject: gpu: nvgpu: gv11b: Per chip default big page size Stop defining per-platform default big page size. It's defined via HAL and inherited from gp10b. JIRA NVGPU-38 Change-Id: If5eedd5d351d5504bdf87489d1aa091d430c43ba Signed-off-by: Terje Bergstrom Reviewed-on: https://git-master/r/1508069 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit --- drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c') diff --git a/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c b/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c index acec2d3a..3f6b0153 100644 --- a/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c +++ b/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c @@ -135,8 +135,6 @@ struct gk20a_platform t19x_gpu_tegra_platform = { .dump_platform_dependencies = gk20a_tegra_debug_dump, - .default_big_page_size = SZ_64K, - .soc_name = "tegra19x", .honors_aperture = true, -- cgit v1.2.2 From d61643c0200983dc340d37962bb0a3ca900a3e97 Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Mon, 25 Sep 2017 08:59:28 -0700 Subject: gpu: nvgpu: gv11b: Change license for common files to MIT Change license of OS independent source code files to MIT. JIRA NVGPU-218 Change-Id: I93c0504f0544ee8ced4898c386b3f5fbaa6a99a9 Signed-off-by: Terje Bergstrom Reviewed-on: https://git-master.nvidia.com/r/1567804 Reviewed-by: svc-mobile-coverity Reviewed-by: David Martinez Nieto Reviewed-by: Seshendra Gadagottu Reviewed-by: svccoveritychecker GVS: Gerrit_Virtual_Submit --- drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) (limited to 'drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c') diff --git a/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c b/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c index 3f6b0153..c29d4a23 100644 --- a/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c +++ b/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c @@ -3,14 +3,23 @@ * * Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved. * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ #include -- cgit v1.2.2 From 192afccf7c9982ea47b46fd4b7ace4114ff7b45e Mon Sep 17 00:00:00 2001 From: Deepak Goyal Date: Fri, 22 Sep 2017 15:36:36 +0530 Subject: gpu: nvgpu: gv11b: skip clk gating prog for pre-si For pre-silicon platforms, clock gating should be skipped as it is not supported. Added new flags "can_"x"lcg" to check platform capability before programming SLCG,BLCG and ELCG. Bug 200314250 Change-Id: Iec7564b00b988cdd50a02f3130662727839c5047 Signed-off-by: Deepak Goyal Reviewed-on: https://git-master.nvidia.com/r/1566251 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c') diff --git a/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c b/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c index c29d4a23..d2c690f4 100644 --- a/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c +++ b/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c @@ -133,6 +133,13 @@ struct gk20a_platform t19x_gpu_tegra_platform = { .probe = gv11b_tegra_probe, .remove = gv11b_tegra_remove, + .enable_slcg = false, + .enable_blcg = false, + .enable_elcg = false, + .can_slcg = false, + .can_blcg = false, + .can_elcg = false, + /* power management callbacks */ .suspend = gv11b_tegra_suspend, .railgate = gv11b_tegra_railgate, -- cgit v1.2.2 From e5c3b05bb2775236679b74194e4ac24612ef39b6 Mon Sep 17 00:00:00 2001 From: Deepak Nibade Date: Mon, 30 Oct 2017 19:28:43 +0530 Subject: gpu: nvgpu: use struct gk20a for create_gr_sysfs API gr_gv11b_create_sysfs() and GR HAL create_gr_sysfs() right now receive linux specific struct device But since this function is called from/declared in common code, we need to remove linux dependency from it Hence update the API and GR HAL to receive struct gk20a pointer instead of device pointer Jira NVGPU-259 Change-Id: I65d717ad9f263f0397f8efa5761c64e55c7846eb Signed-off-by: Deepak Nibade Reviewed-on: https://git-master.nvidia.com/r/1588465 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Terje Bergstrom GVS: Gerrit_Virtual_Submit Reviewed-by: Bharat Nihalani Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c') diff --git a/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c b/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c index d2c690f4..5308f4ea 100644 --- a/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c +++ b/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c @@ -40,6 +40,7 @@ #include "gp10b/platform_gp10b.h" #include "common/linux/platform_gp10b_tegra.h" +#include "common/linux/os_linux.h" #include "common/linux/platform_gk20a_tegra.h" #include "gr_gv11b.h" #include "nvgpu_gpuid_t19x.h" @@ -188,9 +189,9 @@ static struct device_attribute *dev_attr_mmu_hubtlb_ecc_uncorrected_err_count_ar static struct device_attribute *dev_attr_mmu_fillunit_ecc_corrected_err_count_array; static struct device_attribute *dev_attr_mmu_fillunit_ecc_uncorrected_err_count_array; -void gr_gv11b_create_sysfs(struct device *dev) +void gr_gv11b_create_sysfs(struct gk20a *g) { - struct gk20a *g = get_gk20a(dev); + struct device *dev = dev_from_gk20a(g); int error = 0; /* This stat creation function is called on GR init. GR can get initialized multiple times but we only need to create the ECC @@ -199,7 +200,7 @@ void gr_gv11b_create_sysfs(struct device *dev) if (g->ecc.gr.t19x.sm_l1_tag_corrected_err_count.counters != NULL) return; - gr_gp10b_create_sysfs(dev); + gr_gp10b_create_sysfs(g); error |= gr_gp10b_ecc_stat_create(dev, 0, -- cgit v1.2.2 From d73e89f984f2f6f8da4e49a0ec3bea0bfc34cde2 Mon Sep 17 00:00:00 2001 From: Deepak Nibade Date: Tue, 31 Oct 2017 19:24:34 +0530 Subject: gpu: nvgpu: move platform_gk20a.h to linux Fix #includes in all the files to include platform_gk20a.h file with correct path NVGPU-316 Change-Id: Icb26d3c75076b8fdc8da992f751e1cfea22996be Signed-off-by: Deepak Nibade Reviewed-on: https://git-master.nvidia.com/r/1589939 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c') diff --git a/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c b/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c index 5308f4ea..ca346d97 100644 --- a/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c +++ b/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c @@ -33,8 +33,8 @@ #include -#include "gk20a/platform_gk20a.h" #include "gk20a/gk20a.h" +#include "common/linux/platform_gk20a.h" #include "common/linux/clk.h" #include "gp10b/platform_gp10b.h" -- cgit v1.2.2 From bcd78a0be617be07234e3ef4925cecaef66f2fa4 Mon Sep 17 00:00:00 2001 From: Seema Khowala Date: Tue, 31 Oct 2017 20:56:29 -0700 Subject: nvgpu: gv11b: implement railgate/unrailgate Implement gv11b platform specific rail gating functions by calling relevant powergate and unpowergate functions and linux clock frmework functions: gv11b_tegra_is_railgated gv11b_tegra_railgate gv11b_tegra_unrailgate These calls will take care of hot reset sequence required for gpu powergate and gpu unpowergate. Bug 200269361 Bug 200273571 Change-Id: Ib1825e4324d51fc508b3b5dc9e5e2fdb252eeff4 Signed-off-by: seshendra Gadagottu Signed-off-by: Seema Khowala Reviewed-on: https://git-master.nvidia.com/r/1589509 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c | 59 ++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) (limited to 'drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c') diff --git a/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c b/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c index ca346d97..95d82254 100644 --- a/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c +++ b/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c @@ -28,11 +28,15 @@ #include #include #include +#include #include #include #include +#include +#include + #include "gk20a/gk20a.h" #include "common/linux/platform_gk20a.h" #include "common/linux/clk.h" @@ -103,18 +107,73 @@ static int gv11b_tegra_remove(struct device *dev) static bool gv11b_tegra_is_railgated(struct device *dev) { bool ret = false; +#ifdef TEGRA194_POWER_DOMAIN_GPU + struct gk20a *g = get_gk20a(dev); + + if (tegra_bpmp_running()) { + nvgpu_log(g, gpu_dbg_info, "bpmp running"); + ret = !tegra_powergate_is_powered(TEGRA194_POWER_DOMAIN_GPU); + nvgpu_log(g, gpu_dbg_info, "railgated? %s", ret ? "yes" : "no"); + } else { + nvgpu_log(g, gpu_dbg_info, "bpmp not running"); + } +#endif return ret; } static int gv11b_tegra_railgate(struct device *dev) { +#ifdef TEGRA194_POWER_DOMAIN_GPU + struct gk20a_platform *platform = gk20a_get_platform(dev); + struct gk20a *g = get_gk20a(dev); + int i; + + if (tegra_bpmp_running()) { + nvgpu_log(g, gpu_dbg_info, "bpmp running"); + if (!tegra_powergate_is_powered(TEGRA194_POWER_DOMAIN_GPU)) { + nvgpu_log(g, gpu_dbg_info, "powergate is not powered"); + return 0; + } + nvgpu_log(g, gpu_dbg_info, "clk_disable_unprepare"); + for (i = 0; i < platform->num_clks; i++) { + if (platform->clk[i]) + clk_disable_unprepare(platform->clk[i]); + } + nvgpu_log(g, gpu_dbg_info, "powergate_partition"); + tegra_powergate_partition(TEGRA194_POWER_DOMAIN_GPU); + } else { + nvgpu_log(g, gpu_dbg_info, "bpmp not running"); + } +#endif return 0; } static int gv11b_tegra_unrailgate(struct device *dev) { int ret = 0; +#ifdef TEGRA194_POWER_DOMAIN_GPU + struct gk20a_platform *platform = gk20a_get_platform(dev); + struct gk20a *g = get_gk20a(dev); + int i; + + if (tegra_bpmp_running()) { + nvgpu_log(g, gpu_dbg_info, "bpmp running"); + ret = tegra_unpowergate_partition(TEGRA194_POWER_DOMAIN_GPU); + if (ret) { + nvgpu_log(g, gpu_dbg_info, + "unpowergate partition failed"); + return ret; + } + nvgpu_log(g, gpu_dbg_info, "clk_prepare_enable"); + for (i = 0; i < platform->num_clks; i++) { + if (platform->clk[i]) + clk_prepare_enable(platform->clk[i]); + } + } else { + nvgpu_log(g, gpu_dbg_info, "bpmp not running"); + } +#endif return ret; } -- cgit v1.2.2