* ========== Copyright Header Begin ==========================================
* OpenSPARC T2 Processor File: n2_err_McuFbr_McuEcc_LDWC.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_NUCLEUS_ALSO */ /* Access main in priviledge mode */
#define MAIN_PAGE_HV_ALSO
#define DMA_DATA_ADDR 0x0000000123456700
#define DMA_DATA_BYP_SADDR 0xfffc00003000aa00
#define DMA_DATA_BYP_ADDR1 0xfffc000123456700
#define DMA_DATA_BYP_ADDR2 0xfffc000123456780
#define DMA_DATA_BYP_ADDR3 0xfffc000123456800
#define DRAM_ERR_INJ_REG_0 0x8400000290
#define DRAM_ERR_INJ_REG_1 0x8400001290
#define DRAM_ERR_INJ_REG_2 0x8400002290
#define DRAM_ERR_INJ_REG_3 0x8400003290
#define L2_ENTRY_PA 0xa000000000
/************************************************************************
************************************************************************/
setx 0x800001248c80040c,%i1,%i2
setx SOC_EJR_REG, %l7, %i3
ldxa [%g0] ASI_LSU_CONTROL, %l0
stxa %l0, [%g0] ASI_LSU_CONTROL
set_L2_Directly_Mapped_Mode:
setx L2CS_PA0, %l6, %g1 ! Bit 1 in L2 Control Status Register
setx 0x3000aa00, %l0, %g2 ! bits [21:18] select way
set 0x3ffff8, %l2 ! Mask for extracting [21:3]
setx L2_ENTRY_PA, %l0, %g4
and %g2, %l2, %g5 !g2 has L2 PA,
or %g5, %g4, %g5 !g5 now has Diagnostic Data Array address
! Flip one bits to inject error
store_for_wb: !Load to L2 again to get the error
setx DRAM_ERR_CNT_REG_PA_0,%l1,%g6
setx DRAM_ERR_CNT_REG_PA_1,%l1,%g3
setx DRAM_ERR_CNT_REG_PA_2,%l1,%g4
setx DRAM_ERR_CNT_REG_PA_3,%l1,%g5
set 0x10000, %g6 !<16>=countone=1
setx DRAM_FBR_CNT_REG_PA_0, %l7, %o2
setx DRAM_FBR_CNT_REG_PA_1, %l7, %o3
setx DRAM_FBR_CNT_REG_PA_2, %l7, %o4
setx DRAM_FBR_CNT_REG_PA_3, %l7, %o5
set_DRAM_error_inject_ch0_dac:
mov 0x2, %l1 ! ECC Mask (1-bit error)
sllx %l2, DRAM_EI_SSHOT, %l3
or %l1, %l3, %l1 ! Set single shot ;
sllx %l2, DRAM_EI_ENB, %l3
or %l1, %l3, %l1 ! Enable error injection for the next write
setx DRAM_ERR_INJ_REG_0, %l3, %g3
setx DRAM_ERR_INJ_REG_1, %l3, %g4
setx DRAM_ERR_INJ_REG_2, %l3, %g5
setx DRAM_ERR_INJ_REG_3, %l3, %g6
set 0x22000000, %g7 ! bits [21:18] select way
! Storing to same L2 way0 but different tag,this will write to mcu
set 0x31000000, %i3 ! bits [21:18] select way
setx SOC_ESR_REG, %l7, %i0
setx 0x8000036d80000000, %l7, %o3 !valid bit