; --------------------------------------------------------------------------------
; @Title: booting Sandpoint 755 with Lynx bootloader
; @Description: 
;   Lynx bootloader programs the 107's MIOCR register to drive
;   the QACK signal activly. This disables the JTAG control.
;   You probably don't need this sequence with another version
;   of the bootloader, so first try it without this patch.
;   The following sequence waits for the bootloader to
;   program the register and then resets the appropriate
;   bit in order keep control.
; @Keywords: lynx, sandpoint7xx
; @Author: DIE
; @Copyright: (C) 1989-2014 Lauterbach GmbH, licensed for use with TRACE32(R) only
; --------------------------------------------------------------------------------
; $Id: lynx_bootloader.cmm 6750 2014-04-07 21:27:07Z servera $


 SCREEN.ALways          ; to watch wile waiting
 PRINT "patching QACK setup..."
 SYStem.Option MMU OFF  ; keep off while in bootloader
 WinPOS ,,,,,,bl        ; name break.list window to remove it later
 Break.List             ; open break.list window to watch counter
 Break.Set 0xfff03d14 /Onchip /Count 18.    ; set breakpoint and...
 Go.direct                     ; go until the register is programmed
 WAIT !run()            ; and wait until breakpoint is reached
 Break.Delete 0xfff03d14    ; delete breakpoint
 WinCLEAR bl            ; remove break.list window
 Register.Set R5 r(R5)&0xffdfffff    ; reset bit MIOCR:NOHZQACK
 SYStem.Option MMU ON   ; set option back to ON
 SCREEN.ON 
   
 Go.direct                     ; now let the bootloader boot
 PRINT "booting Lynx bootloader..."
 WAIT 6.s               ; wait until fully booted
 Break.direct                  ; and halt the processor
 
 ENDDO
