; --------------------------------------------------------------------------------
; @Title: Script to reset OSK5912 Board
; @Description: Reset OSK5912 board using Data.Set commands
; @Keywords: OMAP*, OSK, TI
; @Author: DIE
; @Board: OSK5912
; @Chip: OMAP5912
; @Copyright: (C) 1989-2019 Lauterbach GmbH, licensed for use with TRACE32(R) only
; --------------------------------------------------------------------------------
; $Id: osk5912_reset.cmm 15210 2019-11-04 10:51:00Z bschroefel $


; disable MMU
  Data.Set c15:1 %Long 0x00050078

; soft reset of ARM and DSP core
  Data.Set 0xfffece10 %Word 0x000c     ; ARM_RSTCT1
  Data.Set 0xfffece10 %Word 0x0004     ; ARM_RSTCT1

; request the DPLL to enter the lock mode
  Data.Set 0xfffecf00 %Word 0x0010     ; DPLL1_CTL_REG

; disable ARM watchdog
  Data.Set 0xfffec808 %Word 0x00f5     ; MPU_WDT_TIMER_MODE
  Data.Set 0xfffec808 %Word 0x00a0     ; MPU_WDT_TIMER_MODE

; allow access to DSP memory
  Data.Set 0xfffece08 %Word 0x0040     ; ARM_IDLECT2
  Data.Set 0xfffec900 %Long 0x0000ff1b ; CTRL_REG

; patch branch to itself for DSP to get a defined behaviour after reset release
  Data.Set 0xe0010000 %Long 0x4a7e4a7e

; DSP reset release; now the start-up script for the DSP will work; DSP boots from 0x10000 byte address
  Data.Set 0xfffec918 %Long 0x00000005 ; DSP_Boot_Config
  Data.Set 0xfffece10 %Word 0x0000     ; ARM_RSTCT1
  Data.Set 0xfffece10 %Word 0x0006     ; ARM_RSTCT1
