📄 ether.cod
字号:
|??_C@_06PJNFHFFO@NE2000?$AA@| DCB "NE2000", 0x0 ; `string'
; Function compile flags: /Ods
00000 AREA |.text| { |OEMEthHardwareInit| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 |OEMEthHardwareInit| PROC
; 133 : {
00000 |$L39511|
00000 e52de004 str lr, [sp, #-4]!
00004 e24dd030 sub sp, sp, #0x30
00008 |$M39509|
; 134 : USHORT usCS8950MacAddress[3];
; 135 : USHORT usDefaultMacAddress[3] = EBOOT_CS8950_MAC_ADDRESS;
00008 e3a03b09 mov r3, #9, 22
0000c e1cd30b4 strh r3, [sp, #4]
00010 e3a03a01 mov r3, #1, 20
00014 e3833020 orr r3, r3, #0x20
00018 e1cd30b6 strh r3, [sp, #6]
0001c e3a03c56 mov r3, #0x56, 24
00020 e3833078 orr r3, r3, #0x78
00024 e1cd30b8 strh r3, [sp, #8]
; 136 : ULONG * pulEthernetBase = 0;
00028 e3a03000 mov r3, #0
0002c e58d3000 str r3, [sp]
; 137 : char * pszEthernetCardType;
; 138 : BOOL bTemp;
; 139 :
; 140 :
; 141 : //
; 142 : // Put ethernet checking here.
; 143 : //
; 144 : #ifdef EDB9307_12_15
; 145 :
; 146 : if(OEMNE2000Detect())
00030 eb000000 bl OEMNE2000Detect
00034 e58d0020 str r0, [sp, #0x20]
00038 e59d3020 ldr r3, [sp, #0x20]
0003c e3530000 cmp r3, #0
00040 0a000004 beq |$L39403|
; 147 : {
; 148 : pDriverGlobals->eth.EdbgHardwareType = EDBG_ADAPTER_NE2000;
00044 e3a03b22 mov r3, #0x22, 22
00048 e3832060 orr r2, r3, #0x60
0004c e3a03001 mov r3, #1
00050 e5823000 str r3, [r2]
; 149 : }
; 150 : else
00054 ea000003 b |$L39405|
00058 |$L39403|
; 151 : #endif
; 152 : {
; 153 : pDriverGlobals->eth.EdbgHardwareType = EDBG_ADAPTER_CS8950;
00058 e3a03b22 mov r3, #0x22, 22
0005c e3832060 orr r2, r3, #0x60
00060 e3a03012 mov r3, #0x12
00064 e5823000 str r3, [r2]
00068 |$L39405|
; 154 : }
; 155 :
; 156 :
; 157 : //
; 158 : // Check to see if a NE2000 card is plugged into the system.
; 159 : //
; 160 : //if(OEMNE2000Detect())
; 161 : //{
; 162 : // pDriverGlobals->eth.EdbgHardwareType = EDBG_ADAPTER_NE2000;
; 163 : //
; 164 : //}
; 165 :
; 166 : //
; 167 : // Get the board information from the SPI device. Even if we are using
; 168 : // ne2000 to download we want to use the board string.
; 169 : //
; 170 : GetBoardInformation();
00068 eb000000 bl GetBoardInformation
; 171 :
; 172 : //
; 173 : // Assign controller-specific callbacks.
; 174 : //
; 175 : switch (pDriverGlobals->eth.EdbgHardwareType)
0006c e3a03b22 mov r3, #0x22, 22
00070 e3833060 orr r3, r3, #0x60
00074 e5933000 ldr r3, [r3]
00078 e58d3024 str r3, [sp, #0x24]
0007c e59d3024 ldr r3, [sp, #0x24]
00080 e3530001 cmp r3, #1
00084 0a000003 beq |$L39412|
00088 e59d3024 ldr r3, [sp, #0x24]
0008c e3530012 cmp r3, #0x12
00090 0a000013 beq |$L39416|
00094 ea00003c b |$L39421|
00098 |$L39412|
; 176 : {
; 177 : #ifdef EDB9307_12_15
; 178 : case EDBG_ADAPTER_NE2000:
; 179 : pfnEDbgInit = NE2000Init;
00098 e59f21a8 ldr r2, [pc, #0x1A8]
0009c e59f316c ldr r3, [pc, #0x16C]
000a0 e5832000 str r2, [r3]
; 180 : pfnEDbgGetFrame = NE2000GetFrame;
000a4 e59f2198 ldr r2, [pc, #0x198]
000a8 e59f3180 ldr r3, [pc, #0x180]
000ac e5832000 str r2, [r3]
; 181 : pfnEDbgSendFrame = NE2000SendFrame;
000b0 e59f2188 ldr r2, [pc, #0x188]
000b4 e59f316c ldr r3, [pc, #0x16C]
000b8 e5832000 str r2, [r3]
; 182 : pulEthernetBase = (ULONG *)(PCMCIACARD_IO + 0x320);
000bc e3a03101 mov r3, #1, 2
000c0 e3833e32 orr r3, r3, #0x32, 28
000c4 e58d3000 str r3, [sp]
; 183 : pszEthernetCardType = "NE2000";
000c8 e59f316c ldr r3, [pc, #0x16C]
000cc e58d3018 str r3, [sp, #0x18]
; 184 :
; 185 : *(volatile unsigned short *)(PCMCIACARD_ATTRIBUTE + 0x3F8) = 0x21;
000d0 e3a03312 mov r3, #0x12, 6
000d4 e3832ffe orr r2, r3, #0xFE, 30
000d8 e3a03021 mov r3, #0x21
000dc e1c230b0 strh r3, [r2]
; 186 :
; 187 : // *(volatile unsigned short *)(PCMCIACARD_ATTRIBUTE + 0x3F8) = 0x26;
; 188 : // *(volatile unsigned short *)(PCMCIACARD_ATTRIBUTE + 0x3F8) = 0x66;
; 189 : break;
000e0 ea00002e b |$L39409|
000e4 |$L39416|
; 190 : #endif
; 191 : case EDBG_ADAPTER_CS8950:
; 192 : pfnEDbgInit = CS8950Init;
000e4 e59f214c ldr r2, [pc, #0x14C]
000e8 e59f3120 ldr r3, [pc, #0x120]
000ec e5832000 str r2, [r3]
; 193 : pfnEDbgGetFrame = CS8950GetFrame;
000f0 e59f213c ldr r2, [pc, #0x13C]
000f4 e59f3134 ldr r3, [pc, #0x134]
000f8 e5832000 str r2, [r3]
; 194 : pfnEDbgSendFrame = CS8950SendFrame;
000fc e59f2128 ldr r2, [pc, #0x128]
00100 e59f3120 ldr r3, [pc, #0x120]
00104 e5832000 str r2, [r3]
; 195 : pulEthernetBase = (ULONG *)ETHERNET_BASE;
00108 e3a03102 mov r3, #2, 2
0010c e3833801 orr r3, r3, #1, 16
00110 e58d3000 str r3, [sp]
; 196 : pszEthernetCardType = "CS8950";
00114 e59f3108 ldr r3, [pc, #0x108]
00118 e58d3018 str r3, [sp, #0x18]
; 197 :
; 198 : //
; 199 : // CS8950 DMA's to SDRAM. Need to give the library a physical and virtual
; 200 : // address to uncached memory.
; 201 : //
; 202 : bTemp = CS8950DMAInit
; 203 : (
; 204 : CS8950_PHYSICAL_MEMORY,
; 205 : CS8950_VIRTUAL_MEMORY,
; 206 : CS8950_MEMORY_SIZE
; 207 : );
0011c e3a02803 mov r2, #3, 16
00120 e3a01801 mov r1, #1, 16
00124 e3a00801 mov r0, #1, 16
00128 eb000000 bl CS8950DMAInit
0012c e58d0028 str r0, [sp, #0x28]
00130 e59d3028 ldr r3, [sp, #0x28]
00134 e58d3014 str r3, [sp, #0x14]
; 208 :
; 209 : if(!bTemp)
00138 e59d3014 ldr r3, [sp, #0x14]
0013c e3530000 cmp r3, #0
00140 1a000004 bne |$L39419|
; 210 : {
; 211 : EdbgOutputDebugString("ERROR: Failed to Initialize CS8950 DMA buffer.\r\n");
00144 e59f00d4 ldr r0, [pc, #0xD4]
00148 eb000000 bl EdbgOutputDebugString
; 212 : return FALSE;
0014c e3a03000 mov r3, #0
00150 e58d301c str r3, [sp, #0x1C]
00154 ea000028 b |$L39397|
00158 |$L39419|
; 213 : }
; 214 :
; 215 : //
; 216 : // Gets the MAC address from either the EEPROM or used the default.
; 217 : //
; 218 : GetDeviceMacAddress
; 219 : (
; 220 : usCS8950MacAddress,
; 221 : usDefaultMacAddress
; 222 : );
00158 e28d1004 add r1, sp, #4
0015c e28d000c add r0, sp, #0xC
00160 eb000000 bl GetDeviceMacAddress
; 223 :
; 224 : //
; 225 : // We need to do this since the board does not have a MAC address.
; 226 : // Lets use the same mac address as eboot.
; 227 : //
; 228 : CS8950WriteEEPROM(0, usCS8950MacAddress[0]);
00164 e1dd10bc ldrh r1, [sp, #0xC]
00168 e3a00000 mov r0, #0
0016c eb000000 bl CS8950WriteEEPROM
; 229 : CS8950WriteEEPROM(1, usCS8950MacAddress[1]);
00170 e1dd10be ldrh r1, [sp, #0xE]
00174 e3a00001 mov r0, #1
00178 eb000000 bl CS8950WriteEEPROM
; 230 : CS8950WriteEEPROM(2, usCS8950MacAddress[2]);
0017c e1dd11b0 ldrh r1, [sp, #0x10]
00180 e3a00002 mov r0, #2
00184 eb000000 bl CS8950WriteEEPROM
; 231 :
; 232 : break;
00188 ea000004 b |$L39409|
0018c |$L39421|
; 233 :
; 234 : default:
; 235 : EdbgOutputDebugString("ERROR: Unable to find network card.\r\n");
0018c e59f0088 ldr r0, [pc, #0x88]
00190 eb000000 bl EdbgOutputDebugString
; 236 : return(FALSE);
00194 e3a03000 mov r3, #0
00198 e58d301c str r3, [sp, #0x1C]
0019c ea000016 b |$L39397|
001a0 |$L39409|
; 237 : }
; 238 :
; 239 : //
; 240 : // Print out the card information.
; 241 : //
; 242 : EdbgOutputDebugString
; 243 : (
; 244 : "Card Type = %s, Address = 0x%x.\r\n",
; 245 : pszEthernetCardType,
; 246 : (ULONG)pulEthernetBase
; 247 : );
001a0 e59d2000 ldr r2, [sp]
001a4 e59d1018 ldr r1, [sp, #0x18]
001a8 e59f0068 ldr r0, [pc, #0x68]
001ac eb000000 bl EdbgOutputDebugString
; 248 :
; 249 : //
; 250 : // Call driver specific initialization
; 251 : //
; 252 : if (!pfnEDbgInit((BYTE *)pulEthernetBase, 1, MyAddr.wMAC))
001b0 e59f305c ldr r3, [pc, #0x5C]
001b4 e2832004 add r2, r3, #4
001b8 e3a01001 mov r1, #1
001bc e59d0000 ldr r0, [sp]
001c0 e59f3048 ldr r3, [pc, #0x48]
001c4 e5933000 ldr r3, [r3]
001c8 e1a0e00f mov lr, pc
001cc e12fff13 bx r3
001d0 e58d002c str r0, [sp, #0x2C]
001d4 e59d302c ldr r3, [sp, #0x2C]
001d8 e3530000 cmp r3, #0
001dc 1a000004 bne |$L39426|
; 253 : {
; 254 : EdbgOutputDebugString("ERROR: Failed to initialize NIC.\r\n");
001e0 e59f0024 ldr r0, [pc, #0x24]
001e4 eb000000 bl EdbgOutputDebugString
; 255 : return(FALSE);
001e8 e3a03000 mov r3, #0
001ec e58d301c str r3, [sp, #0x1C]
001f0 ea000001 b |$L39397|
001f4 |$L39426|
; 256 : }
; 257 :
; 258 : return(TRUE);
001f4 e3a03001 mov r3, #1
001f8 e58d301c str r3, [sp, #0x1C]
001fc |$L39397|
; 212 : return FALSE;
001fc e59d001c ldr r0, [sp, #0x1C]
; 259 : }
00200 e28dd030 add sp, sp, #0x30
00204 e49de004 ldr lr, [sp], #4
00208 e12fff1e bx lr
0020c |$L39514|
0020c 00000000 DCD |??_C@_0CD@PPGFAPPG@ERROR?3?5Failed?5to?5initialize?5NIC?4@|
00210 00000000 DCD |pfnEDbgInit|
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -