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

📄 bootdevice.cod

📁 平台PXA270, Mobile6.0 这是270的mobile6.0的bootloader
💻 COD
📖 第 1 页 / 共 5 页
字号:
  00024	0a000026	 beq         |$L40849|

; 244  : 		return(FALSE);
; 245  : 
; 246  : 	dwStartAddr = OALVAtoPA((void *)dwStartAddr);

  00028	eb000000	 bl          OALVAtoPA
  0002c	e1a04000	 mov         r4, r0

; 247  : 
; 248  : 	// EdbgOutputDebugString("BootDevice_Read: Reading from flash address 0x%x to 0x%x (length=0x%x): ", dwStartAddr, (DWORD)pDataBuffer, dwLength);
; 249  : 
; 250  : 	Nor_FMD_GetInfo(&NorFlsInfo);

  00030	e28d0000	 add         r0, sp, #0
  00034	eb000000	 bl          Nor_FMD_GetInfo

; 251  : 
; 252  : 	// Compute sector address and length.
; 253  : 	SectorAddr = (dwStartAddr / NorFlsInfo.wDataBytesPerSector);

  00038	e1dd00be	 ldrh        r0, [sp, #0xE]
  0003c	e1a01004	 mov         r1, r4
  00040	eb000000	 bl          __rt_udiv
  00044	e1a04000	 mov         r4, r0

; 254  : 	dwNumSects = (dwLength / NorFlsInfo.wDataBytesPerSector);

  00048	e1dd00be	 ldrh        r0, [sp, #0xE]
  0004c	e1a01006	 mov         r1, r6
  00050	eb000000	 bl          __rt_udiv
  00054	e1a07001	 mov         r7, r1
  00058	e1b06000	 movs        r6, r0

; 255  : 	dwNumExtraBytes = (dwLength % NorFlsInfo.wDataBytesPerSector);
; 256  : 
; 257  : 	// NAND FMD only supports single-sector reads at the moment.
; 258  : 	while (dwNumSects--)

  0005c	0a00000c	 beq         |$L41200|
  00060		 |$L40852|

; 259  : 	{
; 260  : 		// Read the sector - if this fails ECC correction, we fail the whole read operation.
; 261  : 		if (!Nor_FMD_ReadSector(SectorAddr, pDataBuffer, NULL, 1))

  00060	e3a03001	 mov         r3, #1
  00064	e3a02000	 mov         r2, #0
  00068	e1a01005	 mov         r1, r5
  0006c	e1a00004	 mov         r0, r4
  00070	e2466001	 sub         r6, r6, #1
  00074	eb000000	 bl          Nor_FMD_ReadSector
  00078	e3500000	 cmp         r0, #0
  0007c	0a00000d	 beq         |$L41199|

; 262  : 		{
; 263  : 			EdbgOutputDebugString("\r\nFlashRead: found unexpected bad sector (0x%x).\r\n", SectorAddr);
; 264  : 			return(FALSE);
; 265  : 		}
; 266  : 
; 267  : 		++SectorAddr;
; 268  : 		pDataBuffer += NorFlsInfo.wDataBytesPerSector;

  00080	e1dd30be	 ldrh        r3, [sp, #0xE]
  00084	e2844001	 add         r4, r4, #1
  00088	e3560000	 cmp         r6, #0
  0008c	e0855003	 add         r5, r5, r3
  00090	1afffff2	 bne         |$L40852|
  00094		 |$L41200|

; 269  : 	}
; 270  : 
; 271  : 	if (dwNumExtraBytes)

  00094	e3570000	 cmp         r7, #0
  00098	0a000013	 beq         |$L40857|

; 272  : 	{
; 273  : 		if (!Nor_FMD_ReadSector(SectorAddr, SectBuff, NULL, 1))

  0009c	e3a03001	 mov         r3, #1
  000a0	e3a02000	 mov         r2, #0
  000a4	e28d1010	 add         r1, sp, #0x10
  000a8	e1a00004	 mov         r0, r4
  000ac	eb000000	 bl          Nor_FMD_ReadSector
  000b0	e3500000	 cmp         r0, #0
  000b4	1a000008	 bne         |$L40859|
  000b8		 |$L41199|

; 274  : 		{
; 275  : 			EdbgOutputDebugString("\r\nFlashRead: found unexpected bad sector (0x%x).\r\n", SectorAddr);

  000b8	e59f003c	 ldr         r0, [pc, #0x3C]
  000bc	e1a01004	 mov         r1, r4
  000c0	eb000000	 bl          EdbgOutputDebugString
  000c4		 |$L40849|
  000c4	e59d0210	 ldr         r0, [sp, #0x210]
  000c8	eb000000	 bl          __security_check_cookie
  000cc	e3a00000	 mov         r0, #0
  000d0		 |$L40842|

; 283  : }

  000d0	e28ddf85	 add         sp, sp, #0x85, 30
  000d4	e8bd40f0	 ldmia       sp!, {r4 - r7, lr}
  000d8	e12fff1e	 bx          lr
  000dc		 |$L40859|

; 276  : 			return(FALSE);
; 277  : 		}
; 278  : 		memcpy(pDataBuffer, SectBuff, dwNumExtraBytes);

  000dc	e1a02007	 mov         r2, r7
  000e0	e28d1010	 add         r1, sp, #0x10
  000e4	e1a00005	 mov         r0, r5
  000e8	eb000000	 bl          memcpy
  000ec		 |$L40857|

; 279  : 	}
; 280  : 
; 281  :     // EdbgOutputDebugString("BootDevice_Read Done.\r\n");
; 282  :     return(TRUE);

  000ec	e59d0210	 ldr         r0, [sp, #0x210]
  000f0	eb000000	 bl          __security_check_cookie
  000f4	e3a00001	 mov         r0, #1
  000f8	eafffff4	 b           |$L40842|
  000fc		 |$L41219|
  000fc	00000000	 DCD         |??_C@_0DD@KJNLLNOL@?$AN?6FlashRead?3?5found?5unexpected?5ba@|
  00100	00000000	 DCD         |__security_cookie|
  00104		 |$M41215|

			 ENDP  ; |BootDevice_Read|

	EXPORT	|DispNand|
	EXPORT	|??_C@_0CI@DMOFGEEB@?$DN?$DN?$DN?$DN?$DN?$DN?$DN?$DN?$DN?$DN?$DN?$DN?$DN?$DN?$DNINFO?$DN?$DN?$DN?$DN?$DN?$DN?$DN?$DN?$DN?$DN?$DN?$DN?$DN@| [ DATA ] ; `string'

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

  00000			 AREA	 |.pdata$$DispNand|, PDATA, SELECTION=5, ASSOC=|.text| { |DispNand| } ; comdat associative
|$T41233| DCD	|$L41232|
	DCD	0x40002101

  00000			 AREA	 |.rdata| { |??_C@_0CI@DMOFGEEB@?$DN?$DN?$DN?$DN?$DN?$DN?$DN?$DN?$DN?$DN?$DN?$DN?$DN?$DN?$DNINFO?$DN?$DN?$DN?$DN?$DN?$DN?$DN?$DN?$DN?$DN?$DN?$DN?$DN@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_0CI@DMOFGEEB@?$DN?$DN?$DN?$DN?$DN?$DN?$DN?$DN?$DN?$DN?$DN?$DN?$DN?$DN?$DNINFO?$DN?$DN?$DN?$DN?$DN?$DN?$DN?$DN?$DN?$DN?$DN?$DN?$DN@| DCB "="
	DCB	"==============INFO==================", 0xd, 0xa, 0x0 ; `string'
; Function compile flags: /Ogsy

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

  00000		 |DispNand| PROC

; 286  : {

  00000		 |$L41232|
  00000	e92d4070	 stmdb       sp!, {r4 - r6, lr}
  00004		 |$M41230|
  00004	e1a05001	 mov         r5, r1
  00008	e3500000	 cmp         r0, #0

; 287  : 	DWORD 	i;
; 288  : 	
; 289  : 	if(buff)

  0000c	0a00000a	 beq         |$L40870|

; 290  : 	{
; 291  : 		for(i = 0; i < 2048; i++)

  00010	e3a04000	 mov         r4, #0
  00014	e2406001	 sub         r6, r0, #1
  00018		 |$L40868|

; 292  : 		{
; 293  : 			EdbgOutputDebugString("%x ", buff[i]);

  00018	e2844001	 add         r4, r4, #1
  0001c	e7d61004	 ldrb        r1, [r6, +r4]
  00020	e59f0054	 ldr         r0, [pc, #0x54]
  00024	eb000000	 bl          EdbgOutputDebugString

; 294  : 			if((i + 1) % 8 == 0)

  00028	e3140007	 tst         r4, #7

; 295  : 				EdbgOutputDebugString("\r\n");

  0002c	059f0044	 ldreq       r0, [pc, #0x44]
  00030	0b000000	 bleq        EdbgOutputDebugString
  00034	e3540b02	 cmp         r4, #2, 22
  00038	3afffff6	 bcc         |$L40868|
  0003c		 |$L40870|

; 296  : 		}
; 297  : 	}
; 298  : 	
; 299  : 	if(info)

  0003c	e3550000	 cmp         r5, #0
  00040	0a00000a	 beq         |$L40872|

; 300  : 	{
; 301  : 		EdbgOutputDebugString("===============INFO==================\r\n");

  00044	e59f0034	 ldr         r0, [pc, #0x34]
  00048	eb000000	 bl          EdbgOutputDebugString

; 302  : 		for(i = 0; i < 8; i++)

  0004c	e3a04000	 mov         r4, #0
  00050		 |$L40874|

; 303  : 		{
; 304  : 			EdbgOutputDebugString("%x ", info[i]);

  00050	e7d41005	 ldrb        r1, [r4, +r5]
  00054	e59f0020	 ldr         r0, [pc, #0x20]
  00058	eb000000	 bl          EdbgOutputDebugString
  0005c	e2844001	 add         r4, r4, #1
  00060	e3540008	 cmp         r4, #8
  00064	3afffff9	 bcc         |$L40874|

; 305  : 		}
; 306  : 		EdbgOutputDebugString("\r\n");

  00068	e59f0008	 ldr         r0, [pc, #8]
  0006c	eb000000	 bl          EdbgOutputDebugString
  00070		 |$L40872|

; 307  : 	}
; 308  : }

  00070	e8bd4070	 ldmia       sp!, {r4 - r6, lr}
  00074	e12fff1e	 bx          lr
  00078		 |$L41235|
  00078	00000000	 DCD         |??_C@_02PCIJFNDE@?$AN?6?$AA@|
  0007c	00000000	 DCD         |??_C@_03IGDBGCKF@?$CFx?5?$AA@|
  00080	00000000	 DCD         |??_C@_0CI@DMOFGEEB@?$DN?$DN?$DN?$DN?$DN?$DN?$DN?$DN?$DN?$DN?$DN?$DN?$DN?$DN?$DNINFO?$DN?$DN?$DN?$DN?$DN?$DN?$DN?$DN?$DN?$DN?$DN?$DN?$DN@|
  00084		 |$M41231|

			 ENDP  ; |DispNand|

	EXPORT	|??_C@_0DE@LFNMJDDJ@Writing?50x?$CFx?5to?5flash?5address?50x@| [ DATA ] ; `string'
	EXPORT	|??_C@_0BE@CKIDBGFB@dwNumofSect?5?$DN?5?$CFd?4?$AN?6?$AA@| [ DATA ] ; `string'
	EXPORT	|??_C@_0BF@PHJKJMJN@dwNumofBlock?5?$DN?5?$CFd?4?$AN?6?$AA@| [ DATA ] ; `string'
	EXPORT	|??_C@_0BE@OILPIIKL@dwStartSect?5?$DN?5?$CFd?4?$AN?6?$AA@| [ DATA ] ; `string'
	EXPORT	|??_C@_0O@KNNNMCMC@?$CFd?5percent?4?$AN?6?$AA@| [ DATA ] ; `string'
	IMPORT	|Nand_FMD_GetInfo|
	IMPORT	|Nand_FMD_GetBlockStatus|
	IMPORT	|Nand_FMD_WriteSector|
	IMPORT	|Nand_FMD_EraseBlock|

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

  00000			 AREA	 |.pdata$$SecondaryDevice_Write|, PDATA, SELECTION=5, ASSOC=|.text| { |SecondaryDevice_Write| } ; comdat associative
|$T41257| DCD	|$L41256|
	DCD	0x40005e02

  00000			 AREA	 |.rdata| { |??_C@_0O@KNNNMCMC@?$CFd?5percent?4?$AN?6?$AA@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_0O@KNNNMCMC@?$CFd?5percent?4?$AN?6?$AA@| DCB "%d percent.", 0xd, 0xa
	DCB	0x0					; `string'

  00000			 AREA	 |.rdata| { |??_C@_0DE@LFNMJDDJ@Writing?50x?$CFx?5to?5flash?5address?50x@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_0DE@LFNMJDDJ@Writing?50x?$CFx?5to?5flash?5address?50x@| DCB "Writi"
	DCB	"ng 0x%x to flash address 0x%x (length=0x%x).", 0xd, 0xa, 0x0 ; `string'

  00000			 AREA	 |.rdata| { |??_C@_0BE@CKIDBGFB@dwNumofSect?5?$DN?5?$CFd?4?$AN?6?$AA@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_0BE@CKIDBGFB@dwNumofSect?5?$DN?5?$CFd?4?$AN?6?$AA@| DCB "dwNumofSe"
	DCB	"ct = %d.", 0xd, 0xa, 0x0		; `string'

  00000			 AREA	 |.rdata| { |??_C@_0BF@PHJKJMJN@dwNumofBlock?5?$DN?5?$CFd?4?$AN?6?$AA@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_0BF@PHJKJMJN@dwNumofBlock?5?$DN?5?$CFd?4?$AN?6?$AA@| DCB "dwNumofB"
	DCB	"lock = %d.", 0xd, 0xa, 0x0		; `string'

  00000			 AREA	 |.rdata| { |??_C@_0BE@OILPIIKL@dwStartSect?5?$DN?5?$CFd?4?$AN?6?$AA@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_0BE@OILPIIKL@dwStartSect?5?$DN?5?$CFd?4?$AN?6?$AA@| DCB "dwStartSe"
	DCB	"ct = %d.", 0xd, 0xa, 0x0		; `string'
; Function compile flags: /Ogsy

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

  00000		 |SecondaryDevice_Write| PROC

; 336  : {

  00000		 |$L41256|
  00000	e92d43f0	 stmdb       sp!, {r4 - r9, lr}
  00004	e24dd010	 sub         sp, sp, #0x10
  00008		 |$M41254|
  00008	e1a04002	 mov         r4, r2
  0000c	e1a09001	 mov         r9, r1
  00010	e1a05000	 mov         r5, r0

; 337  :     FlashInfo 	NandFlsInfo;
; 338  :     DWORD		dwNumofSect;
; 339  :     DWORD		dwStartSect;
; 340  :     DWORD		dwNumofBlock;
; 341  :     DWORD		dwStatus;
; 342  :     DWORD		i;
; 343  :     // BYTE	 	buff[2048], info[8];
; 344  :     // PSectorInfo	bpTempInfo;
; 345  : 
; 346  : 	EdbgOutputDebugString("Writing 0x%x to flash address 0x%x (length=0x%x).\r\n", (DWORD)pData, dwStartAddr, dwLength);

  00014	e59f0158	 ldr         r0, [pc, #0x158]
  00018	e1a03004	 mov         r3, r4
  0001c	e1a02005	 mov         r2, r5
  00020	eb000000	 bl          EdbgOutputDebugString

; 347  : 	Nand_FMD_GetInfo(&NandFlsInfo);

  00024	e28d0000	 add         r0, sp, #0
  00028	eb000000	 bl          Nand_FMD_GetInfo

; 348  : 	dwNumofSect = dwLength / (NandFlsInfo.wDataBytesPerSector + 8);

  0002c	e1dd30be	 ldrh        r3, [sp, #0xE]
  00030	e1a01004	 mov         r1, r4
  00034	e2830008	 add         r0, r3, #8
  00038	eb000000	 bl          __rt_udiv

; 349  : 	dwNumofBlock = dwLength / (NandFlsInfo.dwBytesPerBlock + 8 * NandFlsInfo.wSectorsPerBlock);

  0003c	e1dde0bc	 ldrh        lr, [sp, #0xC]
  00040	e59d3008	 ldr         r3, [sp, #8]
  00044	e1a06000	 mov         r6, r0
  00048	e1a01004	 mov         r1, r4
  0004c	e083018e	 add         r0, r3, lr, lsl #3
  00050	eb000000	 bl          __rt_udiv
  00054	e1a07000	 mov         r7, r0

; 350  : 	EdbgOutputDebugString("dwNumofSect = %d.\r\n", dwNumofSect);

  00058	e59f0110	 ldr         r0, [pc, #0x110]
  0005c	e1a01006	 mov         r1, r6
  00060	eb000000	 bl          EdbgOutputDebugString

; 351  : 	EdbgOutputDebugString("dwNumofBlock = %d.\r\n", dwNumofBlock);

  00064	e59f0100	 ldr         r0, [pc, #0x100]
  00068	e1a01007	 mov         r1, r7
  0006c	eb000000	 bl          EdbgOutputDebugString

; 352  : 	dwStartAddr = OALVAtoPA((void *)dwStartAddr);

  00070	e1a00005	 mov         r0, r5
  00074	eb000000	 bl          OALVAtoPA
  00078	e1a03000	 mov         r3, r0

; 353  : 	dwStartSect = (dwStartAddr - MAINSTONEII_BASE_PA_SECONDARY_FLASH) / NandFlsInfo.wDataBytesPerSector;

  0007c	e1dd00be	 ldrh        r0, [sp, #0xE]
  00080	e2431301	 sub         r1, r3, #1, 6
  00084	eb000000	 bl          __rt_udiv
  00088	e1a04000	 mov         r4, r0

; 354  : 	EdbgOutputDebugString("dwStartSect = %d.\r\n", dwStartSect);

  0008c	e59f00d4	 ldr         r0, [pc, #0xD4]
  00090	e1a01004	 mov         r1, r4
  00094	eb000000	 bl          EdbgOutputDebugString

; 355  : 	
; 356  : 	for(i = 0; i < dwNumofBlock; i++)

  00098	e3a05000	 mov         r5, #0
  0009c	e3570000	 cmp         r7, #0
  000a0	0a000007	 beq         |$L40914|
  000a4		 |$L40912|

⌨️ 快捷键说明

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