86 lines
2.1 KiB
Plaintext
86 lines
2.1 KiB
Plaintext
; --------------------------------------------------------------------------------
|
|
; @Title: i.MX25 Serial FLASH Programming Script
|
|
; @Description:
|
|
; Serial FLASH(NUMONYX, M25P256) is connected to CSPI1_SS1
|
|
;
|
|
; SDRAM: 0x78000000
|
|
; SPI Tx Register : 0x43FA4004
|
|
; SPI Rx Register : 0x43FA4000
|
|
; SPI CS Register : 0x43FA4008
|
|
;
|
|
; @Author: jjeong
|
|
; @Copyright: (C) 1989-2022 Lauterbach GmbH, licensed for use with TRACE32(R) only
|
|
; @Chip: IMX25
|
|
; @Keywords: NUMONYX M25P256 Flash SPI
|
|
; --------------------------------------------------------------------------------
|
|
; $Id: imx25-spi256.cmm 10516 2022-02-02 11:39:30Z bschroefel $
|
|
|
|
LOCAL &arg1
|
|
ENTRY &arg1
|
|
&arg1=STRing.UPpeR("&arg1") // for example "PREPAREONLY"
|
|
|
|
|
|
AREA.RESet
|
|
AREA.view
|
|
|
|
SYStem.RESet
|
|
SYStem.CPU IMX25
|
|
SYStem.JtagClock RTCK
|
|
SYStem.Option ResBreak OFF
|
|
SYStem.Option WaitReset ON
|
|
SYStem.Up
|
|
|
|
PER.Set.simple C15:0x1 %Long 0x00A52878
|
|
|
|
PER.Set.simple ASD:0x53FDC000 %Word 0x1430 ;Watchdog disable
|
|
|
|
PER.Set.simple ASD:0x43FAC164 %Long 0x0 ;CSPI1_SS1
|
|
|
|
PER.Set.simple ASD:0x68000014 %Long 0x4000
|
|
|
|
//Init CSPI registers
|
|
PER.Set.simple ASD:0x43FAC008 %Long 0x00000000 ; General Purpose Register (GPR), bit2=0 for the enable CSPI0
|
|
PER.Set.simple ASD:0x43FAC088 %Long 0x10101010 ; SW_MUX_CTL for the CSPI1
|
|
PER.Set.simple ASD:0x43FAC08C %Long 0x10021010 ; SW_MUX_CTL for the CSPI1
|
|
PER.Set.simple ASD:0x43FA4008 %Long 0x03F21003 ; SS1
|
|
|
|
FLASHFILE.CREATE 0x0++0xFFFFFF 0x3FFFF ;256KB uniform block spi flash
|
|
|
|
//FLASFILE.CONFIG <TXDATA Reg> <RXDATA Reg> <CONREG >
|
|
FLASHFILE.CONFIG 0x43FA4004 0x43FA4000 0x43FA4008
|
|
|
|
//FLASHFILE.TARGET <code range> <data range> <algorithm file>
|
|
FLASHFILE.TARGET 0x78000000++0x1FFF 0x78002000++0x1FFF ~~/demo/arm/flash/byte/spi64_ecspi.bin /KEEP
|
|
|
|
FLASHFILE.GETID
|
|
|
|
//End of the test prepareonly
|
|
IF "&arg1"=="PREPAREONLY"
|
|
ENDDO
|
|
|
|
|
|
//Dump window for Serial FLASH
|
|
FLASHFILE.DUMP 0x0
|
|
|
|
//Unlock Serial FLASH
|
|
;FLASHFILE.UNLOCK 0x0--0x3FFFFF
|
|
|
|
;FLASHFILE.ERASE 0x0--0xFFFFF
|
|
;FLASHFILE.LOAD * 0x0
|
|
;FLASHFILE.LOAD * 0x0 /ComPare
|
|
|
|
ENDDO
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|