diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2008-08-18 00:23:51 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2008-08-20 02:34:58 -0400 |
commit | b950bdd0fc247d0ab4aea88d46e8cced3eac949e (patch) | |
tree | daea275d042511774a6abd558d963e1199aedb65 /arch/powerpc/kernel/cputable.c | |
parent | 41eba0ad0033967eda346dd833194e96fdf5f405 (diff) |
powerpc: Expose PMCs & cache topology in sysfs on 32-bit
The file arch/powerpc/kernel/sysfs.c is currently only compiled for
64-bit kernels. It contain code to register CPU sysdevs in sysfs and
add various properties such as cache topology and raw access by root
to performance monitor counters (PMCs). A lot of that can be re-used
as is on 32-bits.
This makes the file be built for both, with appropriate ifdef'ing
for the few bits that are really 64-bit specific, and adds some
support for the raw PMCs for 75x and 74xx processors.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/kernel/cputable.c')
-rw-r--r-- | arch/powerpc/kernel/cputable.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/cputable.c b/arch/powerpc/kernel/cputable.c index 25c273c761d1..e70d0483fb4e 100644 --- a/arch/powerpc/kernel/cputable.c +++ b/arch/powerpc/kernel/cputable.c | |||
@@ -610,6 +610,7 @@ static struct cpu_spec __initdata cpu_specs[] = { | |||
610 | .icache_bsize = 32, | 610 | .icache_bsize = 32, |
611 | .dcache_bsize = 32, | 611 | .dcache_bsize = 32, |
612 | .num_pmcs = 4, | 612 | .num_pmcs = 4, |
613 | .pmc_type = PPC_PMC_IBM, | ||
613 | .cpu_setup = __setup_cpu_750cx, | 614 | .cpu_setup = __setup_cpu_750cx, |
614 | .machine_check = machine_check_generic, | 615 | .machine_check = machine_check_generic, |
615 | .platform = "ppc750", | 616 | .platform = "ppc750", |
@@ -623,6 +624,7 @@ static struct cpu_spec __initdata cpu_specs[] = { | |||
623 | .icache_bsize = 32, | 624 | .icache_bsize = 32, |
624 | .dcache_bsize = 32, | 625 | .dcache_bsize = 32, |
625 | .num_pmcs = 4, | 626 | .num_pmcs = 4, |
627 | .pmc_type = PPC_PMC_IBM, | ||
626 | .cpu_setup = __setup_cpu_750cx, | 628 | .cpu_setup = __setup_cpu_750cx, |
627 | .machine_check = machine_check_generic, | 629 | .machine_check = machine_check_generic, |
628 | .platform = "ppc750", | 630 | .platform = "ppc750", |
@@ -636,6 +638,7 @@ static struct cpu_spec __initdata cpu_specs[] = { | |||
636 | .icache_bsize = 32, | 638 | .icache_bsize = 32, |
637 | .dcache_bsize = 32, | 639 | .dcache_bsize = 32, |
638 | .num_pmcs = 4, | 640 | .num_pmcs = 4, |
641 | .pmc_type = PPC_PMC_IBM, | ||
639 | .cpu_setup = __setup_cpu_750cx, | 642 | .cpu_setup = __setup_cpu_750cx, |
640 | .machine_check = machine_check_generic, | 643 | .machine_check = machine_check_generic, |
641 | .platform = "ppc750", | 644 | .platform = "ppc750", |
@@ -649,6 +652,7 @@ static struct cpu_spec __initdata cpu_specs[] = { | |||
649 | .icache_bsize = 32, | 652 | .icache_bsize = 32, |
650 | .dcache_bsize = 32, | 653 | .dcache_bsize = 32, |
651 | .num_pmcs = 4, | 654 | .num_pmcs = 4, |
655 | .pmc_type = PPC_PMC_IBM, | ||
652 | .cpu_setup = __setup_cpu_750, | 656 | .cpu_setup = __setup_cpu_750, |
653 | .machine_check = machine_check_generic, | 657 | .machine_check = machine_check_generic, |
654 | .platform = "ppc750", | 658 | .platform = "ppc750", |
@@ -662,6 +666,7 @@ static struct cpu_spec __initdata cpu_specs[] = { | |||
662 | .icache_bsize = 32, | 666 | .icache_bsize = 32, |
663 | .dcache_bsize = 32, | 667 | .dcache_bsize = 32, |
664 | .num_pmcs = 4, | 668 | .num_pmcs = 4, |
669 | .pmc_type = PPC_PMC_IBM, | ||
665 | .cpu_setup = __setup_cpu_750, | 670 | .cpu_setup = __setup_cpu_750, |
666 | .machine_check = machine_check_generic, | 671 | .machine_check = machine_check_generic, |
667 | .platform = "ppc750", | 672 | .platform = "ppc750", |
@@ -675,6 +680,7 @@ static struct cpu_spec __initdata cpu_specs[] = { | |||
675 | .icache_bsize = 32, | 680 | .icache_bsize = 32, |
676 | .dcache_bsize = 32, | 681 | .dcache_bsize = 32, |
677 | .num_pmcs = 4, | 682 | .num_pmcs = 4, |
683 | .pmc_type = PPC_PMC_IBM, | ||
678 | .cpu_setup = __setup_cpu_750, | 684 | .cpu_setup = __setup_cpu_750, |
679 | .machine_check = machine_check_generic, | 685 | .machine_check = machine_check_generic, |
680 | .platform = "ppc750", | 686 | .platform = "ppc750", |
@@ -688,6 +694,7 @@ static struct cpu_spec __initdata cpu_specs[] = { | |||
688 | .icache_bsize = 32, | 694 | .icache_bsize = 32, |
689 | .dcache_bsize = 32, | 695 | .dcache_bsize = 32, |
690 | .num_pmcs = 4, | 696 | .num_pmcs = 4, |
697 | .pmc_type = PPC_PMC_IBM, | ||
691 | .cpu_setup = __setup_cpu_750, | 698 | .cpu_setup = __setup_cpu_750, |
692 | .machine_check = machine_check_generic, | 699 | .machine_check = machine_check_generic, |
693 | .platform = "ppc750", | 700 | .platform = "ppc750", |
@@ -701,6 +708,7 @@ static struct cpu_spec __initdata cpu_specs[] = { | |||
701 | .icache_bsize = 32, | 708 | .icache_bsize = 32, |
702 | .dcache_bsize = 32, | 709 | .dcache_bsize = 32, |
703 | .num_pmcs = 4, | 710 | .num_pmcs = 4, |
711 | .pmc_type = PPC_PMC_IBM, | ||
704 | .cpu_setup = __setup_cpu_750fx, | 712 | .cpu_setup = __setup_cpu_750fx, |
705 | .machine_check = machine_check_generic, | 713 | .machine_check = machine_check_generic, |
706 | .platform = "ppc750", | 714 | .platform = "ppc750", |
@@ -714,6 +722,7 @@ static struct cpu_spec __initdata cpu_specs[] = { | |||
714 | .icache_bsize = 32, | 722 | .icache_bsize = 32, |
715 | .dcache_bsize = 32, | 723 | .dcache_bsize = 32, |
716 | .num_pmcs = 4, | 724 | .num_pmcs = 4, |
725 | .pmc_type = PPC_PMC_IBM, | ||
717 | .cpu_setup = __setup_cpu_750fx, | 726 | .cpu_setup = __setup_cpu_750fx, |
718 | .machine_check = machine_check_generic, | 727 | .machine_check = machine_check_generic, |
719 | .platform = "ppc750", | 728 | .platform = "ppc750", |
@@ -727,6 +736,7 @@ static struct cpu_spec __initdata cpu_specs[] = { | |||
727 | .icache_bsize = 32, | 736 | .icache_bsize = 32, |
728 | .dcache_bsize = 32, | 737 | .dcache_bsize = 32, |
729 | .num_pmcs = 4, | 738 | .num_pmcs = 4, |
739 | .pmc_type = PPC_PMC_IBM, | ||
730 | .cpu_setup = __setup_cpu_750, | 740 | .cpu_setup = __setup_cpu_750, |
731 | .machine_check = machine_check_generic, | 741 | .machine_check = machine_check_generic, |
732 | .platform = "ppc750", | 742 | .platform = "ppc750", |
@@ -741,6 +751,7 @@ static struct cpu_spec __initdata cpu_specs[] = { | |||
741 | .icache_bsize = 32, | 751 | .icache_bsize = 32, |
742 | .dcache_bsize = 32, | 752 | .dcache_bsize = 32, |
743 | .num_pmcs = 4, | 753 | .num_pmcs = 4, |
754 | .pmc_type = PPC_PMC_G4, | ||
744 | .cpu_setup = __setup_cpu_7400, | 755 | .cpu_setup = __setup_cpu_7400, |
745 | .machine_check = machine_check_generic, | 756 | .machine_check = machine_check_generic, |
746 | .platform = "ppc7400", | 757 | .platform = "ppc7400", |
@@ -755,6 +766,7 @@ static struct cpu_spec __initdata cpu_specs[] = { | |||
755 | .icache_bsize = 32, | 766 | .icache_bsize = 32, |
756 | .dcache_bsize = 32, | 767 | .dcache_bsize = 32, |
757 | .num_pmcs = 4, | 768 | .num_pmcs = 4, |
769 | .pmc_type = PPC_PMC_G4, | ||
758 | .cpu_setup = __setup_cpu_7400, | 770 | .cpu_setup = __setup_cpu_7400, |
759 | .machine_check = machine_check_generic, | 771 | .machine_check = machine_check_generic, |
760 | .platform = "ppc7400", | 772 | .platform = "ppc7400", |
@@ -769,6 +781,7 @@ static struct cpu_spec __initdata cpu_specs[] = { | |||
769 | .icache_bsize = 32, | 781 | .icache_bsize = 32, |
770 | .dcache_bsize = 32, | 782 | .dcache_bsize = 32, |
771 | .num_pmcs = 4, | 783 | .num_pmcs = 4, |
784 | .pmc_type = PPC_PMC_G4, | ||
772 | .cpu_setup = __setup_cpu_7410, | 785 | .cpu_setup = __setup_cpu_7410, |
773 | .machine_check = machine_check_generic, | 786 | .machine_check = machine_check_generic, |
774 | .platform = "ppc7400", | 787 | .platform = "ppc7400", |
@@ -783,6 +796,7 @@ static struct cpu_spec __initdata cpu_specs[] = { | |||
783 | .icache_bsize = 32, | 796 | .icache_bsize = 32, |
784 | .dcache_bsize = 32, | 797 | .dcache_bsize = 32, |
785 | .num_pmcs = 6, | 798 | .num_pmcs = 6, |
799 | .pmc_type = PPC_PMC_G4, | ||
786 | .cpu_setup = __setup_cpu_745x, | 800 | .cpu_setup = __setup_cpu_745x, |
787 | .oprofile_cpu_type = "ppc/7450", | 801 | .oprofile_cpu_type = "ppc/7450", |
788 | .oprofile_type = PPC_OPROFILE_G4, | 802 | .oprofile_type = PPC_OPROFILE_G4, |
@@ -799,6 +813,7 @@ static struct cpu_spec __initdata cpu_specs[] = { | |||
799 | .icache_bsize = 32, | 813 | .icache_bsize = 32, |
800 | .dcache_bsize = 32, | 814 | .dcache_bsize = 32, |
801 | .num_pmcs = 6, | 815 | .num_pmcs = 6, |
816 | .pmc_type = PPC_PMC_G4, | ||
802 | .cpu_setup = __setup_cpu_745x, | 817 | .cpu_setup = __setup_cpu_745x, |
803 | .oprofile_cpu_type = "ppc/7450", | 818 | .oprofile_cpu_type = "ppc/7450", |
804 | .oprofile_type = PPC_OPROFILE_G4, | 819 | .oprofile_type = PPC_OPROFILE_G4, |
@@ -815,6 +830,7 @@ static struct cpu_spec __initdata cpu_specs[] = { | |||
815 | .icache_bsize = 32, | 830 | .icache_bsize = 32, |
816 | .dcache_bsize = 32, | 831 | .dcache_bsize = 32, |
817 | .num_pmcs = 6, | 832 | .num_pmcs = 6, |
833 | .pmc_type = PPC_PMC_G4, | ||
818 | .cpu_setup = __setup_cpu_745x, | 834 | .cpu_setup = __setup_cpu_745x, |
819 | .oprofile_cpu_type = "ppc/7450", | 835 | .oprofile_cpu_type = "ppc/7450", |
820 | .oprofile_type = PPC_OPROFILE_G4, | 836 | .oprofile_type = PPC_OPROFILE_G4, |
@@ -831,6 +847,7 @@ static struct cpu_spec __initdata cpu_specs[] = { | |||
831 | .icache_bsize = 32, | 847 | .icache_bsize = 32, |
832 | .dcache_bsize = 32, | 848 | .dcache_bsize = 32, |
833 | .num_pmcs = 6, | 849 | .num_pmcs = 6, |
850 | .pmc_type = PPC_PMC_G4, | ||
834 | .cpu_setup = __setup_cpu_745x, | 851 | .cpu_setup = __setup_cpu_745x, |
835 | .oprofile_cpu_type = "ppc/7450", | 852 | .oprofile_cpu_type = "ppc/7450", |
836 | .oprofile_type = PPC_OPROFILE_G4, | 853 | .oprofile_type = PPC_OPROFILE_G4, |
@@ -847,6 +864,7 @@ static struct cpu_spec __initdata cpu_specs[] = { | |||
847 | .icache_bsize = 32, | 864 | .icache_bsize = 32, |
848 | .dcache_bsize = 32, | 865 | .dcache_bsize = 32, |
849 | .num_pmcs = 6, | 866 | .num_pmcs = 6, |
867 | .pmc_type = PPC_PMC_G4, | ||
850 | .cpu_setup = __setup_cpu_745x, | 868 | .cpu_setup = __setup_cpu_745x, |
851 | .oprofile_cpu_type = "ppc/7450", | 869 | .oprofile_cpu_type = "ppc/7450", |
852 | .oprofile_type = PPC_OPROFILE_G4, | 870 | .oprofile_type = PPC_OPROFILE_G4, |
@@ -863,6 +881,7 @@ static struct cpu_spec __initdata cpu_specs[] = { | |||
863 | .icache_bsize = 32, | 881 | .icache_bsize = 32, |
864 | .dcache_bsize = 32, | 882 | .dcache_bsize = 32, |
865 | .num_pmcs = 6, | 883 | .num_pmcs = 6, |
884 | .pmc_type = PPC_PMC_G4, | ||
866 | .cpu_setup = __setup_cpu_745x, | 885 | .cpu_setup = __setup_cpu_745x, |
867 | .oprofile_cpu_type = "ppc/7450", | 886 | .oprofile_cpu_type = "ppc/7450", |
868 | .oprofile_type = PPC_OPROFILE_G4, | 887 | .oprofile_type = PPC_OPROFILE_G4, |
@@ -879,6 +898,7 @@ static struct cpu_spec __initdata cpu_specs[] = { | |||
879 | .icache_bsize = 32, | 898 | .icache_bsize = 32, |
880 | .dcache_bsize = 32, | 899 | .dcache_bsize = 32, |
881 | .num_pmcs = 6, | 900 | .num_pmcs = 6, |
901 | .pmc_type = PPC_PMC_G4, | ||
882 | .cpu_setup = __setup_cpu_745x, | 902 | .cpu_setup = __setup_cpu_745x, |
883 | .oprofile_cpu_type = "ppc/7450", | 903 | .oprofile_cpu_type = "ppc/7450", |
884 | .oprofile_type = PPC_OPROFILE_G4, | 904 | .oprofile_type = PPC_OPROFILE_G4, |
@@ -895,6 +915,7 @@ static struct cpu_spec __initdata cpu_specs[] = { | |||
895 | .icache_bsize = 32, | 915 | .icache_bsize = 32, |
896 | .dcache_bsize = 32, | 916 | .dcache_bsize = 32, |
897 | .num_pmcs = 6, | 917 | .num_pmcs = 6, |
918 | .pmc_type = PPC_PMC_G4, | ||
898 | .cpu_setup = __setup_cpu_745x, | 919 | .cpu_setup = __setup_cpu_745x, |
899 | .oprofile_cpu_type = "ppc/7450", | 920 | .oprofile_cpu_type = "ppc/7450", |
900 | .oprofile_type = PPC_OPROFILE_G4, | 921 | .oprofile_type = PPC_OPROFILE_G4, |
@@ -910,6 +931,7 @@ static struct cpu_spec __initdata cpu_specs[] = { | |||
910 | .icache_bsize = 32, | 931 | .icache_bsize = 32, |
911 | .dcache_bsize = 32, | 932 | .dcache_bsize = 32, |
912 | .num_pmcs = 6, | 933 | .num_pmcs = 6, |
934 | .pmc_type = PPC_PMC_G4, | ||
913 | .cpu_setup = __setup_cpu_745x, | 935 | .cpu_setup = __setup_cpu_745x, |
914 | .oprofile_cpu_type = "ppc/7450", | 936 | .oprofile_cpu_type = "ppc/7450", |
915 | .oprofile_type = PPC_OPROFILE_G4, | 937 | .oprofile_type = PPC_OPROFILE_G4, |
@@ -926,6 +948,7 @@ static struct cpu_spec __initdata cpu_specs[] = { | |||
926 | .icache_bsize = 32, | 948 | .icache_bsize = 32, |
927 | .dcache_bsize = 32, | 949 | .dcache_bsize = 32, |
928 | .num_pmcs = 6, | 950 | .num_pmcs = 6, |
951 | .pmc_type = PPC_PMC_G4, | ||
929 | .cpu_setup = __setup_cpu_745x, | 952 | .cpu_setup = __setup_cpu_745x, |
930 | .oprofile_cpu_type = "ppc/7450", | 953 | .oprofile_cpu_type = "ppc/7450", |
931 | .oprofile_type = PPC_OPROFILE_G4, | 954 | .oprofile_type = PPC_OPROFILE_G4, |
@@ -942,6 +965,7 @@ static struct cpu_spec __initdata cpu_specs[] = { | |||
942 | .icache_bsize = 32, | 965 | .icache_bsize = 32, |
943 | .dcache_bsize = 32, | 966 | .dcache_bsize = 32, |
944 | .num_pmcs = 6, | 967 | .num_pmcs = 6, |
968 | .pmc_type = PPC_PMC_G4, | ||
945 | .cpu_setup = __setup_cpu_745x, | 969 | .cpu_setup = __setup_cpu_745x, |
946 | .oprofile_cpu_type = "ppc/7450", | 970 | .oprofile_cpu_type = "ppc/7450", |
947 | .oprofile_type = PPC_OPROFILE_G4, | 971 | .oprofile_type = PPC_OPROFILE_G4, |