⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pcmciasupport.cod

📁 EP9315的BSP包(WINCE下的BSP,内有各种驱动的详细的代码)
💻 COD
📖 第 1 页 / 共 2 页
字号:
; Listing generated by Microsoft (R) Optimizing Compiler Version 12.20.9615 

	TTL	d:\wince420\platform\ep931x\eboot\.\pcmciasupport.c
	CODE32

  00000			 AREA	 |.drectve|, DRECTVE
	DCB	"-defaultlib:coredll.lib "
	DCB	"-defaultlib:corelibc.lib "


  00000			 AREA	 |.bss|, NOINIT
|Vcc|	%	0x1
|Vpp1|	%	0x1
|Vpp2|	%	0x1

  00000			 AREA	 |.rdata|, DATA, READONLY
|EdbgVendorIds| DCW 0x0
	DCW	0x0
	DCD	0x4033
	DCB	0x1
	DCB	"AD", 0x0
	DCW	0x1050
	DCW	0x940
	DCD	0x4005
	DCB	0x1
	DCB	"LS", 0x0
	DCW	0x1050
	DCW	0x940
	DCD	0x2078
	DCB	0x1
	DCB	"LS", 0x0
	DCW	0x10ec
	DCW	0x8029
	DCD	0xc0f0
	DCB	0x1
	DCB	"KS", 0x0
	DCW	0x10ec
	DCW	0x8129
	DCD	0x0
	DCB	0x4
	DCB	"RT", 0x0
	DCW	0x10ec
	DCW	0x8139
	DCD	0x900b
	DCB	0x4
	DCB	"RT", 0x0
	DCW	0x10ec
	DCW	0x8139
	DCD	0xd0c9
	DCB	0x4
	DCB	"RT", 0x0
	DCW	0x10ec
	DCW	0x8139
	DCD	0xe04c
	DCB	0x4
	DCB	"RT", 0x0
	DCW	0x1186
	DCW	0x1300
	DCD	0x50ba
	DCB	0x4
	DCB	"DL", 0x0
	DCW	0x100b
	DCW	0x20
	DCD	0xa0cc
	DCB	0x5
	DCB	"NG", 0x0
	DCW	0x10b7
	DCW	0x9050
	DCD	0x6008
	DCB	0x6
	DCB	"3C", 0x0
	DCW	0x10b7
	DCW	0x9200
	DCD	0x476
	DCB	0x6
	DCB	"3C", 0x0
	EXPORT	|OEMPCMCIAInitialize|
	IMPORT	|DelayInMsec|
; File d:\wince420\platform\ep931x\eboot\pcmciasupport.c

  00000			 AREA	 |.text| { |OEMPCMCIAInitialize| }, CODE, ARM, SELECTION=1 ; comdat noduplicate

  00000			 AREA	 |.pdata$$OEMPCMCIAInitialize|, PDATA, SELECTION=5, ASSOC=|.text| { |OEMPCMCIAInitialize| } ; comdat associative
|$T36688| DCD	|OEMPCMCIAInitialize|
	DCD	0x40004001
; Function compile flags: /Ogsy

  00000			 AREA	 |.text| { |OEMPCMCIAInitialize| }, CODE, ARM, SELECTION=1 ; comdat noduplicate

  00000		 |OEMPCMCIAInitialize| PROC

