2 * BCM947XX DRAM init & sizing
4 * Used by both cfe and shared/boot.
6 * Copyright (C) 2009, Broadcom Corporation
9 * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
10 * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
11 * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
12 * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
14 * $Id: sisdram.S,v 1.3.2.4 2008/10/31 21:39:48 Exp $
23 /* Debug macro - write a number to memory - use it with caution,
24 * it changes k0 and k1 registers.
31 * This file exists because board_draminit is an entry point for cfe as well
32 * as for hndrte & min_osl. Because of the former case, we cannot assume
33 * any of the register settings from boot.S,
43 /* Figure out if we have an SB or AI chip */
44 li s2,KSEG1ADDR(SI_ENUM_BASE) # s2 = SI_ENUM_BASE
46 lw s6,CC_CHIPID(s2) # s6 = ChipId reg
48 srl s7,t1,CID_TYPE_SHIFT # s7 = ChipType (0 for SB, = 1 for AI)
50 /* Check if we booted from flash, compute reloc for text addresses */
54 1: li t0,PHYSADDR_MASK
60 sub s5,ra,t0 # s5: Relocation factor
62 /* Call appropriate draminit for chip type */
64 #if !defined(BCMCHIPTYPE) || (BCMCHIPTYPE == 0)
70 #if !defined(BCMCHIPTYPE) || (BCMCHIPTYPE == 1)
77 /* BCMCHIPTYPE defined but does not match this chip */
87 /* Size memory if needed (Need to reinit TRACE after sb_draminit) */
92 li a0,-1 # -1 means no controller
106 li s3,KSEG1 # s3 = KSEG1
114 lw t1,0x3c(t0) # Read back to ensure completion
122 /* Didn't find an alias, must be 128MB */