diff options
author | Lakshmanan M <lm@nvidia.com> | 2017-05-10 04:52:15 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-05-18 12:04:34 -0400 |
commit | b1d303685b384d58064d8b18ec97e1302bcbba88 (patch) | |
tree | febc0226b712513b025afd78f5c898f41b4846d3 /drivers/gpu/nvgpu/tegra/linux | |
parent | 4d7711b076acf077b93b8cbac40ab0429b33fce6 (diff) |
gpu: nvgpu: Add gr_t19x support for gv11b ECC
This CL covers the following modification,
1) Added gr_t19x support for gv11b ECC
2) Modified the gp10b platform config for
gv11b sysfs support
JIRA GPUT19X-85
JIRA GPUT19X-104
JIRA GPUT19X-100
JIRA GPUT19X-103
Bug 1825948
Bug 1825962
Bug 1775457
Change-Id: I0bf13f80a73cc2184147230d098e89a517554c01
Signed-off-by: Lakshmanan M <lm@nvidia.com>
Reviewed-on: http://git-master/r/1478952
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/tegra/linux')
-rw-r--r-- | drivers/gpu/nvgpu/tegra/linux/platform_gp10b_tegra.c | 73 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/tegra/linux/platform_gp10b_tegra.h | 35 |
2 files changed, 72 insertions, 36 deletions
diff --git a/drivers/gpu/nvgpu/tegra/linux/platform_gp10b_tegra.c b/drivers/gpu/nvgpu/tegra/linux/platform_gp10b_tegra.c index 32cc80d9..1dedd593 100644 --- a/drivers/gpu/nvgpu/tegra/linux/platform_gp10b_tegra.c +++ b/drivers/gpu/nvgpu/tegra/linux/platform_gp10b_tegra.c | |||
@@ -39,6 +39,7 @@ | |||
39 | #include "platform_gk20a_tegra.h" | 39 | #include "platform_gk20a_tegra.h" |
40 | #include "gp10b/gp10b_sysfs.h" | 40 | #include "gp10b/gp10b_sysfs.h" |
41 | #include "gp10b/platform_gp10b.h" | 41 | #include "gp10b/platform_gp10b.h" |
42 | #include "platform_gp10b_tegra.h" | ||
42 | 43 | ||
43 | #include <nvgpu/hw/gp10b/hw_gr_gp10b.h> | 44 | #include <nvgpu/hw/gp10b/hw_gr_gp10b.h> |
44 | #include <nvgpu/hw/gp10b/hw_ltc_gp10b.h> | 45 | #include <nvgpu/hw/gp10b/hw_ltc_gp10b.h> |
@@ -181,7 +182,7 @@ static int gp10b_tegra_late_probe(struct device *dev) | |||
181 | return 0; | 182 | return 0; |
182 | } | 183 | } |
183 | 184 | ||
184 | static int gp10b_tegra_remove(struct device *dev) | 185 | int gp10b_tegra_remove(struct device *dev) |
185 | { | 186 | { |
186 | gr_gp10b_remove_sysfs(dev); | 187 | gr_gp10b_remove_sysfs(dev); |
187 | /*Remove GP10B specific sysfs*/ | 188 | /*Remove GP10B specific sysfs*/ |
@@ -483,7 +484,7 @@ static ssize_t ecc_stat_show(struct device *dev, | |||
483 | const char *ecc_stat_full_name = attr->attr.name; | 484 | const char *ecc_stat_full_name = attr->attr.name; |
484 | const char *ecc_stat_base_name; | 485 | const char *ecc_stat_base_name; |
485 | unsigned int hw_unit; | 486 | unsigned int hw_unit; |
486 | struct ecc_stat *ecc_stat; | 487 | struct gr_gp10b_ecc_stat *ecc_stat; |
487 | u32 hash_key; | 488 | u32 hash_key; |
488 | 489 | ||
489 | if (sscanf(ecc_stat_full_name, "ltc%u", &hw_unit) == 1) { | 490 | if (sscanf(ecc_stat_full_name, "ltc%u", &hw_unit) == 1) { |
@@ -508,10 +509,10 @@ static ssize_t ecc_stat_show(struct device *dev, | |||
508 | return snprintf(buf, PAGE_SIZE, "Error: No ECC stat found!\n"); | 509 | return snprintf(buf, PAGE_SIZE, "Error: No ECC stat found!\n"); |
509 | } | 510 | } |
510 | 511 | ||
511 | static int ecc_stat_create(struct device *dev, | 512 | int gr_gp10b_ecc_stat_create(struct device *dev, |
512 | int is_l2, | 513 | int is_l2, |
513 | char *ecc_stat_name, | 514 | char *ecc_stat_name, |
514 | struct ecc_stat *ecc_stat, | 515 | struct gr_gp10b_ecc_stat *ecc_stat, |
515 | struct device_attribute *dev_attr_array) | 516 | struct device_attribute *dev_attr_array) |
516 | { | 517 | { |
517 | int error = 0; | 518 | int error = 0; |
@@ -569,9 +570,9 @@ static int ecc_stat_create(struct device *dev, | |||
569 | return error; | 570 | return error; |
570 | } | 571 | } |
571 | 572 | ||
572 | static void ecc_stat_remove(struct device *dev, | 573 | void gr_gp10b_ecc_stat_remove(struct device *dev, |
573 | int is_l2, | 574 | int is_l2, |
574 | struct ecc_stat *ecc_stat, | 575 | struct gr_gp10b_ecc_stat *ecc_stat, |
575 | struct device_attribute *dev_attr_array) | 576 | struct device_attribute *dev_attr_array) |
576 | { | 577 | { |
577 | struct gk20a *g = get_gk20a(dev); | 578 | struct gk20a *g = get_gk20a(dev); |
@@ -612,80 +613,80 @@ void gr_gp10b_create_sysfs(struct device *dev) | |||
612 | if (g->gr.t18x.ecc_stats.sm_lrf_single_err_count.counters != NULL) | 613 | if (g->gr.t18x.ecc_stats.sm_lrf_single_err_count.counters != NULL) |
613 | return; | 614 | return; |
614 | 615 | ||
615 | error |= ecc_stat_create(dev, | 616 | error |= gr_gp10b_ecc_stat_create(dev, |
616 | 0, | 617 | 0, |
617 | "sm_lrf_ecc_single_err_count", | 618 | "sm_lrf_ecc_single_err_count", |
618 | &g->gr.t18x.ecc_stats.sm_lrf_single_err_count, | 619 | &g->gr.t18x.ecc_stats.sm_lrf_single_err_count, |
619 | dev_attr_sm_lrf_ecc_single_err_count_array); | 620 | dev_attr_sm_lrf_ecc_single_err_count_array); |
620 | error |= ecc_stat_create(dev, | 621 | error |= gr_gp10b_ecc_stat_create(dev, |
621 | 0, | 622 | 0, |
622 | "sm_lrf_ecc_double_err_count", | 623 | "sm_lrf_ecc_double_err_count", |
623 | &g->gr.t18x.ecc_stats.sm_lrf_double_err_count, | 624 | &g->gr.t18x.ecc_stats.sm_lrf_double_err_count, |
624 | dev_attr_sm_lrf_ecc_double_err_count_array); | 625 | dev_attr_sm_lrf_ecc_double_err_count_array); |
625 | 626 | ||
626 | error |= ecc_stat_create(dev, | 627 | error |= gr_gp10b_ecc_stat_create(dev, |
627 | 0, | 628 | 0, |
628 | "sm_shm_ecc_sec_count", | 629 | "sm_shm_ecc_sec_count", |
629 | &g->gr.t18x.ecc_stats.sm_shm_sec_count, | 630 | &g->gr.t18x.ecc_stats.sm_shm_sec_count, |
630 | dev_attr_sm_shm_ecc_sec_count_array); | 631 | dev_attr_sm_shm_ecc_sec_count_array); |
631 | error |= ecc_stat_create(dev, | 632 | error |= gr_gp10b_ecc_stat_create(dev, |
632 | 0, | 633 | 0, |
633 | "sm_shm_ecc_sed_count", | 634 | "sm_shm_ecc_sed_count", |
634 | &g->gr.t18x.ecc_stats.sm_shm_sed_count, | 635 | &g->gr.t18x.ecc_stats.sm_shm_sed_count, |
635 | dev_attr_sm_shm_ecc_sed_count_array); | 636 | dev_attr_sm_shm_ecc_sed_count_array); |
636 | error |= ecc_stat_create(dev, | 637 | error |= gr_gp10b_ecc_stat_create(dev, |
637 | 0, | 638 | 0, |
638 | "sm_shm_ecc_ded_count", | 639 | "sm_shm_ecc_ded_count", |
639 | &g->gr.t18x.ecc_stats.sm_shm_ded_count, | 640 | &g->gr.t18x.ecc_stats.sm_shm_ded_count, |
640 | dev_attr_sm_shm_ecc_ded_count_array); | 641 | dev_attr_sm_shm_ecc_ded_count_array); |
641 | 642 | ||
642 | error |= ecc_stat_create(dev, | 643 | error |= gr_gp10b_ecc_stat_create(dev, |
643 | 0, | 644 | 0, |
644 | "tex_ecc_total_sec_pipe0_count", | 645 | "tex_ecc_total_sec_pipe0_count", |
645 | &g->gr.t18x.ecc_stats.tex_total_sec_pipe0_count, | 646 | &g->gr.t18x.ecc_stats.tex_total_sec_pipe0_count, |
646 | dev_attr_tex_ecc_total_sec_pipe0_count_array); | 647 | dev_attr_tex_ecc_total_sec_pipe0_count_array); |
647 | error |= ecc_stat_create(dev, | 648 | error |= gr_gp10b_ecc_stat_create(dev, |
648 | 0, | 649 | 0, |
649 | "tex_ecc_total_ded_pipe0_count", | 650 | "tex_ecc_total_ded_pipe0_count", |
650 | &g->gr.t18x.ecc_stats.tex_total_ded_pipe0_count, | 651 | &g->gr.t18x.ecc_stats.tex_total_ded_pipe0_count, |
651 | dev_attr_tex_ecc_total_ded_pipe0_count_array); | 652 | dev_attr_tex_ecc_total_ded_pipe0_count_array); |
652 | error |= ecc_stat_create(dev, | 653 | error |= gr_gp10b_ecc_stat_create(dev, |
653 | 0, | 654 | 0, |
654 | "tex_ecc_unique_sec_pipe0_count", | 655 | "tex_ecc_unique_sec_pipe0_count", |
655 | &g->gr.t18x.ecc_stats.tex_unique_sec_pipe0_count, | 656 | &g->gr.t18x.ecc_stats.tex_unique_sec_pipe0_count, |
656 | dev_attr_tex_ecc_unique_sec_pipe0_count_array); | 657 | dev_attr_tex_ecc_unique_sec_pipe0_count_array); |
657 | error |= ecc_stat_create(dev, | 658 | error |= gr_gp10b_ecc_stat_create(dev, |
658 | 0, | 659 | 0, |
659 | "tex_ecc_unique_ded_pipe0_count", | 660 | "tex_ecc_unique_ded_pipe0_count", |
660 | &g->gr.t18x.ecc_stats.tex_unique_ded_pipe0_count, | 661 | &g->gr.t18x.ecc_stats.tex_unique_ded_pipe0_count, |
661 | dev_attr_tex_ecc_unique_ded_pipe0_count_array); | 662 | dev_attr_tex_ecc_unique_ded_pipe0_count_array); |
662 | error |= ecc_stat_create(dev, | 663 | error |= gr_gp10b_ecc_stat_create(dev, |
663 | 0, | 664 | 0, |
664 | "tex_ecc_total_sec_pipe1_count", | 665 | "tex_ecc_total_sec_pipe1_count", |
665 | &g->gr.t18x.ecc_stats.tex_total_sec_pipe1_count, | 666 | &g->gr.t18x.ecc_stats.tex_total_sec_pipe1_count, |
666 | dev_attr_tex_ecc_total_sec_pipe1_count_array); | 667 | dev_attr_tex_ecc_total_sec_pipe1_count_array); |
667 | error |= ecc_stat_create(dev, | 668 | error |= gr_gp10b_ecc_stat_create(dev, |
668 | 0, | 669 | 0, |
669 | "tex_ecc_total_ded_pipe1_count", | 670 | "tex_ecc_total_ded_pipe1_count", |
670 | &g->gr.t18x.ecc_stats.tex_total_ded_pipe1_count, | 671 | &g->gr.t18x.ecc_stats.tex_total_ded_pipe1_count, |
671 | dev_attr_tex_ecc_total_ded_pipe1_count_array); | 672 | dev_attr_tex_ecc_total_ded_pipe1_count_array); |
672 | error |= ecc_stat_create(dev, | 673 | error |= gr_gp10b_ecc_stat_create(dev, |
673 | 0, | 674 | 0, |
674 | "tex_ecc_unique_sec_pipe1_count", | 675 | "tex_ecc_unique_sec_pipe1_count", |
675 | &g->gr.t18x.ecc_stats.tex_unique_sec_pipe1_count, | 676 | &g->gr.t18x.ecc_stats.tex_unique_sec_pipe1_count, |
676 | dev_attr_tex_ecc_unique_sec_pipe1_count_array); | 677 | dev_attr_tex_ecc_unique_sec_pipe1_count_array); |
677 | error |= ecc_stat_create(dev, | 678 | error |= gr_gp10b_ecc_stat_create(dev, |
678 | 0, | 679 | 0, |
679 | "tex_ecc_unique_ded_pipe1_count", | 680 | "tex_ecc_unique_ded_pipe1_count", |
680 | &g->gr.t18x.ecc_stats.tex_unique_ded_pipe1_count, | 681 | &g->gr.t18x.ecc_stats.tex_unique_ded_pipe1_count, |
681 | dev_attr_tex_ecc_unique_ded_pipe1_count_array); | 682 | dev_attr_tex_ecc_unique_ded_pipe1_count_array); |
682 | 683 | ||
683 | error |= ecc_stat_create(dev, | 684 | error |= gr_gp10b_ecc_stat_create(dev, |
684 | 1, | 685 | 1, |
685 | "lts0_ecc_sec_count", | 686 | "lts0_ecc_sec_count", |
686 | &g->gr.t18x.ecc_stats.l2_sec_count, | 687 | &g->gr.t18x.ecc_stats.l2_sec_count, |
687 | dev_attr_l2_ecc_sec_count_array); | 688 | dev_attr_l2_ecc_sec_count_array); |
688 | error |= ecc_stat_create(dev, | 689 | error |= gr_gp10b_ecc_stat_create(dev, |
689 | 1, | 690 | 1, |
690 | "lts0_ecc_ded_count", | 691 | "lts0_ecc_ded_count", |
691 | &g->gr.t18x.ecc_stats.l2_ded_count, | 692 | &g->gr.t18x.ecc_stats.l2_ded_count, |
@@ -699,66 +700,66 @@ static void gr_gp10b_remove_sysfs(struct device *dev) | |||
699 | { | 700 | { |
700 | struct gk20a *g = get_gk20a(dev); | 701 | struct gk20a *g = get_gk20a(dev); |
701 | 702 | ||
702 | ecc_stat_remove(dev, | 703 | gr_gp10b_ecc_stat_remove(dev, |
703 | 0, | 704 | 0, |
704 | &g->gr.t18x.ecc_stats.sm_lrf_single_err_count, | 705 | &g->gr.t18x.ecc_stats.sm_lrf_single_err_count, |
705 | dev_attr_sm_lrf_ecc_single_err_count_array); | 706 | dev_attr_sm_lrf_ecc_single_err_count_array); |
706 | ecc_stat_remove(dev, | 707 | gr_gp10b_ecc_stat_remove(dev, |
707 | 0, | 708 | 0, |
708 | &g->gr.t18x.ecc_stats.sm_lrf_double_err_count, | 709 | &g->gr.t18x.ecc_stats.sm_lrf_double_err_count, |
709 | dev_attr_sm_lrf_ecc_double_err_count_array); | 710 | dev_attr_sm_lrf_ecc_double_err_count_array); |
710 | 711 | ||
711 | ecc_stat_remove(dev, | 712 | gr_gp10b_ecc_stat_remove(dev, |
712 | 0, | 713 | 0, |
713 | &g->gr.t18x.ecc_stats.sm_shm_sec_count, | 714 | &g->gr.t18x.ecc_stats.sm_shm_sec_count, |
714 | dev_attr_sm_shm_ecc_sec_count_array); | 715 | dev_attr_sm_shm_ecc_sec_count_array); |
715 | ecc_stat_remove(dev, | 716 | gr_gp10b_ecc_stat_remove(dev, |
716 | 0, | 717 | 0, |
717 | &g->gr.t18x.ecc_stats.sm_shm_sed_count, | 718 | &g->gr.t18x.ecc_stats.sm_shm_sed_count, |
718 | dev_attr_sm_shm_ecc_sed_count_array); | 719 | dev_attr_sm_shm_ecc_sed_count_array); |
719 | ecc_stat_remove(dev, | 720 | gr_gp10b_ecc_stat_remove(dev, |
720 | 0, | 721 | 0, |
721 | &g->gr.t18x.ecc_stats.sm_shm_ded_count, | 722 | &g->gr.t18x.ecc_stats.sm_shm_ded_count, |
722 | dev_attr_sm_shm_ecc_ded_count_array); | 723 | dev_attr_sm_shm_ecc_ded_count_array); |
723 | 724 | ||
724 | ecc_stat_remove(dev, | 725 | gr_gp10b_ecc_stat_remove(dev, |
725 | 0, | 726 | 0, |
726 | &g->gr.t18x.ecc_stats.tex_total_sec_pipe0_count, | 727 | &g->gr.t18x.ecc_stats.tex_total_sec_pipe0_count, |
727 | dev_attr_tex_ecc_total_sec_pipe0_count_array); | 728 | dev_attr_tex_ecc_total_sec_pipe0_count_array); |
728 | ecc_stat_remove(dev, | 729 | gr_gp10b_ecc_stat_remove(dev, |
729 | 0, | 730 | 0, |
730 | &g->gr.t18x.ecc_stats.tex_total_ded_pipe0_count, | 731 | &g->gr.t18x.ecc_stats.tex_total_ded_pipe0_count, |
731 | dev_attr_tex_ecc_total_ded_pipe0_count_array); | 732 | dev_attr_tex_ecc_total_ded_pipe0_count_array); |
732 | ecc_stat_remove(dev, | 733 | gr_gp10b_ecc_stat_remove(dev, |
733 | 0, | 734 | 0, |
734 | &g->gr.t18x.ecc_stats.tex_unique_sec_pipe0_count, | 735 | &g->gr.t18x.ecc_stats.tex_unique_sec_pipe0_count, |
735 | dev_attr_tex_ecc_unique_sec_pipe0_count_array); | 736 | dev_attr_tex_ecc_unique_sec_pipe0_count_array); |
736 | ecc_stat_remove(dev, | 737 | gr_gp10b_ecc_stat_remove(dev, |
737 | 0, | 738 | 0, |
738 | &g->gr.t18x.ecc_stats.tex_unique_ded_pipe0_count, | 739 | &g->gr.t18x.ecc_stats.tex_unique_ded_pipe0_count, |
739 | dev_attr_tex_ecc_unique_ded_pipe0_count_array); | 740 | dev_attr_tex_ecc_unique_ded_pipe0_count_array); |
740 | ecc_stat_remove(dev, | 741 | gr_gp10b_ecc_stat_remove(dev, |
741 | 0, | 742 | 0, |
742 | &g->gr.t18x.ecc_stats.tex_total_sec_pipe1_count, | 743 | &g->gr.t18x.ecc_stats.tex_total_sec_pipe1_count, |
743 | dev_attr_tex_ecc_total_sec_pipe1_count_array); | 744 | dev_attr_tex_ecc_total_sec_pipe1_count_array); |
744 | ecc_stat_remove(dev, | 745 | gr_gp10b_ecc_stat_remove(dev, |
745 | 0, | 746 | 0, |
746 | &g->gr.t18x.ecc_stats.tex_total_ded_pipe1_count, | 747 | &g->gr.t18x.ecc_stats.tex_total_ded_pipe1_count, |
747 | dev_attr_tex_ecc_total_ded_pipe1_count_array); | 748 | dev_attr_tex_ecc_total_ded_pipe1_count_array); |
748 | ecc_stat_remove(dev, | 749 | gr_gp10b_ecc_stat_remove(dev, |
749 | 0, | 750 | 0, |
750 | &g->gr.t18x.ecc_stats.tex_unique_sec_pipe1_count, | 751 | &g->gr.t18x.ecc_stats.tex_unique_sec_pipe1_count, |
751 | dev_attr_tex_ecc_unique_sec_pipe1_count_array); | 752 | dev_attr_tex_ecc_unique_sec_pipe1_count_array); |
752 | ecc_stat_remove(dev, | 753 | gr_gp10b_ecc_stat_remove(dev, |
753 | 0, | 754 | 0, |
754 | &g->gr.t18x.ecc_stats.tex_unique_ded_pipe1_count, | 755 | &g->gr.t18x.ecc_stats.tex_unique_ded_pipe1_count, |
755 | dev_attr_tex_ecc_unique_ded_pipe1_count_array); | 756 | dev_attr_tex_ecc_unique_ded_pipe1_count_array); |
756 | 757 | ||
757 | ecc_stat_remove(dev, | 758 | gr_gp10b_ecc_stat_remove(dev, |
758 | 1, | 759 | 1, |
759 | &g->gr.t18x.ecc_stats.l2_sec_count, | 760 | &g->gr.t18x.ecc_stats.l2_sec_count, |
760 | dev_attr_l2_ecc_sec_count_array); | 761 | dev_attr_l2_ecc_sec_count_array); |
761 | ecc_stat_remove(dev, | 762 | gr_gp10b_ecc_stat_remove(dev, |
762 | 1, | 763 | 1, |
763 | &g->gr.t18x.ecc_stats.l2_ded_count, | 764 | &g->gr.t18x.ecc_stats.l2_ded_count, |
764 | dev_attr_l2_ecc_ded_count_array); | 765 | dev_attr_l2_ecc_ded_count_array); |
diff --git a/drivers/gpu/nvgpu/tegra/linux/platform_gp10b_tegra.h b/drivers/gpu/nvgpu/tegra/linux/platform_gp10b_tegra.h new file mode 100644 index 00000000..0fcb9f39 --- /dev/null +++ b/drivers/gpu/nvgpu/tegra/linux/platform_gp10b_tegra.h | |||
@@ -0,0 +1,35 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved. | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify it | ||
5 | * under the terms and conditions of the GNU General Public License, | ||
6 | * version 2, as published by the Free Software Foundation. | ||
7 | * | ||
8 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
9 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
10 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
11 | * more details. | ||
12 | * | ||
13 | * You should have received a copy of the GNU General Public License | ||
14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
15 | */ | ||
16 | |||
17 | #ifndef _PLATFORM_GP10B_TEGRA_H_ | ||
18 | #define _PLATFORM_GP10B_TEGRA_H_ | ||
19 | |||
20 | #include "gp10b/gr_gp10b.h" | ||
21 | |||
22 | int gr_gp10b_ecc_stat_create(struct device *dev, | ||
23 | int is_l2, | ||
24 | char *ecc_stat_name, | ||
25 | struct gr_gp10b_ecc_stat *ecc_stat, | ||
26 | struct device_attribute *dev_attr_array); | ||
27 | |||
28 | void gr_gp10b_ecc_stat_remove(struct device *dev, | ||
29 | int is_l2, | ||
30 | struct gr_gp10b_ecc_stat *ecc_stat, | ||
31 | struct device_attribute *dev_attr_array); | ||
32 | |||
33 | int gp10b_tegra_remove(struct device *dev); | ||
34 | |||
35 | #endif | ||