⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 jnandtest.cmm

📁 QUALCOMM JNAND DRIVER
💻 CMM
字号:
;============================================================================
;  Name:
;    JNANDTEST.CMM
;
;  Test script for JNAND that does not use T32 FLASH.* commands
;  For use with terminal printf for debugging purposes
;
;
;  Description:
;    FLASH Programming Script file for Lauterbach JTAG/ICD TRACE32.
;
;  Execution:
;    Inside the debugger, type at the command line: "do jnandtest".
;
; Copyright (c) 2002 by QUALCOMM, Incorporated.  All Rights Reserved.
;----------------------------------------------------------------------------
;============================================================================
;
;                        EDIT HISTORY FOR MODULE
;
; $Header: //depot/asic/MSMSHARED/tools/jnand/jnandtest.cmm#1 $ $DateTime: 2003/02/06 15:47:46 $ $Author: pingguan $
;
; when       who     what, where, why
; -------    ---     --------------------------------------------------------
; 02/06/03   pg      Moved from ASWP402 server to ASWP401 server.
; 07/08/02   drh     Move all the sys.* directives from the top of this file
;                    into the MSM specific init file, as some of it has to
;                    be done after some initial setup that is MSM specific
; 07/06/02   drh     Take out all hard coded addresses and CPU type.  Read
;                    in from jnand_param.cmm which is generated during build
;                    process 
; 07/05/02   drh     Created
;
;============================================================================;



;============================================================================
; Set some MSM specific variables used later in flash.target command
;    &JnandCodeAddr=
;    &JnandParamAddr=
;    &JnandCpuType=
;============================================================================
 do jnand_param


;============================================================================
; 1) Set up the JTAG debugger for this MSM
; 2) Init important MSM/ASB registers
;    use existing external script that is MSM specific
;============================================================================
 do jnand_msm_init

;============================================================================
; Put up terminal window
;============================================================================
term.size 60 1000
term.scroll on
WinPOS 10 5
term.view


;-------------------------------------------------------------------------------
; Set some variables used later on
;   This script file is sourced by both jnand.cmm and jnandtest.cmm
;-------------------------------------------------------------------------------

do jnand_addr_init.cmm


;======================================================
; Map flash readonly - first 3mb
;======================================================
 map.readonly 000000--2FFFFF

;======================================================
; Load our flash programming routine and prepare flash
;======================================================
 d.load.elf "jnand.elf"
 ; need this breakpoint as per Lauterbach Spec so that we
 ; can hand back control to the Debugger
 break.delete /ALL
 break.set swbp
 
 ;--------------------------------------------------------
 ; reset our flash command
 ;--------------------------------------------------------
 flash.res
 
 ;--------------------------------------------------------
 ; Let flash command know where our routine and buffer is located
 ; code at &JnandCodeAddr, data at &JnandParamAddr, buffer size = 16K
 ; Earlier versions of JTAG s/w would allow larger buffer of 64k
 ; but now we seem to be limited to 16k
 ;--------------------------------------------------------
 ;
 flash.target &JnandCodeAddr &JnandParamAddr 4000 
 
 ;--------------------------------------------------------
 ; Define our flash range and tell flash command we're using
 ; our own flash programming routine via keyword "target"
 ; right now, we are defining 3 MBytes for code which in
 ; the NAND environment is meaningless, as this has to do
 ; with memory mapping in the flash, but we have to use it
 ; to use the other FLASH.* functions
 ;--------------------------------------------------------
 ;
 flash.create 000000--2FFFFF target word
 
 
 ;--------------------------------------------------------
 ; Call selftest function.  Will run selftest either
 ; to completion or to error.
 ;--------------------------------------------------------
 ;
 print "Starting self test"
 data.set &ParmCmd %LONG &TestCmd
 r.s pc &StartAddr
 go

 gosub check_status  ;; will not return if error
 
 ;--------------------------------------------------------
 ; Call report statistics function.  Will report stats
 ; only on last test to finish which is the skip block
 ; case;
 ;--------------------------------------------------------
 ;
 gosub report_stats
 
 sys.d
 
 b.delete /all

 sys.u

 end



;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;
;  SUBROUTINES
;
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


;=====================================================
; --- Function to report statistics
;       and exit if 0x100
;=====================================================

report_stats:
  print "  Statistics Report:"
  &ReportInt=data.long(A:&ReportBytesGap)
  print "    Gaps due to gaps in image  0x" &ReportInt
  &ReportInt=data.long(A:&ReportBlocksGap)
  print "    Gaps due to bad blocks     0x" &ReportInt
  &ReportInt=data.long(A:&ReportImageSize)
  print "    Total size of code image   0x" &ReportInt

 return


;=====================================================
; --- Function to check command status return
;       and exit if 0x100
;=====================================================

check_status:
 wait !run()

 &Result=data.long(A:&ParmStatus)
 if &Result==0x100
 (
   print "Command failed"
   &Result=data.long(A:&ParmReserved)
   print "Extended status is " &Result
   print "exiting"
   end
 )
 else
 (
  print "Command Success"  
 )
 return


END

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -