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

📄 mpc5500_usrdefs.inc

📁 MPC5554处理器的初始化例程
💻 INC
📖 第 1 页 / 共 2 页
字号:
#************************************************************************
#* FILE NAME: mpc5500_usrdefs.inc            COPYRIGHT (c) Freescale 2004 
#*                                                All Rights Reserved     
#* DESCRIPTION:                                                           
#* This file contains user definitions for the MPC5500 assembly functions.
#* The user will only need to make changes to this file for the assembly
#*  portion of this code.
#* 
#*========================================================================
#* ORIGINAL AUTHOR: G. Jackson           
#* REV      AUTHOR        DATE       DESCRIPTION OF CHANGE                
#* ---   -----------   -----------   ---------------------                  
#* 0.1   G. Jackson     12/Apr/04    Initial version        
#* 0.2   G. Jackson     15/Apr/04    Added compiler designations
#* 0.3   G. Jackson     13/May/04    Added runtime variables
#* 0.4   G. Jackson     06/Jun/04    Added EXT_BOOT config option
#* 0.5   G. Jackson     30/Jun/04    Added RCHW variables
#* 1.0   G. Jackson     07/Oct/04    Internal and external RAM set to 
#*                                    CACHE_INHIBIT (TLBs 3 & 11)
#*       P&E                         See code comments for modifications                                    
#************************************************************************
    .include "mpc5500_defs.inc"
    
#***************************************************************
#******** Compiler Designation for Assembler Options ***********
#  Set one compiler to "1" from the four choices below:    
    .equ __GRNHS__,  0  ## Designation for the Green Hills compiler
    .equ __PEGNU__,  1  ## Designation for the P&E Micro Gnu compiler
	.equ __DIABCC__, 0  ## Designation for the Wind River compiler
    .equ __CWWRKS__, 0  ## Designation for the Metrowerks CodeWarrior compiler

#*************** Runtime Variables *****************
#  These runtime variables are used in __start.s
# main(), assembly cfg_* calls, and cfg_mpc5500_ccd() need to  **
# have far absolute addressing if flashing to ROM with         **
# distant addresses on the MPC5500.                            **
# The .equ statements below should be set to "1" to be valid   **
#  and set to "0" to be inactive.                              **

    .equ FAR_ADDRESS,      0  # Used for a FAR_ADDRESS call
    .equ FAR_ADDRESS_MAIN, 1  # Used for a FAR_ADDRESS call to main
    .equ SIM_VER,          0  # Used with the Code Warrior simulator

#Removed to ram_flsh_run.inc (alex.gong)
#    .equ FLSH_RUN,         1  # Set to (1) for code in Flash
#                             #     to (0) for code in SRAM
    .equ EXT_BOOT,         0  # Set to (1) for External boot. 
#                             #  BAM sets up external bus and CS[0]
# Reset Configuration Half Word Variables **
    .equ RCHW_WTE, WDOG_DISABLE # Watchdog control at reset
    .equ RCHW_PS0, CS0_32BIT    # CS0 data port size at reset
    .equ BOOT_ID,  MPC5500_ID   # Valid boot ID for MPC5500 devices

#*************************************************************
#******** Special Initialization Option Constants  ***********
# The "I_" prefixed variables are initialization defines      
#  Set the value to one ("1") to enable the option.
#  Or, set the value to zero ("0") to disable the option.

    .equ I_LOCEN,    1 # Set loss of clock enable function
    .equ I_BCKUPCLK, 1 # Enable backup clock on loss of clock

# Mutually exclusive pair (one set to "0", one set to "1"):
    .equ I_LOSSCRST, 0 # Enable reset on loss of clock 
    .equ I_LOCINT,   1 # Enable interrupt on loss of clock
# Mutually exclusive pair (one set to "0", one set to "1"):
    .equ I_LOSSLRST, 0 # Enable reset on loss of lock  
    .equ I_LOLINT,   1 # Enable interrupt on loss of lock 


# To match MMU entry size:
    .equ I_SRAM_SIZE,   SIZE_64K   #   64 KB RAM Size
    .equ I_XSRAM_SIZE,  SIZE_512K  #  512 KB External RAM Size
    .equ I_XSRAM_SPACE, SIZE_4M    #    4 MB External RAM Space

#*************************************************************
#      User Defined Options
#  These values should be modified based on user requirements
#*************************************************************
# Cache definitions used by cfg_CACHE and cfg_STACK:
#  Copy back mode (CWM=1) and Push buffer disabled (DPB=1) is
#   required by errata #32 and #34 to allow MMU control of cache.
#   These errata may go away in the future (see current errata)
    .equ CACHE_CLEAR,(CLFC_NO_OP | CINV_INV_OP | CE_DISABLE)
    .equ CACHE_SETTINGS, (CWM_COPYBCK | DPB_NOPUSH | CE_ENABLE) 

#*******************************************************************
# Flash definitions used by cfg_FLASH:
#     Internal Flash: FLASH_BIUCR (0xC3F8_801C)    
    .equ FLASH_SETTINGS, (EBI_PREFTCH_ON | APC_3 | WWSC_1 | RWSC_2 | IPFEN_ANY | PFLIM_2 | BFEN_EN)
#     External Flash: CS0 OR settings used by cfg_FLASH:
#     The next line is commented out as an example of optimizing
#      external Flash boot times.
#    .equ CS0_OR_OPTIONS, (AMASK_8M | OR0SCY_2 | OR0BSCY_0)
    
