* ========== Copyright Header Begin ==========================================
* OpenSPARC T2 Processor File: hboot_mcuctl_init.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 ============================================
#include "mcu_fbdimm_training.s"
setx 0x8400000000, %l7, %l6
sethi %hi(0x00001000), %g1
sethi %hi(0x00002000), %g2
sethi %hi(0x00003000), %g3
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! For non slam vectors much of this code has been
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
add %l6, 0x1a0, %l0 ! DRAM_DIMM_INIT_REG
mov 3, %l3 ! Set CKE enable to 1 to assert CKE high to the DIMMs
stx %l3, [%l0+%g0] ! (per conversation with Rashid)
! Memory Density Type : 256 Mb, 512 Mb, 1 Gb, 2 Gb
#if defined(DIMM_SIZE_1G)
add %l6, 0x008, %l0 ! DRAM_RAS_ADDR_WIDTH_REG
#if defined(DIMM_SIZE_512)
add %l6, 0x128, %l0 ! 8_BANK_REG
#if defined(DIMM_SIZE_256)
! MEMORY CONFIGURATION SETUP
#define CAS_LATENCY VARY_CAS_LATENCY
add %l6, 0x148, %l0 ! SINGLE_CHANNEL_MODE_REG
!! HIGH ADDR / SINGLE RANK
#if !defined(RANK_LOW) && !defined(STACK_DIMM)
add %l6, 0x140, %l0 ! DRAM_SEL_LO_ADDR_BITS_REG
add %l6, 0x108, %l0 ! DRAM_DIMM_STACK_REG
#if defined(FBDIMMS_1) || defined(FBDIMMS_2) || defined(FBDIMMS_4) || defined(FBDIMMS_8)
add %l6, 0x218, %l0 ! DRAM_DIMM_PRESENT_REG
add %l6, 0x800, %l0 ! FBD_CHANNEL_STATE_REG
#if !defined(RANK_LOW) && defined(STACK_DIMM)
add %l6, 0x140, %l0 ! DRAM_SEL_LO_ADDR_BITS_REG
add %l6, 0x108, %l0 ! DRAM_DIMM_STACK_REG
#if defined(FBDIMMS_1) || defined(FBDIMMS_2) || defined(FBDIMMS_4) || defined(FBDIMMS_8)
add %l6, 0x218, %l0 ! DRAM_DIMM_PRESENT_REG
add %l6, 0x800, %l0 ! FBD_CHANNEL_STATE_REG
!! LOW ADDR / SINGLE RANK
#if defined(RANK_LOW) && !defined(STACK_DIMM)
add %l6, 0x140, %l0 ! DRAM_SEL_LO_ADDR_BITS_REG
add %l6, 0x108, %l0 ! DRAM_DIMM_STACK_REG
#if defined(FBDIMMS_1) || defined(FBDIMMS_2) || defined(FBDIMMS_4) || defined(FBDIMMS_6) || defined(FBDIMMS_8)
add %l6, 0x218, %l0 ! DRAM_DIMM_PRESENT_REG
add %l6, 0x800, %l0 ! FBD_CHANNEL_STATE_REG
#if defined(RANK_LOW) && defined(STACK_DIMM)
add %l6, 0x140, %l0 ! DRAM_SEL_LO_ADDR_BITS_REG
add %l6, 0x108, %l0 ! DRAM_DIMM_STACK_REG
#if defined(FBDIMMS_1) || defined(FBDIMMS_2) || defined(FBDIMMS_4) || defined(FBDIMMS_6) || defined(FBDIMMS_8)
add %l6, 0x218, %l0 ! DRAM_DIMM_PRESENT_REG
add %l6, 0x800, %l0 ! FBD_CHANNEL_STATE_REG
!!! Program same values as in mcu_mem_config.v
add %l6, 0x0b0, %l0 ! DRAM_TRAS_REG
! add %l6, 0x0b8, %l0 ! DRAM_TRP_REG - same as POR value
! add %l6, 0x0a8, %l0 ! DRAM_TRTP_REG - same as POR value
add %l6, 0x088, %l0 ! DRAM_TRC_REG
! add %l6, 0x090, %l0 ! DRAM_TRCD_REG - same as POR value
add %l6, 0x0c8, %l0 ! DRAM_TRFC_REG
add %l6, 0x0c0, %l0 ! DRAM_TWR_REG
add %l6, 0x0e0, %l0 ! DRAM_TIWTR_REG
add %l6, 0x0a0, %l0 ! DRAM_TRTW_REG
add %l6, 0x080, %l0 ! DRAM_TRRD_REG
add %l6, 0x0d8, %l0 ! missing from mcu_defines.h
#else // end of #ifdef DDR2_533
add %l6, 0x0b0, %l0 ! DRAM_TRAS_REG
add %l6, 0x0b8, %l0 ! DRAM_TRP_REG
add %l6, 0x0a8, %l0 ! DRAM_TRTP_REG
add %l6, 0x020, %l0 ! DRAM_REFRESH_FREQ_REG
add %l6, 0x088, %l0 ! DRAM_TRC_REG
add %l6, 0x090, %l0 ! DRAM_TRCD_REG
add %l6, 0x0c8, %l0 ! DRAM_TRFC_REG
add %l6, 0x0c0, %l0 ! DRAM_TWR_REG
add %l6, 0x0e0, %l0 ! DRAM_TIWTR_REG
add %l6, 0x0a0, %l0 ! DRAM_TRTW_REG
add %l6, 0x080, %l0 ! DRAM_TRRD_REG
add %l6, 0x0d8, %l0 ! missing from mcu_defines.h
#endif // end of !#ifdef DDR2_533
! AT 04/12/06: Do not reset FBDIMM channel in DTM mode
add %l6, 0x810, %l0 ! CHANNEL_RESET_REG
#ifdef POLL_MCU_CHAN_RESET_REG
#endif // ifdef POLL_MCU_CHAN_RESET_REG
#endif // ifndef DTM_ENABLED
#endif // ifndef NON_SLAM_VECTORS
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
#define DIMM_INIT_DATA 0x0000000000000002
add %l6, 0x1a0, %l0 ! DRAM_DIMM_INIT_REG
! 04/12/06: need to program DIMM INIT REG to 2.
! 04/12/06: Enable MCU0 last, which kicks off counters in Sun AMB model