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

📄 eeinfo.cod

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

	TTL	d:\wince420\platform\ep931x\kernel\hal\.\eeinfo.c
	CODE32

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


  00000			 AREA	 |.data|, DATA
	 COMMON	|gBoardInformation|, 0x20

	 COMMON	|gBoardInformationValid|, 0x4

	 COMMON	|pTemp|, 0x2000


  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	|GetBoardInformation|
	EXPORT	|??_C@_0BJ@PHBE@EEINFO?3?5EEInformation?4?$AN?6?$AA@| [ DATA ] ; `string'
	EXPORT	|??_C@_0BP@GPE@EEINFO?3?50x?$CFx?50x?$CFx?50x?$CFx?50x?$CFx?4?$AN?6?$AA@| [ DATA ] ; `string'
	EXPORT	|??_C@_04NLK@EMAC?$AA@| [ DATA ]	; `string'
	EXPORT	|??_C@_0CD@BBNB@EEINFO?3?5SPI?5Device?5Not?5detected?4@| [ DATA ] ; `string'
	IMPORT	|memset|
	IMPORT	|memcmp|
	IMPORT	|EdbgOutputDebugString|
; File d:\wince420\platform\ep931x\kernel\hal\eeinfo.c

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

  00000			 AREA	 |.pdata$$GetBoardInformation|, PDATA, SELECTION=5, ASSOC=|.text| { |GetBoardInformation| } ; comdat associative
