diff options
author | Mike Frysinger <vapier@gentoo.org> | 2011-02-02 22:31:42 -0500 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2011-03-18 04:01:03 -0400 |
commit | 820b127dae869cbbd2133f066e8b8f32a90d46e5 (patch) | |
tree | 792ffece1051b81b1c678174129663680d54253b /arch/blackfin | |
parent | 567ebfc99d7546913408b560ad443a5315bf8a53 (diff) |
Blackfin: split optimization settings more
We need to place icache flush funcs into L1 inst sram to work around a
hardware anomaly. But this currently breaks SMP support as the L1 inst
sram is per-core and cannot be called directly. So in preparation for
making that work, split the two options.
Further, split out the SMP depend so that we can allow some for SMP.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'arch/blackfin')
-rw-r--r-- | arch/blackfin/Kconfig | 42 | ||||
-rw-r--r-- | arch/blackfin/mach-common/arch_checks.c | 2 | ||||
-rw-r--r-- | arch/blackfin/mach-common/cache.S | 18 |
3 files changed, 47 insertions, 15 deletions
diff --git a/arch/blackfin/Kconfig b/arch/blackfin/Kconfig index c09577ddc3c5..0f34ec58bac3 100644 --- a/arch/blackfin/Kconfig +++ b/arch/blackfin/Kconfig | |||
@@ -690,13 +690,13 @@ endmenu | |||
690 | 690 | ||
691 | 691 | ||
692 | menu "Blackfin Kernel Optimizations" | 692 | menu "Blackfin Kernel Optimizations" |
693 | depends on !SMP | ||
694 | 693 | ||
695 | comment "Memory Optimizations" | 694 | comment "Memory Optimizations" |
696 | 695 | ||
697 | config I_ENTRY_L1 | 696 | config I_ENTRY_L1 |
698 | bool "Locate interrupt entry code in L1 Memory" | 697 | bool "Locate interrupt entry code in L1 Memory" |
699 | default y | 698 | default y |
699 | depends on !SMP | ||
700 | help | 700 | help |
701 | If enabled, interrupt entry code (STORE/RESTORE CONTEXT) is linked | 701 | If enabled, interrupt entry code (STORE/RESTORE CONTEXT) is linked |
702 | into L1 instruction memory. (less latency) | 702 | into L1 instruction memory. (less latency) |
@@ -704,6 +704,7 @@ config I_ENTRY_L1 | |||
704 | config EXCPT_IRQ_SYSC_L1 | 704 | config EXCPT_IRQ_SYSC_L1 |
705 | bool "Locate entire ASM lowlevel exception / interrupt - Syscall and CPLB handler code in L1 Memory" | 705 | bool "Locate entire ASM lowlevel exception / interrupt - Syscall and CPLB handler code in L1 Memory" |
706 | default y | 706 | default y |
707 | depends on !SMP | ||
707 | help | 708 | help |
708 | If enabled, the entire ASM lowlevel exception and interrupt entry code | 709 | If enabled, the entire ASM lowlevel exception and interrupt entry code |
709 | (STORE/RESTORE CONTEXT) is linked into L1 instruction memory. | 710 | (STORE/RESTORE CONTEXT) is linked into L1 instruction memory. |
@@ -712,6 +713,7 @@ config EXCPT_IRQ_SYSC_L1 | |||
712 | config DO_IRQ_L1 | 713 | config DO_IRQ_L1 |
713 | bool "Locate frequently called do_irq dispatcher function in L1 Memory" | 714 | bool "Locate frequently called do_irq dispatcher function in L1 Memory" |
714 | default y | 715 | default y |
716 | depends on !SMP | ||
715 | help | 717 | help |
716 | If enabled, the frequently called do_irq dispatcher function is linked | 718 | If enabled, the frequently called do_irq dispatcher function is linked |
717 | into L1 instruction memory. (less latency) | 719 | into L1 instruction memory. (less latency) |
@@ -719,6 +721,7 @@ config DO_IRQ_L1 | |||
719 | config CORE_TIMER_IRQ_L1 | 721 | config CORE_TIMER_IRQ_L1 |
720 | bool "Locate frequently called timer_interrupt() function in L1 Memory" | 722 | bool "Locate frequently called timer_interrupt() function in L1 Memory" |
721 | default y | 723 | default y |
724 | depends on !SMP | ||
722 | help | 725 | help |
723 | If enabled, the frequently called timer_interrupt() function is linked | 726 | If enabled, the frequently called timer_interrupt() function is linked |
724 | into L1 instruction memory. (less latency) | 727 | into L1 instruction memory. (less latency) |
@@ -726,6 +729,7 @@ config CORE_TIMER_IRQ_L1 | |||
726 | config IDLE_L1 | 729 | config IDLE_L1 |
727 | bool "Locate frequently idle function in L1 Memory" | 730 | bool "Locate frequently idle function in L1 Memory" |
728 | default y | 731 | default y |
732 | depends on !SMP | ||
729 | help | 733 | help |
730 | If enabled, the frequently called idle function is linked | 734 | If enabled, the frequently called idle function is linked |
731 | into L1 instruction memory. (less latency) | 735 | into L1 instruction memory. (less latency) |
@@ -733,6 +737,7 @@ config IDLE_L1 | |||
733 | config SCHEDULE_L1 | 737 | config SCHEDULE_L1 |
734 | bool "Locate kernel schedule function in L1 Memory" | 738 | bool "Locate kernel schedule function in L1 Memory" |
735 | default y | 739 | default y |
740 | depends on !SMP | ||
736 | help | 741 | help |
737 | If enabled, the frequently called kernel schedule is linked | 742 | If enabled, the frequently called kernel schedule is linked |
738 | into L1 instruction memory. (less latency) | 743 | into L1 instruction memory. (less latency) |
@@ -740,6 +745,7 @@ config SCHEDULE_L1 | |||
740 | config ARITHMETIC_OPS_L1 | 745 | config ARITHMETIC_OPS_L1 |
741 | bool "Locate kernel owned arithmetic functions in L1 Memory" | 746 | bool "Locate kernel owned arithmetic functions in L1 Memory" |
742 | default y | 747 | default y |
748 | depends on !SMP | ||
743 | help | 749 | help |
744 | If enabled, arithmetic functions are linked | 750 | If enabled, arithmetic functions are linked |
745 | into L1 instruction memory. (less latency) | 751 | into L1 instruction memory. (less latency) |
@@ -747,6 +753,7 @@ config ARITHMETIC_OPS_L1 | |||
747 | config ACCESS_OK_L1 | 753 | config ACCESS_OK_L1 |
748 | bool "Locate access_ok function in L1 Memory" | 754 | bool "Locate access_ok function in L1 Memory" |
749 | default y | 755 | default y |
756 | depends on !SMP | ||
750 | help | 757 | help |
751 | If enabled, the access_ok function is linked | 758 | If enabled, the access_ok function is linked |
752 | into L1 instruction memory. (less latency) | 759 | into L1 instruction memory. (less latency) |
@@ -754,6 +761,7 @@ config ACCESS_OK_L1 | |||
754 | config MEMSET_L1 | 761 | config MEMSET_L1 |
755 | bool "Locate memset function in L1 Memory" | 762 | bool "Locate memset function in L1 Memory" |
756 | default y | 763 | default y |
764 | depends on !SMP | ||
757 | help | 765 | help |
758 | If enabled, the memset function is linked | 766 | If enabled, the memset function is linked |
759 | into L1 instruction memory. (less latency) | 767 | into L1 instruction memory. (less latency) |
@@ -761,6 +769,7 @@ config MEMSET_L1 | |||
761 | config MEMCPY_L1 | 769 | config MEMCPY_L1 |
762 | bool "Locate memcpy function in L1 Memory" | 770 | bool "Locate memcpy function in L1 Memory" |
763 | default y | 771 | default y |
772 | depends on !SMP | ||
764 | help | 773 | help |
765 | If enabled, the memcpy function is linked | 774 | If enabled, the memcpy function is linked |
766 | into L1 instruction memory. (less latency) | 775 | into L1 instruction memory. (less latency) |
@@ -768,6 +777,7 @@ config MEMCPY_L1 | |||
768 | config STRCMP_L1 | 777 | config STRCMP_L1 |
769 | bool "locate strcmp function in L1 Memory" | 778 | bool "locate strcmp function in L1 Memory" |
770 | default y | 779 | default y |
780 | depends on !SMP | ||
771 | help | 781 | help |
772 | If enabled, the strcmp function is linked | 782 | If enabled, the strcmp function is linked |
773 | into L1 instruction memory (less latency). | 783 | into L1 instruction memory (less latency). |
@@ -775,6 +785,7 @@ config STRCMP_L1 | |||
775 | config STRNCMP_L1 | 785 | config STRNCMP_L1 |
776 | bool "locate strncmp function in L1 Memory" | 786 | bool "locate strncmp function in L1 Memory" |
777 | default y | 787 | default y |
788 | depends on !SMP | ||
778 | help | 789 | help |
779 | If enabled, the strncmp function is linked | 790 | If enabled, the strncmp function is linked |
780 | into L1 instruction memory (less latency). | 791 | into L1 instruction memory (less latency). |
@@ -782,6 +793,7 @@ config STRNCMP_L1 | |||
782 | config STRCPY_L1 | 793 | config STRCPY_L1 |
783 | bool "locate strcpy function in L1 Memory" | 794 | bool "locate strcpy function in L1 Memory" |
784 | default y | 795 | default y |
796 | depends on !SMP | ||
785 | help | 797 | help |
786 | If enabled, the strcpy function is linked | 798 | If enabled, the strcpy function is linked |
787 | into L1 instruction memory (less latency). | 799 | into L1 instruction memory (less latency). |
@@ -789,6 +801,7 @@ config STRCPY_L1 | |||
789 | config STRNCPY_L1 | 801 | config STRNCPY_L1 |
790 | bool "locate strncpy function in L1 Memory" | 802 | bool "locate strncpy function in L1 Memory" |
791 | default y | 803 | default y |
804 | depends on !SMP | ||
792 | help | 805 | help |
793 | If enabled, the strncpy function is linked | 806 | If enabled, the strncpy function is linked |
794 | into L1 instruction memory (less latency). | 807 | into L1 instruction memory (less latency). |
@@ -796,6 +809,7 @@ config STRNCPY_L1 | |||
796 | config SYS_BFIN_SPINLOCK_L1 | 809 | config SYS_BFIN_SPINLOCK_L1 |
797 | bool "Locate sys_bfin_spinlock function in L1 Memory" | 810 | bool "Locate sys_bfin_spinlock function in L1 Memory" |
798 | default y | 811 | default y |
812 | depends on !SMP | ||
799 | help | 813 | help |
800 | If enabled, sys_bfin_spinlock function is linked | 814 | If enabled, sys_bfin_spinlock function is linked |
801 | into L1 instruction memory. (less latency) | 815 | into L1 instruction memory. (less latency) |
@@ -803,6 +817,7 @@ config SYS_BFIN_SPINLOCK_L1 | |||
803 | config IP_CHECKSUM_L1 | 817 | config IP_CHECKSUM_L1 |
804 | bool "Locate IP Checksum function in L1 Memory" | 818 | bool "Locate IP Checksum function in L1 Memory" |
805 | default n | 819 | default n |
820 | depends on !SMP | ||
806 | help | 821 | help |
807 | If enabled, the IP Checksum function is linked | 822 | If enabled, the IP Checksum function is linked |
808 | into L1 instruction memory. (less latency) | 823 | into L1 instruction memory. (less latency) |
@@ -811,7 +826,7 @@ config CACHELINE_ALIGNED_L1 | |||
811 | bool "Locate cacheline_aligned data to L1 Data Memory" | 826 | bool "Locate cacheline_aligned data to L1 Data Memory" |
812 | default y if !BF54x | 827 | default y if !BF54x |
813 | default n if BF54x | 828 | default n if BF54x |
814 | depends on !BF531 | 829 | depends on !SMP && !BF531 |
815 | help | 830 | help |
816 | If enabled, cacheline_aligned data is linked | 831 | If enabled, cacheline_aligned data is linked |
817 | into L1 data memory. (less latency) | 832 | into L1 data memory. (less latency) |
@@ -819,7 +834,7 @@ config CACHELINE_ALIGNED_L1 | |||
819 | config SYSCALL_TAB_L1 | 834 | config SYSCALL_TAB_L1 |
820 | bool "Locate Syscall Table L1 Data Memory" | 835 | bool "Locate Syscall Table L1 Data Memory" |
821 | default n | 836 | default n |
822 | depends on !BF531 | 837 | depends on !SMP && !BF531 |
823 | help | 838 | help |
824 | If enabled, the Syscall LUT is linked | 839 | If enabled, the Syscall LUT is linked |
825 | into L1 data memory. (less latency) | 840 | into L1 data memory. (less latency) |
@@ -827,16 +842,17 @@ config SYSCALL_TAB_L1 | |||
827 | config CPLB_SWITCH_TAB_L1 | 842 | config CPLB_SWITCH_TAB_L1 |
828 | bool "Locate CPLB Switch Tables L1 Data Memory" | 843 | bool "Locate CPLB Switch Tables L1 Data Memory" |
829 | default n | 844 | default n |
830 | depends on !BF531 | 845 | depends on !SMP && !BF531 |
831 | help | 846 | help |
832 | If enabled, the CPLB Switch Tables are linked | 847 | If enabled, the CPLB Switch Tables are linked |
833 | into L1 data memory. (less latency) | 848 | into L1 data memory. (less latency) |
834 | 849 | ||
835 | config CACHE_FLUSH_L1 | 850 | config ICACHE_FLUSH_L1 |
836 | bool "Locate cache flush funcs in L1 Inst Memory" | 851 | bool "Locate icache flush funcs in L1 Inst Memory" |
837 | default y | 852 | default y |
853 | depends on !SMP | ||
838 | help | 854 | help |
839 | If enabled, the Blackfin cache flushing functions are linked | 855 | If enabled, the Blackfin icache flushing functions are linked |
840 | into L1 instruction memory. | 856 | into L1 instruction memory. |
841 | 857 | ||
842 | Note that this might be required to address anomalies, but | 858 | Note that this might be required to address anomalies, but |
@@ -844,9 +860,18 @@ config CACHE_FLUSH_L1 | |||
844 | If you are using a processor affected by an anomaly, the build | 860 | If you are using a processor affected by an anomaly, the build |
845 | system will double check for you and prevent it. | 861 | system will double check for you and prevent it. |
846 | 862 | ||
863 | config DCACHE_FLUSH_L1 | ||
864 | bool "Locate dcache flush funcs in L1 Inst Memory" | ||
865 | default y | ||
866 | depends on !SMP | ||
867 | help | ||
868 | If enabled, the Blackfin dcache flushing functions are linked | ||
869 | into L1 instruction memory. | ||
870 | |||
847 | config APP_STACK_L1 | 871 | config APP_STACK_L1 |
848 | bool "Support locating application stack in L1 Scratch Memory" | 872 | bool "Support locating application stack in L1 Scratch Memory" |
849 | default y | 873 | default y |
874 | depends on !SMP | ||
850 | help | 875 | help |
851 | If enabled the application stack can be located in L1 | 876 | If enabled the application stack can be located in L1 |
852 | scratch memory (less latency). | 877 | scratch memory (less latency). |
@@ -856,7 +881,7 @@ config APP_STACK_L1 | |||
856 | config EXCEPTION_L1_SCRATCH | 881 | config EXCEPTION_L1_SCRATCH |
857 | bool "Locate exception stack in L1 Scratch Memory" | 882 | bool "Locate exception stack in L1 Scratch Memory" |
858 | default n | 883 | default n |
859 | depends on !APP_STACK_L1 | 884 | depends on !SMP && !APP_STACK_L1 |
860 | help | 885 | help |
861 | Whenever an exception occurs, use the L1 Scratch memory for | 886 | Whenever an exception occurs, use the L1 Scratch memory for |
862 | stack storage. You cannot place the stacks of FLAT binaries | 887 | stack storage. You cannot place the stacks of FLAT binaries |
@@ -868,6 +893,7 @@ comment "Speed Optimizations" | |||
868 | config BFIN_INS_LOWOVERHEAD | 893 | config BFIN_INS_LOWOVERHEAD |
869 | bool "ins[bwl] low overhead, higher interrupt latency" | 894 | bool "ins[bwl] low overhead, higher interrupt latency" |
870 | default y | 895 | default y |
896 | depends on !SMP | ||
871 | help | 897 | help |
872 | Reads on the Blackfin are speculative. In Blackfin terms, this means | 898 | Reads on the Blackfin are speculative. In Blackfin terms, this means |
873 | they can be interrupted at any time (even after they have been issued | 899 | they can be interrupted at any time (even after they have been issued |
diff --git a/arch/blackfin/mach-common/arch_checks.c b/arch/blackfin/mach-common/arch_checks.c index bceb98126c21..d8643fdd0fcf 100644 --- a/arch/blackfin/mach-common/arch_checks.c +++ b/arch/blackfin/mach-common/arch_checks.c | |||
@@ -61,6 +61,6 @@ | |||
61 | # error "Anomaly 05000220 does not allow you to use Write Back cache with L2 or External Memory" | 61 | # error "Anomaly 05000220 does not allow you to use Write Back cache with L2 or External Memory" |
62 | #endif | 62 | #endif |
63 | 63 | ||
64 | #if ANOMALY_05000491 && !defined(CONFIG_CACHE_FLUSH_L1) | 64 | #if ANOMALY_05000491 && !defined(CONFIG_ICACHE_FLUSH_L1) |
65 | # error You need IFLUSH in L1 inst while Anomaly 05000491 applies | 65 | # error You need IFLUSH in L1 inst while Anomaly 05000491 applies |
66 | #endif | 66 | #endif |
diff --git a/arch/blackfin/mach-common/cache.S b/arch/blackfin/mach-common/cache.S index ab4a925a443e..85aadeb76658 100644 --- a/arch/blackfin/mach-common/cache.S +++ b/arch/blackfin/mach-common/cache.S | |||
@@ -11,12 +11,6 @@ | |||
11 | #include <asm/cache.h> | 11 | #include <asm/cache.h> |
12 | #include <asm/page.h> | 12 | #include <asm/page.h> |
13 | 13 | ||
14 | #ifdef CONFIG_CACHE_FLUSH_L1 | ||
15 | .section .l1.text | ||
16 | #else | ||
17 | .text | ||
18 | #endif | ||
19 | |||
20 | /* 05000443 - IFLUSH cannot be last instruction in hardware loop */ | 14 | /* 05000443 - IFLUSH cannot be last instruction in hardware loop */ |
21 | #if ANOMALY_05000443 | 15 | #if ANOMALY_05000443 |
22 | # define BROK_FLUSH_INST "IFLUSH" | 16 | # define BROK_FLUSH_INST "IFLUSH" |
@@ -68,11 +62,23 @@ | |||
68 | RTS; | 62 | RTS; |
69 | .endm | 63 | .endm |
70 | 64 | ||
65 | #ifdef CONFIG_ICACHE_FLUSH_L1 | ||
66 | .section .l1.text | ||
67 | #else | ||
68 | .text | ||
69 | #endif | ||
70 | |||
71 | /* Invalidate all instruction cache lines assocoiated with this memory area */ | 71 | /* Invalidate all instruction cache lines assocoiated with this memory area */ |
72 | ENTRY(_blackfin_icache_flush_range) | 72 | ENTRY(_blackfin_icache_flush_range) |
73 | do_flush IFLUSH | 73 | do_flush IFLUSH |
74 | ENDPROC(_blackfin_icache_flush_range) | 74 | ENDPROC(_blackfin_icache_flush_range) |
75 | 75 | ||
76 | #ifdef CONFIG_DCACHE_FLUSH_L1 | ||
77 | .section .l1.text | ||
78 | #else | ||
79 | .text | ||
80 | #endif | ||
81 | |||
76 | /* Throw away all D-cached data in specified region without any obligation to | 82 | /* Throw away all D-cached data in specified region without any obligation to |
77 | * write them back. Since the Blackfin ISA does not have an "invalidate" | 83 | * write them back. Since the Blackfin ISA does not have an "invalidate" |
78 | * instruction, we use flush/invalidate. Perhaps as a speed optimization we | 84 | * instruction, we use flush/invalidate. Perhaps as a speed optimization we |