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

📄 startup.s

📁 arm4 driver for freescale imx35
💻 S
字号:
;
; Copyright (c) Microsoft Corporation.  All rights reserved.
;
;
; Use of this sample source code is subject to the terms of the Microsoft
; license agreement under which you licensed this sample source code. If
; you did not accept the terms of the license agreement, you are not
; authorized to use this sample source code. For the terms of the license,
; please see the license agreement between you and Microsoft or, if applicable,
; see the LICENSE.RTF on your install media or the root of your tools installation.
; THE SAMPLE SOURCE CODE IS PROVIDED "AS IS", WITH NO WARRANTIES.
;
; Portions Copyright (c) Texas Instruments.  All rights reserved. 
;
;------------------------------------------------------------------------------
;
;   File:  startup.s
;
;   Boot startup routine for OMAP5912 ArubaBoard.
;

        OPT   2             ; Disable listing 

        INCLUDE kxarm.h     ; This defines the WinCE/ARM Calling Sequence Specification

        INCLUDE bsp_cfg.inc
        INCLUDE omap5912.inc
        INCLUDE image_cfg.inc

        IMPORT  ArubaboardMain

        OPT   1             ; Reenable listing
        OPT   128           ; Disable listing of macro expansions


        ;---------------------------------------------------------------
        ;   Function:  StartUp
        ;---------------------------------------------------------------
        ;  This function is entry point to Windows CE EBOOT. It should be called
        ;  in state with deactivated MMU and disabled caches.


        STARTUPTEXT

        LEAF_ENTRY StartUp 

        mov     r1, pc			               ; Get pc+8
        sub	    r1, r1, #8			           ; Adjust to get load address
        mov     r10, r1				           ; Lets save our start address in r10 so we can pass it to the C main routine
	                        		           ; so that way we can act differently based on our starting address

        ; If we start from base of SDRAM then OMAP tools loaded us
        ; I had issues loading directly to high memory so we will just copy ourselves there like from flash
        ldr	    r0, =0x10001000
        cmp     r0, r10 			           ; Were we loaded into SDRAM via OMAP STH?
        beq     SkipCPUInit	                   ; If not we do not need to copy ouselves to SDRAM

        ; If we started from flash we must perform CPU init
        ldr	    r0, =0x0C002000
        cmp     r0, r10 			           ; Did we start from FLASH?
        bne     TransferControlToCRoutine

        ;---------------------------------------------------------------
        ;              'Start from Flash in CS3' case
        ;---------------------------------------------------------------
        ; Since we started from flash we can enter supervisor mode and perform required initialization


BSP_EMIFS_CFG_3      EQU     BSP_EMIFS_CFG_3_NOR
BSP_EMIFS_ACFG_3     EQU     BSP_EMIFS_ACFG_3_NOR   

        INCLUDE ..\startup\hwinit.s

SkipCPUInit
        ; Copy ourselves from NOR Flash or SDRAM (low memory)  to SDRAM (high memory)
        ldr	    r0, =0x10001000
        cmp     r0, r10 
        ldrne   r0, =IMAGE_EBOOT_NOR_PA
        ldreq   r0, =IMAGE_EBOOT_RAM_PA

        ldr     r1, =IMAGE_EBOOT_CODE_PA
        ldr     r2, =IMAGE_EBOOT_NOR_SIZE
10      ldr     r3, [r0], #4
        str     r3, [r1], #4
        subs    r2, r2, #4
        bne     %b10

TransferControlToCRoutine
        ldr     sp, =(IMAGE_EBOOT_STACK_PA + IMAGE_EBOOT_STACK_SIZE)
        mov     r0, r10				           ;pass bootstrap address to our C function
        ldr     r1, =ArubaboardMain
	    bx      r1

;------------------------------------------------------------------------------

        ; Include memory configuration file with g_oalAddressTable
        INCLUDE addrtab_cfg.inc

        ENTRY_END 

        END



⌨️ 快捷键说明

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