|$T13992| DCD	|GetBoardInformation|
	DCD	0x40004c02

  00000			 AREA	 |.rdata| { |??_C@_0BJ@PHBE@EEINFO?3?5EEInformation?4?$AN?6?$AA@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_0BJ@PHBE@EEINFO?3?5EEInformation?4?$AN?6?$AA@| DCB "EEINFO: EEInfo"
	DCB	"rmation.", 0xd, 0xa, 0x0		; `string'

  00000			 AREA	 |.rdata| { |??_C@_0BP@GPE@EEINFO?3?50x?$CFx?50x?$CFx?50x?$CFx?50x?$CFx?4?$AN?6?$AA@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_0BP@GPE@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@_04NLK@EMAC?$AA@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_04NLK@EMAC?$AA@| DCB "EMAC", 0x0			; `string'

  00000			 AREA	 |.rdata| { |??_C@_0CD@BBNB@EEINFO?3?5SPI?5Device?5Not?5detected?4@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_0CD@BBNB@EEINFO?3?5SPI?5Device?5Not?5detected?4@| DCB "EEINFO: SPI"
	DCB	" Device Not detected.", 0xd, 0xa, 0x0	; `string'
; Function compile flags: /Ogsy

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

  00000		 |GetBoardInformation| PROC

; 74   : {

  00000	e92d4030	 stmdb     sp!, {r4, r5, lr}
  00004	e24dd004	 sub       sp, sp, #4
  00008		 |$M13990|

; 75   :     BOOL    bRet;
; 76   :     PULONG   pul;
; 77   :     PUCHAR  puc;
; 78   :     ULONG   ulTemp;
; 79   :     // int     x;
; 80   : 
; 81   :     //
; 82   :     // Initialize the board information structure.
; 83   :     //
; 84   :     memset(&gBoardInformation, 0, sizeof(BOARD_INFO));

  00008	e59f511c	 ldr       r5, [pc, #0x11C]
  0000c	e3a02020	 mov       r2, #0x20
  00010	e3a01000	 mov       r1, #0
  00014	e1a00005	 mov       r0, r5
  00018	eb000000	 bl        memset

; 85   :     
; 86   :     //
; 87   :     // Initialize the SPI device for reading the EEPROM.
; 88   :     //
; 89   :     InitializeSPI();

  0001c	eb000000	 bl        InitializeSPI

; 90   : 
; 91   :     //
; 92   :     // Test the SPI device to make sure that it is an ATMEL
; 93   :     //
; 94   :     bRet =  TestSPI();

  00020	eb000000	 bl        TestSPI

; 95   :     if(bRet)

  00024	e3500000	 cmp       r0, #0
  00028	0a000030	 beq       |$L13811|

; 96   :     {
; 97   : 
; 98   :         // bRet = ReadEEWord(0, 0x2000, pTemp);
; 99   :         // for(x = 0; x<0x2000; x++)
; 100  :         // {
; 101  :         //     if(x%16 == 0)
; 102  :         //    {
; 103  :         //        EdbgOutputDebugString("0x%x  :",x);
; 104  :         //    }
; 105  :         //    EdbgOutputDebugString("0x%x ",(ULONG)pTemp[x]);
; 106  :         //
; 107  :         //    if(x%16 == 15)
; 108  :         //    {
; 109  :         //        EdbgOutputDebugString("\r\n");
; 110  :         //    }
; 111  :         // }
; 112  : 
; 113  :         bRet =  ReadEEWord(0x1000, sizeof(BOARD_INFO), (PCHAR) &gBoardInformation);

  0002c	e1a02005	 mov       r2, r5
  00030	e3a01020	 mov       r1, #0x20
  00034	e3a00a01	 mov       r0, #1, 20
  00038	eb000000	 bl        ReadEEWord
  0003c	e1a04000	 mov       r4, r0

; 114  :         pul = (PULONG) &gBoardInformation;
; 115  : 
; 116  :         puc = (unsigned char *)pul;
; 117  :         EdbgOutputDebugString("EEINFO: EEInformation.\r\n");

  00040	e59f00e0	 ldr       r0, [pc, #0xE0]
  00044	eb000000	 bl        EdbgOutputDebugString

; 118  :         EdbgOutputDebugString("EEINFO: 0x%x 0x%x 0x%x 0x%x.\r\n", (ULONG) puc[0],  (ULONG) puc[1],  (ULONG) puc[2],  (ULONG) puc[3]);

  00048	e5d53003	 ldrb      r3, [r5, #3]
  0004c	e5d52001	 ldrb      r2, [r5, #1]
  00050	e58d3000	 str       r3, [sp]
  00054	e5d53002	 ldrb      r3, [r5, #2]
  00058	e5d51000	 ldrb      r1, [r5]
  0005c	e59f00c0	 ldr       r0, [pc, #0xC0]
  00060	eb000000	 bl        EdbgOutputDebugString

; 119  :         EdbgOutputDebugString("EEINFO: 0x%x 0x%x 0x%x 0x%x.\r\n", (ULONG) puc[4],  (ULONG) puc[5],  (ULONG) puc[6],  (ULONG) puc[7]);

  00064	e5d53007	 ldrb      r3, [r5, #7]
  00068	e5d52005	 ldrb      r2, [r5, #5]
  0006c	e58d3000	 str       r3, [sp]
  00070	e5d53006	 ldrb      r3, [r5, #6]
  00074	e5d51004	 ldrb      r1, [r5, #4]
  00078	e59f00a4	 ldr       r0, [pc, #0xA4]
  0007c	eb000000	 bl        EdbgOutputDebugString

; 120  :         EdbgOutputDebugString("EEINFO: 0x%x 0x%x 0x%x 0x%x.\r\n", (ULONG) puc[8],  (ULONG) puc[9],  (ULONG) puc[10], (ULONG) puc[11]);

  00080	e5d5300b	 ldrb      r3, [r5, #0xB]
  00084	e5d52009	 ldrb      r2, [r5, #9]
  00088	e58d3000	 str       r3, [sp]
  0008c	e5d5300a	 ldrb      r3, [r5, #0xA]
  00090	e5d51008	 ldrb      r1, [r5, #8]
  00094	e59f0088	 ldr       r0, [pc, #0x88]
  00098	eb000000	 bl        EdbgOutputDebugString

; 121  :         EdbgOutputDebugString("EEINFO: 0x%x 0x%x 0x%x 0x%x.\r\n", (ULONG) puc[12], (ULONG) puc[13], (ULONG) puc[14], (ULONG) puc[15]);

  0009c	e5d5300f	 ldrb      r3, [r5, #0xF]
  000a0	e5d5200d	 ldrb      r2, [r5, #0xD]
  000a4	e58d3000	 str       r3, [sp]
  000a8	e5d5300e	 ldrb      r3, [r5, #0xE]
  000ac	e5d5100c	 ldrb      r1, [r5, #0xC]
  000b0	e59f006c	 ldr       r0, [pc, #0x6C]
  000b4	eb000000	 bl        EdbgOutputDebugString

; 122  : 
; 123  :         if(bRet && !memcmp(&gBoardInformation.strSignature,"EMAC", 4))

  000b8	e3540000	 cmp       r4, #0
  000bc	0a000009	 beq       |$L13834|
  000c0	e59f1058	 ldr       r1, [pc, #0x58]
  000c4	e3a02004	 mov       r2, #4
  000c8	e1a00005	 mov       r0, r5
  000cc	eb000000	 bl        memcmp
  000d0	e3500000	 cmp       r0, #0
  000d4	1a000003	 bne       |$L13834|

; 124  :         {
; 125  :             gBoardInformationValid = TRUE;

  000d8	e3a01001	 mov       r1, #1
  000dc		 |$L13989|
  000dc	e59f0038	 ldr       r0, [pc, #0x38]
  000e0	e5801000	 str       r1, [r0]

; 126  :         }
; 127  :         else

  000e4	ea000003	 b         |$L13837|
  000e8		 |$L13834|

; 128  :         {
; 129  :             gBoardInformationValid = FALSE;

  000e8	e3a01000	 mov       r1, #0

; 130  :         }
; 131  :     }
; 132  :     else

  000ec	eafffffa	 b         |$L13989|
  000f0		 |$L13811|

; 133  :     {
; 134  :         EdbgOutputDebugString("EEINFO: SPI Device Not detected.\r\n");

  000f0	e59f0020	 ldr       r0, [pc, #0x20]
  000f4	eb000000	 bl        EdbgOutputDebugString
  000f8		 |$L13837|

; 135  : 
; 136  :     }
; 137  : 
; 138  : 
; 139  :     //
; 140  :     //Set GPIO pins 7 to disable the frame line.
; 141  :     //
; 142  :     ulTemp = *GPIO_PADR;

  000f8	e3a0220b	 mov       r2, #0xB, 4
  000fc	e3822721	 orr       r2, r2, #0x21, 14
  00100	e5920000	 ldr       r0, [r2]

; 143  :     *GPIO_PADR = ulTemp | 0x80;

  00104	e3801080	 orr       r1, r0, #0x80
  00108	e5821000	 str       r1, [r2]

; 144  : }

  0010c	e28dd004	 add       sp, sp, #4
  00110	e8bd4030	 ldmia     sp!, {r4, r5, lr}
  00114	e12fff1e	 bx        lr
  00118		 |$L13994|
  00118	00000000	 DCD       |??_C@_0CD@BBNB@EEINFO?3?5SPI?5Device?5Not?5detected?4@|
  0011c	00000000	 DCD       |gBoardInformationValid|
  00120	00000000	 DCD       |??_C@_04NLK@EMAC?$AA@|
  00124	00000000	 DCD       |??_C@_0BP@GPE@EEINFO?3?50x?$CFx?50x?$CFx?50x?$CFx?50x?$CFx?4?$AN?6?$AA@|
  00128	00000000	 DCD       |??_C@_0BJ@PHBE@EEINFO?3?5EEInformation?4?$AN?6?$AA@|
  0012c	00000000	 DCD       |gBoardInformation|
  00130		 |$M13991|

			 ENDP  ; |GetBoardInformation|


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

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

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

  00000		 |InitializeSPI| PROC

; 153  : {

  00000		 |$M14001|

; 154  :     ULONG ulTemp;
; 155  : 
; 156  :     //
; 157  :     // Set GPIO Pins 12 and 14 as outputs.
; 158  :     //
; 159  :     ulTemp = *GPIO_PBDDR;

  00000	e59f2084	 ldr       r2, [pc, #0x84]

; 160  :     *GPIO_PBDDR = ulTemp | 0x50;
; 161  : 
; 162  :     //
; 163  :     // Set GPIO pins 12 and 14 to high to disable the keyboard.
; 164  :     //
; 165  :     ulTemp = *GPIO_PBDR;

  00004	e59f307c	 ldr       r3, [pc, #0x7C]
  00008	e5920000	 ldr       r0, [r2]
  0000c	e3801050	 orr       r1, r0, #0x50
  00010	e5821000	 str       r1, [r2]
  00014	e5930000	 ldr       r0, [r3]

; 166  :     *GPIO_PBDR = ulTemp | 0x50;
; 167  : 
; 168  :     //
; 169  :     // Set GPIO pins 7 as an output.
; 170  :     //
; 171  :     ulTemp = *GPIO_PADDR;

  00018	e59f2064	 ldr       r2, [pc, #0x64]
  0001c	e3801050	 orr       r1, r0, #0x50
  00020	e5831000	 str       r1, [r3]

; 172  :     *GPIO_PADDR = ulTemp | 0x80;
; 173  : 
; 174  :     //
; 175  :     // Clear GPIO pins 7 to enable the frame line.
; 176  :     //
; 177  :     ulTemp = *GPIO_PADR;

  00024	e3a0320b	 mov       r3, #0xB, 4
  00028	e5920000	 ldr       r0, [r2]
  0002c	e3833721	 orr       r3, r3, #0x21, 14
  00030	e3801080	 orr       r1, r0, #0x80
  00034	e5821000	 str       r1, [r2]

; 178  :     *GPIO_PADR = ulTemp & ~0x80;
; 179  : 
; 180  : 
; 181  :     //
; 182  :     // Program the CR0 register.
; 183  :     //        
; 184  :     *SPI_CR0 =  SPICR0_FRF_MOTOROLA | SPICR0_SPO |
; 185  :                 SPICR0_SPH | (8-1) | (SPICR0_SCR_MASK & 0x600);

  00038	e3a0220b	 mov       r2, #0xB, 4
  0003c	e5930000	 ldr       r0, [r3]
  00040	e382288a	 orr       r2, r2, #0x8A, 16
  00044	e3c01080	 bic       r1, r0, #0x80
  00048	e3a00d1b	 mov       r0, #0x1B, 26
  0004c	e5831000	 str       r1, [r3]
  00050	e3800007	 orr       r0, r0, #7

; 186  : 
; 187  :     //
; 188  :     // Program the predivisor register.  This will give us an 
; 189  :     // 14.7Mhz / ((6 +1) * 2) = Approx 1Mhz.
; 190  :     //
; 191  :     // The Max is 20Mhz for the AT25F1024. 
; 192  :     //
; 193  :     *SPI_CPSR = 2;

⌨️ 快捷键说明

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