* ========== Copyright Header Begin ==========================================
* OpenSPARC T2 Processor File: n2_ras_vec_mcu_dbu1.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 ENABLE_PCIE_LINK_TRAINING
#define MAIN_PAGE_HV_ALSO
#define L2_ENTRY_PA 0xa000000000
#define TEST_DATA1 0x5555555555555555
#define L2_ENTRY_PA0 0x2020000008
#define L2_ES_W1C_VALUE 0xc03ffffc00000000
#define DRAM_ERR_STAT_REG 0x8400000280
#define L2_BANK_ADDR 0x00
#define DRAM_ES_W1C_VALUE 0xfe00000000000000
#define OOB_ADDR1 0x1123456000
#define OOB_ADDR2 0x2022000000
#define OOB_ADDR3 0x4022000000
#define OOB_ADDR4 0x8022000000
#define DRAM_ERR_STAT_REG 0x8400000280
#define L2_ERR_STAT_REG 0xAB00000000
#define DMA_DATA_BYP_ADDR1 0xfffc001123456000
#define OOB_ADDR1 0x1123456080
#define OOB_ADDR2 0x2022000080
#define OOB_ADDR3 0x4022000080
#define OOB_ADDR4 0x8022000080
#define L2_BANK_ADDR 0x80
#define DRAM_ERR_STAT_REG 0x8400001280
#define L2_ERR_STAT_REG 0xAB00000080
#define DMA_DATA_BYP_ADDR1 0xfffc001123456080
#define OOB_ADDR1 0x1123456100
#define OOB_ADDR2 0x2022000100
#define OOB_ADDR3 0x4022000100
#define OOB_ADDR4 0x8022000100
#define L2_BANK_ADDR 0x100
#define DRAM_ERR_STAT_REG 0x8400002280
#define L2_ERR_STAT_REG 0xAB00000100
#define DMA_DATA_BYP_ADDR1 0xfffc001123456100
#define OOB_ADDR1 0x1123456180
#define OOB_ADDR2 0x2022000180
#define OOB_ADDR3 0x4022000180
#define OOB_ADDR4 0x8022000180
#define L2_BANK_ADDR 0x180
#define DRAM_ERR_STAT_REG 0x8400003280
#define L2_ERR_STAT_REG 0xAB00000180
#define DMA_DATA_BYP_ADDR1 0xfffc001123456180
.global My_Recoverable_Sw_error_trap
! Boot code does not provide TLB translation for IO address space
add %l1, L2_BANK_ADDR, %l1
setx 0xfffffffffffffffc, %l7, %l0
/*************************************************
**************************************************/
setx FIRE_DLC_MMU_CSR_A_CTL_ADDR, %g1, %g2
setx FIRE_DLC_MMU_CSR_A_CTL__BYPASS_EN, %g1, %g3
! $EV trig_pc_d(1, @VA(.MAIN.XmtUsrEvnt1)) -> EnablePCIeIgCmd ("DMAWR", DMA_DATA_BYP_ADDR1, DMA_DATA_BYP_ADDR1, "64'h40", 1)
setx FIRE_PLC_TLU_CTB_TLR_CSR_A_TLU_CTL_ADDR, %g1, %g2
setx SOC_ESR_REG, %l7, %i0
add %g1, L2_BANK_ADDR, %g1
setx DRAM_ERR_STAT_REG, %l3, %g5
/***************************************************************
***************************************************************/
add %g1, L2_BANK_ADDR, %g1
setx 0xf1fffffff0000000, %l3, %l0 ! MSA; ignore CoreID -> <59:57>; TH_ID <56:54> should be OK
andcc %l0, %g2, %l5 ! %g2 has the ESR content
sllx %l1, L2ES_MEU, %l2 ! MEU
setx L2_ES_W1C_VALUE, %g7, %g1
cmp %l4, %g6 !%g6 has the OOB_ADDR
setx DRAM_ERR_STAT_REG, %l3, %g5
setx 0xffc000000000ffff, %l0,%o2
sllx %l1, DRAM_ES_DBU, %l0 ! %l0 has expected value
setx DRAM_ES_W1C_VALUE, %g7, %g1
/*******************************************************
*******************************************************/