📄 m29w800dt.cod
字号:
00078 ea000001 b |$L34692|
0007c |$L34317|
; 257 : }
; 258 :
; 259 : //----- 2. Process the read request(s)... -----
; 260 : for(i = startSectorAddr ; i < (startSectorAddr + dwNumSectors) ; i++)
0007c e59a3000 ldr r3, [r10]
00080 e0873003 add r3, r7, r3
00084 |$L34692|
; 273 : physicalSectorAddr = s_STFlsInfo.dwBaseAddr + i*(SECTOR_SIZE);
00084 e58d3000 str r3, [sp]
; 274 :
; 275 : //----- Read the necessary sector data -----
; 276 : if(pSectorBuff)
00088 e3550000 cmp r5, #0
0008c 0a000004 beq |$L34320|
; 277 : {
; 278 : memcpy(pSectorBuff, (PUCHAR)physicalSectorAddr, SECTOR_SIZE);
00090 e59d1000 ldr r1, [sp]
00094 e3a02c02 mov r2, #2, 24
00098 e1a00005 mov r0, r5
0009c eb000000 bl memcpy
; 279 : pSectorBuff += SECTOR_SIZE;
000a0 e2855c02 add r5, r5, #2, 24
000a4 |$L34320|
; 280 : }
; 281 :
; 282 : //----- Read the necessary SectorInfo data (metadata) -----
; 283 : if(!s_bXIPMode && pSectorInfoBuff)
000a4 e35b0000 cmp r11, #0
000a8 1a000007 bne |$L34315|
000ac e3560000 cmp r6, #0
000b0 0a000005 beq |$L34315|
; 284 : {
; 285 : // The metadata bytes are read directly into the SectorInfo structure...
; 286 : memcpy(pSectorInfoBuff, (CONST PVOID)(physicalSectorAddr+SECTOR_SIZE), sizeof(SectorInfo));
000b4 e59d3000 ldr r3, [sp]
000b8 e3a02008 mov r2, #8
000bc e1a00006 mov r0, r6
000c0 e2831c02 add r1, r3, #2, 24
000c4 eb000000 bl memcpy
; 287 : pSectorInfoBuff += sizeof(SectorInfo);
000c8 e2866040 add r6, r6, #0x40
000cc |$L34315|
000cc e2844001 add r4, r4, #1
000d0 e1540008 cmp r4, r8
000d4 e2899f82 add r9, r9, #0x82, 30
000d8 e2877c02 add r7, r7, #2, 24
000dc 3affffdc bcc |$L34314|
000e0 |$L34316|
; 288 : }
; 289 : }
; 290 :
; 291 : return(TRUE);
000e0 e3a00001 mov r0, #1
000e4 ea000000 b |$L34308|
000e8 |$L34313|
; 255 : {
; 256 : return(FALSE);
000e8 e3a00000 mov r0, #0
000ec |$L34308|
; 292 : }
000ec e28dd004 add sp, sp, #4
000f0 e8bd4ff0 ldmia sp!, {r4 - r11, lr}
000f4 e12fff1e bx lr
000f8 |$L34698|
000f8 00000000 DCD |s_STFlsInfo|
000fc |$M34694|
ENDP ; |?Spansion_Nor_FMD_ReadSector@@YAHKPAEPAU_SectorInfo@@K@Z|, Spansion_Nor_FMD_ReadSector
EXPORT |?WriteFlashEx@@YAHKPAEK@Z| ; WriteFlashEx
00000 AREA |.text| { |?WriteFlashEx@@YAHKPAEK@Z| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 AREA |.pdata$$?WriteFlashEx@@YAHKPAEK@Z|, PDATA, SELECTION=5, ASSOC=|.text| { |?WriteFlashEx@@YAHKPAEK@Z| } ; comdat associative
|$T34726| DCD |$L34725|
DCD 0x40003501
; Function compile flags: /Ogsy
00000 AREA |.text| { |?WriteFlashEx@@YAHKPAEK@Z| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 |?WriteFlashEx@@YAHKPAEK@Z| PROC ; WriteFlashEx
; 296 : {
00000 |$L34725|
00000 e92d4ff0 stmdb sp!, {r4 - r11, lr}
00004 |$M34723|
00004 e1a06002 mov r6, r2
00008 e1a07001 mov r7, r1
0000c e1a08000 mov r8, r0
; 297 : DWORD i;
; 298 :
; 299 : if ((DWORD)pbBuf & ((1 << (s_STFlsInfo.bBusWidth - 1)) - 1) || dwBufSize % s_STFlsInfo.bBusWidth)
00010 e59f50b8 ldr r5, [pc, #0xB8]
00014 e3a02001 mov r2, #1
00018 e5d50004 ldrb r0, [r5, #4]
0001c e2403001 sub r3, r0, #1
00020 e1a03312 mov r3, r2, lsl r3
00024 e2433001 sub r3, r3, #1
00028 e1130007 tst r3, r7
0002c 1a000024 bne |$L34334|
00030 e1a01006 mov r1, r6
00034 eb000000 bl __rt_udiv
00038 e3510000 cmp r1, #0
0003c 1a000020 bne |$L34334|
; 303 : }
; 304 :
; 305 : for (i = 0; i < dwBufSize; i += sizeof(WORD))
00040 e3a04000 mov r4, #0
00044 e3560000 cmp r6, #0
00048 0a000016 beq |$L34339|
0004c e3a090aa mov r9, #0xAA
00050 e3a0a055 mov r10, #0x55
00054 e3a0b0a0 mov r11, #0xA0
00058 |$L34337|
; 306 : {
; 307 : STUnlockChip(&s_STFlsInfo);
00058 e5952000 ldr r2, [r5]
0005c e5953024 ldr r3, [r5, #0x24]
; 308 : STIssueCmd(&s_STFlsInfo, ST_CMD_PROGRAM);
; 309 : STWriteWord(&s_STFlsInfo, dwFlashAddr + i, *((WORD*)(pbBuf + i)));
; 310 : if(FALSE == STWaitComplete(&s_STFlsInfo))
00060 e1a00005 mov r0, r5
00064 e18290b3 strh r9, [r2, +r3]
00068 e5952000 ldr r2, [r5]
0006c e5953028 ldr r3, [r5, #0x28]
00070 e182a0b3 strh r10, [r2, +r3]
00074 e5952020 ldr r2, [r5, #0x20]
00078 e5953000 ldr r3, [r5]
0007c e182b0b3 strh r11, [r2, +r3]
00080 e5953000 ldr r3, [r5]
00084 e19420b7 ldrh r2, [r4, +r7]
00088 e0833004 add r3, r3, r4
0008c e18320b8 strh r2, [r3, +r8]
00090 eb000000 bl |?STWaitComplete@@YAHPAU_ST_FLS_INFO_@@@Z|
00094 e3500000 cmp r0, #0
00098 0a000005 beq |$L34715|
0009c e2844002 add r4, r4, #2
000a0 e1540006 cmp r4, r6
000a4 3affffeb bcc |$L34337|
000a8 |$L34339|
; 314 : }
; 315 : }
; 316 :
; 317 : return TRUE;
000a8 e3a00001 mov r0, #1
; 318 : }
000ac e8bd4ff0 ldmia sp!, {r4 - r11, lr}
000b0 e12fff1e bx lr
000b4 |$L34715|
; 311 : {
; 312 : STIssueCmd(&s_STFlsInfo,ST_CMD_RESET);
000b4 e5952020 ldr r2, [r5, #0x20]
000b8 e5953000 ldr r3, [r5]
000bc e3a010f0 mov r1, #0xF0
; 313 : return FALSE;
000c0 e18210b3 strh r1, [r2, +r3]
000c4 |$L34334|
; 300 : {
; 301 : DEBUGMSG(1,(TEXT("Write pointer not aligned or the size is not correct!\r\n")));
; 302 : return FALSE;
000c4 e3a00000 mov r0, #0
; 318 : }
000c8 e8bd4ff0 ldmia sp!, {r4 - r11, lr}
000cc e12fff1e bx lr
000d0 |$L34728|
000d0 00000000 DCD |s_STFlsInfo|
000d4 |$M34724|
ENDP ; |?WriteFlashEx@@YAHKPAEK@Z|, WriteFlashEx
EXPORT |?Spansion_Nor_FMD_WriteSector@@YAHKPAEPAU_SectorInfo@@K@Z| ; Spansion_Nor_FMD_WriteSector
EXPORT |??_C@_1JC@BBAGBKBP@?$AAE?$AAR?$AAR?$AAO?$AAR?$AA?3?$AAT?$AAh?$AAe?$AA?5?$AAw?$AAr?$AAi?$AAt?$AAe?$AA?5?$AAs?$AAe?$AAc?$AAt@| [ DATA ] ; `string'
EXPORT |??_C@_1IC@OLJPHDMC@?$AAN?$AAo?$AAr?$AA_?$AAF?$AAM?$AAD?$AA_?$AAW?$AAr?$AAi?$AAt?$AAe?$AAS?$AAe?$AAc?$AAt?$AAo?$AAr?$AA?3@| [ DATA ] ; `string'
IMPORT |__security_cookie|
IMPORT |__security_check_cookie|
00000 AREA |.text| { |?Spansion_Nor_FMD_WriteSector@@YAHKPAEPAU_SectorInfo@@K@Z| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 AREA |.pdata$$?Spansion_Nor_FMD_WriteSector@@YAHKPAEPAU_SectorInfo@@K@Z|, PDATA, SELECTION=5, ASSOC=|.text| { |?Spansion_Nor_FMD_WriteSector@@YAHKPAEPAU_SectorInfo@@K@Z| } ; comdat associative
|$T34757| DCD |$L34756|
DCD 0x40006e02
00000 AREA |.rdata| { |??_C@_1IC@OLJPHDMC@?$AAN?$AAo?$AAr?$AA_?$AAF?$AAM?$AAD?$AA_?$AAW?$AAr?$AAi?$AAt?$AAe?$AAS?$AAe?$AAc?$AAt?$AAo?$AAr?$AA?3@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_1IC@OLJPHDMC@?$AAN?$AAo?$AAr?$AA_?$AAF?$AAM?$AAD?$AA_?$AAW?$AAr?$AAi?$AAt?$AAe?$AAS?$AAe?$AAc?$AAt?$AAo?$AAr?$AA?3@| DCB "N"
DCB 0x0, "o", 0x0, "r", 0x0, "_", 0x0, "F", 0x0, "M", 0x0, "D"
DCB 0x0, "_", 0x0, "W", 0x0, "r", 0x0, "i", 0x0, "t", 0x0, "e"
DCB 0x0, "S", 0x0, "e", 0x0, "c", 0x0, "t", 0x0, "o", 0x0, "r"
DCB 0x0, ":", 0x0, " ", 0x0, "U", 0x0, "n", 0x0, "a", 0x0, "l"
DCB 0x0, "i", 0x0, "g", 0x0, "n", 0x0, "e", 0x0, "d", 0x0, " "
DCB 0x0, "p", 0x0, "o", 0x0, "i", 0x0, "n", 0x0, "t", 0x0, "e"
DCB 0x0, "r", 0x0, " ", 0x0, "-", 0x0, " ", 0x0, "u", 0x0, "s"
DCB 0x0, "i", 0x0, "n", 0x0, "g", 0x0, " ", 0x0, "i", 0x0, "n"
DCB 0x0, "t", 0x0, "e", 0x0, "r", 0x0, "n", 0x0, "a", 0x0, "l"
DCB 0x0, " ", 0x0, "b", 0x0, "u", 0x0, "f", 0x0, "f", 0x0, "e"
DCB 0x0, "r", 0x0, 0xd, 0x0, 0xa, 0x0, 0x0, 0x0 ; `string'
00000 AREA |.rdata| { |??_C@_1JC@BBAGBKBP@?$AAE?$AAR?$AAR?$AAO?$AAR?$AA?3?$AAT?$AAh?$AAe?$AA?5?$AAw?$AAr?$AAi?$AAt?$AAe?$AA?5?$AAs?$AAe?$AAc?$AAt@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_1JC@BBAGBKBP@?$AAE?$AAR?$AAR?$AAO?$AAR?$AA?3?$AAT?$AAh?$AAe?$AA?5?$AAw?$AAr?$AAi?$AAt?$AAe?$AA?5?$AAs?$AAe?$AAc?$AAt@| DCB "E"
DCB 0x0, "R", 0x0, "R", 0x0, "O", 0x0, "R", 0x0, ":", 0x0, "T"
DCB 0x0, "h", 0x0, "e", 0x0, " ", 0x0, "w", 0x0, "r", 0x0, "i"
DCB 0x0, "t", 0x0, "e", 0x0, " ", 0x0, "s", 0x0, "e", 0x0, "c"
DCB 0x0, "t", 0x0, "o", 0x0, "r", 0x0, " ", 0x0, "n", 0x0, "u"
DCB 0x0, "m", 0x0, ":", 0x0, "0", 0x0, "x", 0x0, "%", 0x0, "X"
DCB 0x0, " ", 0x0, "i", 0x0, "s", 0x0, " ", 0x0, "l", 0x0, "a"
DCB 0x0, "r", 0x0, "g", 0x0, "e", 0x0, " ", 0x0, "t", 0x0, "h"
DCB 0x0, "a", 0x0, "n", 0x0, " ", 0x0, "t", 0x0, "h", 0x0, "e"
DCB 0x0, " ", 0x0, "m", 0x0, "a", 0x0, "x", 0x0, " ", 0x0, "s"
DCB 0x0, "e", 0x0, "c", 0x0, "t", 0x0, "o", 0x0, "r", 0x0, " "
DCB 0x0, "n", 0x0, "u", 0x0, "m", 0x0, ":", 0x0, "0", 0x0, "x"
DCB 0x0, "%", 0x0, "X", 0x0, "!", 0x0, 0xd, 0x0, 0xa, 0x0, 0x0
DCB 0x0 ; `string'
; Function compile flags: /Ogsy
00000 AREA |.text| { |?Spansion_Nor_FMD_WriteSector@@YAHKPAEPAU_SectorInfo@@K@Z| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 |?Spansion_Nor_FMD_WriteSector@@YAHKPAEPAU_SectorInfo@@K@Z| PROC ; Spansion_Nor_FMD_WriteSector
; 333 : {
00000 |$L34756|
00000 e92d4ff0 stmdb sp!, {r4 - r11, lr}
00004 e24ddf83 sub sp, sp, #0x83, 30
00008 |$M34754|
00008 e3530000 cmp r3, #0
0000c e1a05002 mov r5, r2
00010 e1a06001 mov r6, r1
00014 e1a04000 mov r4, r0
00018 e59f0194 ldr r0, [pc, #0x194]
0001c e5900000 ldr r0, [r0]
00020 e58d0208 str r0, [sp, #0x208]
; 334 : volatile SECTOR_ADDR physicalSectorAddr = 0;
00024 e3a02000 mov r2, #0
00028 e58d2000 str r2, [sp]
; 335 : BLOCK_ID blockID = 0;
; 336 : DWORD i = 0;
; 337 : DWORD j = 0;
; 338 : DWORD k = 0;
; 339 : volatile DWORD ulBlockAddress = 0;
0002c e58d2000 str r2, [sp]
; 340 : LPBYTE pBuffer = pSectorBuff;
; 341 : BOOL fRet = FALSE;
; 342 :
; 343 : BYTE bsTmpBuf[SECTOR_SIZE];
; 344 :
; 345 : // EdbgOutputDebugString("Spansion_Nor_FMD_WriteSector(%d).\r\n", startSectorAddr);
; 346 : //----- 1. Check the input parameters -----
; 347 : // NOTE: The FAL insures that the starting sector address is in the allowable range.
; 348 : if((dwNumSectors == 0) || ((pSectorBuff == NULL) && (pSectorInfoBuff == NULL)))
00030 0a00000d beq |$L34358|
00034 e3560000 cmp r6, #0
00038 1a000001 bne |$L34357|
0003c e3550000 cmp r5, #0
00040 0a000009 beq |$L34358|
00044 |$L34357|
; 349 : {
; 350 : return(FALSE);
; 351 : }
; 352 : if( (s_STFlsInfo.dwBlkNum*s_STFlsInfo.wSectorsPerBlock)<(startSectorAddr+dwNumSectors))
00044 e59f7164 ldr r7, [pc, #0x164]
00048 e0848003 add r8, r4, r3
0004c e597000c ldr r0, [r7, #0xC]
00050 e1d731b6 ldrh r3, [r7, #0x16]
00054 e0020093 mul r2, r3, r0
00058 e1520008 cmp r2, r8
0005c 2a000008 bcs |$L34359|
; 353 : {
; 354 : RETAILMSG(1, (TEXT("ERROR:The write sector num:0x%X is large than the max sector num:0x%X!\r\n"),startSectorAddr+dwNumSectors,s_STFlsInfo.dwBlkNum*s_STFlsInfo.wSectorsPerBlock));
00060 e59f0144 ldr r0, [pc, #0x144]
00064 e1a01008 mov r1, r8
00068 eb000000 bl NKDbgPrintfW
0006c |$L34358|
0006c e59d0208 ldr r0, [sp, #0x208]
00070 eb000000 bl __security_check_cookie
00074 e3a00000 mov r0, #0
00078 |$L34347|
; 415 : }
00078 e28ddf83 add sp, sp, #0x83, 30
0007c e8bd4ff0 ldmia sp!, {r4 - r11, lr}
00080 e12fff1e bx lr
00084 |$L34359|
; 355 : return FALSE;
; 356 : }
; 357 :
; 358 : //----- 2. Process the write request(s)... -----
; 359 : for(i = startSectorAddr; i < (startSectorAddr + dwNumSectors); i++)
00084 e1540008 cmp r4, r8
00088 2a000042 bcs |$L34363|
0008c e0843304 add r3, r4, r4, lsl #6
00090 e1a09183 mov r9, r3, lsl #3
00094 e3a0a001 mov r10, #1
00098 e3a0b001 mov r11, #1
0009c |$L34361|
0009c e597302c ldr r3, [r7, #0x2C]
; 360 : {
; 361 : //----- Determine the block this physical sector resides in -----
; 362 : blockID = i / s_STFlsInfo.wSectorsPerBlock;
; 363 :
; 364 : //----- Compute the physical address for the requested sector -----
; 365 : // Note we do this differently based on whether the caller wants us to write the sector information structure as well. Since we're
; 366 : // dealing with a NOR flash which is XIP-able, one might want to use this function to write an XIP region (i.e., no sector information
; 367 : // structures in flash).
; 368 : if (!s_bXIPMode)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -