# File: setup_mdi.src
#
# This procedure brings the MDI DEP and IP up to the flight configuration
# after the DEP and IP have been turned on.
#

program "@(#) MODULE: setup_mdi.src RELEASE: %R%.%L% CREATED: %G% %U%"
source "/mdisw/cfl/sim/src/setup_mdi.src"
descr "  setup_mdi - Informs the DEP that the instrument is on."

display "Executing procedure setup_mdi."

# load patches to DEP built-in code and sequencer

perf dep_patches_v02

perf dep_mos+10f_v01

# Reset IP

tcb mbiprsal

# load built-in code to IP writable control store

tcblock mbiplbic 0x36 0x06       ## Load Flight WCS code
wait time 70

tcblock mbipcmd 5        ## Run Initialization code
wait time 5

# load patches to IP writable control store

perf ip_patches_v01

#   Initialize 2-byte EDAC page (16) for registers and look-ups tables
tcblock mbipldin 0x0116 0x8000 0x0080

#   Initialize 8-byte EDAC page (14) for lists, TWA and Circular Buffer data
tcblock mbipldin 0x0118 0x7000 0x0088

perf init_fftbl12_v02


tcb mbipldin 0x136     ## Re-enable Queue
tcb mbipldin 0x134     ## Re-enable Interrupts

tcblock mbipldin 0x0140 0x003d  0
tcblock mbipldin 0x0140 0x0021  0

tcblock mbipldin 0x11c


return
