📄 intel_j3_2x16.cod
字号:
; Listing generated by Microsoft (R) Optimizing Compiler Version 12.20.9615
TTL d:\wince420\platform\ep931x\eboot\.\intel_j3_2x16.c
CODE32
00000 AREA |.drectve|, DRECTVE
DCB "-defaultlib:coredll.lib "
DCB "-defaultlib:corelibc.lib "
00000 AREA |.bss|, NOINIT
|gdwStartAddr| % 0x4
|gdwLength| % 0x4
|gpulCurAddr| % 0x4
|gbFlashEraseComplete| % 0x4
00000 AREA |.rdata|, DATA, READONLY
|EdbgVendorIds| DCW 0x0
DCW 0x0
DCD 0x4033
DCB 0x1
DCB "AD", 0x0
DCW 0x1050
DCW 0x940
DCD 0x4005
DCB 0x1
DCB "LS", 0x0
DCW 0x1050
DCW 0x940
DCD 0x2078
DCB 0x1
DCB "LS", 0x0
DCW 0x10ec
DCW 0x8029
DCD 0xc0f0
DCB 0x1
DCB "KS", 0x0
DCW 0x10ec
DCW 0x8129
DCD 0x0
DCB 0x4
DCB "RT", 0x0
DCW 0x10ec
DCW 0x8139
DCD 0x900b
DCB 0x4
DCB "RT", 0x0
DCW 0x10ec
DCW 0x8139
DCD 0xd0c9
DCB 0x4
DCB "RT", 0x0
DCW 0x10ec
DCW 0x8139
DCD 0xe04c
DCB 0x4
DCB "RT", 0x0
DCW 0x1186
DCW 0x1300
DCD 0x50ba
DCB 0x4
DCB "DL", 0x0
DCW 0x100b
DCW 0x20
DCD 0xa0cc
DCB 0x5
DCB "NG", 0x0
DCW 0x10b7
DCW 0x9050
DCD 0x6008
DCB 0x6
DCB "3C", 0x0
DCW 0x10b7
DCW 0x9200
DCD 0x476
DCB 0x6
DCB "3C", 0x0
00000 AREA |.data|, DATA
|gbUnlocked| DCD 0x1
EXPORT |StartEraseFlashJ3_2x16|
EXPORT |??_C@_0DK@OPO@ERROR?3?5No?5Flash?5located?5in?5the?5l@| [ DATA ] ; `string'
EXPORT |??_C@_0DG@FLPF@ERROR?3?5Address?5?$CFx?5is?5not?5on?5a?5fl@| [ DATA ] ; `string'
IMPORT |EdbgOutputDebugString|
; File d:\wince420\platform\ep931x\eboot\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
|$T36741| DCD |StartEraseFlashJ3_2x16|
DCD 0x40003501
00000 AREA |.rdata| { |??_C@_0DG@FLPF@ERROR?3?5Address?5?$CFx?5is?5not?5on?5a?5fl@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_0DG@FLPF@ERROR?3?5Address?5?$CFx?5is?5not?5on?5a?5fl@| DCB "ERROR:"
DCB " Address %x is not on a flash block boundary.", 0xd, 0xa
DCB 0x0 ; `string'
00000 AREA |.rdata| { |??_C@_0DK@OPO@ERROR?3?5No?5Flash?5located?5in?5the?5l@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_0DK@OPO@ERROR?3?5No?5Flash?5located?5in?5the?5l@| DCB "ERROR: No F"
DCB "lash located in the locations from %x to %xr", 0xd, 0xa, 0x0 ; `string'
; Function compile flags: /Ogsy
00000 AREA |.text| { |StartEraseFlashJ3_2x16| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 |StartEraseFlashJ3_2x16| PROC
; 77 : {
00000 e52de004 str lr, [sp, #-4]!
00004 |$M36739|
00004 e1a03000 mov r3, r0
; 78 : //
; 79 : // Make sure that the flash addresses are valid.
; 80 : //
; 81 : if(dwStartAddr + dwLength > FLASH_VIRTUAL_MEMORY + FLASH_SIZE ||
; 82 : dwStartAddr < FLASH_VIRTUAL_MEMORY)
00008 e0830001 add r0, r3, r1
0000c e3500462 cmp r0, #0x62, 8
00010 8a000021 bhi |$L36606|
00014 e3530206 cmp r3, #6, 4
00018 3a00001f bcc |$L36606|
; 91 : }
; 92 :
; 93 : //
; 94 : // Check to make sure that the flash is on a Block boundary.
; 95 : //
; 96 : if(dwStartAddr & (FLASH_BLOCK_SIZE - 1))
0001c e59f00ac ldr r0, [pc, #0xAC]
00020 e1130000 tst r3, r0
00024 0a000003 beq |$L36608|
; 97 : {
; 98 :
; 99 : EdbgOutputDebugString
; 100 : (
; 101 : "ERROR: Address %x is not on a flash block boundary.\r\n",
; 102 : dwStartAddr
; 103 : );
00028 e59f009c ldr r0, [pc, #0x9C]
0002c e1a01003 mov r1, r3
00030 eb000000 bl EdbgOutputDebugString
; 104 : return FALSE;
00034 ea00001c b |$L36738|
00038 |$L36608|
; 105 : }
; 106 :
; 107 : //
; 108 : // Save off the start address and the length.
; 109 : //
; 110 : gdwStartAddr = dwStartAddr;
; 111 : gdwLength = dwLength;
00038 e59f2088 ldr r2, [pc, #0x88]
0003c e59f0080 ldr r0, [pc, #0x80]
00040 e5021004 str r1, [r2, #-4]
; 112 : gpulCurAddr = (PULONG) dwStartAddr;
; 113 :
; 114 :
; 115 : //
; 116 : // Put the flash in read mode to make sure that we are not in the middle
; 117 : // of a command.
; 118 : //
; 119 : *gpulCurAddr = FLASH_READ_MODE;
00044 e3a018ff mov r1, #0xFF, 16
00048 e5803000 str r3, [r0]
0004c e38110ff orr r1, r1, #0xFF
00050 e5823000 str r3, [r2]
; 120 :
; 121 : // DelayInuSec(500);
; 122 :
; 123 :
; 124 : //
; 125 : // Clear the lock bit.
; 126 : //
; 127 : *gpulCurAddr = FLASH_LOCK_BIT;
; 128 : *gpulCurAddr = FLASH_LOCK_CLEAR;
; 129 : *gpulCurAddr = FLASH_READ_STATUS;
; 130 : gbUnlocked = TRUE;
00054 e3a03001 mov r3, #1
00058 e5920000 ldr r0, [r2]
0005c e5801000 str r1, [r0]
00060 e3a00606 mov r0, #6, 12
00064 e5921000 ldr r1, [r2]
00068 e3800060 orr r0, r0, #0x60
0006c e5810000 str r0, [r1]
00070 e3a0160d mov r1, #0xD, 12
00074 e5920000 ldr r0, [r2]
00078 e38110d0 orr r1, r1, #0xD0
0007c e5801000 str r1, [r0]
00080 e3a00607 mov r0, #7, 12
00084 e5921000 ldr r1, [r2]
00088 e3800070 orr r0, r0, #0x70
0008c e5810000 str r0, [r1]
00090 e59f0028 ldr r0, [pc, #0x28]
00094 e5803000 str r3, [r0]
; 131 :
; 132 :
; 133 : return TRUE;
00098 ea000004 b |$L36604|
0009c |$L36606|
; 83 : {
; 84 : EdbgOutputDebugString
; 85 : (
; 86 : "ERROR: No Flash located in the locations from %x to %xr\r\n",
; 87 : dwStartAddr,
; 88 : dwLength
; 89 : );
0009c e1a02001 mov r2, r1
000a0 e59f0014 ldr r0, [pc, #0x14]
000a4 e1a01003 mov r1, r3
000a8 eb000000 bl EdbgOutputDebugString
000ac |$L36738|
; 90 : return FALSE;
000ac e3a03000 mov r3, #0
000b0 |$L36604|
; 104 : return FALSE;
000b0 e1a00003 mov r0, r3
; 134 : }
000b4 e8bd4000 ldmia sp!, {lr}
000b8 e12fff1e bx lr
000bc |$L36743|
000bc 00000000 DCD |??_C@_0DK@OPO@ERROR?3?5No?5Flash?5located?5in?5the?5l@|
000c0 00000000 DCD |gbUnlocked|
000c4 00000000 DCD |gdwStartAddr|
000c8 00000000 DCD |gpulCurAddr|
000cc 00000000 DCD |??_C@_0DG@FLPF@ERROR?3?5Address?5?$CFx?5is?5not?5on?5a?5fl@|
000d0 0003ffff DCD 0x3ffff
000d4 |$M36740|
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
|$T36749| DCD |ContinueEraseFlashJ3_2x16|
DCD 0x40003801
; Function compile flags: /Ogsy
00000 AREA |.text| { |ContinueEraseFlashJ3_2x16| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 |ContinueEraseFlashJ3_2x16| PROC
; 144 : {
00000 e92d4030 stmdb sp!, {r4, r5, lr}
00004 |$M36747|
; 145 : //
; 146 : // Check to see if the flash has been completely erased. If so just
; 147 : // return.
; 148 : //
; 149 : if(gbFlashEraseComplete)
00004 e59f30d0 ldr r3, [pc, #0xD0]
00008 e593000c ldr r0, [r3, #0xC]
0000c e3500000 cmp r0, #0
00010 1a00002d bne |$L36616|
; 150 : {
; 151 : return;
; 152 : }
; 153 :
; 154 : //
; 155 : // Check to see if the last block has been erased.
; 156 : //
; 157 : if((*gpulCurAddr & EXT_STATUS_WBUFFER_READY) != EXT_STATUS_WBUFFER_READY)
00014 e59f50bc ldr r5, [pc, #0xBC]
00018 e3a02502 mov r2, #2, 10
0001c e3822080 orr r2, r2, #0x80
00020 e5950000 ldr r0, [r5]
00024 e5901000 ldr r1, [r0]
00028 e0010002 and r0, r1, r2
0002c e1500002 cmp r0, r2
00030 1a000025 bne |$L36616|
; 158 : {
; 159 : return;
; 160 : }
; 161 :
; 162 : //
; 163 : // Clear Status.
; 164 : //
; 165 : *gpulCurAddr = FLASH_CLEAR_STATUS;
00034 e3a01605 mov r1, #5, 12
00038 e5950000 ldr r0, [r5]
0003c e3811050 orr r1, r1, #0x50
; 166 :
; 167 :
; 168 : if(gbUnlocked)
00040 e59f408c ldr r4, [pc, #0x8C]
00044 e5801000 str r1, [r0]
00048 e5940000 ldr r0, [r4]
0004c e3500000 cmp r0, #0
; 169 : {
; 170 : //
; 171 : // Erase the flash block
; 172 : //
; 173 : *gpulCurAddr = FLASH_BLOCK_ERASE;
00050 13a01602 movne r1, #2, 12
00054 13811020 orrne r1, r1, #0x20
; 174 : *gpulCurAddr = FLASH_BLOCK_ERASE_RESUME;
; 175 :
; 176 : //
; 177 : // Read erase status.
; 178 : //
; 179 : *gpulCurAddr = FLASH_READ_STATUS;
; 180 : gbUnlocked = FALSE;
00058 13a02000 movne r2, #0
0005c 1a00000f bne |$L36746|
; 181 : }
; 182 : else
; 183 : {
; 184 : //
; 185 : // Check to see if we have finished erasing the flash memory.
; 186 : //
; 187 : if(gdwStartAddr + gdwLength < ((DWORD)gpulCurAddr) + FLASH_BLOCK_SIZE)
00060 e5931000 ldr r1, [r3]
00064 e5930004 ldr r0, [r3, #4]
00068 e0802001 add r2, r0, r1
0006c e5951000 ldr r1, [r5]
00070 e2810701 add r0, r1, #1, 14
00074 e1520000 cmp r2, r0
; 188 : {
; 189 : gbFlashEraseComplete = TRUE;
00078 33a00001 movcc r0, #1
0007c 3583000c strcc r0, [r3, #0xC]
; 206 : }
; 207 : }
00080 38bd4030 ldmccia sp!, {r4, r5, lr}
00084 312fff1e bxcc lr
; 190 : return;
; 191 : }
; 192 :
; 193 : //
; 194 : // Advance to the next block.
; 195 : //
; 196 : gpulCurAddr+= FLASH_BLOCK_SIZE>>2;
00088 e5950000 ldr r0, [r5]
0008c e2801701 add r1, r0, #1, 14
00090 e5851000 str r1, [r5]
; 197 :
; 198 : //
; 199 : // Clear the lock bits if the flash block was locked.
; 200 : //
; 201 : *gpulCurAddr = FLASH_LOCK_BIT;
00094 e3a01606 mov r1, #6, 12
00098 e3811060 orr r1, r1, #0x60
; 204 :
; 205 : gbUnlocked = TRUE;
0009c e3a02001 mov r2, #1
000a0 |$L36746|
; 197 :
; 198 : //
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -