📄 bootdevice.cod
字号:
00028 e59f0008 ldr r0, [pc, #8]
0002c eb000000 bl EdbgOutputDebugString
; 133 : }
00030 e8bd4030 ldmia sp!, {r4, r5, lr}
00034 e12fff1e bx lr
00038 |$L41159|
00038 00000000 DCD |??_C@_02PCIJFNDE@?$AN?6?$AA@|
0003c 00000000 DCD |??_C@_03IGDBGCKF@?$CFx?5?$AA@|
00040 802e2000 DCD 0x802e2000
00044 |$M41155|
ENDP ; |dump|
EXPORT |BootDevice_Erase|
EXPORT |??_C@_0DA@HLNJAAJD@FlashErase?3?5block?5number?5outside@| [ DATA ] ; `string'
EXPORT |??_C@_0EC@JJDNBIFN@FlashErase?3?5Unlocking?5flash?5bloc@| [ DATA ] ; `string'
EXPORT |??_C@_0DA@ENMBDGDG@?$AN?6WARNING?3?5Unable?5to?5unlock?5all?5@| [ DATA ] ; `string'
EXPORT |??_C@_07JLACOFEO@Done?4?$AN?6?$AA@| [ DATA ] ; `string'
EXPORT |??_C@_0DE@CGMOADDG@Erasing?5flash?5block?$CIs?$CJ?5?$FL0x?$CFx?0?50x@| [ DATA ] ; `string'
EXPORT |??_C@_0CO@LIGOLFOG@?$AN?6FlashErase?3?5unable?5to?5erase?5bl@| [ DATA ] ; `string'
EXPORT |??_C@_01LFCBOECM@?4?$AA@| [ DATA ] ; `string'
IMPORT |Nor_FMD_GetInfo|
IMPORT |Nor_FMD_EraseBlock|
IMPORT |Nor_FMD_OEMIoControl|
00000 AREA |.text| { |BootDevice_Erase| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 AREA |.pdata$$BootDevice_Erase|, PDATA, SELECTION=5, ASSOC=|.text| { |BootDevice_Erase| } ; comdat associative
|$T41177| DCD |$L41176|
DCD 0x40004402
00000 AREA |.rdata| { |??_C@_0DA@HLNJAAJD@FlashErase?3?5block?5number?5outside@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_0DA@HLNJAAJD@FlashErase?3?5block?5number?5outside@| DCB "FlashEras"
DCB "e: block number outside valid range.", 0xd, 0xa, 0x0 ; `string'
00000 AREA |.rdata| { |??_C@_0CO@LIGOLFOG@?$AN?6FlashErase?3?5unable?5to?5erase?5bl@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_0CO@LIGOLFOG@?$AN?6FlashErase?3?5unable?5to?5erase?5bl@| DCB 0xd, 0xa
DCB "FlashErase: unable to erase block (0x%x).", 0xd, 0xa, 0x0 ; `string'
00000 AREA |.rdata| { |??_C@_01LFCBOECM@?4?$AA@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_01LFCBOECM@?4?$AA@| DCB ".", 0x0 ; `string'
00000 AREA |.rdata| { |??_C@_0DE@CGMOADDG@Erasing?5flash?5block?$CIs?$CJ?5?$FL0x?$CFx?0?50x@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_0DE@CGMOADDG@Erasing?5flash?5block?$CIs?$CJ?5?$FL0x?$CFx?0?50x@| DCB "E"
DCB "rasing flash block(s) [0x%x, 0x%x] (please wait): ", 0x0 ; `string'
00000 AREA |.rdata| { |??_C@_07JLACOFEO@Done?4?$AN?6?$AA@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_07JLACOFEO@Done?4?$AN?6?$AA@| DCB "Done.", 0xd, 0xa, 0x0 ; `string'
00000 AREA |.rdata| { |??_C@_0DA@ENMBDGDG@?$AN?6WARNING?3?5Unable?5to?5unlock?5all?5@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_0DA@ENMBDGDG@?$AN?6WARNING?3?5Unable?5to?5unlock?5all?5@| DCB 0xd, 0xa
DCB "WARNING: Unable to unlock all flash blocks!", 0xd, 0xa, 0x0 ; `string'
00000 AREA |.rdata| { |??_C@_0EC@JJDNBIFN@FlashErase?3?5Unlocking?5flash?5bloc@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_0EC@JJDNBIFN@FlashErase?3?5Unlocking?5flash?5bloc@| DCB "FlashEras"
DCB "e: Unlocking flash block(s) [0x%x, 0x%x] (please wait): "
DCB 0x0 ; `string'
; Function compile flags: /Ogsy
00000 AREA |.text| { |BootDevice_Erase| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 |BootDevice_Erase| PROC
; 169 : {
00000 |$L41176|
00000 e92d4070 stmdb sp!, {r4 - r6, lr}
00004 e24dd020 sub sp, sp, #0x20
00008 |$M41174|
00008 e1a05001 mov r5, r1
0000c e1a04000 mov r4, r0
; 170 : BlockLockInfo BlockLockInfo;
; 171 : FlashInfo NorFlsInfo;
; 172 : Nor_FMD_GetInfo(&NorFlsInfo);
00010 e28d0010 add r0, sp, #0x10
00014 eb000000 bl Nor_FMD_GetInfo
; 173 :
; 174 : if (dwStartBlock >= NorFlsInfo.dwNumBlocks || (dwStartBlock + dwNumBlocks - 1) >= NorFlsInfo.dwNumBlocks)
00018 e59d2014 ldr r2, [sp, #0x14]
0001c e1540002 cmp r4, r2
00020 2a00002d bcs |$L40808|
00024 e0843005 add r3, r4, r5
00028 e2436001 sub r6, r3, #1
0002c e1560002 cmp r6, r2
00030 2a000029 bcs |$L40808|
; 178 : }
; 179 :
; 180 : // Unlock all the blocks to be erased.
; 181 : //
; 182 : EdbgOutputDebugString("FlashErase: Unlocking flash block(s) [0x%x, 0x%x] (please wait): ", dwStartBlock, (dwStartBlock + dwNumBlocks - 1));
00034 e59f00d0 ldr r0, [pc, #0xD0]
00038 e1a02006 mov r2, r6
0003c e1a01004 mov r1, r4
00040 eb000000 bl EdbgOutputDebugString
; 183 : BlockLockInfo.StartBlock = dwStartBlock;
; 184 : BlockLockInfo.NumBlocks = dwNumBlocks;
; 185 : if (!Nor_FMD_OEMIoControl(IOCTL_FMD_UNLOCK_BLOCKS, (PBYTE)&BlockLockInfo, sizeof(BlockLockInfo), NULL, 0, NULL))
00044 e3a00a72 mov r0, #0x72, 20
00048 e3a0e000 mov lr, #0
0004c e2400078 sub r0, r0, #0x78
00050 e3a03000 mov r3, #0
00054 e3a02008 mov r2, #8
00058 e28d1008 add r1, sp, #8
0005c e58de004 str lr, [sp, #4]
00060 e58de000 str lr, [sp]
00064 e58d4008 str r4, [sp, #8]
00068 e58d500c str r5, [sp, #0xC]
0006c eb000000 bl Nor_FMD_OEMIoControl
00070 e3500000 cmp r0, #0
; 186 : {
; 187 : EdbgOutputDebugString("\r\nWARNING: Unable to unlock all flash blocks!\r\n");
00074 059f008c ldreq r0, [pc, #0x8C]
; 188 : }
; 189 : else
; 190 : {
; 191 : EdbgOutputDebugString("Done.\r\n");
00078 159f007c ldrne r0, [pc, #0x7C]
0007c eb000000 bl EdbgOutputDebugString
; 192 : }
; 193 :
; 194 : EdbgOutputDebugString("Erasing flash block(s) [0x%x, 0x%x] (please wait): ", dwStartBlock, (dwStartBlock + dwNumBlocks - 1));
00080 e59f007c ldr r0, [pc, #0x7C]
00084 e1a02006 mov r2, r6
00088 e1a01004 mov r1, r4
0008c eb000000 bl EdbgOutputDebugString
00090 ea000007 b |$L41172|
00094 |$L40820|
; 195 : while (dwNumBlocks--)
; 196 : {
; 197 : if (!Nor_FMD_EraseBlock(dwStartBlock))
00094 e1a00004 mov r0, r4
00098 e2455001 sub r5, r5, #1
0009c eb000000 bl Nor_FMD_EraseBlock
000a0 e3500000 cmp r0, #0
000a4 0a000008 beq |$L41163|
; 201 : }
; 202 : ++dwStartBlock;
; 203 : EdbgOutputDebugString(".");
000a8 e59f0050 ldr r0, [pc, #0x50]
000ac e2844001 add r4, r4, #1
000b0 eb000000 bl EdbgOutputDebugString
000b4 |$L41172|
000b4 e3550000 cmp r5, #0
000b8 1afffff5 bne |$L40820|
; 204 : }
; 205 : EdbgOutputDebugString("Done.\r\n");
000bc e59f0038 ldr r0, [pc, #0x38]
000c0 eb000000 bl EdbgOutputDebugString
; 206 :
; 207 : return TRUE;
000c4 e3a00001 mov r0, #1
000c8 ea000006 b |$L40804|
000cc |$L41163|
; 198 : {
; 199 : EdbgOutputDebugString("\r\nFlashErase: unable to erase block (0x%x).\r\n", dwStartBlock);
000cc e59f0024 ldr r0, [pc, #0x24]
000d0 e1a01004 mov r1, r4
000d4 eb000000 bl EdbgOutputDebugString
; 200 : return FALSE;
000d8 ea000001 b |$L41173|
000dc |$L40808|
; 175 : {
; 176 : EdbgOutputDebugString("FlashErase: block number outside valid range.\r\n");
000dc e59f0010 ldr r0, [pc, #0x10]
000e0 eb000000 bl EdbgOutputDebugString
000e4 |$L41173|
; 177 : return FALSE;
000e4 e3a00000 mov r0, #0
000e8 |$L40804|
; 208 : }
000e8 e28dd020 add sp, sp, #0x20
000ec e8bd4070 ldmia sp!, {r4 - r6, lr}
000f0 e12fff1e bx lr
000f4 |$L41179|
000f4 00000000 DCD |??_C@_0DA@HLNJAAJD@FlashErase?3?5block?5number?5outside@|
000f8 00000000 DCD |??_C@_0CO@LIGOLFOG@?$AN?6FlashErase?3?5unable?5to?5erase?5bl@|
000fc 00000000 DCD |??_C@_07JLACOFEO@Done?4?$AN?6?$AA@|
00100 00000000 DCD |??_C@_01LFCBOECM@?4?$AA@|
00104 00000000 DCD |??_C@_0DE@CGMOADDG@Erasing?5flash?5block?$CIs?$CJ?5?$FL0x?$CFx?0?50x@|
00108 00000000 DCD |??_C@_0DA@ENMBDGDG@?$AN?6WARNING?3?5Unable?5to?5unlock?5all?5@|
0010c 00000000 DCD |??_C@_0EC@JJDNBIFN@FlashErase?3?5Unlocking?5flash?5bloc@|
00110 |$M41175|
ENDP ; |BootDevice_Erase|
EXPORT |BootDevice_Init|
EXPORT |??_C@_0CK@CBBGLELK@ERROR?3?5Flash?5FMD?5initialization?5@| [ DATA ] ; `string'
IMPORT |__security_cookie|
IMPORT |__security_check_cookie|
IMPORT |memset|
IMPORT |Nor_FMD_Init|
00000 AREA |.text| { |BootDevice_Init| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 AREA |.pdata$$BootDevice_Init|, PDATA, SELECTION=5, ASSOC=|.text| { |BootDevice_Init| } ; comdat associative
|$T41193| DCD |$L41192|
DCD 0x40002502
00000 AREA |.rdata| { |??_C@_0CK@CBBGLELK@ERROR?3?5Flash?5FMD?5initialization?5@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_0CK@CBBGLELK@ERROR?3?5Flash?5FMD?5initialization?5@| DCB "ERROR: F"
DCB "lash FMD initialization failed.", 0xd, 0xa, 0x0 ; `string'
; Function compile flags: /Ogsy
00000 AREA |.text| { |BootDevice_Init| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 |BootDevice_Init| PROC
; 212 : {
00000 |$L41192|
00000 e92d4030 stmdb sp!, {r4, r5, lr}
00004 e24ddfe1 sub sp, sp, #0xE1, 30
00008 |$M41190|
00008 e1a05001 mov r5, r1
0000c e1a04000 mov r4, r0
00010 e59f3078 ldr r3, [pc, #0x78]
00014 e5933000 ldr r3, [r3]
00018 e58d3380 str r3, [sp, #0x380]
; 213 : // Read the device ID and determine the flash part type.
; 214 : //
; 215 : PCI_REG_INFO BootflsInfo;
; 216 : // UINT8 *pDataBuffer = (UINT8 *) OEMMapMemAddr(StartAddr, StartAddr);
; 217 :
; 218 : memset(&BootflsInfo, 0, sizeof(PCI_REG_INFO));
0001c e3a02d0e mov r2, #0xE, 26
00020 e3a01000 mov r1, #0
00024 e28d0000 add r0, sp, #0
00028 eb000000 bl memset
; 219 : BootflsInfo.MemBase.Num = 1;
; 220 : BootflsInfo.MemLen.Num = 1;
0002c e3a02001 mov r2, #1
00030 e58d2328 str r2, [sp, #0x328]
00034 e3a03001 mov r3, #1
; 221 : BootflsInfo.MemBase.Reg[0] = StartAddr; // Flash base address.
; 222 : BootflsInfo.MemLen.Reg[0] = Size; // Total flash length.
; 223 :
; 224 : // memset(pDataBuffer, 0, 0x40000);
; 225 :
; 226 : if(!Nor_FMD_Init(NULL, &BootflsInfo, NULL))
00038 e3a02000 mov r2, #0
0003c e28d1000 add r1, sp, #0
00040 e3a00000 mov r0, #0
00044 e58d330c str r3, [sp, #0x30C]
00048 e58d4310 str r4, [sp, #0x310]
0004c e58d532c str r5, [sp, #0x32C]
00050 eb000000 bl Nor_FMD_Init
00054 e3500000 cmp r0, #0
00058 1a000005 bne |$L40834|
; 227 : {
; 228 : EdbgOutputDebugString("ERROR: Flash FMD initialization failed.\r\n");
0005c e59f0028 ldr r0, [pc, #0x28]
00060 eb000000 bl EdbgOutputDebugString
; 229 : return(FALSE);
00064 e59d0380 ldr r0, [sp, #0x380]
00068 eb000000 bl __security_check_cookie
0006c e3a00000 mov r0, #0
00070 ea000002 b |$L40829|
00074 |$L40834|
; 230 : }
; 231 : return TRUE;
00074 e59d0380 ldr r0, [sp, #0x380]
00078 eb000000 bl __security_check_cookie
0007c e3a00001 mov r0, #1
00080 |$L40829|
; 232 : }
00080 e28ddfe1 add sp, sp, #0xE1, 30
00084 e8bd4030 ldmia sp!, {r4, r5, lr}
00088 e12fff1e bx lr
0008c |$L41195|
0008c 00000000 DCD |??_C@_0CK@CBBGLELK@ERROR?3?5Flash?5FMD?5initialization?5@|
00090 00000000 DCD |__security_cookie|
00094 |$M41191|
ENDP ; |BootDevice_Init|
EXPORT |BootDevice_Read|
EXPORT |??_C@_0DD@KJNLLNOL@?$AN?6FlashRead?3?5found?5unexpected?5ba@| [ DATA ] ; `string'
IMPORT |__rt_udiv|
IMPORT |memcpy|
IMPORT |OALVAtoPA|
IMPORT |Nor_FMD_ReadSector|
00000 AREA |.text| { |BootDevice_Read| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 AREA |.pdata$$BootDevice_Read|, PDATA, SELECTION=5, ASSOC=|.text| { |BootDevice_Read| } ; comdat associative
|$T41217| DCD |$L41216|
DCD 0x40004102
00000 AREA |.rdata| { |??_C@_0DD@KJNLLNOL@?$AN?6FlashRead?3?5found?5unexpected?5ba@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_0DD@KJNLLNOL@?$AN?6FlashRead?3?5found?5unexpected?5ba@| DCB 0xd, 0xa
DCB "FlashRead: found unexpected bad sector (0x%x).", 0xd, 0xa
DCB 0x0 ; `string'
; Function compile flags: /Ogsy
00000 AREA |.text| { |BootDevice_Read| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 |BootDevice_Read| PROC
; 236 : {
00000 |$L41216|
00000 e92d40f0 stmdb sp!, {r4 - r7, lr}
00004 e24ddf85 sub sp, sp, #0x85, 30
00008 |$M41214|
00008 e1a06002 mov r6, r2
0000c e1b05001 movs r5, r1
00010 e59f30e8 ldr r3, [pc, #0xE8]
00014 e5933000 ldr r3, [r3]
00018 e58d3210 str r3, [sp, #0x210]
; 237 : SECTOR_ADDR SectorAddr;
; 238 : DWORD dwNumSects;
; 239 : BYTE SectBuff[SECTOR_SIZE];
; 240 : DWORD dwNumExtraBytes;
; 241 : FlashInfo NorFlsInfo;
; 242 :
; 243 : if (!pDataBuffer || dwLength == 0)
0001c 0a000028 beq |$L40849|
00020 e3560000 cmp r6, #0
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -