1/* ********************************************************************* 2 * SB1250 Board Support Package 3 * 4 * Board-specific initialization File: VCS_INIT.S 5 * 6 * This module contains the assembly-language part of the init 7 * code for this board support package. The routine 8 * "board_earlyinit" lives here. 9 * 10 * This board support package is for operation in the Verilog 11 * simulator. 12 * 13 * Author: Mitch Lichtenberg 14 * 15 ********************************************************************* 16 * 17 * Copyright 2000,2001,2002,2003 18 * Broadcom Corporation. All rights reserved. 19 * 20 * This software is furnished under license and may be used and 21 * copied only in accordance with the following terms and 22 * conditions. Subject to these conditions, you may download, 23 * copy, install, use, modify and distribute modified or unmodified 24 * copies of this software in source and/or binary form. No title 25 * or ownership is transferred hereby. 26 * 27 * 1) Any source code used, modified or distributed must reproduce 28 * and retain this copyright notice and list of conditions 29 * as they appear in the source file. 30 * 31 * 2) No right is granted to use any trade name, trademark, or 32 * logo of Broadcom Corporation. The "Broadcom Corporation" 33 * name may not be used to endorse or promote products derived 34 * from this software without the prior written permission of 35 * Broadcom Corporation. 36 * 37 * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR 38 * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED 39 * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 40 * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT 41 * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN 42 * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT, 43 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 44 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 45 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 46 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 47 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR 48 * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF 49 * THE POSSIBILITY OF SUCH DAMAGE. 50 ********************************************************************* */ 51 52 53#include "sbmips.h" 54#include "bsp_config.h" 55#include "vcs.h" 56 57 .text 58 59/* ********************************************************************* 60 * Macros 61 ********************************************************************* */ 62 63 64#if CFG_RUNFROMKSEG0 65#define CALLKSEG1(x) la k0,x ; or k0,K1BASE ; jal k0 66#else 67#define CALLKSEG1(x) jal x 68#endif 69 70 71/* ********************************************************************* 72 * BOARD_EARLYINIT() 73 * 74 * Initialize board registers. This is the earliest 75 * time the BSP gets control. This routine cannot assume that 76 * memory is operational, and therefore all code in this routine 77 * must run from registers only. The $ra register must not 78 * be modified, as it contains the return address. 79 * 80 * This routine will be called from uncached space, before 81 * the caches are initialized. If you want to make 82 * subroutine calls from here, you must use the CALLKSEG1 macro. 83 * 84 * Among other things, this is where the GPIO registers get 85 * programmed to make on-board LEDs function, or other startup 86 * that has to be done before anything will work. 87 * 88 * Input parameters: 89 * nothing 90 * 91 * Return value: 92 * nothing 93 ********************************************************************* */ 94 95LEAF(board_earlyinit) 96 97 98 j ra 99 100END(board_earlyinit) 101 102 103/* ********************************************************************* 104 * BOARD_DRAMINFO 105 * 106 * Return the address of the DRAM information table. Note that 107 * the address must be obtained in a position-independent way, 108 * so avoid the use of the "la" instruction. 109 * 110 * Input parameters: 111 * nothing 112 * 113 * Return value: 114 * v0 - DRAM info table, return 0 to use default table 115 ********************************************************************* */ 116 117LEAF(board_draminfo) 118 119 move v0,zero 120 j ra 121 122END(board_draminfo) 123 124 125 126/* ********************************************************************* 127 * BOARD_SETLEDS(x) 128 * 129 * Set LEDs for boot-time progress indication. Not used if 130 * the board does not have progress LEDs. This routine 131 * must not call any other routines, since it may be invoked 132 * either from KSEG0 or KSEG1 and it may be invoked 133 * whether or not the icache is operational. 134 * 135 * Input parameters: 136 * a0 - LED value (8 bits per character, 4 characters) 137 * 138 * Return value: 139 * nothing 140 * 141 * Registers used: 142 * t0,t1,t2,t3 143 ********************************************************************* */ 144 145 146LEAF(board_setleds) 147 148 j ra 149 150END(board_setleds) 151 152