1 /* Memory sub-system initialization code */
5 #include <asm/regdef.h>
6 #include <asm/au1x00.h>
7 #include <asm/mipsregs.h>
9 #define AU1500_SYS_ADDR 0xB1900000
10 #define sys_endian 0x0038
11 #define CP0_Config0 $16
12 #define MEM_1MS ((396000000/1000000) * 1000)
21 * Step 1) Establish CPU endian mode.
22 * NOTE: A fair amount of code is necessary on the Pb1000 to
23 * obtain the value of Switch S8.1 which is used to determine
40 /* Set DSTRB bits so switch will read correctly */
46 /* Check switch setting */
49 and t2, t2, 0x00000100
50 bne t2, zero, big_endian
55 /* Change Au1 core to little endian */
56 li t0, AU1500_SYS_ADDR
64 /* Big Endian is default so nothing to do but fall through */
69 * Step 2) Establish Status Register
70 * (set BEV, clear ERL, clear EXL, clear IE)
76 * Step 3) Establish CP0 Config0
83 * Step 4) Disable Watchpoint facilities
89 * Step 5) Disable the performance counters
91 mtc0 zero, CP0_PERFORMANCE
95 * Step 6) Establish EJTAG Debug register
101 * Step 7) Establish Cause
107 /* Establish Wired (and Random) */
111 /* First setup pll:s to make serial work ok */
112 /* We have a 12 MHz crystal */
114 li t1, 0x21 /* 396 MHz */
120 /* wait 1mS for clocks to settle */
127 li t1, 8 /* 96 MHz */
128 sw t1, 0(t0) /* aux pll */
131 /* Static memory controller */
133 /* RCE0 8MB AMD29D323 Flash */
146 /* RCE1 CPLD Board Logic */
159 /* RCE2 CPLD Board Logic */
172 /* RCE3 PCMCIA 250ns */
187 /* Set peripherals to a known state */
213 li t0, IC0_FALLINGCLR
246 li t0, IC1_FALLINGCLR
266 li t0, SYS_PININPUTEN
288 /* wait 1mS before setup */
295 * Skip memory setup if we are running from memory
299 bltz t0, skip_memsetup
303 * SDCS0 - Not used, for SMROM
304 * SDCS1 - 32MB Micron 48LCBM16A2
305 * SDCS2 - 32MB Micron 48LCBM16A2
334 li t1, 0x74000c30 /* Disable */
349 li t1, 0x76000c30 /* Enable */
368 /* wait 1mS after setup */
377 li t1, 0/*0x00008080*/