#*******************************************************************
# FMPLL definitions used by cfg_FMPLL
#  Set the internal clock to 32 MHz with MFD=16, and RFD=4.
#  Setting 1 is intended to only change the MFD bit with no change to the RFD bit.
    .equ FMPLL_SYNCR_SETTING1, (MFD_16 | RFD_4 | LOCEN_EN)  # MFD=16, RFD=4 for  32MHz
#  Set the internal clock to 128 MHz with MFD=16, and RFD=1.
#  This sequence sets the RFD to divide-by-1 in the FMPLL_SYNCR Register.
#  Setting 2 is intended to only change the RFD bit with no change to the MFD bit.
    .equ FMPLL_SYNCR_SETTING2, (MFD_16 | RFD_1 | LOCEN_EN)  # MFD=16, RFD=1 for 128MHz
    
#*******************************************************************
# SIU definitions used by cfg_FMPLL
# The SIU definition below will generate a reset of the device when used.
#  A system reset or an external reset will result depending on settings.
    .equ SIU_SRCR_SYSRST, (SSR_SYSRST | SER_NORST | CRE_NO)    

#*******************************************************************
# ERRLOGREG (Error Log Register) address definition
    .equ ERRLOGREG, ERRLOGAD_ETPUPRAM_HI # Assembler token address

#*********************************************************************

##*************************************************************************/
# FUNCTION     : MMU DATA Tables                                          */
# PURPOSE      : This defines the MMU data tables for the TLB entries     */
#                which are set in the file mpc5500_asmcfg.c               */
# INPUT NOTES  : Requires that the TLB settings be in MPC5500_defs.inc    */
# RETURN NOTES : mmu_tlb0 [TLB0_MAS[0:3] through mmu_tlb11 [TLB0_MAS[0:3] */
# WARNING      : Registers used: none. Section is: .rodata                */
##*************************************************************************/


# Section declaration:

    .if __PEGNU__
    .section ".rodata" 
    .endif

    .if __CWWRKS__ | __DIABCC__ | __GRNHS__
    .section .rodata
    .endif
    
    
#*************************************************************************/
#* DESCRIPTION:                                                          */  
#* This table contains definitions for the MPC5554 MMU TLB entries.      */
#* The bit definitions used in the TLB defines are located below.        */  
#* The second half of the file is the TLB setup code in mpc5500_asmcfg.s */
#*************************************************************************/ 

#*** TLB DEFINES ***/

#** TLB entry 15 - BAM in Flash set to 1M **
mmu_tlb15:
# TLB0_MAS0
    .long (TLB_SELECT | TLB_ENTRY15 )
# TLB0_MAS1
    .long (TLB_ENTRY_VALID | ENTRY_PROTECTED | GLOBAL_MATCH | TS_IS_COMPARE | TSIZ_1M )
# TLB0_MAS2
    .long (BAM_BASE_ADDR | CACHE_WRITE_BACK | CACHE_ACTIVE | MEM_NO_COHERENCE | PAGE_NOT_GUARDED | PAGE_BIG_ENDIAN )
# TLB0_MAS3
    .long ( BAM_BASE_ADDR | READWRITEEXECUTE )


#** TLB entry 0 - PBRIDGE_B set to 1M **
mmu_tlb0:
# TLB1_MAS0
    .long ( TLB_SELECT | TLB_ENTRY0 )
# TLB1_MAS1
    .long ( TLB_ENTRY_VALID | ENTRY_PROTECTED | GLOBAL_MATCH | TS_IS_COMPARE | TSIZ_1M )
# TLB1_MAS2
    .long ( PBRIDGEB_BASE_ADDR | CACHE_WRITE_BACK | CACHE_INHIBIT | MEM_NO_COHERENCE | PAGE_GUARDED | PAGE_BIG_ENDIAN )
# TLB1_MAS3
    .long ( PBRIDGEB_BASE_ADDR | READWRITEEXECUTE )

#** TLB entry 1 - Split Internal FLASH (1) set to 1MB **
mmu_tlb1:
# TLB5_MAS0
    .long ( TLB_SELECT | TLB_ENTRY1 )
# TLB5_MAS1
    .long ( TLB_ENTRY_VALID | ENTRY_PROTECTED | GLOBAL_MATCH | TS_IS_COMPARE | TSIZ_1M )
# TLB5_MAS2
    .long ( FLASH_BASE_ADDR | CACHE_WRITE_BACK | CACHE_ACTIVE | MEM_NO_COHERENCE | PAGE_NOT_GUARDED | PAGE_BIG_ENDIAN )
# TLB5_MAS3
    .long ( FLASH_BASE_ADDR | READWRITEEXECUTE )

#** TLB entry 2 - External Memory 1 (Flash) 4M **
mmu_tlb2:
# TLB2_MAS0
    .long ( TLB_SELECT | TLB_ENTRY2 )
# TLB2_MAS1
    .long ( TLB_ENTRY_VALID | ENTRY_PROTECTED | GLOBAL_MATCH | TS_IS_COMPARE | TSIZ_4M )
# TLB2_MAS2
    .long ( EXTMEM1_BASE_ADDR | CACHE_WRITE_BACK | CACHE_ACTIVE | MEM_NO_COHERENCE | PAGE_NOT_GUARDED | PAGE_BIG_ENDIAN )
# TLB2_MAS3
    .long ( EXTMEM1_BASE_ADDR | READWRITEEXECUTE )

#** TLB entry 3 - Internal SRAM reduce from 1M space to 64K only **
mmu_tlb3:
# TLB3_MAS0
    .long ( TLB_SELECT | TLB_ENTRY3 )
# TLB3_MAS1

⌨️ 快捷键说明

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