Files
Gen4_R-Car_Trace32/2_Trunk/demo/arm/flash/mb9df125.cmm
2025-10-14 09:52:32 +09:00

91 lines
2.6 KiB
Plaintext

; --------------------------------------------------------------------------------
; @Title: Example for flash declaration of Fujitsu MB9DF125 (Atlas-L) internal flash.
;
; @Description:
; Script arguments:
;
; DO mb9df125 [PREPAREONLY]
;
; PREPAREONLY only declares flash but does not execute flash programming example
;
; @Chip: MB9DF125
; @Author: WRD
; @Copyright: (C) 1989-2022 Lauterbach GmbH, licensed for use with TRACE32(R) only
; --------------------------------------------------------------------------------
; $Rev: 10516 $
; $Id: mb9df125.cmm 10516 2022-02-02 11:39:30Z bschroefel $
LOCAL &parameters &param_prepareonly
ENTRY %LINE &parameters
&param_prepareonly=(STRing.SCAN(STRing.UPpeR("&parameters"),"PREPAREONLY",0)!=-1)
; --------------------------------------------------------------------------------
; Start debugging
IF SYStem.MODE()<5
(
PRIVATE &val
SYStem.RESet
SYStem.CPU MB9DF125
SYStem.Option.ResBreak OFF
SYStem.Option.WaitReset 2.ms
; connect and handle watchdog
; <timing critical>
SYStem.Up
&val=Data.Long(AD:0xB0608048)
IF (&val&0x01000000)==0
(
; disable watchdog
Data.Set AD:0xB0608000 %Long 0xEDACCE55
Data.Set AD:0xB0608048 %Long 0x01000000
)
ELSE IF (&val&0xb)==(0x1||0x2||0x3)
(
; watchdog already locked - bug DBGEN not set
DIALOG.OK "Watchdog enabled BUT DBGEN not set!"
STOP
)
; </timing critical>
; Initialize TCM RAM to have valid ECC
Data.Set 0x0--0xBFFF %Long 0x0
)
; --------------------------------------------------------------------------------
; Flash declaration
FLASH.RESet
; TC Flash large sectors (AXI address range)
FLASH.Create 1. 0x01000000--0x010FFFFF 0x20000 TARGET Long
; TC Flash small sectors (AXI address range)
FLASH.Create 2. 0x017F0000--0x017F3FFF 0x4000 TARGET Long /CENSORSHIP 0x17F0000--0x17F01BF ; MSDR + TCSDR0
FLASH.Create 2. 0x017F4000--0x017FBFFF 0x4000 TARGET Long
FLASH.Create 2. 0x017FC000--0x017FFFFF 0x4000 TARGET Long /CENSORSHIP 0x17FFFE0--0x17FFFFF ; BDR
; Map TCM address range to AXI address range
FLASH.CreateALIAS 0x00800000--0x00FFFFFF 0x01000000
; Map AXI slave core0 address range to AXI address range
FLASH.CreateALIAS 0x05800000--0x05FFFFFF 0x01000000
FLASH.TARGET 0x1000 0x2000 0x1000 ~~/demo/arm/flash/long/fcr4d125.bin
; Flash script ends here if called with parameter PREPAREONLY
IF &param_prepareonly
ENDDO PREPAREDONE
; --------------------------------------------------------------------------------
; Flash programming example
DIALOG.YESNO "Program flash memory?"
LOCAL &progflash
ENTRY &progflash
IF &progflash
(
FLASH.ReProgram.ALL /Erase
Data.LOAD.auto *
FLASH.ReProgram.off
)
ENDDO