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

📄 mcf5206e_lo.s

📁 motorola 针对coldfire 5275 评估板的Dbug bootloader源程序
💻 S
字号:
/*
 * File:    mcf5206e_lo.s
 * Purpose: Lowest level routines for mcf5206e.
 *
 * Notes:   This file assembles with both Diab and GNU tools
 *
 *
 * Modifications:
 *
 */

#ifdef _UNDERSCORE_
#define mcf5206_mbar    _mcf5206_mbar
#define mcf5206_rambar  _mcf5206_rambar
#define mcf5206e_init   _mcf5206e_init
#define main            _main
#endif
 
    .extern ___SP_INIT
    .extern VECTOR_TABLE
    .extern mcf5206_mbar
    .extern mcf5206_rambar
    .extern mcf5206e_init
    .extern main
 
    .global asm_startmeup
    .global _asm_startmeup
 
    .global cpu_cache_flush
    .global _cpu_cache_flush

    .equ    SRAMsize,8192

    .text

/*
 * This is the main entry point upon hard reset.
 */
asm_startmeup:
_asm_startmeup:

    move.w      #0x2700,SR
    move.l      #VECTOR_TABLE,d0
    movec       d0,VBR

    /* Invalidate the cache and disable it */
    move.l  #0x01000000,d0
    .long   0x4e7b0002      /* movec d0,cacr */

    /* Disable ACRs */
    moveq.l #0,d0
    .long   0x4e7b0004      /* movec d0,ACR0 */
    .long   0x4e7b0005      /* movec d0,ACR1 */

    /* Initialize SRAMBAR */
    move.l  #0xE0000001,d0  /* locate SRAM, validate it! */
    .long   0x4e7b0C04      /* movec d0,SRAMBAR */

    nop
    nop

    /*
     * Point SP into SRAM (temporarily).  SRAM is used as stack space
     * while initializing the mcf5206e periphs and memory controller.
     */
    move.l  #0xE0000000+SRAMsize,SP

    /* Obtain pointer to where MBAR is to be mapped */
    jsr     mcf5206_mbar
    move.l  d0,d6

    /* Obtain pointer to where RAMBAR is to be mapped */
    jsr     mcf5206_rambar

    /* Adjust SP to (soon to be valid) SRAM */
    move.l  d0,a0
    lea     SRAMsize(a0),SP

    /* Map RAMBAR and MBAR */
    addq.l  #1,d0           /* Set Valid bit */
    .long   0x4e7b0C04      /* movec d0,RAMBAR */

    move.l  d6,d0
    addq.l  #1,d0           /* Set Valid bit */
    .long   0x4e7b0C0F      /* movec d0,MBAR */

    /* Initialize mcf5206e periphs, etc */
    move.l  d6,-(sp)        /* pointer to internal resources */
    jsr     mcf5206e_init
    lea     4(sp),sp

    /*
     * Point SP to DRAM.  DRAM may only be visible once CS0 
     * de-activated as global chipselect.
     */
    move.l  #___SP_INIT,sp

    nop
    nop

    jmp     main

/*
 * mcf5206e has Icache only
 */
cpu_cache_flush:
_cpu_cache_flush:
    nop                     /* sync */
    move.l  #0x01000000,d0
    .long   0x4e7b0002      /* movec d0,cacr */
    nop                     /* sync */
    .long   0x4e7b0002      /* movec d0,cacr */
    rts

    .end

⌨️ 快捷键说明

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