📄 bootarm.s
字号:
;/*****************************************************************************
;* Copyright Statement:
;* --------------------
;* This software is protected by Copyright and the information contained
;* herein is confidential. The software may not be copied and the information
;* contained herein may not be used or disclosed except with the written
;* permission of MediaTek Inc. (C) 2005
;*
;* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
;* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
;* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
;* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
;* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
;* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
;* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
;* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
;* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
;* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
;* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
;* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
;*
;* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
;* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
;* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
;* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
;* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
;*
;* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
;* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
;* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
;* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
;* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
;*
;*****************************************************************************/
;
;/*****************************************************************************
; *
; * Filename:
; * ---------
; * bootarm.s
; *
; * Project:
; * --------
; * Maui_Software
; *
; * Description:
; * ------------
; * This Module defines the boot sequence of asm level.
; *
; * Author:
; * -------
; * Rex Luo (mtk00389)
; * Anthony Chin (mtk00276)
; *
; *============================================================================
; * HISTORY
; * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
; *------------------------------------------------------------------------------
; * $Revision: 1.38 $
; * $Modtime: Aug 15 2005 18:13:06 $
; * $Log: //mtkvs01/vmdata/Maui_sw/archives/mcu/init/src/bootarm.s-arc $
; *
; * Aug 7 2007 mtk01500
; * [MAUI_00530954] [System Service] Check in the feature of HW ID check
; *
; *
; * Aug 7 2007 mtk01500
; * [MAUI_00530954] [System Service] Check in the feature of HW ID check
; *
; *
; * Jul 7 2007 mtk01077
; * [MAUI_00413769] [INIT] adjust exception stack pointer to avoid corrupt neighbor global variable
; *
; *
; * May 10 2007 mtk01178
; * [MAUI_00387299] [New Chip Support][MT6230] add MT6230 support to bootarm.s
; * Add MT6230 support
; *
; * Apr 17 2007 mtk01077
; * [MAUI_00382952] [SST] Add System Stack , TIMER HISR Guard Pattern and Checking
; *
; *
; * Feb 12 2007 mtk00702
; * [MAUI_00346291] [init][Enhancement] Check IRQ disable duration
; * add LockIRQ() and refine DisableIRQ()
; *
; * Feb 6 2007 mtk01337
; * [MAUI_00361983] [NOR][FDM]Enhanced Single Bank NOR Flash Support
; * Add remapping definition for single bank support on MT6225.
; *
; * Feb 5 2007 mtk00702
; * [MAUI_00346291] [init][Enhancement] Check IRQ disable duration
; * merge SNORCODE section into INTERNCODE section
; *
; * Jan 29 2007 mtk01337
; * [MAUI_00361983] [NOR][FDM]Enhanced Single Bank NOR Flash Support
; * enhanced single bank NOR flash support phase in
; *
; * Jan 4 2007 mtk01587
; * [MAUI_00355761] [init][AddFeature] Dynamic switch stack
; * Remove the compiler option __SW_JPEG_CODEC_SUPPORT__
; *
; * Jan 2 2007 mtk01587
; * [MAUI_00355761] [init][AddFeature] Dynamic switch stack
; * Add compile option __SW_JPEG_CODEC_SUPPORT__
; *
; * Jan 2 2007 mtk01587
; * [MAUI_00355761] [init][AddFeature] Dynamic switch stack
; * Add INT_SwitchStackAndBranch()
; *
; * Dec 26 2006 mtk01178
; * [MAUI_00342696] [New Feature][FOTA] Add firmware update over the air feature
; * modify bootarm.s to support FOTA
; *
; * Dec 8 2006 mtk00702
; * [MAUI_00339559] [kal][AddFeature] THREADX porting
; * add dummy reference
; *
; * Dec 5 2006 mtk00681
; * [MAUI_00348640] [SST] Remove JTAG control compile option
; *
; *
; * Nov 27 2006 mtk00702
; * [MAUI_00346291] [init][Enhancement] Check IRQ disable duration
; * rename SaveAndSetIRQMask() and RestoreIRQMask() to DisableIRQ() and RestoreIRQ() respectively.
; *
; * Nov 6 2006 mtk00702
; * [MAUI_00339559] [kal][AddFeature] THREADX porting
; * add INT_GetCurrentSP()
; *
; * Oct 31 2006 mtk00702
; * [MAUI_00339559] [kal][AddFeature] THREADX porting
; * add threadx-related code
; *
; * Oct 24 2006 mtk00576
; * [MAUI_00338241] [Init][Bug Fixed]Enable SW JTAG ealier
; * Calling SST_DTLB_Init().
; *
; * Oct 23 2006 mtk01077
; * [MAUI_00337852] [INIT] independent stack pool for exception handling
; *
; *
; * Jul 9 2006 mtk01337
; * [MAUI_00208924] [SST][Enhancement] keep the sp used before abnormal reset
; * Save current sp value before INT_System_Reset_Check( )
;
; Rev 1.38 Aug 15 2005 18:19:58 mtk00576
; Assign SaveAndSetIRQMask and RestoreIRQMask to internal SRAM.
; Resolution for 12357: [INIT, CUSTOM][Add Feature] System site supports single bank NOR-flash solution
;
; Rev 1.37 Jul 28 2005 17:20:14 mtk00576
; Adding custom_setAdvEMI.
; Resolution for 12098: [Init, Inc, drv, custom][Add Feature] Porting system to MT6226, MT6227 and MT6229
;
; Rev 1.36 Jun 27 2005 12:23:44 mtk00576
; Disable INT_Swith2BurstMode.
; Resolution for 11695: [Init, Custom, SST][Enhancement] Leaving EMI setting outside of MAUI
;
; Rev 1.35 Jun 13 2005 09:27:20 BM
; add copyright and disclaimer
;
; Rev 1.34 May 29 2005 12:43:44 mtk00576
; Porting to MT6228
; Resolution for 11274: [System][Enhancement] Support MT6228
;
; Rev 1.33 May 06 2005 20:01:12 mtk00681
; Add ROM code initialization
; Resolution for 10959: [ROM][AddFeature] Add ROM code support on main trunk
;
; Rev 1.32 Feb 01 2005 17:05:12 mtk00702
; 1. invoke INT_Switch2BurstMode
; 2. add IMG_INFO
; Resolution for 9731: [INIT, SST][AddFeature] Add Chip UID feature
;
; Rev 1.31 Nov 08 2004 17:48:16 mtk00576
; Changing FIQ service routine.
; Resolution for 8654: [Init][Enhancement] Correction of FIQ service routine.
;
; Rev 1.30 Sep 24 2004 10:50:50 mtk00576
; Rest the SP to system stack rather than IRQ stack.
; Resolution for 7064: [INIT][Bug Fixed] Memory corruption at system stack.
;
; Rev 1.29 Aug 08 2004 22:34:08 mtk00576
; Changing stack initialization method.
; Resolution for 7064: [INIT][Bug Fixed] Memory corruption at system stack.
;
; Rev 1.28 Apr 27 2004 16:45:24 mtk00576
; Take abnormal reset into consideration.
;
; Rev 1.27 Apr 15 2004 18:43:36 mtk00576
; (1) Setting RLT to 2 rather than 7.
; (2) Adding NOP soon after remapping.
; (3) Restart watchdog at the first instruction fetched from address 0x0800____.
; Resolution for 518: Fatal Error on Internal KAL Take Mutex when power on the MS
; Resolution for 552: [PS2][Tester] System error - undefined exception
; Resolution for 956: Fatal Error:Undefined Exception lr=0x250 -?????????
;
; Rev 1.26 Dec 29 2003 14:54:10 mtk00702
; Re-write the comment of INT_ExceptionSwitchSP() function definition.
;
; Rev 1.25 Dec 12 2003 18:34:38 mtk00576
; Switching SP to system stack while system error.
; Resolution for 3530: [KAL][Enhancement]Avoid damaging stack of offending task.
;
; Rev 1.24 Nov 20 2003 17:34:48 mtk00576
; Merging CPU exception to stack fatal error.
; Resolution for 3374: [KAL][Enhancement]Simplify bootarm.s and adding Remapping Scheme
;
; Rev 1.23 Nov 19 2003 18:05:16 mtk00576
; Saving ISR return address to global variable processing_irqlr.
; Resolution for 418: Assert fail:0 m12168.c 485
;
; Rev 1.22 Oct 29 2003 16:06:32 mtk00576
; Porting to MT6218B.
; Resolution for 3225: [Init][Add Feature]Porting to support MT6218B.
;
; Rev 1.21 Oct 03 2003 21:50:18 mtk00576
; Always disable watchdog in saving exception records.
; Resolution for 3056: [Init][Bug Fixed]Flash corrupted when saving fatal errors with watchdog enabled.
;
; Rev 1.20 Sep 19 2003 17:28:38 mtk00576
; Masking IRQ via C function call and passing lr for tracing where abnormal reset taken place.
; Resolution for 2925: [Init][Enhance]Enhance portability and saving return addressof abnormal reset.
;
; Rev 1.19 Aug 22 2003 19:43:00 mtk00576
; Removing unnecessary or non-timing critical code and data from internal SRAM to fully utilize its usage.
; Resolution for 2606: Fine tuning code and data of system service occupied in internal SRAM.
;
; Rev 1.18 Jun 16 2003 09:10:14 mtk00576
; Declare internal stack as array, includeing IRQ, FIQ, Abort, Undefined, System and Timer HISR.
; Resolution for 2012: [Init][Enhance]Declare internal memory stack as array.
;
; Rev 1.17 Jun 11 2003 17:06:58 mtk00389
; Reduce IRQ stack (1024->128), System stack (1536->1024), Timer HISR stack (1024->512), and increase FIQ stack (64->128)
;
; Rev 1.16 Jun 06 2003 20:20:46 mtk00389
; Modify for to use INTERNSRAM_DATA as system stack
; Resolution for 93: Integration with MT6218
;
; Rev 1.15 May 29 2003 09:26:40 mtk00389
; Modify to save prefetch/data abort, undef instr exception after switch to supervisor mode
; Resolution for 230: General exception handling
;
; Rev 1.14 May 27 2003 09:02:36 mtk00389
; Move INT_Config() to external memory
; Resolution for 1705: [System][Optimization]Optimize internal RAM usage
;
; Rev 1.12 Mar 25 2003 15:42:40 mtk00389
; Expand stack frame up to 60longs for exception record
; Resolution for 1371: Expand saved stack frame up to 60longs for exception record
;
; Rev 1.11.2.0 Mar 12 2003 11:01:00 admin
; check in field trial load based on Maui_sw.W03.11
;
; Rev 1.11 27 Jan 2003 10:14:30 mtk00389
; Modify to use WDT timeout interval register as abornmal reset check
; Resolution for 230: General exception handling
;
; Rev 1.10 22 Jan 2003 15:12:00 mtk00389
; Fix disabled codes typo
; Resolution for 223: Fix typo
;
; Rev 1.9 22 Jan 2003 09:07:34 mtk00389
; Modify exception record format
; Resolution for 230: General exception handling
;
; Rev 1.8 14 Jan 2003 16:48:40 mtk00389
; Fix save MCU information before halt
; Resolution for 230: General exception handling
;
; Rev 1.7 09 Jan 2003 15:27:18 mtk00389
; Fix save MCU information and stack information if assertion fail or fatal error
;
; Rev 1.6 02 Jan 2003 20:47:22 mtk00389
; add handler for abnormal reset case
;
; Rev 1.5 31 Dec 2002 16:55:58 mtk00389
; fix INT_Initialize_Check value due to endian order
;
; Rev 1.4 19 Dec 2002 16:54:32 mtk00389
; modify exception handler to dump task information
;
; Rev 1.3 19 Dec 2002 13:28:20 mtk00389
; Move set cache, preftech register codes from bootarm.s to init.c
;
; Rev 1.2 17 Dec 2002 18:11:36 mtk00389
; add INT_SaveMCUInfo()
;
; Rev 1.1 02 Dec 2002 16:45:36 mtk00389
; optimize boot stack size for different modes
;
; Rev 1.0 Nov 30 2002 19:49:54 admin
; Initial revision.
; *------------------------------------------------------------------------------
; * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
; *============================================================================
; ****************************************************************************/
;
;/*************************************************************************/
;/* */
;/* Copyright (c) 1994 -2000 Accelerated Technology, Inc. */
;/* */
;/* PROPRIETARY RIGHTS of Accelerated Technology are involved in the */
;/* subject matter of this material. All manufacturing, reproduction, */
;/* use, and sales rights pertaining to this subject matter are governed */
;/* by the license agreement. The recipient of this software implicitly */
;/* accepts the terms of the license. */
;/* */
;/*************************************************************************/
;
;/*************************************************************************/
;/* */
;/* FILE NAME VERSION */
;/* */
;/* bootarm.s ARM 6/7/9 1.11.19 */
;/* */
;/* COMPONENT */
;/* */
;/* IN - Initialization */
;/* */
;/* DESCRIPTION */
;/* */
;/* This file contains the target processor dependent initialization */
;/* routines and data. */
;/* */
;/* */
;/* DATA STRUCTURES */
;/* */
;/* INT_Vectors Interrupt vector table */
;/* */
;/* FUNCTIONS */
;/* */
;/* INT_Initialize Target initialization */
;/* INT_Vectors_Loaded Returns a NU_TRUE if all the */
;/* default vectors are loaded */
;/* INT_Setup_Vector Sets up an actual vector */
;/* */
;/* */
;/*************************************************************************/
;/* Define constants used in low-level initialization. */
;
;
LOCKOUT EQU &C0 ; Interrupt lockout value
LOCK_MSK EQU &C0 ; Interrupt lockout mask value
MODE_MASK EQU &1F ; Processor Mode Mask
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -