* ========== Copyright Header Begin ==========================================
* OpenSPARC T2 Processor File: n2_ras_vec_l2_lvc_trap.s
* Copyright (C) 1995-2007 Sun Microsystems, Inc. All Rights Reserved
* 4150 Network Circle, Santa Clara, California 95054, U.S.A.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
* This program is distributed in the hope that 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.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* For the avoidance of doubt, and except that if any non-GPL license
* choice is available it will apply instead, Sun elects to use only
* the General Public License version 2 (GPLv2) at this time for any
* software where a choice of GPL license versions is made
* available with the language indicating that GPLv2 or any later version
* may be used, or where a choice of which version of the GPL is applied is
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* ========== Copyright Header End ============================================
#define H_HT0_Hw_Corrected_Error_0x63 My_Corrected_ECC_error_trap
#define MAIN_PAGE_HV_ALSO
#define L2_ENTRY_PA 0x517590000
#define TEST_DATA 0x555555555555555
#define L2_ES_W1C_VALUE 0xc03ffffc00000000
#define L2_ESR_MASK 0xf03ffffff0000000
.global My_Corrected_ECC_error_trap
! Boot code does not provide TLB translation for IO address space
! Now access L2 control and status registers
ldxa [%g0] ASI_LSU_CONTROL, %l0
! Remove the lower 2 bits (I-Cache and D-Cache enables)
stxa %l0, [%g0] ASI_LSU_CONTROL
! mov 0x2, %o5 ! L2_CSR_REG<1>=1 => DM mode
ldxa [%g0]ASI_INTR_ID, %o4 ! get the thread id; for core-portable
sllx %o4, 15, %o4 ! L2_CSR_REG<21:15> = ERROR_STEER
setx 0x44400000, %l0, %g1
setx 0x3ffc0, %l0, %g2 ! Mask for extracting [17:6]
setx 0x5555555555555555, %g7, %g4
! Generate L2 VD Diag read address
! Addressing: [39:32] See PRM, [22] 1 for V/D, [17:8] set, [8:6] bank, [2:0] = 0
sllx %g4, 32, %g6 ! Bits [39:32]
sllx %g4, 22, %g5 ! Bit [22]
sllx %g5, %i3, %g7 ! %i3=1,2,3,....16
xor %g4, %g7, %g5 ! inject single bit error
setx 0xaaaaaaaa, %g4, %g5
sllx %i3, 24, %g6 ! %i3=1,2,3,....16
! to have different tag; same index
or %g1, %g6, %g3 ! %g1 had the PA
nop; nop; nop; nop; nop; nop; nop; nop; nop; nop;
nop; nop; nop; nop; nop; nop; nop; nop; nop; nop;
nop; nop; nop; nop; nop; nop; nop; nop; nop; nop;
nop; nop; nop; nop; nop; nop; nop; nop; nop; nop;
nop; nop; nop; nop; nop; nop; nop; nop; nop; nop;
nop; nop; nop; nop; nop; nop; nop; nop; nop; nop;
nop; nop; nop; nop; nop; nop; nop; nop; nop; nop;
nop; nop; nop; nop; nop; nop; nop; nop; nop; nop;
add %g1, %g4, %g1 ! to go to the next Set; <17:9>
/*******************************************************
*******************************************************/
My_Corrected_ECC_error_trap:
setx L2_ESR_MASK, %g7, %g3
setx LVC_MASK_ZERO, %g7, %g2
and %g1, %g2, %g2 ! %g1 has esr value
cmp %g2, %g0 ! makes sure <27:14>, <6:0> are 0 for VD
! makes sure <27:14>, <13:7> are 0 for UA
setx LVC_MASK_NONZERO, %g7, %g2
and %g1, %g2, %g2 ! %g1 has esr value
cmp %g2, %g0 ! makes sure <13:7> nonzero for VD
! makes sure <6:0> nonzero for UA
setx 0xc03ffffc00000000, %g7, %g2
setx 0xff00000000000000, %g7, %g2
setx 0x8900000000000000, %g7, %g4