; 432  : {

  00000	e92d4030	 stmdb     sp!, {r4, r5, lr}
  00004		 |$M36686|

; 433  :     int iVolts;
; 434  :     int iReturnValue = 1;
; 435  :     //
; 436  :     // All other GPIO pins except WP..
; 437  :     //
; 438  :     *GPIO_PFDDR = GPIOF_PCMCIA_WP;

  00004	e59f00f0	 ldr       r0, [pc, #0xF0]

; 439  :     *GPIO_PFDR  = 0;        

  00008	e59f10e8	 ldr       r1, [pc, #0xE8]
  0000c	e3a04001	 mov       r4, #1
  00010	e3a05000	 mov       r5, #0
  00014	e5804000	 str       r4, [r0]
  00018	e5815000	 str       r5, [r1]

; 440  : 
; 441  : 
; 442  :     //
; 443  :     // Temporarily disable all PCMCIA interrupts.
; 444  :     //
; 445  :     *GPIO_INTENF    = 0;
; 446  : 
; 447  :     //
; 448  :     // Acknowlege any pending edge triggered PCMCIA interrupts.
; 449  :     //
; 450  :     *GPIO_FEOI      = 0xFF;

  0001c	e3a000ff	 mov       r0, #0xFF
  00020	e59f20cc	 ldr       r2, [pc, #0xCC]
  00024	e59f10c4	 ldr       r1, [pc, #0xC4]
  00028	e5825000	 str       r5, [r2]
  0002c	e5810000	 str       r0, [r1]

; 451  :     
; 452  :     //
; 453  :     // We want to make the  GPIOF_PCMCIA_IRQ pin level triggered.
; 454  :     // We don't care about any of the other bits in the register.
; 455  :     //
; 456  :     *GPIO_FINTTYPE1 = 0;

  00030	e59f10b4	 ldr       r1, [pc, #0xB4]

; 457  :     
; 458  :     //
; 459  :     // We want the GPIOF_PCMCIA to be triggered high.
; 460  :     //
; 461  :     //*GPIO_FINTTYPE2  = GPIOF_PCMCIA_IRQ;
; 462  : 
; 463  :     //
; 464  :     // We want the GPIOF_PCMCIA to be triggered low.
; 465  :     //
; 466  :     *GPIO_FINTTYPE2 = 0;

  00034	e59f00ac	 ldr       r0, [pc, #0xAC]
  00038	e5815000	 str       r5, [r1]

; 467  :     
; 468  :     //
; 469  :     // Enable the interrupt.
; 470  :     //
; 471  :     *GPIO_INTENF    = GPIOF_PCMCIA_IRQ;

  0003c	e3a01040	 mov       r1, #0x40
  00040	e5805000	 str       r5, [r0]
  00044	e5821000	 str       r1, [r2]

; 472  : 
; 473  :     //
; 474  :     // Detect the correct voltages.
; 475  :     //
; 476  :     iVolts = detectVolts();

  00048	eb000000	 bl        detectVolts
  0004c	e3500000	 cmp       r0, #0

; 477  : 
; 478  :     //
; 479  :     // Program the voltage to the PCMCIA card.
; 480  :     // 
; 481  :     if(iVolts )

  00050	0a00001c	 beq       |$L36651|

; 482  :     {
; 483  :         PowerPCCardWrite
; 484  :         (
; 485  :             iVolts,
; 486  :             0,
; 487  :             0
; 488  :         );

  00054	e3a02000	 mov       r2, #0
  00058	e3a01000	 mov       r1, #0
  0005c	e20000ff	 and       r0, r0, #0xFF
  00060	eb000000	 bl        PowerPCCardWrite

; 489  : 
; 490  :         //
; 491  :         // Set the enable and reset lines.
; 492  :         //   
; 493  :         *SMC_PCCONT |= PCCONT_PC1EN | PCCONT_PC1RST;

  00064	e59f5078	 ldr       r5, [pc, #0x78]
  00068	e5950000	 ldr       r0, [r5]
  0006c	e3801005	 orr       r1, r0, #5

; 494  :         DelayInMsec(600);

  00070	e3a00f96	 mov       r0, #0x96, 30
  00074	e5851000	 str       r1, [r5]
  00078	eb000000	 bl        DelayInMsec

; 495  :     
; 496  :         //
; 497  :         // Clear the reset line.
; 498  :         //    
; 499  :         *SMC_PCCONT &= ~PCCONT_PC1RST;

  0007c	e5953000	 ldr       r3, [r5]
  00080	e3c30004	 bic       r0, r3, #4
  00084	e5850000	 str       r0, [r5]

; 500  :         DelayInMsec(400);

  00088	e3a00e19	 mov       r0, #0x19, 28
  0008c	eb000000	 bl        DelayInMsec

; 501  : 
; 502  : 
; 503  :         //
; 504  :         // Initialize the SMC interface.  Rather than parse the pcmcia configuration space,
; 505  :         // just set the Attribute and memory timings to 600 ns and PCMCIA timing to I/O all 
; 506  :         // access.
; 507  :         //
; 508  :         *SMC_PCCONFIG_ATT1  = CalculatePcmciaTimings(300);

  00090	e3a00f4b	 mov       r0, #0x4B, 30
  00094	eb000000	 bl        CalculatePcmciaTimings
  00098	e59f1040	 ldr       r1, [pc, #0x40]
  0009c	e5810000	 str       r0, [r1]

; 509  :         *SMC_PCCONFIG_MEM1  = CalculatePcmciaTimings(300);

  000a0	e3a00f4b	 mov       r0, #0x4B, 30
  000a4	eb000000	 bl        CalculatePcmciaTimings
  000a8	e59f102c	 ldr       r1, [pc, #0x2C]
  000ac	e5810000	 str       r0, [r1]

; 510  :         *SMC_PCCONFIG_IO1   = CalculatePcmciaTimings(0 ) | PCCONFIG_MW_16BIT;

  000b0	e3a00000	 mov       r0, #0
  000b4	eb000000	 bl        CalculatePcmciaTimings
  000b8	e59f2018	 ldr       r2, [pc, #0x18]
  000bc	e3801102	 orr       r1, r0, #2, 2
  000c0	e5821000	 str       r1, [r2]

; 511  :         //*SMC_PCCONFIG_IO1   = CalculatePcmciaTimings(0 );
; 512  :     }
; 513  :     else

  000c4	ea000000	 b         |$L36657|
  000c8		 |$L36651|

; 514  :     {    
; 515  :         iReturnValue = 0;

  000c8	e1a04005	 mov       r4, r5
  000cc		 |$L36657|

; 516  :     }
; 517  : 
; 518  : 
; 519  :     return iReturnValue;

  000cc	e1a00004	 mov       r0, r4

; 520  : }

  000d0	e8bd4030	 ldmia     sp!, {r4, r5, lr}
  000d4	e12fff1e	 bx        lr
  000d8		 |$L36690|
  000d8	80080028	 DCD       0x80080028
  000dc	80080024	 DCD       0x80080024
  000e0	80080020	 DCD       0x80080020
  000e4	80080040	 DCD       0x80080040
  000e8	80840050	 DCD       0x80840050
  000ec	8084004c	 DCD       0x8084004c
  000f0	80840054	 DCD       0x80840054
  000f4	80840058	 DCD       0x80840058
  000f8	80840030	 DCD       0x80840030
  000fc	80840034	 DCD       0x80840034
  00100		 |$M36687|

			 ENDP  ; |OEMPCMCIAInitialize|

	IMPORT	|DelayInuSec|

  00000			 AREA	 |.text| { |PowerPCCardWrite| }, CODE, ARM, SELECTION=1 ; comdat noduplicate

  00000			 AREA	 |.pdata$$PowerPCCardWrite|, PDATA, SELECTION=5, ASSOC=|.text| { |PowerPCCardWrite| } ; comdat associative
|$T36704| DCD	|PowerPCCardWrite|
	DCD	0x40004901
; Function compile flags: /Ogsy

  00000			 AREA	 |.text| { |PowerPCCardWrite| }, CODE, ARM, SELECTION=1 ; comdat noduplicate

  00000		 |PowerPCCardWrite| PROC

; 86   : {    

  00000	e92d47f0	 stmdb     sp!, {r4 - r10, lr}
  00004		 |$M36702|
  00004	e1a03000	 mov       r3, r0

; 87   :     unsigned char retVal = 0;    // 0 = G_SUCCESS
; 88   :     ULONG         ulSwitchSettings;
; 89   :     int       i;
; 90   :     
; 91   :     
; 92   :     if(vccOut == 50)

  00008	e20300ff	 and       r0, r3, #0xFF
  0000c	e3500032	 cmp       r0, #0x32

; 93   :     {
; 94   :         //
; 95   :         // Configure PCMCIA for 5 Volts.
; 96   :         //
; 97   :         ulSwitchSettings = EE_ADDRESS |ENABLE | AVPP_0V | BVPP_0V |AVCC_5V | BVCC_0V;

  00010	03a05cab	 moveq     r5, #0xAB, 24
  00014	03855008	 orreq     r5, r5, #8
  00018	0a000006	 beq       |$L36574|

; 98   :     }
; 99   :     else if(vccOut ==33)

  0001c	e3500021	 cmp       r0, #0x21

; 100  :     {
; 101  :         //
; 102  :         // Configure PCMCIA for 3.3 Volts.
; 103  :         //
; 104  :         ulSwitchSettings = EE_ADDRESS | ENABLE | AVPP_0V | BVPP_0V |AVCC_33V | BVCC_0V;

  00020	03a05cab	 moveq     r5, #0xAB, 24
  00024	03855004	 orreq     r5, r5, #4
  00028	0a000002	 beq       |$L36574|

; 105  :     }
; 106  :     else if(vccOut == 0)

  0002c	e3500000	 cmp       r0, #0
  00030	1a000034	 bne       |$L36573|

; 107  :     {
; 108  :         //
; 109  :         // Configure PCMCIA for 0 Volts.
; 110  :         //
; 111  :         ulSwitchSettings = EE_ADDRESS | ENABLE | AVPP_0V | BVPP_0V |AVCC_0V | BVCC_0V;

  00034	e3a05cab	 mov       r5, #0xAB, 24
  00038		 |$L36574|

; 117  :     }
; 118  :         
; 119  :     //
; 120  :     // Update these variables while processing
; 121  :     //
; 122  :     Vcc = vccOut;      

  00038	e59f00e0	 ldr       r0, [pc, #0xE0]

; 123  :     Vpp1 = vpp1Out;
; 124  :     Vpp2 = vpp2Out;             
; 125  : 
; 126  :     //
; 127  :     // Turn on the power to the socket !!!
; 128  :     //
; 129  :     //  EECLK  -> Clock
; 130  :     //  EEDATA -> Data
; 131  :     //  SLA0   -> Latch
; 132  :     //*EEPROM_CONFIG   =  CONFIG_S0DIR;
; 133  :     //Sleep(20);
; 134  :     //*EEPROM_CONFIG   =  CONFIG_S0DIR | CONFIG_DDIR | CONFIG_CDIR ;
; 135  :     *GPIO_PGDDR         =  GPIOG_EECLK | GPIOG_EEDAT | GPIOG_SLA0;
; 136  :  
; 137  :     
; 138  :     //
; 139  :     // Clear all except EECLK
; 140  :     // 
; 141  :     //*EEPROM_DATA     = DATA_EECLK;
; 142  :     *GPIO_PGDR          = GPIOG_EECLK;

  0003c	e3a09001	 mov       r9, #1
  00040	e59fa0d4	 ldr       r10, [pc, #0xD4]
  00044	e5c01001	 strb      r1, [r0, #1]
  00048	e5c03000	 strb      r3, [r0]
  0004c	e5c02002	 strb      r2, [r0, #2]
  00050	e3a00007	 mov       r0, #7
  00054	e59f10bc	 ldr       r1, [pc, #0xBC]
  00058	e5810000	 str       r0, [r1]

; 143  : 
; 144  :     //
; 145  :     // Raise the clock.
; 146  :     //    
; 147  :     DelayInuSec(50);

  0005c	e3a00032	 mov       r0, #0x32
  00060	e58a9000	 str       r9, [r10]
  00064	eb000000	 bl        DelayInuSec

; 148  :     //*EEPROM_DATA     = 0;
; 149  :     *GPIO_PGDR          = 0;

  00068	e3a06000	 mov       r6, #0

; 150  :     DelayInuSec(50);

  0006c	e3a00032	 mov       r0, #0x32
  00070	e58a6000	 str       r6, [r10]
  00074	eb000000	 bl        DelayInuSec

; 151  : 
; 152  :     for (i=18; i>=0; --i)

  00078	e3a04012	 mov       r4, #0x12
  0007c	e3a07002	 mov       r7, #2
  00080	e3a08003	 mov       r8, #3
  00084		 |$L36578|

; 153  :     //for (i=9; i>=0; --i)
; 154  :     {
; 155  :         if((ulSwitchSettings >> i) & 1)

  00084	e1a00435	 mov       r0, r5, lsr r4
  00088	e3100001	 tst       r0, #1

; 156  :         {
; 157  :             //
; 158  :             // Put the data on the bus and lower the clock.
; 159  :             //
; 160  :             *GPIO_PGDR = GPIOG_EEDAT ;
; 161  :             DelayInuSec(50);

  0008c	e3a00032	 mov       r0, #0x32
  00090	0a000006	 beq       |$L36581|
  00094	e58a7000	 str       r7, [r10]
  00098	eb000000	 bl        DelayInuSec

; 162  :         
; 163  :             //
; 164  :             // Raise the clock to latch the data in.
; 165  :             //
; 166  :             //*EEPROM_DATA    = DATA_EECLK | DATA_EEDAT;
; 167  :             *GPIO_PGDR       = GPIOG_EECLK | GPIOG_EEDAT;
; 168  :             DelayInuSec(50);

  0009c	e3a00032	 mov       r0, #0x32
  000a0	e58a8000	 str       r8, [r10]
  000a4	eb000000	 bl        DelayInuSec

; 169  : 
; 170  :             //
; 171  :             // Lower the clock again.
; 172  :             //        
; 173  :             //*EEPROM_DATA     = DATA_EEDAT;
; 174  :             *GPIO_PGDR        = GPIOG_EEDAT;

  000a8	e58a7000	 str       r7, [r10]

; 175  :             DelayInuSec(50);
; 176  :         }
; 177  :         else            

  000ac	ea000005	 b         |$L36701|
  000b0		 |$L36581|

; 178  :         {
; 179  :             //
; 180  :             // Put the data on the bus and lower the clock.
; 181  :             //
; 182  :             //*EEPROM_DATA    = 0 ;
; 183  :             *GPIO_PGDR       = 0;

  000b0	e58a6000	 str       r6, [r10]

; 184  :             DelayInuSec(50);

  000b4	eb000000	 bl        DelayInuSec

; 185  :         
; 186  :             //
; 187  :             // Raise the clock to latch the data in.
; 188  :             //
; 189  :             //*EEPROM_DATA     = DATA_EECLK ;
; 190  :             *GPIO_PGDR       = GPIOG_EECLK ;
; 191  :             DelayInuSec(50);

  000b8	e3a00032	 mov       r0, #0x32
  000bc	e58a9000	 str       r9, [r10]
  000c0	eb000000	 bl        DelayInuSec

; 192  : 
; 193  :             //
; 194  :             // Lower the clock again.
; 195  :             //        
; 196  :             //*EEPROM_DATA     = 0;
; 197  :             *GPIO_PGDR       = 0 ;

  000c4	e58a6000	 str       r6, [r10]
  000c8		 |$L36701|

; 198  :             DelayInuSec(50);

  000c8	e3a00032	 mov       r0, #0x32
  000cc	eb000000	 bl        DelayInuSec

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -