
#setMMRBaseAddr 0xd0000000
writereg	MBAR	0xff400000

# change internal MMR base from 0xd0000000 (reset value) to 0xd0000000
writemem.l 0xff400000 0xd0000000 # IMMRBAR = 0xd0000000

#setMMRBaseAddr 0xe0000000
writereg	MBAR	0xd0000000

# Relocate 128K SRAM Base Address to 0x00000000
writemem.l 0xd00000c4 0x00000000 # SRAMBAR

# LocalPlus Bus Local Access Windows
#####################################
# WINDOW 1 - LocalPlus Boot: 64MB NOR FLASH
writemem.l 0xd0000020 0xfc00ffff #LPBAW  - begining at 0xfc000000 

# NFC memory window
####################
writemem.l 0xd00000c8 0x40000000 # NFCBAR - begining at 0x40000000

#Enable Clocks
##################
writemem.l 0xd0000f04 0xffffffff # SCCR1 - enable all clocks
writemem.l 0xd0000f08 0xffffffff # SCCR2 - enable all clocks

# Local Plus Controller (LPC) Configuration
##############################################

# CS0 - NOR FLASH 
writemem.l 0xd0010000 0x00209300 # enable write access

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

# SPCR[TBEN] enable timebase
writemem.l 0xd0000104 0x00400000

#invalidate SP
writereg SP 0xF
