📄 flash.cod
字号:
; Listing generated by Microsoft (R) Optimizing Compiler Version 13.10.4237
TTL C:\WINCE500\PLATFORM\Ep93xx\Src\Bootloader\Common\.\flash.c
CODE32
00000 AREA |.drectve|, DRECTVE
DCB "-defaultlib:coredll.lib "
DCB "-defaultlib:corelibc.lib "
EXPORT |gdwFlashSize| [ DATA ]
00000 AREA |.bss|, NOINIT
|pfnStartErase| % 0x4
|pfnContinueErase| % 0x4
|pfnFinishErase| % 0x4
|pfnWriteFlash| % 0x4
|gdwStartAddr| % 0x4
|gdwLength| % 0x4
|gpulCurAddr| % 0x4
|gbFlashEraseComplete| % 0x4
00000 AREA |.data|, DATA
|gbUnlocked| DCD 0x1
|gdwFlashSize| DCD 0x2000000
00000 AREA |.rdata|, DATA, READONLY
|EdbgVendorIds| DCW 0x0
DCW 0x0
DCD 0x4033
DCB 0x1
DCB 0x0
DCB "AD", 0x0
% 3
DCW 0x1050
DCW 0x940
DCD 0x4005
DCB 0x1
DCB 0x0
DCB "LS", 0x0
% 3
DCW 0x1050
DCW 0x940
DCD 0x2078
DCB 0x1
DCB 0x0
DCB "LS", 0x0
% 3
DCW 0x10ec
DCW 0x8029
DCD 0xc0f0
DCB 0x1
DCB 0x0
DCB "KS", 0x0
% 3
DCW 0x10ec
DCW 0x8129
DCD 0x0
DCB 0x4
DCB 0x0
DCB "RT", 0x0
% 3
DCW 0x10ec
DCW 0x8139
DCD 0x900b
DCB 0x4
DCB 0x0
DCB "RT", 0x0
% 3
DCW 0x10ec
DCW 0x8139
DCD 0xd0c9
DCB 0x4
DCB 0x0
DCB "RT", 0x0
% 3
DCW 0x10ec
DCW 0x8139
DCD 0xe04c
DCB 0x4
DCB 0x0
DCB "RT", 0x0
% 3
DCW 0x1186
DCW 0x1300
DCD 0x50ba
DCB 0x4
DCB 0x0
DCB "DL", 0x0
% 3
DCW 0x100b
DCW 0x20
DCD 0xa0cc
DCB 0x5
DCB 0x0
DCB "NG", 0x0
% 3
DCW 0x10b7
DCW 0x9050
DCD 0x6008
DCB 0x6
DCB 0x0
DCB "3C", 0x0
% 3
DCW 0x10b7
DCW 0x9200
DCD 0x476
DCB 0x6
DCB 0x0
DCB "3C", 0x0
% 3
DCW 0x8086
DCW 0x1039
DCD 0x4033
DCB 0x7
DCB 0x1
DCB "IN", 0x0
% 3
DCW 0x8086
DCW 0x103a
DCD 0x4033
DCB 0x7
DCB 0x1
DCB "IN", 0x0
% 3
DCW 0x8086
DCW 0x1051
DCD 0x4033
DCB 0x7
DCB 0x1
DCB "IN", 0x0
% 3
DCW 0x8086
DCW 0x1229
DCD 0x4033
DCB 0x7
DCB 0x1
DCB "IN", 0x0
% 3
DCW 0x8086
DCW 0x2449
DCD 0x4033
DCB 0x7
DCB 0x1
DCB "IN", 0x0
% 3
EXPORT |StartEraseFlashJ3_2x16|
EXPORT |??_C@_0DG@BFHELHDG@ERROR?3?5Address?5?$CFx?5is?5not?5on?5a?5fl@| [ DATA ] ; `string'
IMPORT |EdbgOutputDebugString|
; File c:\wince500\platform\ep93xx\src\bootloader\common\flash\intel_j3_2x16.c
00000 AREA |.text| { |StartEraseFlashJ3_2x16| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 AREA |.pdata$$StartEraseFlashJ3_2x16|, PDATA, SELECTION=5, ASSOC=|.text| { |StartEraseFlashJ3_2x16| } ; comdat associative
|$T38381| DCD |$L38380|
DCD 0x40003a04
00000 AREA |.rdata| { |??_C@_0DG@BFHELHDG@ERROR?3?5Address?5?$CFx?5is?5not?5on?5a?5fl@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_0DG@BFHELHDG@ERROR?3?5Address?5?$CFx?5is?5not?5on?5a?5fl@| DCB "ER"
DCB "ROR: Address %x is not on a flash block boundary.", 0xd, 0xa
DCB 0x0 ; `string'
; Function compile flags: /Ods
00000 AREA |.text| { |StartEraseFlashJ3_2x16| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 |StartEraseFlashJ3_2x16| PROC
; 75 : {
00000 |$L38380|
00000 e1a0c00d mov r12, sp
00004 e92d0003 stmdb sp!, {r0, r1}
00008 e92d5000 stmdb sp!, {r12, lr}
0000c e24dd004 sub sp, sp, #4
00010 |$M38378|
; 76 : //
; 77 : // Check to make sure that the flash is on a Block boundary.
; 78 : //
; 79 : if(dwStartAddr & (FLASH_BLOCK_SIZE - 1))
00010 e59d200c ldr r2, [sp, #0xC]
00014 e3a03701 mov r3, #1, 14
00018 e2433001 sub r3, r3, #1
0001c e1120003 tst r2, r3
00020 0a000005 beq |$L38106|
; 80 : {
; 81 :
; 82 : EdbgOutputDebugString
; 83 : (
; 84 : "ERROR: Address %x is not on a flash block boundary.\r\n",
; 85 : dwStartAddr
; 86 : );
00024 e59d100c ldr r1, [sp, #0xC]
00028 e59f00b4 ldr r0, [pc, #0xB4]
0002c eb000000 bl EdbgOutputDebugString
; 87 : return FALSE;
00030 e3a03000 mov r3, #0
00034 e58d3000 str r3, [sp]
00038 ea000021 b |$L38105|
0003c |$L38106|
; 88 : }
; 89 :
; 90 : //
; 91 : // Save off the start address and the length.
; 92 : //
; 93 : gdwStartAddr = dwStartAddr;
0003c e59d200c ldr r2, [sp, #0xC]
00040 e59f3098 ldr r3, [pc, #0x98]
00044 e5832000 str r2, [r3]
; 94 : gdwLength = dwLength;
00048 e59d2010 ldr r2, [sp, #0x10]
0004c e59f3088 ldr r3, [pc, #0x88]
00050 e5832000 str r2, [r3]
; 95 : gpulCurAddr = (PULONG) dwStartAddr;
00054 e59d200c ldr r2, [sp, #0xC]
00058 e59f3078 ldr r3, [pc, #0x78]
0005c e5832000 str r2, [r3]
; 96 :
; 97 :
; 98 : //
; 99 : // Put the flash in read mode to make sure that we are not in the middle
; 100 : // of a command.
; 101 : //
; 102 : *gpulCurAddr = FLASH_READ_MODE;
00060 e59f3070 ldr r3, [pc, #0x70]
00064 e5932000 ldr r2, [r3]
00068 e3a038ff mov r3, #0xFF, 16
0006c e38330ff orr r3, r3, #0xFF
00070 e5823000 str r3, [r2]
; 103 :
; 104 : // DelayInuSec(500);
; 105 :
; 106 :
; 107 : //
; 108 : // Clear the lock bit.
; 109 : //
; 110 : *gpulCurAddr = FLASH_LOCK_BIT;
00074 e59f305c ldr r3, [pc, #0x5C]
00078 e5932000 ldr r2, [r3]
0007c e3a03606 mov r3, #6, 12
00080 e3833060 orr r3, r3, #0x60
00084 e5823000 str r3, [r2]
; 111 : *gpulCurAddr = FLASH_LOCK_CLEAR;
00088 e59f3048 ldr r3, [pc, #0x48]
0008c e5932000 ldr r2, [r3]
00090 e3a0360d mov r3, #0xD, 12
00094 e38330d0 orr r3, r3, #0xD0
00098 e5823000 str r3, [r2]
; 112 : *gpulCurAddr = FLASH_READ_STATUS;
0009c e59f3034 ldr r3, [pc, #0x34]
000a0 e5932000 ldr r2, [r3]
000a4 e3a03607 mov r3, #7, 12
000a8 e3833070 orr r3, r3, #0x70
000ac e5823000 str r3, [r2]
; 113 : gbUnlocked = TRUE;
000b0 e59f201c ldr r2, [pc, #0x1C]
000b4 e3a03001 mov r3, #1
000b8 e5823000 str r3, [r2]
; 114 :
; 115 :
; 116 : return TRUE;
000bc e3a03001 mov r3, #1
000c0 e58d3000 str r3, [sp]
000c4 |$L38105|
; 87 : return FALSE;
000c4 e59d0000 ldr r0, [sp]
; 117 : }
000c8 e28dd004 add sp, sp, #4
000cc e89d6000 ldmia sp, {sp, lr}
000d0 e12fff1e bx lr
000d4 |$L38383|
000d4 00000000 DCD |gbUnlocked|
000d8 00000000 DCD |gpulCurAddr|
000dc 00000000 DCD |gdwLength|
000e0 00000000 DCD |gdwStartAddr|
000e4 00000000 DCD |??_C@_0DG@BFHELHDG@ERROR?3?5Address?5?$CFx?5is?5not?5on?5a?5fl@|
000e8 |$M38379|
ENDP ; |StartEraseFlashJ3_2x16|
EXPORT |ContinueEraseFlashJ3_2x16|
00000 AREA |.text| { |ContinueEraseFlashJ3_2x16| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 AREA |.pdata$$ContinueEraseFlashJ3_2x16|, PDATA, SELECTION=5, ASSOC=|.text| { |ContinueEraseFlashJ3_2x16| } ; comdat associative
|$T38389| DCD |$L38388|
DCD 0x40005700
; Function compile flags: /Ods
00000 AREA |.text| { |ContinueEraseFlashJ3_2x16| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 |ContinueEraseFlashJ3_2x16| PROC
; 127 : {
00000 |$L38388|
00000 |$M38386|
; 128 : //
; 129 : // Check to see if the flash has been completely erased. If so just
; 130 : // return.
; 131 : //
; 132 : if(gbFlashEraseComplete)
00000 e59f3148 ldr r3, [pc, #0x148]
00004 e5933000 ldr r3, [r3]
00008 e3530000 cmp r3, #0
0000c 0a000000 beq |$L38111|
; 133 : {
; 134 : return;
00010 ea00004b b |$L38110|
00014 |$L38111|
; 135 : }
; 136 :
; 137 : //
; 138 : // Check to see if the last block has been erased.
; 139 : //
; 140 : if((*gpulCurAddr & EXT_STATUS_WBUFFER_READY) != EXT_STATUS_WBUFFER_READY)
00014 e59f3130 ldr r3, [pc, #0x130]
00018 e5933000 ldr r3, [r3]
0001c e5932000 ldr r2, [r3]
00020 e3a03502 mov r3, #2, 10
00024 e3833080 orr r3, r3, #0x80
00028 e0022003 and r2, r2, r3
0002c e3a03502 mov r3, #2, 10
00030 e3833080 orr r3, r3, #0x80
00034 e1520003 cmp r2, r3
00038 0a000000 beq |$L38112|
; 141 : {
; 142 : return;
0003c ea000040 b |$L38110|
00040 |$L38112|
; 143 : }
; 144 :
; 145 : //
; 146 : // Clear Status.
; 147 : //
; 148 : *gpulCurAddr = FLASH_CLEAR_STATUS;
00040 e59f3104 ldr r3, [pc, #0x104]
00044 e5932000 ldr r2, [r3]
00048 e3a03605 mov r3, #5, 12
0004c e3833050 orr r3, r3, #0x50
00050 e5823000 str r3, [r2]
; 149 :
; 150 :
; 151 : if(gbUnlocked)
00054 e59f30ec ldr r3, [pc, #0xEC]
00058 e5933000 ldr r3, [r3]
0005c e3530000 cmp r3, #0
00060 0a000012 beq |$L38113|
; 152 : {
; 153 : //
; 154 : // Erase the flash block
; 155 : //
; 156 : *gpulCurAddr = FLASH_BLOCK_ERASE;
00064 e59f30e0 ldr r3, [pc, #0xE0]
00068 e5932000 ldr r2, [r3]
0006c e3a03602 mov r3, #2, 12
00070 e3833020 orr r3, r3, #0x20
00074 e5823000 str r3, [r2]
; 157 : *gpulCurAddr = FLASH_BLOCK_ERASE_RESUME;
00078 e59f30cc ldr r3, [pc, #0xCC]
0007c e5932000 ldr r2, [r3]
00080 e3a0360d mov r3, #0xD, 12
00084 e38330d0 orr r3, r3, #0xD0
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -