📄 ether.cod
字号:
; 146 : //
; 147 : //}
; 148 :
; 149 : //
; 150 : // Assign controller-specific callbacks.
; 151 : //
; 152 : switch (pDriverGlobals->eth.EdbgHardwareType)
; 153 : {
00038 e5900000 ldr r0, [r0]
0003c e3500001 cmp r0, #1
00040 0a000020 beq |$L37549|
00044 e3500012 cmp r0, #0x12
; 163 : break;
; 164 :
; 165 : case EDBG_ADAPTER_CS8950:
; 166 : pfnEDbgInit = CS8950Init;
; 167 : pfnEDbgGetFrame = CS8950GetFrame;
; 168 : pfnEDbgSendFrame = CS8950SendFrame;
; 169 : pulEthernetBase = (ULONG *)ETHERNET_BASE;
; 170 : pszEthernetCardType = "CS8950";
; 171 :
; 172 :
; 173 : //
; 174 : // CS8950 DMA's to SDRAM. Need to give the library a physical and virtual
; 175 : // address to uncached memory.
; 176 : //
; 177 : bTemp = CS8950DMAInit
; 178 : (
; 179 : CS8950_PHYSICAL_MEMORY,
; 180 : CS8950_VIRTUAL_MEMORY,
; 181 : CS8950_MEMORY_SIZE
; 182 : );
; 183 :
; 184 : if(!bTemp)
; 185 : {
; 186 : EdbgOutputDebugString("ERROR: Failed to Initialize CS8950 DMA buffer.\r\n");
; 187 : return FALSE;
; 188 : }
; 189 : //
; 190 : // We need to do this since the board does not have a MAC address.
; 191 : // Lets use the same mac address as eboot.
; 192 : //
; 193 : CS8950WriteEEPROM(0, usCS8950MacAddress[0]);
; 194 : CS8950WriteEEPROM(1, usCS8950MacAddress[1]);
; 195 : CS8950WriteEEPROM(2, usCS8950MacAddress[2]);
; 196 :
; 197 :
; 198 : break;
; 199 :
; 200 : default:
; 201 : EdbgOutputDebugString("ERROR: Unable to find network card.\r\n");
00048 159f0134 ldrne r0, [pc, #0x134]
0004c 1a000039 bne |$L37697|
00050 e59f0128 ldr r0, [pc, #0x128]
00054 e3a05102 mov r5, #2, 2
00058 e59f7108 ldr r7, [pc, #0x108]
0005c e3a02803 mov r2, #3, 16
00060 e59f60fc ldr r6, [pc, #0xFC]
00064 e3855801 orr r5, r5, #1, 16
00068 e5870000 str r0, [r7]
0006c e59f0108 ldr r0, [pc, #0x108]
00070 e59f1100 ldr r1, [pc, #0x100]
00074 e5060008 str r0, [r6, #-8]
00078 e3a00801 mov r0, #1, 16
0007c e5061004 str r1, [r6, #-4]
00080 e3a01801 mov r1, #1, 16
00084 e59f40e8 ldr r4, [pc, #0xE8]
00088 eb000000 bl CS8950DMAInit
0008c e3500000 cmp r0, #0
00090 059f00d8 ldreq r0, [pc, #0xD8]
00094 0a000027 beq |$L37697|
00098 e3a01b09 mov r1, #9, 22
0009c e3a00000 mov r0, #0
000a0 eb000000 bl CS8950WriteEEPROM
000a4 e3a01a01 mov r1, #1, 20
000a8 e3811020 orr r1, r1, #0x20
000ac e3a00001 mov r0, #1
000b0 eb000000 bl CS8950WriteEEPROM
000b4 e3a01c46 mov r1, #0x46, 24
000b8 e3811034 orr r1, r1, #0x34
000bc e3a00002 mov r0, #2
000c0 eb000000 bl CS8950WriteEEPROM
000c4 ea00000e b |$L37546|
000c8 |$L37549|
; 154 : case EDBG_ADAPTER_NE2000:
; 155 : pfnEDbgInit = NE2000Init;
000c8 e59f009c ldr r0, [pc, #0x9C]
; 156 : pfnEDbgGetFrame = NE2000GetFrame;
; 157 : pfnEDbgSendFrame = NE2000SendFrame;
; 158 : pulEthernetBase = (ULONG *)(PCMCIACARD_IO + 0x320);
000cc e3a05101 mov r5, #1, 2
000d0 e59f7090 ldr r7, [pc, #0x90]
000d4 e3855e32 orr r5, r5, #0x32, 28
000d8 e59f6084 ldr r6, [pc, #0x84]
000dc e59f107c ldr r1, [pc, #0x7C]
000e0 e5870000 str r0, [r7]
000e4 e59f0070 ldr r0, [pc, #0x70]
000e8 e5061004 str r1, [r6, #-4]
; 159 : pszEthernetCardType = "NE2000";
; 160 : //*(volatile unsigned short *)(PCMCIACARD_ATTRIBUTE + 0x3F8) = 0x21;
; 161 : //*(volatile unsigned short *)(PCMCIACARD_ATTRIBUTE + 0x3F8) = 0x26;
; 162 : *(volatile unsigned short *)(PCMCIACARD_ATTRIBUTE + 0x3F8) = 0x66;
000ec e3a01312 mov r1, #0x12, 6
000f0 e5060008 str r0, [r6, #-8]
000f4 e3811ffe orr r1, r1, #0xFE, 30
000f8 e3a00066 mov r0, #0x66
000fc e59f4054 ldr r4, [pc, #0x54]
00100 e1c100b0 strh r0, [r1]
00104 |$L37546|
; 203 : }
; 204 :
; 205 : //
; 206 : // Print out the card information.
; 207 : //
; 208 : EdbgOutputDebugString
; 209 : (
; 210 : "Card Type = %s, Address = 0x%x.\r\n",
; 211 : pszEthernetCardType,
; 212 : (ULONG)pulEthernetBase
; 213 : );
00104 e59f0048 ldr r0, [pc, #0x48]
00108 e1a02005 mov r2, r5
0010c e1a01004 mov r1, r4
00110 eb000000 bl EdbgOutputDebugString
; 214 :
; 215 : //
; 216 : // Call driver specific initialization
; 217 : //
; 218 : if (!pfnEDbgInit((BYTE *)pulEthernetBase, 1, MyAddr.wMAC))
00114 e5973000 ldr r3, [r7]
00118 e2862004 add r2, r6, #4
0011c e3a01001 mov r1, #1
00120 e1a00005 mov r0, r5
00124 e1a0e00f mov lr, pc
00128 e12fff13 bx r3
0012c e3500000 cmp r0, #0
00130 1a000002 bne |$L37533|
; 219 : {
; 220 : EdbgOutputDebugString("ERROR: Failed to initialize NIC.\r\n");
00134 e59f0014 ldr r0, [pc, #0x14]
00138 |$L37697|
00138 eb000000 bl EdbgOutputDebugString
; 221 : return(FALSE);
0013c e3a08000 mov r8, #0
00140 |$L37533|
; 202 : return(FALSE);
00140 e1a00008 mov r0, r8
; 222 : }
; 223 :
; 224 : return(TRUE);
; 225 : }
00144 e28dd010 add sp, sp, #0x10
00148 e8bd41f0 ldmia sp!, {r4 - r8, lr}
0014c e12fff1e bx lr
00150 |$L37702|
00150 00000000 DCD |??_C@_0CD@IFFA@ERROR?3?5Failed?5to?5initialize?5NIC?4@|
00154 00000000 DCD |??_C@_0CC@JFEM@Card?5Type?5?$DN?5?$CFs?0?5Address?5?$DN?50x?$CFx?4?$AN@|
00158 00000000 DCD |??_C@_06DDP@NE2000?$AA@|
0015c 00000000 DCD |NE2000GetFrame|
00160 00000000 DCD |NE2000SendFrame|
00164 00000000 DCD |MyAddr|
00168 00000000 DCD |pfnEDbgInit|
0016c 00000000 DCD |NE2000Init|
00170 00000000 DCD |??_C@_0DB@LMBN@ERROR?3?5Failed?5to?5Initialize?5CS89@|
00174 00000000 DCD |??_C@_06EBAD@CS8950?$AA@|
00178 00000000 DCD |CS8950SendFrame|
0017c 00000000 DCD |CS8950GetFrame|
00180 00000000 DCD |CS8950Init|
00184 00000000 DCD |??_C@_0CG@GFND@ERROR?3?5Unable?5to?5find?5network?5ca@|
00188 00000000 DCD |??_C@_06GGLE@EP931x?$AA@|
0018c |$M37699|
ENDP ; |OEMEthHardwareInit|
EXPORT |OEMEthPreDownload|
EXPORT |??_C@_0BP@OBGL@INFO?3?5Using?5device?5name?3?5?8?$CFs?8?6?$AA@| [ DATA ] ; `string'
IMPORT |memset|
IMPORT |memcpy|
IMPORT |EbootInitEtherTransport|
00000 AREA |.text| { |OEMEthPreDownload| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 AREA |.pdata$$OEMEthPreDownload|, PDATA, SELECTION=5, ASSOC=|.text| { |OEMEthPreDownload| } ; comdat associative
|$T37712| DCD |OEMEthPreDownload|
DCD 0x40004302
00000 AREA |.rdata| { |??_C@_0BP@OBGL@INFO?3?5Using?5device?5name?3?5?8?$CFs?8?6?$AA@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_0BP@OBGL@INFO?3?5Using?5device?5name?3?5?8?$CFs?8?6?$AA@| DCB "INF"
DCB "O: Using device name: '%s'", 0xa, 0x0 ; `string'
; Function compile flags: /Ogsy
00000 AREA |.text| { |OEMEthPreDownload| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 |OEMEthPreDownload| PROC
; 234 : {
00000 e92d4070 stmdb sp!, {r4 - r6, lr}
00004 e24dd038 sub sp, sp, #0x38
00008 |$M37710|
; 235 : char szDeviceName[EDBG_MAX_DEV_NAMELEN];
; 236 : char szPlatformString[] = EBOOT_PLATFORM_STRING;
00008 e59f00f8 ldr r0, [pc, #0xF8]
; 237 : DWORD dwSubnetMask = 0;
0000c e3a06000 mov r6, #0
00010 e58d0018 str r0, [sp, #0x18]
; 238 : BOOL fGotJumpImg = FALSE;
; 239 : DWORD DHCPLeaseTime = DEFAULT_DHCP_LEASE;
00014 e3a00bfd mov r0, #0xFD, 22
00018 e3800080 orr r0, r0, #0x80
0001c e58d6024 str r6, [sp, #0x24]
00020 e58d001c str r0, [sp, #0x1C]
; 240 : DWORD dwBootFlags = 0;
; 241 : DWORD *pDHCPLeaseTime = &DHCPLeaseTime;
; 242 :
; 243 : //
; 244 : // Clear out the device name.
; 245 : //
; 246 : memset(szDeviceName, 0, EDBG_MAX_DEV_NAMELEN);
00024 e3a02010 mov r2, #0x10
00028 e3a01000 mov r1, #0
0002c e58d6020 str r6, [sp, #0x20]
00030 e28d0028 add r0, sp, #0x28
00034 eb000000 bl memset
; 247 :
; 248 : //
; 249 : // Create device name based on Ethernet address.
; 250 : //
; 251 : CreateDeviceName(&MyAddr, szDeviceName, szPlatformString);
00038 e59f40c4 ldr r4, [pc, #0xC4]
0003c e28d2018 add r2, sp, #0x18
00040 e28d1028 add r1, sp, #0x28
00044 e1a00004 mov r0, r4
00048 eb000000 bl CreateDeviceName
; 252 :
; 253 : EdbgOutputDebugString("INFO: Using device name: '%s'\n", szDeviceName);
0004c e59f00ac ldr r0, [pc, #0xAC]
00050 e28d1028 add r1, sp, #0x28
00054 eb000000 bl EdbgOutputDebugString
; 254 :
; 255 :
; 256 : //
; 257 : // Initialize the TFTP transport.
; 258 : //
; 259 : if (!EbootInitEtherTransport(&MyAddr,
; 260 : &dwSubnetMask,
; 261 : &fGotJumpImg,
; 262 : pDHCPLeaseTime,
; 263 : EBOOT_VERSION_MAJOR,
; 264 : EBOOT_VERSION_MINOR,
; 265 : szPlatformString,
; 266 : szDeviceName,
; 267 : EDBG_CPU_ARM720,
; 268 : dwBootFlags))
00058 e58d6014 str r6, [sp, #0x14]
0005c e3a00041 mov r0, #0x41
00060 e58d6004 str r6, [sp, #4]
00064 e58d0010 str r0, [sp, #0x10]
00068 e28d1028 add r1, sp, #0x28
0006c e28d0018 add r0, sp, #0x18
00070 e58d100c str r1, [sp, #0xC]
00074 e58d0008 str r0, [sp, #8]
00078 e3a05001 mov r5, #1
0007c e28d301c add r3, sp, #0x1C
00080 e58d5000 str r5, [sp]
00084 e28d2020 add r2, sp, #0x20
00088 e28d1024 add r1, sp, #0x24
0008c e1a00004 mov r0, r4
00090 eb000000 bl EbootInitEtherTransport
00094 e3500000 cmp r0, #0
; 269 : {
; 270 : return(BL_ERROR);
00098 03e05000 mvneq r5, #0
0009c 0a000013 beq |$L37566|
; 271 : }
; 272 :
; 273 : //
; 274 : // Save the Ethernet address in boot args area.
; 275 : //
; 276 : memcpy(&(pDriverGlobals->eth.EdbgAddr), &MyAddr, sizeof(MyAddr));
000a0 e3a03b22 mov r3, #0x22, 22
000a4 e5940000 ldr r0, [r4]
000a8 e3833010 orr r3, r3, #0x10
000ac e5941004 ldr r1, [r4, #4]
000b0 e5942008 ldr r2, [r4, #8]
000b4 e5830000 str r0, [r3]
; 277 : memcpy(&pDriverGlobals->eth.strEdbgName, szDeviceName, EDBG_MAX_DEV_NAMELEN);
000b8 e3a00b22 mov r0, #0x22, 22
000bc e5831004 str r1, [r3, #4]
000c0 e3800064 orr r0, r0, #0x64
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -