* ========== Copyright Header Begin ==========================================
* OpenSPARC T2 Processor File: Debug_Pciex_Mode.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 DBG_CONFIG_PA 0x8600000000
#define DBG_PCIEX_VAL 0x800000000000000B
#define DBG_PEUA_PA 0x8800683000
#define DBG_PEUA_VAL 0x40
#define DBG_PEUB_PA 0x8800683008
#define DBG_PEUB_VAL 0x40
#define DBG_DMUA_PA 0x8800653000
#define DBG_DMUA_VAL 0x140
#define DBG_DMUB_PA 0x8800653008
#define DBG_DMUB_VAL 0x140
#define MEM64_WR_ADDR mpeval(N2_PCIE_BASE_ADDR + MEM64_OFFSET_BASE_REG_DATA)
#define MEM64_WR_ADDR0 mpeval(MEM64_WR_ADDR + 0x0000000000)
#define MEM64_WR_ADDR1 mpeval(MEM64_WR_ADDR + 0x0100000000)
#define MEM64_WR_ADDR2 mpeval(MEM64_WR_ADDR + 0x0200000000)
#define MEM64_WR_ADDR4 mpeval(MEM64_WR_ADDR + 0x0400000000)
#define BNE_TEST_FAIL bne test_failed
#define BNE_TEST_FAIL nop
/************************************************************************
************************************************************************/
setx DBG_CONFIG_PA,%g1,%g2
setx DBG_PCIEX_VAL,%g3,%g4
setx DBG_PEUA_VAL,%g3,%g4
setx DBG_PEUB_VAL,%g3,%g4
setx DBG_DMUA_VAL,%g3,%g4
setx DBG_DMUB_VAL,%g3,%g4
! select a Mem address in PCI address range and transmit the command to NCU
setx MEM64_WR_ADDR1, %g1, %g2
! store byte to a few offsets
! store half-word to a few offsets
setx 0xd3d2d1d0, %g1, %l0
setx 0xe3e2e1e0, %g1, %l0
setx 0xf3f2f1f0, %g1, %l0
setx 0x03020100, %g1, %l0
setx 0x1716151413121110, %g1, %l0
setx 0x2726252423222120, %g1, %l0
/************************************************************************
************************************************************************/
SECTION .DATA DATA_VA=MEM64_WR_ADDR1
data0: .xword 0x1111111111111111
.xword 0x2222222222222222
.xword 0x3333333333333333
.xword 0x4444444444444444
.xword 0x5555555555555555
.xword 0x6666666666666666
.xword 0x7777777777777777
.xword 0x8888888888888888
/************************************************************************/