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

📄 flash.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\.\flash.c
	CODE32

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


  00000			 AREA	 |.bss|, NOINIT
|pfnContinueErase| % 0x4
|pfnFinishErase| % 0x4
|pfnWriteFlash| % 0x4
|pfnStartErase| % 0x4

  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	|OEMIsFlashAddr|
; File d:\wince420\platform\ep931x\eboot\flash.c

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

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

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

  00000		 |OEMIsFlashAddr| PROC

; 48   : {

  00000		 |$M36710|

; 49   :     BOOL    bReturnValue = FALSE;

  00000	e3a01000	 mov       r1, #0

; 50   : 
; 51   :     if(PHYSICAL_ADDR_FLASH_INTEL <= dwAddr  &&
; 52   :         dwAddr < (PHYSICAL_ADDR_FLASH_INTEL + SIZE_FLASH_INTEL))

  00004	e3500206	 cmp       r0, #6, 4
  00008	3a000001	 bcc       |$L36584|
  0000c	e3500462	 cmp       r0, #0x62, 8

; 53   :     {
; 54   :         bReturnValue = TRUE;

  00010	33a01001	 movcc     r1, #1
  00014		 |$L36584|

; 55   :     }
; 56   :     
; 57   :     return bReturnValue;

  00014	e1a00001	 mov       r0, r1

; 58   : }

  00018	e12fff1e	 bx        lr
  0001c		 |$M36711|

			 ENDP  ; |OEMIsFlashAddr|

	EXPORT	|OEMMapMemAddr|

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

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

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

  00000		 |OEMMapMemAddr| PROC

; 81   : {

  00000	e92d4010	 stmdb     sp!, {r4, lr}
  00004		 |$M36720|
  00004	e1a04001	 mov       r4, r1

; 82   :     LPBYTE  pReturnValue;
; 83   : 
; 84   :     if(OEMIsFlashAddr(dwImageStart))

  00008	eb000000	 bl        OEMIsFlashAddr
  0000c	e3500000	 cmp       r0, #0

; 85   :     {
; 86   :         pReturnValue = (LPBYTE)( (dwAddr - FLASH_VIRTUAL_MEMORY) + FLASH_CACHE_PHYSICAL_MEMORY ); 

  00010	13a0045f	 movne     r0, #0x5F, 8
  00014	1380060e	 orrne     r0, r0, #0xE, 12
  00018	10440000	 subne     r0, r4, r0

; 98   :     }
; 99   : 
; 100  :     //EdbgOutputDebugString
; 101  :     //(
; 102  :     //    "OEMMapMemAddr: dwImageStart = 0x%x, dwAddr= 0x%x,  pReturnValue = 0x%x\n",
; 103  :     //    dwImageStart,
; 104  :     //    dwAddr,
; 105  :     //    (ULONG)pReturnValue
; 106  :     //);
; 107  :         
; 108  :     return pReturnValue; 
; 109  : }

  0001c	18bd4010	 ldmneia   sp!, {r4, lr}
  00020	112fff1e	 bxne      lr

; 87   :     }
; 88   :     //  
; 89   :     // Hack hack hack.  Looks like eboot thinks that this is the wrong address.
; 90   :     //
; 91   :     else if((0x80000000  < dwAddr) &&  (dwAddr < 0x84000000 ))

  00024	e3540102	 cmp       r4, #2, 2
  00028	9a000002	 bls       |$L36595|
  0002c	e3540321	 cmp       r4, #0x21, 6

