📄 pcmciasupport.cod
字号:
000d0 e2544001 subs r4, r4, #1
000d4 5affffea bpl |$L36578|
; 199 : }
; 200 : }
; 201 :
; 202 : //
; 203 : // Raise and lower the Latch.
; 204 : //
; 205 : *GPIO_PGDR = GPIOG_SLA0;
000d8 e3a00004 mov r0, #4
000dc e58a0000 str r0, [r10]
; 206 : DelayInuSec(50);
000e0 e3a00032 mov r0, #0x32
000e4 eb000000 bl DelayInuSec
; 207 :
; 208 : *GPIO_PGDR = 0;
000e8 e58a6000 str r6, [r10]
; 209 : *GPIO_PGDR = GPIOG_EECLK;
; 210 : DelayInuSec(50);
000ec e3a00032 mov r0, #0x32
000f0 e58a9000 str r9, [r10]
000f4 eb000000 bl DelayInuSec
; 211 : *GPIO_PGDR = GPIOG_EECLK| GPIOG_EEDAT;
000f8 e58a8000 str r8, [r10]
; 212 : DelayInuSec(50);
000fc e3a00032 mov r0, #0x32
00100 eb000000 bl DelayInuSec
; 213 :
; 214 : //
; 215 : // Change the configuration back to zero.
; 216 : // This will cause the PCMCIA interface to reset.
; 217 : //
; 218 : //*EEPROM_CONFIG = CONFIG_S0DIR;
; 219 :
; 220 : return(retVal);
00104 ea000000 b |$L36565|
00108 |$L36573|
; 112 :
; 113 : }
; 114 : else
; 115 : {
; 116 : return (ERROR_POWERPCCARD_INVALID_PARMS);
00108 e3a06001 mov r6, #1
0010c |$L36565|
; 213 :
; 214 : //
; 215 : // Change the configuration back to zero.
; 216 : // This will cause the PCMCIA interface to reset.
; 217 : //
; 218 : //*EEPROM_CONFIG = CONFIG_S0DIR;
; 219 :
; 220 : return(retVal);
0010c e1a00006 mov r0, r6
; 221 : }
00110 e8bd47f0 ldmia sp!, {r4 - r10, lr}
00114 e12fff1e bx lr
00118 |$L36706|
00118 8084003c DCD 0x8084003c
0011c 80840038 DCD 0x80840038
00120 00000000 DCD |Vcc|
00124 |$M36703|
ENDP ; |PowerPCCardWrite|
EXPORT |??_C@_0CL@CONH@Card?5Voltage?3?5Card?5bus?0?5Unsuppor@| [ DATA ] ; `string'
EXPORT |??_C@_0CF@LIEA@Card?5Voltage?3?5x?4x?53?43v?5and?55v?5Ca@| [ DATA ] ; `string'
EXPORT |??_C@_0CF@PPOK@Card?5Voltage?3?5x?4xv?5?$CINot?5supporte@| [ DATA ] ; `string'
EXPORT |??_C@_0BF@FGK@Card?5Voltage?3?53?43v?4?6?$AA@| [ DATA ] ; `string'
EXPORT |??_C@_0BD@CHKG@Card?5Voltage?3?55v?4?6?$AA@| [ DATA ] ; `string'
IMPORT |EdbgOutputDebugString|
00000 AREA |.text| { |detectVolts| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 AREA |.pdata$$detectVolts|, PDATA, SELECTION=5, ASSOC=|.text| { |detectVolts| } ; comdat associative
|$T36715| DCD |detectVolts|
DCD 0x40002701
00000 AREA |.rdata| { |??_C@_0CL@CONH@Card?5Voltage?3?5Card?5bus?0?5Unsuppor@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_0CL@CONH@Card?5Voltage?3?5Card?5bus?0?5Unsuppor@| DCB "Card Voltag"
DCB "e: Card bus, Unsupported card.", 0xa, 0x0 ; `string'
00000 AREA |.rdata| { |??_C@_0CF@LIEA@Card?5Voltage?3?5x?4x?53?43v?5and?55v?5Ca@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_0CF@LIEA@Card?5Voltage?3?5x?4x?53?43v?5and?55v?5Ca@| DCB "Card Vol"
DCB "tage: x.x 3.3v and 5v Card.", 0xa, 0x0 ; `string'
00000 AREA |.rdata| { |??_C@_0CF@PPOK@Card?5Voltage?3?5x?4xv?5?$CINot?5supporte@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_0CF@PPOK@Card?5Voltage?3?5x?4xv?5?$CINot?5supporte@| DCB "Card Vol"
DCB "tage: x.xv (Not supported).", 0xa, 0x0 ; `string'
00000 AREA |.rdata| { |??_C@_0BF@FGK@Card?5Voltage?3?53?43v?4?6?$AA@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_0BF@FGK@Card?5Voltage?3?53?43v?4?6?$AA@| DCB "Card Voltage: 3.3v.", 0xa
DCB 0x0 ; `string'
00000 AREA |.rdata| { |??_C@_0BD@CHKG@Card?5Voltage?3?55v?4?6?$AA@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_0BD@CHKG@Card?5Voltage?3?55v?4?6?$AA@| DCB "Card Voltage: 5v.", 0xa
DCB 0x0 ; `string'
; Function compile flags: /Ogsy
00000 AREA |.text| { |detectVolts| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 |detectVolts| PROC
; 231 : {
00000 e52de004 str lr, [sp, #-4]!
00004 |$M36713|
; 232 : ULONG ulVS;
; 233 :
; 234 : // *PCMCIA_PCCONFIG = PCMCIA_PCCONFIG_VSEN | PCMCIA_PCCONFIG_VS2 | PCMCIA_PCCONFIG_VS1;
; 235 : *GPIO_PFDR = GPIOF_PCMCIA_VS1 | GPIOF_PCMCIA_VS2;
00004 e59f108c ldr r1, [pc, #0x8C]
00008 e3a000a0 mov r0, #0xA0
0000c e5810000 str r0, [r1]
; 236 :
; 237 : ulVS = *GPIO_PFDR &( GPIOF_PCMCIA_CD1 | GPIOF_PCMCIA_CD2 |
; 238 : GPIOF_PCMCIA_VS1 | GPIOF_PCMCIA_VS2);
00010 e5910000 ldr r0, [r1]
00014 e20010a6 and r1, r0, #0xA6
; 239 :
; 240 :
; 241 : //if(*PCMCIA_PCCONFIG & (PCMCIA_PCCONFIG_MCD2 | PCMCIA_PCCONFIG_MCD1))
; 242 : if(ulVS &( GPIOF_PCMCIA_CD1 | GPIOF_PCMCIA_CD2))
00018 e3110006 tst r1, #6
; 243 : {
; 244 : EdbgOutputDebugString("Card Voltage: Card bus, Unsupported card.\n");
0001c 159f0070 ldrne r0, [pc, #0x70]
00020 1a000005 bne |$L36711|
; 245 : return 0;
; 246 : }
; 247 :
; 248 : //ulVS = *PCMCIA_PCCONFIG & (PCMCIA_PCCONFIG_VS2FBK | PCMCIA_PCCONFIG_VS1FBK);
; 249 :
; 250 : else if(ulVS == 0)
00024 e3510000 cmp r1, #0
; 251 : {
; 252 : EdbgOutputDebugString("Card Voltage: x.x 3.3v and 5v Card.\n");
00028 059f0060 ldreq r0, [pc, #0x60]
0002c 0a000009 beq |$L36712|
; 253 : return 33;
; 254 : }
; 255 : else if (ulVS == GPIOF_PCMCIA_VS1)
00030 e3510020 cmp r1, #0x20
00034 1a000004 bne |$L36605|
; 256 : {
; 257 : EdbgOutputDebugString("Card Voltage: x.xv (Not supported).\n");
00038 e59f004c ldr r0, [pc, #0x4C]
0003c |$L36711|
0003c eb000000 bl EdbgOutputDebugString
00040 |$L36611|
; 269 : }
; 270 :
; 271 : return 0;
00040 e3a00000 mov r0, #0
; 272 :
; 273 : }
00044 e8bd4000 ldmia sp!, {lr}
00048 e12fff1e bx lr
0004c |$L36605|
; 258 : return 0;
; 259 : }
; 260 : else if (ulVS == GPIOF_PCMCIA_VS2)
0004c e3510080 cmp r1, #0x80
00050 1a000004 bne |$L36608|
; 261 : {
; 262 : EdbgOutputDebugString("Card Voltage: 3.3v.\n");
00054 e59f002c ldr r0, [pc, #0x2C]
00058 |$L36712|
00058 eb000000 bl EdbgOutputDebugString
; 263 : return 33;
0005c e3a00021 mov r0, #0x21
; 272 :
; 273 : }
00060 e8bd4000 ldmia sp!, {lr}
00064 e12fff1e bx lr
00068 |$L36608|
; 264 : }
; 265 : else if (ulVS == (GPIOF_PCMCIA_VS1 | GPIOF_PCMCIA_VS2))
00068 e35100a0 cmp r1, #0xA0
0006c 1afffff3 bne |$L36611|
; 266 : {
; 267 : EdbgOutputDebugString("Card Voltage: 5v.\n");
00070 e59f000c ldr r0, [pc, #0xC]
00074 eb000000 bl EdbgOutputDebugString
; 268 : return 50;
00078 e3a00032 mov r0, #0x32
; 272 :
; 273 : }
0007c e8bd4000 ldmia sp!, {lr}
00080 e12fff1e bx lr
00084 |$L36717|
00084 00000000 DCD |??_C@_0BD@CHKG@Card?5Voltage?3?55v?4?6?$AA@|
00088 00000000 DCD |??_C@_0BF@FGK@Card?5Voltage?3?53?43v?4?6?$AA@|
0008c 00000000 DCD |??_C@_0CF@PPOK@Card?5Voltage?3?5x?4xv?5?$CINot?5supporte@|
00090 00000000 DCD |??_C@_0CF@LIEA@Card?5Voltage?3?5x?4x?53?43v?5and?55v?5Ca@|
00094 00000000 DCD |??_C@_0CL@CONH@Card?5Voltage?3?5Card?5bus?0?5Unsuppor@|
00098 80840030 DCD 0x80840030
0009c |$M36714|
ENDP ; |detectVolts|
00000 AREA |.text| { |CalculatePcmciaTimings| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 AREA |.pdata$$CalculatePcmciaTimings|, PDATA, SELECTION=5, ASSOC=|.text| { |CalculatePcmciaTimings| } ; comdat associative
|$T36735| DCD |CalculatePcmciaTimings|
DCD 0x40003f01
; Function compile flags: /Ogsy
00000 AREA |.text| { |CalculatePcmciaTimings| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 |CalculatePcmciaTimings| PROC
; 307 : {
00000 e92d40f0 stmdb sp!, {r4 - r7, lr}
00004 |$M36733|
; 308 : ULONG ulAddressTime;
; 309 : ULONG ulHoldTime;
; 310 : ULONG ulAccessTime;
; 311 : ULONG ulSMC;
; 312 : //ULONG ulHCLK = REAL_HCLOCK;
; 313 : ULONG ulHCLK = 92000000;
; 314 : ULONG ulHPeriod;
; 315 : ULONG ulHAccessTime;
; 316 : ULONG ulHAddressTime;
; 317 : ULONG ulHHoldTime;
; 318 :
; 319 : switch(NsSpeed)
; 320 : {
00004 e3a0700f mov r7, #0xF
00008 e3500000 cmp r0, #0
0000c 0a00001d beq |$L36636|
00010 e3500064 cmp r0, #0x64
00014 0a000017 beq |$L36635|
00018 e3500096 cmp r0, #0x96
0001c 0a000010 beq |$L36634|
00020 e35000c8 cmp r0, #0xC8
00024 0a00000c beq |$L36633|
00028 e35000fa cmp r0, #0xFA
0002c 0a000007 beq |$L36632|
00030 e3500f4b cmp r0, #0x4B, 30
; 321 : case 600:
; 322 : default:
; 323 : ulAccessTime = 600;
00034 13a05f96 movne r5, #0x96, 30
; 324 : ulAddressTime = 100;
00038 13a01064 movne r1, #0x64
; 325 : ulHoldTime = 35;
0003c 13a02023 movne r2, #0x23
00040 1a000013 bne |$L36627|
; 326 : break;
; 327 :
; 328 : case 300:
; 329 : ulAccessTime = 300;
00044 e3a05f4b mov r5, #0x4B, 30
; 336 : ulAddressTime = 30;
00048 e3a0101e mov r1, #0x1E
; 337 : ulHoldTime = 20;
; 338 : break;
0004c ea00000f b |$L36730|
00050 |$L36632|
; 330 : ulAddressTime = 30;
; 331 : ulHoldTime = 20;
; 332 : break;
; 333 :
; 334 : case 250:
; 335 : ulAccessTime = 250;
00050 e3a050fa mov r5, #0xFA
; 336 : ulAddressTime = 30;
00054 e3a0101e mov r1, #0x1E
; 337 : ulHoldTime = 20;
; 338 : break;
00058 ea00000c b |$L36730|
0005c |$L36633|
; 339 :
; 340 : case 200:
; 341 : ulAccessTime = 200;
0005c e3a050c8 mov r5, #0xC8
; 342 : ulAddressTime = 20;
; 343 : ulHoldTime = 20;
; 344 : break;
00060 ea000000 b |$L36732|
00064 |$L36634|
; 345 :
; 346 : case 150:
; 347 : ulAccessTime = 150;
00064 e3a05096 mov r5, #0x96
00068 |$L36732|
; 348 : ulAddressTime = 20;
00068 e3a00014 mov r0, #0x14
0006c e1a01000 mov r1, r0
; 349 : ulHoldTime = 20;
00070 e1a02000 mov r2, r0
; 350 : break;
00074 ea000006 b |$L36627|
00078 |$L36635|
; 351 :
; 352 : case 100:
; 353 : ulAccessTime = 100;
00078 e3a05064 mov r5, #0x64
; 354 : ulAddressTime = 10;
0007c e3a0100a mov r1, #0xA
; 355 : ulHoldTime = 15;
00080 e1a02007 mov r2, r7
; 356 : break;
00084 ea000002 b |$L36627|
00088 |$L36636|
; 357 :
; 358 : //
; 359 : // Special case for I/O all access.
; 360 : //
; 361 : case 0:
; 362 : ulAccessTime = 165;
00088 e3a050a5 mov r5, #0xA5
; 363 : ulAddressTime = 70;
0008c e3a01046 mov r1, #0x46
00090 |$L36730|
; 364 : ulHoldTime = 20;
00090 e3a02014 mov r2, #0x14
00094 |$L36627|
; 365 : break;
; 366 : }
; 367 :
; 368 : //
; 369 : // Add in a board delay.
; 370 : //
; 371 : ulAccessTime += PCMCIA_BOARD_DELAY;
; 372 : ulAddressTime += PCMCIA_BOARD_DELAY;
00094 e2813028 add r3, r1, #0x28
; 373 : ulHoldTime += PCMCIA_BOARD_DELAY;
; 374 :
; 375 : //
; 376 : // This gives us the period in nanosecods.
; 377 : //
; 378 : // = 1000000000 (ns/s) / HCLK (cycle/s)
; 379 : //
; 380 : // = (ns/cycle)
; 381 : //
; 382 : ulHPeriod = (1000000000/ ulHCLK);
; 383 :
; 384 : //
; 385 : // Find the number of hclk cycles for cycle time, address time and
; 386 : // hold time.
; 387 : //
; 388 : // = ulAccessTime (ns) / ulHPeriod (ns/Cycles)
; 389 : // = ulAddressTime (ns) / ulHPeriod (ns/Cycles)
; 390 : // = ulHoldTime (ns) / ulHPeriod (ns/Cycles)
; 391 : //
; 392 : ulHAccessTime = ulAccessTime / ulHPeriod;
00098 e59f6058 ldr r6, [pc, #0x58]
0009c e2851028 add r1, r5, #0x28
000a0 e2824028 add r4, r2, #0x28
000a4 e0820691 umull r0, r2, r1, r6
; 393 : if(ulHAccessTime > 0xFF)
; 394 : ulHAccessTime = 0xFF;
; 395 :
; 396 : ulHAddressTime = ulAddressTime / ulHPeriod;
000a8 e0810693 umull r0, r1, r3, r6
000ac e1a051a2 mov r5, r2, lsr #3
000b0 e3a020ff mov r2, #0xFF
000b4 e1a031a1 mov r3, r1, lsr #3
; 397 : if(ulHAddressTime > 0xFF)
; 398 : ulHAddressTime = 0xFF;
; 399 :
; 400 : ulHHoldTime = (ulHoldTime /ulHPeriod) + 1;
000b8 e0810694 umull r0, r1, r4, r6
000bc e35500ff cmp r5, #0xFF
000c0 81a05002 movhi r5, r2
000c4 e35300ff cmp r3, #0xFF
000c8 e1a001a1 mov r0, r1, lsr #3
000cc 81a03002 movhi r3, r2
000d0 e2802001 add r2, r0, #1
; 401 : if(ulHHoldTime >0xF)
000d4 e352000f cmp r2, #0xF
; 402 : ulHHoldTime = 0xF;
000d8 81a02007 movhi r2, r7
; 403 :
; 404 : ulSMC = (PCCONFIG_ADDRESSTIME_MASK & (ulHAddressTime << PCCONFIG_ADDRESSTIME_SHIFT)) |
; 405 : (PCCONFIG_HOLDTIME_MASK & (ulHHoldTime << PCCONFIG_HOLDTIME_SHIFT)) |
; 406 : (PCCONFIG_ACCESSTIME_MASK & (ulHAccessTime << PCCONFIG_ACCESSTIME_SHIFT)) ;
; 407 :
; 408 : return ulSMC;
000dc e20510ff and r1, r5, #0xFF
000e0 e202000f and r0, r2, #0xF
000e4 e1802401 orr r2, r0, r1, lsl #8
000e8 e20310ff and r1, r3, #0xFF
000ec e1810402 orr r0, r1, r2, lsl #8
; 409 : }
000f0 e8bd40f0 ldmia sp!, {r4 - r7, lr}
000f4 e12fff1e bx lr
000f8 |$L36737|
000f8 cccccccd DCD 0xcccccccd
000fc |$M36734|
ENDP ; |CalculatePcmciaTimings|
END
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -