
writereg	MBAR	0xFF400000

#################################
# Local Bus Local Access Windows
#################################

# WINDOW 1 - FLASH
writemem.l 0xff400028 0xFE000000 # LBLAWBAR1  - begining at 0xff000000
writemem.l 0xff40002C 0x80000018 # LBLAWAR1   - enable, size = 32MB 

##############################################
# Local Bus Interface (LBIU) Configuration
##############################################

# CS0 - 16MB FLASH 
writemem.l 0xff405000 0xfe001001 # BR0 base address at 0xFE000000, port size 16 bit, GPCM, valid
writemem.l 0xff405004 0xfe006ff7 # OR0 32MB flash size, 15 w.s., timing relaxed


#LBCR - local bus enable
writemem.l 0xff4050d0 0x00000000

# LCRR
writemem.l 0xff4050d4 0x00010002

# MRTPR - refresh timer prescaler
writemem.l 0xff405084 0x20000000 

# SICRL
writemem.l 0xff400114 0x80000000

# SICRH
writemem.l 0xff400118 0x00000002

#Enable Core in ACR
writemem.l 0xff400800 0x00000000

writereg MSR 0x3000 #machine check enable, exception vectors at 0x0000_0000

ANDMem.l    0xff400800 0x00300000 # ACR - bits 10-11 should get a value different than '00'
                                  #       when the core is operating at below x2 of the system clock