; 92   :     {
; 93   :         pReturnValue = (LPBYTE)(dwAddr & 0x7FFFFFFF); 

  00030	e3c40102	 bic       r0, r4, #2, 2
  00034	3a000000	 bcc       |$L36597|
  00038		 |$L36595|

; 94   :     }
; 95   :     else
; 96   :     {
; 97   :         pReturnValue = (LPBYTE)(dwAddr); 

  00038	e1a00004	 mov       r0, r4
  0003c		 |$L36597|

; 98   :     }
; 99   : 
; 100  :     //EdbgOutputDebugString
; 101  :     //(
; 102  :     //    "OEMMapMemAddr: dwImageStart = 0x%x, dwAddr= 0x%x,  pReturnValue = 0x%x\n",
; 103  :     //    dwImageStart,
; 104  :     //    dwAddr,
; 105  :     //    (ULONG)pReturnValue
; 106  :     //);
; 107  :         
; 108  :     return pReturnValue; 
; 109  : }

  0003c	e8bd4010	 ldmia     sp!, {r4, lr}
  00040	e12fff1e	 bx        lr
  00044		 |$M36721|

			 ENDP  ; |OEMMapMemAddr|

	EXPORT	|OEMStartEraseFlash|
	EXPORT	|??_C@_0EC@BK@ERROR?3?5OEMStartEraseFlash?5?9?5not?5@| [ DATA ] ; `string'
	EXPORT	|??_C@_0FD@HMCL@ERROR?3?5OEMStartEraseFlash?5?9?5leng@| [ DATA ] ; `string'
	EXPORT	|??_C@_0DJ@BLGL@Erasing?5flash?5blocks?3?5start?5Addr@| [ DATA ] ; `string'
	IMPORT	|EdbgOutputDebugString|
	IMPORT	|StartEraseFlashJ3_2x16|
	IMPORT	|ContinueEraseFlashJ3_2x16|
	IMPORT	|FinishEraseFlashJ3_2x16|
	IMPORT	|WriteFlashJ3_2x16|

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

  00000			 AREA	 |.pdata$$OEMStartEraseFlash|, PDATA, SELECTION=5, ASSOC=|.text| { |OEMStartEraseFlash| } ; comdat associative
|$T36733| DCD	|OEMStartEraseFlash|
	DCD	0x40003901

  00000			 AREA	 |.rdata| { |??_C@_0FD@HMCL@ERROR?3?5OEMStartEraseFlash?5?9?5leng@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_0FD@HMCL@ERROR?3?5OEMStartEraseFlash?5?9?5leng@| DCB "ERROR: OEMSt"
	DCB	"artEraseFlash - length isn't an integral number of longw"
	DCB	"ords (0x%x).", 0xd, 0xa, 0x0		; `string'

  00000			 AREA	 |.rdata| { |??_C@_0DJ@BLGL@Erasing?5flash?5blocks?3?5start?5Addr@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_0DJ@BLGL@Erasing?5flash?5blocks?3?5start?5Addr@| DCB "Erasing flas"
	DCB	"h blocks: start Addr = 0x%x  length = 0x%x", 0xd, 0xa, 0x0 ; `string'

  00000			 AREA	 |.rdata| { |??_C@_0EC@BK@ERROR?3?5OEMStartEraseFlash?5?9?5not?5@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_0EC@BK@ERROR?3?5OEMStartEraseFlash?5?9?5not?5@| DCB "ERROR: OEMSta"
	DCB	"rtEraseFlash - not a flash address (0x%x or 0x%x).", 0xd
	DCB	0xa, 0x0				; `string'
; Function compile flags: /Ogsy

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

  00000		 |OEMStartEraseFlash| PROC

; 124  : {

  00000	e92d4070	 stmdb     sp!, {r4 - r6, lr}
  00004		 |$M36731|
  00004	e1a06000	 mov       r6, r0
  00008	e1a05001	 mov       r5, r1

; 125  : 
; 126  :     ULONG   i = 0;
; 127  :     ULONG   nNumBlocks = 0;
; 128  :     ULONG   ulSMC;
; 129  : 
; 130  :     //
; 131  :     // Make sure the start and end addresses are in flash.
; 132  :     //
; 133  :     if (!OEMIsFlashAddr(dwStartAddr) || !OEMIsFlashAddr(dwStartAddr + dwLength - 1))

  0000c	eb000000	 bl        OEMIsFlashAddr
  00010	e3500000	 cmp       r0, #0
  00014	0a000021	 beq       |$L36609|
  00018	e0860005	 add       r0, r6, r5
  0001c	e2400001	 sub       r0, r0, #1
  00020	eb000000	 bl        OEMIsFlashAddr
  00024	e3500000	 cmp       r0, #0
  00028	0a00001c	 beq       |$L36609|

; 142  :     }
; 143  : 
; 144  :     // 
; 145  :     // Make sure start address is block-aligned.
; 146  :     //
; 147  :     //if (dwStartAddr % FLASH_BLOCK_SIZE)
; 148  :     //{
; 149  :     //    EdbgOutputDebugString("ERROR: OEMStartEraseFlash - start address isn't block aligned (0x%x).\r\n", dwStartAddr);
; 150  :     //    return(FALSE);
; 151  :     //}
; 152  :     if (dwLength & 0x03)

  0002c	e3150003	 tst       r5, #3
  00030	0a000003	 beq       |$L36611|

; 153  :     {
; 154  :         EdbgOutputDebugString
; 155  :         (
; 156  :             "ERROR: OEMStartEraseFlash - length isn't an integral number of longwords (0x%x).\r\n",
; 157  :             dwLength
; 158  :         );

  00034	e59f00a4	 ldr       r0, [pc, #0xA4]
  00038	e1a01005	 mov       r1, r5
  0003c	eb000000	 bl        EdbgOutputDebugString

; 159  :         return(FALSE);

  00040	ea00001b	 b         |$L36730|
  00044		 |$L36611|

; 160  :     }
; 161  : 
; 162  :     EdbgOutputDebugString("Erasing flash blocks: start Addr = 0x%x  length = 0x%x\r\n", dwStartAddr, dwLength);

  00044	e59f0090	 ldr       r0, [pc, #0x90]
  00048	e1a02005	 mov       r2, r5
  0004c	e1a01006	 mov       r1, r6
  00050	eb000000	 bl        EdbgOutputDebugString

; 163  : 
; 164  :     //
; 165  :     // Clear the Flash write protect for chip select 6.
; 166  :     //
; 167  :     ulSMC        = *SMC_SMCBCR6;

  00054	e59f307c	 ldr       r3, [pc, #0x7C]

; 168  :     ulSMC       |= SMCBCR_WPERR; 
; 169  :     ulSMC       &= ~SMCBCR_WP;
; 170  :     *SMC_SMCBCR6 = ulSMC ;
; 171  : 
; 172  : 
; 173  :     //
; 174  :     // Fill in the pointers for the following.
; 175  :     //
; 176  :     pfnStartErase       = StartEraseFlashJ3_2x16;

  00058	e59f4074	 ldr       r4, [pc, #0x74]
  0005c	e5930000	 ldr       r0, [r3]
  00060	e3c01406	 bic       r1, r0, #6, 8
  00064	e59f0064	 ldr       r0, [pc, #0x64]
  00068	e3812402	 orr       r2, r1, #2, 8

; 177  :     pfnContinueErase    = ContinueEraseFlashJ3_2x16;

  0006c	e59f1058	 ldr       r1, [pc, #0x58]
  00070	e5832000	 str       r2, [r3]

; 178  :     pfnFinishErase      = FinishEraseFlashJ3_2x16;

  00074	e59f204c	 ldr       r2, [pc, #0x4C]

; 179  :     pfnWriteFlash       = WriteFlashJ3_2x16;

  00078	e59f3044	 ldr       r3, [pc, #0x44]
  0007c	e5840000	 str       r0, [r4]

; 180  : 
; 181  : 
; 182  :     return(pfnStartErase(dwStartAddr, dwLength));

  00080	e1a00006	 mov       r0, r6
  00084	e5841004	 str       r1, [r4, #4]
  00088	e1a01005	 mov       r1, r5
  0008c	e5842008	 str       r2, [r4, #8]
  00090	e584300c	 str       r3, [r4, #0xC]
  00094	eb000000	 bl        StartEraseFlashJ3_2x16

; 183  : }

  00098	e8bd4070	 ldmia     sp!, {r4 - r6, lr}
  0009c	e12fff1e	 bx        lr
  000a0		 |$L36609|

; 134  :     {
; 135  :         EdbgOutputDebugString
; 136  :         (
; 137  :             "ERROR: OEMStartEraseFlash - not a flash address (0x%x or 0x%x).\r\n", 
; 138  :             dwStartAddr, 
; 139  :             (dwStartAddr + dwLength - 1)
; 140  :         );

  000a0	e0860005	 add       r0, r6, r5
  000a4	e2402001	 sub       r2, r0, #1
  000a8	e59f0010	 ldr       r0, [pc, #0x10]
  000ac	e1a01006	 mov       r1, r6
  000b0	eb000000	 bl        EdbgOutputDebugString
  000b4		 |$L36730|

; 141  :         return(FALSE);

  000b4	e3a00000	 mov       r0, #0

; 183  : }

  000b8	e8bd4070	 ldmia     sp!, {r4 - r6, lr}
  000bc	e12fff1e	 bx        lr
  000c0		 |$L36735|
  000c0	00000000	 DCD       |??_C@_0EC@BK@ERROR?3?5OEMStartEraseFlash?5?9?5not?5@|
  000c4	00000000	 DCD       |WriteFlashJ3_2x16|
  000c8	00000000	 DCD       |FinishEraseFlashJ3_2x16|
  000cc	00000000	 DCD       |ContinueEraseFlashJ3_2x16|
  000d0	00000000	 DCD       |StartEraseFlashJ3_2x16|
  000d4	00000000	 DCD       |pfnStartErase|
  000d8	80080018	 DCD       0x80080018
  000dc	00000000	 DCD       |??_C@_0DJ@BLGL@Erasing?5flash?5blocks?3?5start?5Addr@|
  000e0	00000000	 DCD       |??_C@_0FD@HMCL@ERROR?3?5OEMStartEraseFlash?5?9?5leng@|
  000e4		 |$M36732|

			 ENDP  ; |OEMStartEraseFlash|

	EXPORT	|OEMContinueEraseFlash|

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

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

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

  00000		 |OEMContinueEraseFlash| PROC

; 192  : {

  00000	e52de004	 str       lr, [sp, #-4]!
  00004		 |$M36738|

; 193  : 
; 194  :     if(pfnContinueErase)

⌨️ 快捷键说明

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