aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc64/kernel/entry.S
diff options
context:
space:
mode:
authorDavid S. Miller <davem@sunset.davemloft.net>2005-09-26 03:32:17 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2005-09-26 03:32:17 -0400
commit80dc0d6b44ce0f01df58d8899e46612690ed7d81 (patch)
tree570b8e834c0fae0793bdf75dd2fd2516b0fabf4f /arch/sparc64/kernel/entry.S
parent56425306517ef28a9b480161cdb96d182172bc1d (diff)
[SPARC64]: Probe D/I/E-cache config and use.
At boot time, determine the D-cache, I-cache and E-cache size and line-size. Use them in cache flushes when appropriate. This change was motivated by discovering that the D-cache on UltraSparc-IIIi and later are 64K not 32K, and the flushes done by the Cheetah error handlers were assuming a 32K size. There are still some pieces of code that are hard coding things and will need to be fixed up at some point. While we're here, fix the D-cache and I-cache parity error handlers to run with interrupts disabled, and when the trap occurs at trap level > 1 log the event via a counter displayed in /proc/cpuinfo. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc64/kernel/entry.S')
-rw-r--r--arch/sparc64/kernel/entry.S27
1 files changed, 18 insertions, 9 deletions
diff --git a/arch/sparc64/kernel/entry.S b/arch/sparc64/kernel/entry.S
index 45cd3bbdb7e0..2879b1072921 100644
--- a/arch/sparc64/kernel/entry.S
+++ b/arch/sparc64/kernel/entry.S
@@ -372,14 +372,13 @@ cheetah_plus_patch_fpdis:
372 * 372 *
373 * DATA 0: [low 32-bits] Address of function to call, jmp to this 373 * DATA 0: [low 32-bits] Address of function to call, jmp to this
374 * [high 32-bits] MMU Context Argument 0, place in %g5 374 * [high 32-bits] MMU Context Argument 0, place in %g5
375 * DATA 1: Address Argument 1, place in %g6 375 * DATA 1: Address Argument 1, place in %g1
376 * DATA 2: Address Argument 2, place in %g7 376 * DATA 2: Address Argument 2, place in %g7
377 * 377 *
378 * With this method we can do most of the cross-call tlb/cache 378 * With this method we can do most of the cross-call tlb/cache
379 * flushing very quickly. 379 * flushing very quickly.
380 * 380 *
381 * Current CPU's IRQ worklist table is locked into %g1, 381 * Current CPU's IRQ worklist table is locked into %g6, don't touch.
382 * don't touch.
383 */ 382 */
384 .text 383 .text
385 .align 32 384 .align 32
@@ -853,13 +852,14 @@ cheetah_plus_dcpe_trap_vector:
853 nop 852 nop
854 853
855do_cheetah_plus_data_parity: 854do_cheetah_plus_data_parity:
856 ba,pt %xcc, etrap 855 rdpr %pil, %g2
856 wrpr %g0, 15, %pil
857 ba,pt %xcc, etrap_irq
857 rd %pc, %g7 858 rd %pc, %g7
858 mov 0x0, %o0 859 mov 0x0, %o0
859 call cheetah_plus_parity_error 860 call cheetah_plus_parity_error
860 add %sp, PTREGS_OFF, %o1 861 add %sp, PTREGS_OFF, %o1
861 ba,pt %xcc, rtrap 862 ba,a,pt %xcc, rtrap_irq
862 clr %l6
863 863
864cheetah_plus_dcpe_trap_vector_tl1: 864cheetah_plus_dcpe_trap_vector_tl1:
865 membar #Sync 865 membar #Sync
@@ -883,13 +883,14 @@ cheetah_plus_icpe_trap_vector:
883 nop 883 nop
884 884
885do_cheetah_plus_insn_parity: 885do_cheetah_plus_insn_parity:
886 ba,pt %xcc, etrap 886 rdpr %pil, %g2
887 wrpr %g0, 15, %pil
888 ba,pt %xcc, etrap_irq
887 rd %pc, %g7 889 rd %pc, %g7
888 mov 0x1, %o0 890 mov 0x1, %o0
889 call cheetah_plus_parity_error 891 call cheetah_plus_parity_error
890 add %sp, PTREGS_OFF, %o1 892 add %sp, PTREGS_OFF, %o1
891 ba,pt %xcc, rtrap 893 ba,a,pt %xcc, rtrap_irq
892 clr %l6
893 894
894cheetah_plus_icpe_trap_vector_tl1: 895cheetah_plus_icpe_trap_vector_tl1:
895 membar #Sync 896 membar #Sync
@@ -922,6 +923,10 @@ do_dcpe_tl1:
922 nop 923 nop
923 wrpr %g1, %tl ! Restore original trap level 924 wrpr %g1, %tl ! Restore original trap level
924do_dcpe_tl1_nonfatal: /* Ok we may use interrupt globals safely. */ 925do_dcpe_tl1_nonfatal: /* Ok we may use interrupt globals safely. */
926 sethi %hi(dcache_parity_tl1_occurred), %g2
927 lduw [%g2 + %lo(dcache_parity_tl1_occurred)], %g1
928 add %g1, 1, %g1
929 stw %g1, [%g2 + %lo(dcache_parity_tl1_occurred)]
925 /* Reset D-cache parity */ 930 /* Reset D-cache parity */
926 sethi %hi(1 << 16), %g1 ! D-cache size 931 sethi %hi(1 << 16), %g1 ! D-cache size
927 mov (1 << 5), %g2 ! D-cache line size 932 mov (1 << 5), %g2 ! D-cache line size
@@ -968,6 +973,10 @@ do_icpe_tl1:
968 nop 973 nop
969 wrpr %g1, %tl ! Restore original trap level 974 wrpr %g1, %tl ! Restore original trap level
970do_icpe_tl1_nonfatal: /* Ok we may use interrupt globals safely. */ 975do_icpe_tl1_nonfatal: /* Ok we may use interrupt globals safely. */
976 sethi %hi(icache_parity_tl1_occurred), %g2
977 lduw [%g2 + %lo(icache_parity_tl1_occurred)], %g1
978 add %g1, 1, %g1
979 stw %g1, [%g2 + %lo(icache_parity_tl1_occurred)]
971 /* Flush I-cache */ 980 /* Flush I-cache */
972 sethi %hi(1 << 15), %g1 ! I-cache size 981 sethi %hi(1 << 15), %g1 ! I-cache size
973 mov (1 << 5), %g2 ! I-cache line size 982 mov (1 << 5), %g2 ! I-cache line size