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

85 lines
2.7 KiB
Plaintext

; --------------------------------------------------------------------------------
; @Title: Example for flash declaration of Fujitsu MB9EF226 (Titan) internal flash.
;
; @Description:
; Script arguments:
;
; DO mb9ef226 [PREPAREONLY]
;
; PREPAREONLY only declares flash but does not execute flash programming example
;
; @Chip: MB9EF226
; @Author: FLC
; @Copyright: (C) 1989-2022 Lauterbach GmbH, licensed for use with TRACE32(R) only
; --------------------------------------------------------------------------------
; $Rev: 12049 $
; $Id: mb9ef226.cmm 12049 2023-04-20 12:32:16Z bschroefel $
LOCAL &parameters &param_prepareonly
ENTRY %LINE &parameters
&param_prepareonly=(STRing.SCAN(STRing.UPpeR("&parameters"),"PREPAREONLY",0)!=-1)
; --------------------------------------------------------------------------------
; Start debugging
IF SYStem.MODE()<5
(
SYStem.RESet
SYStem.CPU MB9EF226
SYStem.Option.ResBreak OFF
SYStem.Option.WaitReset 200ms
SYStem.Up
)
; Switch MPU and caches off
Data.Set C15:0x1 %Long Data.Long(C15:0x1)&~0x1005
; Disable watchdog if needed
IF ((Data.Long(C:0xB0608048)&0x01000000)==0)
(
Data.Set 0xB0608000 %Long 0xEDACCE55
Data.Set 0xB0608048 %Long 0x01000000
)
; Initialize TCM RAM to have valid ECC
Data.Set 0x0--0x1FFFF %Long 0x0
; --------------------------------------------------------------------------------
; Flash declaration
FLASH.RESet
; TC Flash large sectors (AXI address range)
FLASH.Create 1. 0x01000000--0x011FFFFF 0x40000 TARGET Long
; TC Flash small sectors (AXI address range)
FLASH.Create 2. 0x017E0000--0x017E3FFF 0x4000 TARGET Long /CENSORSHIP 0x017E0000--0x017E013F ; SDR
FLASH.Create 2. 0x017E4000--0x017EFFFF 0x4000 TARGET Long
FLASH.Create 3. 0x017F0000--0x017F3FFF 0x4000 TARGET Long /CENSORSHIP 0x017F0000--0x017F007F ; SDR
FLASH.Create 3. 0x017F4000--0x017FBFFF 0x4000 TARGET Long
FLASH.Create 3. 0x017FC000--0x017FFFFF 0x4000 TARGET Long /CENSORSHIP 0x017FFFE0--0x017FFFFF ; 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/fcr4.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