79 lines
2.0 KiB
Plaintext
79 lines
2.0 KiB
Plaintext
; --------------------------------------------------------------------------------
|
|
; @Title: TI DM6443 NAND FLASH Programming Script
|
|
; @Description:
|
|
; TI DM6443 NAND FLASH(Micron, MT29F2G08) is connected to CS2
|
|
;
|
|
; Internal SRAM : 0x40000
|
|
; Command Register : 0x2000010
|
|
; Address Register : 0x200000B
|
|
; Data Register : 0x2000000
|
|
;
|
|
; @Author: jjeong
|
|
; @Chip: TMS320DM6443
|
|
; @Keywords: Micron MT29F2G08 FLASH NAND
|
|
; @Copyright: (C) 1989-2022 Lauterbach GmbH, licensed for use with TRACE32(R) only
|
|
; --------------------------------------------------------------------------------
|
|
; $Id: dm6443-nand2g08.cmm 12049 2023-04-20 12:32:16Z bschroefel $
|
|
|
|
LOCAL &arg1
|
|
ENTRY &arg1
|
|
&arg1=STRing.UPpeR("&arg1") // for example "PREPAREONLY"
|
|
|
|
|
|
SYStem.RESet
|
|
SYStem.CPU DM6443
|
|
SYStem.JtagClock RTCK 1MHZ
|
|
SYStem.Mode Go
|
|
WAIT 5.s
|
|
IF STATE.RUN()
|
|
Break.direct
|
|
|
|
; Disable WP by setting GPIO 51
|
|
Data.Set ASD:0x1C41A68 %Long 0x703
|
|
Data.Set ASD:0x1C41868 %Long 0x1F03
|
|
Data.Set ASD:0x1C67038 %Long 0yXXXXxxxxXXXX0xxxXXXXxxxxXXXXxxxx
|
|
Data.Set ASD:0x1C67040 %Long 0x80000
|
|
|
|
;EMIF, CS2 Enable for NAND FLASH
|
|
PER.Set.simple ASD:0x1E00060 %Long 0x1 ; CS2 Enable
|
|
PER.Set.simple ASD:0x1E00010 %Long 0x00624388 ; CS2 bus timing
|
|
|
|
FLASHFILE.RESet
|
|
|
|
//FLASHFILE.config <Cmd_reg> <Addr_reg> <Data_reg>
|
|
FLASHFILE.CONFIG 0x2000010 0x200000B 0x2000000
|
|
|
|
//FLASHFILE.TARGET <Code_range> <Data_range> <Algorithm file>
|
|
FLASHFILE.TARGET 0x40000++0x1FFF 0x42000++0x1FFF ~~/demo/arm/flash/byte/nand2g08.bin
|
|
|
|
//Read FLASH Manufacture and Device ID
|
|
FLASHFILE.GETID
|
|
|
|
//End of the test prepareonly
|
|
IF "&arg1"=="PREPAREONLY"
|
|
ENDDO
|
|
|
|
|
|
//Put a list of bad blocks into area window
|
|
FLASHFILE.GETBADBLOCK 0x0--0xFFFFF
|
|
|
|
DIALOG.YESNO "Program flash memory?"
|
|
ENTRY &progflash
|
|
IF &progflash
|
|
(
|
|
//Erase NAND FLASH Main and Bad block inforamtion
|
|
FLASHFILE.Erase 0x0--0x7FFFFFF
|
|
;FLASHFILE.ERASE 0x0--0x7FFFFFF /EraseBadBlocks
|
|
|
|
//Skipped way
|
|
FLASHFILE.LOAD.binary * 0x0
|
|
)
|
|
|
|
//Open NAND FLASH Dump window
|
|
FLASHFILE.DUMP 0x0
|
|
|
|
ENDDO
|
|
|
|
|
|
|