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

📄 bl_one.s

📁 S3C2443Nandflash启动
💻 S
字号:
;/*********************************************************************
;* Project Name : S3C2443
;*
;* Copyright 2006 by Samsung Electronics, Inc.
;* All rights reserved.
;*
;* Project Description :
;* This software is only for verifying functions of the S3C2443
;* Anybody can use this code without our permission.
;**********************************************************************
;* Description	:	BootLoader1 for OneNAND boot buffer.
;*					It should be smaller than 1KB.
;*					Load the image from page 1 to 63 (126KB).
;*					So, downloaded image should be smaller than 126KB.
;*					And move it into DownloadAddress and then jump.
;*
;* History
;*		R0.0 (2006.06.07): Junon draft
;*			- This code is derived from S5I3000 code that Y.C.Kwon draft
;**********************************************************************/


				GET		Option.inc
				GET		2443addr.inc

			
				AREA    BL_ONE1,CODE,READONLY
				
				EXPORT	__main
				
__main			
				;** initializing several values
				mov		r5,#0x0004			;	read from page 1 and sector 0 in block 0

				ldr		r7,=DownloadAddress	;	download address

				ldr		r1,=0x001e400		;	'R1' indicate Start Buffer Register of OneNAND

				ldrh	r2,[r1,#0x42]		;	setting Config Register of OneNAND
				orr		r2,r2,#0x100
				strh	r2,[r1,#0x42]		;	ECC bypass operation

download_image								
				;** loop start point for uploading 126KB image
				ldr		r1,=0x001e400		;	'R1' reinitialize for loop
				sub		r0,r1,#0x0200		;	'R0' has OneNAND Start address 1

				mov		r3,#0				;	block 0
				strh	r3,[r0,#0x00]		;	Write 'DFS, FBA' of Flash

				strh	r5,[r0,#0x0e]		;	Write 'FPA, FSA' of Flash

				mov		r2,#0x0800			;	Load into DataBuffer0
				strh	r2,[r1,#0x00]		;	Write 'BSA, BSC' of DataRAM

				strh	r3,[r0,#0x02]		;	Select DataRAM for DDP as 0

				strh	r3,[r1,#0x82]		;	Write 0 to interrupt register

				strh	r3,[r1,#0x40]		;	Write 'Load' Command

wait_int_reg
				ldrh	r2,[r1,#0x82]
				tst		r2,#0x8000
				beq		wait_int_reg		;	Wait for INT register low to high transition

				mov		r6,#0x0000400		;	Address of DataBuffer0
				mov		r8,#0x40			;	Amount of move (64cnt * 8reg * 4B = 2KB)
move_page
				ldmia	r6!,{r0-r3,r9-r12}
				stmia	r7!,{r0-r3,r9-r12}	;	Copy the image from DataBuffer0 into destination.
				subs	r8,r8,#0x1
				bne		move_page

				add		r5,r5,#0x0004		;	Increase page number
				cmp		r5,#0x00fc			;	Repeat movement to page number 63 (126KB)
				blt		download_image
				;** loop end point for uploading 126KB image


				ldr		r0,=DownloadAddress
				mov		pc,r0				;	Jump to download start address

				LTORG


		        END

⌨️ 快捷键说明

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