📄 eeinfo.cod
字号:
; 322 : if(ullMax < ullCurrent)
00134 e1590001 cmp r9, r1
00138 3a000027 bcc |$L15537|
0013c 8a000001 bhi |$L15545|
00140 e1580000 cmp r8, r0
00144 3a000024 bcc |$L15537|
00148 |$L15545|
; 326 : }
; 327 :
; 328 : } while(ulCount < 4);
00148 e3550004 cmp r5, #4
0014c 3affffeb bcc |$L15574|
; 329 :
; 330 : //
; 331 : // Read in the rest of the data.
; 332 : //
; 333 : ullStart = GetSystemTimeInUSec();
00150 eb000000 bl GetSystemTimeInUSec
; 334 : ullMax = ullStart + SPI_MINTIME + ulLength * SPI_BYTETIME;
00154 e08a310a add r3, r10, r10, lsl #2
00158 e0902083 adds r2, r0, r3, lsl #1
0015c e2a13000 adc r3, r1, #0
00160 e29280c8 adds r8, r2, #0xC8
00164 e2a39000 adc r9, r3, #0
; 335 : ulCount = 0;
00168 e3a05000 mov r5, #0
0016c |$L15317|
; 336 : do
; 337 : {
; 338 : //
; 339 : // Check to see if there are bytes to receive.
; 340 : //
; 341 : if(*SPI_SR & SPISR_RNE)
0016c e5943000 ldr r3, [r4]
00170 e3130004 tst r3, #4
; 342 : {
; 343 : pucData[ulCount++] = (UCHAR)(*SPI_DR & 0xFF);
00174 15973000 ldrne r3, [r7]
00178 17c5300b strneb r3, [r5, +r11]
0017c 12855001 addne r5, r5, #1
; 344 : }
; 345 :
; 346 : //
; 347 : // Check to see if we can transmit data so that we can receive.
; 348 : //
; 349 : if(ulTransmitCount <ulLength && (*SPI_SR & SPISR_TNF))
00180 e156000a cmp r6, r10
00184 2a000004 bcs |$L15325|
00188 e5943000 ldr r3, [r4]
0018c e3130002 tst r3, #2
; 350 : {
; 351 : *SPI_DR = 0;
00190 13a03000 movne r3, #0
00194 15873000 strne r3, [r7]
; 352 : ulTransmitCount++;
00198 12866001 addne r6, r6, #1
0019c |$L15325|
; 353 : }
; 354 :
; 355 : //
; 356 : // Have a timeout so the system does not get stuck.
; 357 : //
; 358 : ullCurrent = GetSystemTimeInUSec();
0019c eb000000 bl GetSystemTimeInUSec
; 359 : if(ullMax < ullCurrent)
001a0 e1590001 cmp r9, r1
001a4 3a00000e bcc |$L15539|
001a8 8a000001 bhi |$L15546|
001ac e1580000 cmp r8, r0
001b0 3a00000b bcc |$L15539|
001b4 |$L15546|
; 364 : }
; 365 : } while(ulCount < ulLength);
001b4 e155000a cmp r5, r10
001b8 3affffeb bcc |$L15317|
; 366 : return (1);
001bc e3a00001 mov r0, #1
001c0 |$L15291|
; 367 : }
001c0 e28dd004 add sp, sp, #4
001c4 e8bd4ff0 ldmia sp!, {r4 - r11, lr}
001c8 e12fff1e bx lr
001cc |$L15541|
; 273 : if(!bRet)
; 274 : {
; 275 : EdbgOutputDebugString("EEINFO: ClearReceiveFifo Timeout.\r\n");
001cc e59f003c ldr r0, [pc, #0x3C]
001d0 |$L15576|
001d0 eb000000 bl EdbgOutputDebugString
; 363 : return(0);
001d4 e3a00000 mov r0, #0
001d8 eafffff8 b |$L15291|
001dc |$L15537|
; 323 : {
; 324 : EdbgOutputDebugString("EEINFO: ReadEEWord 1rst Timeout.\r\n");
001dc e59f0028 ldr r0, [pc, #0x28]
; 325 : return(0);
001e0 eafffffa b |$L15576|
001e4 |$L15539|
; 360 : {
; 361 : EdbgOutputDebugString("EEINFO: ReadEEWord 2nd Timeout.\r\n");
001e4 e59f001c ldr r0, [pc, #0x1C]
001e8 eb000000 bl EdbgOutputDebugString
; 362 : EdbgOutputDebugString("EEINFO: Receive = 0x%x, Transmit = 0x%x.\r\n", ulCount, ulTransmitCount);
001ec e59f0010 ldr r0, [pc, #0x10]
001f0 e1a02006 mov r2, r6
001f4 e1a01005 mov r1, r5
001f8 eb000000 bl EdbgOutputDebugString
; 363 : return(0);
001fc e3a00000 mov r0, #0
00200 eaffffee b |$L15291|
00204 |$L15582|
00204 00000000 DCD |??_C@_0CL@KFPMGBGB@EEINFO?3?5Receive?5?$DN?50x?$CFx?0?5Transmit@|
00208 00000000 DCD |??_C@_0CC@ENCMIEAA@EEINFO?3?5ReadEEWord?52nd?5Timeout?4?$AN@|
0020c 00000000 DCD |??_C@_0CD@DCGJPODM@EEINFO?3?5ReadEEWord?51rst?5Timeout?4@|
00210 00000000 DCD |??_C@_0CE@EMPABGLD@EEINFO?3?5ClearReceiveFifo?5Timeout@|
00214 b08a0008 DCD 0xb08a0008
00218 b08a000c DCD 0xb08a000c
0021c |$M15578|
ENDP ; |ReadEEWord|
EXPORT |GetBoardInformation|
EXPORT |??_C@_0BJ@JMNHHKIF@EEINFO?3?5EEInformation?4?$AN?6?$AA@| [ DATA ] ; `string'
EXPORT |??_C@_0BP@DOCAFDDJ@EEINFO?3?50x?$CFx?50x?$CFx?50x?$CFx?50x?$CFx?4?$AN?6?$AA@| [ DATA ] ; `string'
EXPORT |??_C@_0CB@HOJDAEME@MAC?5Address?5?$DN?50x?$CFx?0?50x?$CFx?0?50x?$CFx?$AN?6@| [ DATA ] ; `string'
EXPORT |??_C@_0BC@ECDBGCHG@Board?5Name?5?$DN?5?$CFs?$AN?6?$AA@| [ DATA ] ; `string'
EXPORT |??_C@_04GKLMKEAK@EMAC?$AA@| [ DATA ] ; `string'
IMPORT |memset|
IMPORT |memcmp|
00000 AREA |.text| { |GetBoardInformation| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 AREA |.pdata$$GetBoardInformation|, PDATA, SELECTION=5, ASSOC=|.text| { |GetBoardInformation| } ; comdat associative
|$T15650| DCD |$L15649|
DCD 0x40009502
00000 AREA |.rdata| { |??_C@_04GKLMKEAK@EMAC?$AA@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_04GKLMKEAK@EMAC?$AA@| DCB "EMAC", 0x0 ; `string'
00000 AREA |.rdata| { |??_C@_0BJ@JMNHHKIF@EEINFO?3?5EEInformation?4?$AN?6?$AA@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_0BJ@JMNHHKIF@EEINFO?3?5EEInformation?4?$AN?6?$AA@| DCB "EEINFO: EE"
DCB "Information.", 0xd, 0xa, 0x0 ; `string'
00000 AREA |.rdata| { |??_C@_0BP@DOCAFDDJ@EEINFO?3?50x?$CFx?50x?$CFx?50x?$CFx?50x?$CFx?4?$AN?6?$AA@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_0BP@DOCAFDDJ@EEINFO?3?50x?$CFx?50x?$CFx?50x?$CFx?50x?$CFx?4?$AN?6?$AA@| DCB "E"
DCB "EINFO: 0x%x 0x%x 0x%x 0x%x.", 0xd, 0xa, 0x0 ; `string'
00000 AREA |.rdata| { |??_C@_0CB@HOJDAEME@MAC?5Address?5?$DN?50x?$CFx?0?50x?$CFx?0?50x?$CFx?$AN?6@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_0CB@HOJDAEME@MAC?5Address?5?$DN?50x?$CFx?0?50x?$CFx?0?50x?$CFx?$AN?6@| DCB "M"
DCB "AC Address = 0x%x, 0x%x, 0x%x", 0xd, 0xa, 0x0 ; `string'
00000 AREA |.rdata| { |??_C@_0BC@ECDBGCHG@Board?5Name?5?$DN?5?$CFs?$AN?6?$AA@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_0BC@ECDBGCHG@Board?5Name?5?$DN?5?$CFs?$AN?6?$AA@| DCB "Board Name "
DCB "= %s", 0xd, 0xa, 0x0 ; `string'
; Function compile flags: /Ogsy
00000 AREA |.text| { |GetBoardInformation| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 |GetBoardInformation| PROC
; 75 : {
00000 |$L15649|
00000 e92d43f0 stmdb sp!, {r4 - r9, lr}
00004 e24dd004 sub sp, sp, #4
00008 |$M15647|
; 76 : BOOL bRet;
; 77 : PULONG pul;
; 78 : PUCHAR puc;
; 79 : ULONG ulTemp;
; 80 : // int x;
; 81 :
; 82 : //
; 83 : // Initialize the board information structure.
; 84 : //
; 85 : memset(&gBoardInformation, 0, sizeof(BOARD_INFO));
00008 e59f7240 ldr r7, [pc, #0x240]
0000c e3a02020 mov r2, #0x20
00010 e3a01000 mov r1, #0
00014 e1a00007 mov r0, r7
00018 eb000000 bl memset
; 86 :
; 87 : //
; 88 : // Initialize the SPI device for reading the EEPROM.
; 89 : //
; 90 : InitializeSPI();
0001c e59f2228 ldr r2, [pc, #0x228]
00020 e59f1220 ldr r1, [pc, #0x220]
00024 e59fe218 ldr lr, [pc, #0x218]
00028 e5923000 ldr r3, [r2]
0002c e3a0520b mov r5, #0xB, 4
00030 e3855721 orr r5, r5, #0x21, 14
00034 e3833050 orr r3, r3, #0x50
00038 e5823000 str r3, [r2]
0003c e5913000 ldr r3, [r1]
00040 e59f21f8 ldr r2, [pc, #0x1F8]
00044 e3a0020b mov r0, #0xB, 4
00048 e3833050 orr r3, r3, #0x50
0004c e5813000 str r3, [r1]
00050 e59e3000 ldr r3, [lr]
00054 e3a01d1b mov r1, #0x1B, 26
00058 e380088a orr r0, r0, #0x8A, 16
0005c e3833080 orr r3, r3, #0x80
00060 e58e3000 str r3, [lr]
00064 e5953000 ldr r3, [r5]
00068 e3811007 orr r1, r1, #7
0006c e3a0e002 mov lr, #2
00070 e3c33080 bic r3, r3, #0x80
00074 e5853000 str r3, [r5]
00078 e59f31bc ldr r3, [pc, #0x1BC]
0007c e5801000 str r1, [r0]
00080 e582e000 str lr, [r2]
00084 e3a01000 mov r1, #0
; 91 :
; 92 : //
; 93 : // Test the SPI device to make sure that it is an ATMEL
; 94 : //
; 95 : bRet = TestSPI();
00088 e59f91a8 ldr r9, [pc, #0x1A8]
0008c e3a02010 mov r2, #0x10
00090 e5831000 str r1, [r3]
00094 e5832000 str r2, [r3]
00098 e3a03015 mov r3, #0x15
0009c e5893000 str r3, [r9]
000a0 e5891000 str r1, [r9]
000a4 e5891000 str r1, [r9]
000a8 eb000000 bl GetSystemTimeInUSec
000ac e29060c8 adds r6, r0, #0xC8
000b0 e59f417c ldr r4, [pc, #0x17C]
000b4 e2a18000 adc r8, r1, #0
000b8 ea000005 b |$L15622|
000bc |$L15613|
000bc eb000000 bl GetSystemTimeInUSec
000c0 e1580001 cmp r8, r1
000c4 3a000014 bcc |$L15609|
000c8 8a000001 bhi |$L15622|
000cc e1560000 cmp r6, r0
000d0 3a000011 bcc |$L15609|
000d4 |$L15622|
000d4 e5943000 ldr r3, [r4]
000d8 e3130001 tst r3, #1
000dc 0afffff6 beq |$L15613|
000e0 eb000000 bl GetSystemTimeInUSec
000e4 e29060c8 adds r6, r0, #0xC8
000e8 e2a18000 adc r8, r1, #0
000ec ea000005 b |$L15623|
000f0 |$L15605|
000f0 eb000000 bl GetSystemTimeInUSec
000f4 e1580001 cmp r8, r1
000f8 3a000007 bcc |$L15609|
000fc 8a000001 bhi |$L15623|
00100 e1560000 cmp r6, r0
00104 3a000004 bcc |$L15609|
00108 |$L15623|
00108 e5943000 ldr r3, [r4]
0010c e3130010 tst r3, #0x10
00110 1afffff6 bne |$L15605|
00114 e3a000c8 mov r0, #0xC8
00118 eb000000 bl DelayInuSec
0011c |$L15609|
0011c e599e000 ldr lr, [r9]
00120 e5994000 ldr r4, [r9]
00124 e5993000 ldr r3, [r9]
; 96 : if(bRet)
; 97 : {
; 98 : bRet = ReadEEWord(0x1000, sizeof(BOARD_INFO), (PCHAR) &gBoardInformation);
00128 e1a02007 mov r2, r7
0012c e3a01020 mov r1, #0x20
00130 e3a00a01 mov r0, #1, 20
00134 eb000000 bl ReadEEWord
00138 e1a04000 mov r4, r0
; 99 : pul = (PULONG) &gBoardInformation;
; 100 :
; 101 : puc = (unsigned char *)pul;
; 102 : EdbgOutputDebugString( "EEINFO: EEInformation.\r\n");
0013c e59f00ec ldr r0, [pc, #0xEC]
00140 eb000000 bl EdbgOutputDebugString
; 103 : EdbgOutputDebugString( "EEINFO: 0x%x 0x%x 0x%x 0x%x.\r\n" , (ULONG) puc[0], (ULONG) puc[1], (ULONG) puc[2], (ULONG) puc[3]);
00144 e5d7e003 ldrb lr, [r7, #3]
00148 e5d73002 ldrb r3, [r7, #2]
0014c e5d72001 ldrb r2, [r7, #1]
00150 e5d71000 ldrb r1, [r7]
00154 e59f00d0 ldr r0, [pc, #0xD0]
00158 e58de000 str lr, [sp]
0015c eb000000 bl EdbgOutputDebugString
; 104 : EdbgOutputDebugString( "EEINFO: 0x%x 0x%x 0x%x 0x%x.\r\n" , (ULONG) puc[4], (ULONG) puc[5], (ULONG) puc[6], (ULONG) puc[7]);
00160 e5d7e007 ldrb lr, [r7, #7]
00164 e5d73006 ldrb r3, [r7, #6]
00168 e5d72005 ldrb r2, [r7, #5]
0016c e5d71004 ldrb r1, [r7, #4]
00170 e59f00b4 ldr r0, [pc, #0xB4]
00174 e58de000 str lr, [sp]
00178 eb000000 bl EdbgOutputDebugString
; 105 : EdbgOutputDebugString( "EEINFO: 0x%x 0x%x 0x%x 0x%x.\r\n" , (ULONG) puc[8], (ULONG) puc[9], (ULONG) puc[10], (ULONG) puc[11]);
0017c e5d7e00b ldrb lr, [r7, #0xB]
00180 e5d7300a ldrb r3, [r7, #0xA]
00184 e5d72009 ldrb r2, [r7, #9]
00188 e5d71008 ldrb r1, [r7, #8]
0018c e59f0098 ldr r0, [pc, #0x98]
00190 e58de000 str lr, [sp]
00194 eb000000 bl EdbgOutputDebugString
; 106 : EdbgOutputDebugString( "EEINFO: 0x%x 0x%x 0x%x 0x%x.\r\n" , (ULONG) puc[12], (ULONG) puc[13], (ULONG) puc[14], (ULONG) puc[15]);
00198 e5d7e00f ldrb lr, [r7, #0xF]
0019c e5d7300e ldrb r3, [r7, #0xE]
001a0 e5d7200d ldrb r2, [r7, #0xD]
001a4 e5d7100c ldrb r1, [r7, #0xC]
001a8 e59f007c ldr r0, [pc, #0x7C]
001ac e58de000 str lr, [sp]
001b0 eb000000 bl EdbgOutputDebugString
; 107 :
; 108 : //
; 109 : // Mac Address.
; 110 : //
; 111 : EdbgOutputDebugString("MAC Address = 0x%x, 0x%x, 0x%x\r\n",
; 112 : (ULONG) gBoardInformation.MACAddress[0],
; 113 : (ULONG) gBoardInformation.MACAddress[1],
; 114 : (ULONG) gBoardInformation.MACAddress[2]);
001b4 e1d730b8 ldrh r3, [r7, #8]
001b8 e1d720b6 ldrh r2, [r7, #6]
001bc e1d710b4 ldrh r1, [r7, #4]
001c0 e59f0060 ldr r0, [pc, #0x60]
001c4 eb000000 bl EdbgOutputDebugString
; 115 :
; 116 : EdbgOutputDebugString("Board Name = %s\r\n", gBoardInformation.strEdbgName);
001c8 e59f0054 ldr r0, [pc, #0x54]
001cc e2871010 add r1, r7, #0x10
001d0 eb000000 bl EdbgOutputDebugString
; 117 :
; 118 : if(bRet && !memcmp(&gBoardInformation.strSignature,"EMAC", 4))
001d4 e3540000 cmp r4, #0
001d8 0a000006 beq |$L15252|
001dc e59f103c ldr r1, [pc, #0x3C]
001e0 e3a02004 mov r2, #4
001e4 e1a00007 mov r0, r7
001e8 eb000000 bl memcmp
001ec e3500000 cmp r0, #0
; 119 : {
; 120 : gBoardInformationValid = TRUE;
001f0 03a02001 moveq r2, #1
001f4 0a000000 beq |$L15646|
001f8 |$L15252|
; 121 : }
; 122 : else
; 123 : {
; 124 : gBoardInformationValid = FALSE;
001f8 e3a02000 mov r2, #0
001fc |$L15646|
001fc e59f3018 ldr r3, [pc, #0x18]
00200 e5832000 str r2, [r3]
; 125 : }
; 126 : }
; 127 : else
; 128 : {
; 129 : EdbgOutputDebugString("EEINFO: SPI Device Not detected.\r\n");
; 130 : gBoardInformationValid = FALSE;
; 131 : }
; 132 :
; 133 :
; 134 : //
; 135 : //Set GPIO pins 7 to disable the frame line.
; 136 : //
; 137 : ulTemp = *GPIO_PADR;
00204 e5953000 ldr r3, [r5]
; 138 : *GPIO_PADR = ulTemp | 0x80;
00208 e3833080 orr r3, r3, #0x80
0020c e5853000 str r3, [r5]
; 139 : }
00210 e28dd004 add sp, sp, #4
00214 e8bd43f0 ldmia sp!, {r4 - r9, lr}
00218 e12fff1e bx lr
0021c |$L15652|
0021c 00000000 DCD |gBoardInformationValid|
00220 00000000 DCD |??_C@_04GKLMKEAK@EMAC?$AA@|
00224 00000000 DCD |??_C@_0BC@ECDBGCHG@Board?5Name?5?$DN?5?$CFs?$AN?6?$AA@|
00228 00000000 DCD |??_C@_0CB@HOJDAEME@MAC?5Address?5?$DN?50x?$CFx?0?50x?$CFx?0?50x?$CFx?$AN?6@|
0022c 00000000 DCD |??_C@_0BP@DOCAFDDJ@EEINFO?3?50x?$CFx?50x?$CFx?50x?$CFx?50x?$CFx?4?$AN?6?$AA@|
00230 00000000 DCD |??_C@_0BJ@JMNHHKIF@EEINFO?3?5EEInformation?4?$AN?6?$AA@|
00234 b08a000c DCD 0xb08a000c
00238 b08a0008 DCD 0xb08a0008
0023c b08a0004 DCD 0xb08a0004
00240 b08a0010 DCD 0xb08a0010
00244 b0840010 DCD 0xb0840010
00248 b0840004 DCD 0xb0840004
0024c b0840014 DCD 0xb0840014
00250 00000000 DCD |gBoardInformation|
00254 |$M15648|
ENDP ; |GetBoardInformation|
END
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -