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

📄 start-sa1110.s

📁 PXA250上的XBOOT
💻 S
字号:
;; $Id: start-sa1110.s,v 1.2 2003/03/26 12:14:33 telka Exp $;; Copyright (C) 2001, 2002 ETC s.r.o.;; This program is free software; you can redistribute it and/or; modify it under the terms of the GNU General Public License; as published by the Free Software Foundation; either version 2; of the License, or (at your option) any later version.;; This program is distributed in the hope that it will be useful,; but WITHOUT ANY WARRANTY; without even the implied warranty of; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the; GNU General Public License for more details.;; You should have received a copy of the GNU General Public License; along with this program; if not, write to the Free Software; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA; 02111-1307, USA.;; Written by Marcel Telka <marcel@telka.sk>, 2001, 2002.;	INCLUDE boardasm.h	IF CPU = "SA1110"	INCLUDE kxarm.hFLD_OFFSET	EQU	0xC000RAMIMAGE_OFFSET	EQU	0x0000RAMIMAGE_SIZE	EQU	0x8000STACK_OFFSET	EQU	0xA000; this code is executed on HW/SW reset (pc=0x00xxxxxx),; after relocation (pc=0xC0xxxxxx); or after initializing MMU (pc=0x8Cxxxxxx) (in progress); FIXME: jump to StartUp after init MMU	STARTUPTEXT	EXPORT	StartUpStartUp; check Flash or RAM execution	ands	r0, pc, #0xFF000000	bne	SkipLLSetup	; skipping low level setup; clear DH & PH bits in PSSR	mov	r1, #0x90000000	add	r1, r1, #0x00020000	mov	r2, #0x18	str	r2, [r1, #4]; switch CPU to 206.4 Mhz	mov	r1, #0x90000000	add	r1, r1, #0x20000	mov	r2, #0x0A	str	r2, [r1, #0x14]; setup memory	mov	r0, #0xA0000000	ldr	r1, =0x55555557		; MDCAS00	str	r1, [r0, #0x04]	ldr	r1, =0x55555555		; MDCAS01	str	r1, [r0, #0x08]	ldr	r1, =0x55555555		; MDCAS02	str	r1, [r0, #0x0C]	ldr	r1, =0x00300301		; MDREFR	str	r1, [r0, #0x1C]         	ldr	r1, =0x61546154		; MDCNFG	str	r1, [r0, #0x00]		IF BOARD = "EI370"	ldr	r1, =0x0000425A		; MSC0		ELSE	ldr	r1, =0x00004272		; MSC0		ENDIF	str	r1, [r0, #0x10];  Perform 8 reads from unenabled DRAM	mov	r1, #0xC0000000	ldr	r3, [r1]	ldr	r3, [r1]	ldr	r3, [r1]	ldr	r3, [r1]	ldr	r3, [r1]	ldr	r3, [r1]	ldr	r3, [r1]	ldr	r3, [r1]	ldr	r1, =0x61546155		; MDCNFG	str	r1, [r0, #0x00]; setup stack	ldr	sp, =0xC0000000 + STACK_OFFSET; relocate image	ldr	r0, =0xC0000000 + RAMIMAGE_OFFSET	; dest (RAM)	mov	r1, #0x00000000				; src (Flash)	mov	r2, #RAMIMAGE_SIZE			; count (32 kB)	mov	r4, r0					; save dest	IMPORT	memcpy	bl	memcpy; jump to StartUp	mov	pc, r4SkipLLSetup; create translation page table	ldr	r0, =0xC0000000	+ FLD_OFFSET	; TTB address	mov	r4, r0				; save TTB address	IMPORT	OEMAddressTable	ldr	r1, =OEMAddressTable	ldr	r2, =StartUp - 0x1000	sub	r1, r1, r2	IMPORT	CreatePageTables	bl	CreatePageTables; initialize & enable MMU	mov	r0, #0x70	mcr	p15, 0, r0, c7, c10, 4	; Drain write buffer	mcr	p15, 0, r0, c1, c0, 0	; All caches & buffers disabled (c1 in initial state)	mcr	p15, 0, r0, c7, c7, 0	; Flush caches (I + D)	mov	r0, #1	mcr	p15, 0, r0, c3, c0, 0	; access to domain 0 enabled	mcr	p15, 0, r4, c2, c0, 0	; TTB	mcr	p15, 0, r0, c8, c7, 0	; flush TLBs (I + D)		mov	r0, #0x0070		; bits 6:4 should always be 1	orr	r0, r0, #0x0001		; enable MMU	orr	r0, r0, #0x1000		; enable I cache	orr	r0, r0, #0x0008		; enable Write buffer	ldr	r1,=VirtualStart	nop	mcr	p15, 0, r0, c1, c0, 0	; enable MMU & caches	mov	pc, r1	nopVirtualStart; setup stack	ldr	sp, =0x8C000000 + STACK_OFFSET		IMPORT	main	b	main; Launch is needed by xboot (main) for jumping to downloaded image,; target physical address (LaunchAddr) is in r0	EXPORT	LaunchLaunch	ldr	r2, =PhysicalStart	mov	r3, #0x34000000	add	r2, r2, r3	; convert PhysicalStart to physical address		mov	r1, #0x0070	; disable MMU	mcr	p15, 0, r1, c1, c0, 0	nop	mov	pc, r2		; jump to PhysicalStart	nopPhysicalStart	mov	r2, #0x0	mcr	p15, 0, r2, c8, c7, 0	; flush TLBs (I + D)	mov	pc, r0	ENDIF	END

⌨️ 快捷键说明

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