fwinit.s

来自「WinCE 3.0 BSP, 包含Inter SA1110, Intel_815」· S 代码 · 共 134 行

S
134
字号
//      TITLE("Puzzle Firmware Initialization")
//++
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
// Copyright (c) 1995, 1996, 1997  Microsoft Corporation
//
// Module Name:
//
//   fwinit.s
//
// Abstract:
//
//   This module implements the code necessary to initialize the LC2W HW and
//   Kernel interface routines.
//
// Notes:
//
//
//--

#include <kxmips.h>
#include <alt_def.h>
#include <bldver.h>

#if CE_MAJOR_VER >= 3
.globl IntrPriority
.globl IntrMask

//#define HARDWARE_VERIFY 1

IntrPriority:
	.byte	-4,	// 000 000	// for spurious interrupt
	.byte	0	// 000 001
	.byte	1*4	// 000 010
	.byte	0	// 000 011
	.byte	2*4	// 000 100
	.byte	0	// 000 101
	.byte	1*4	// 000 110
	.byte	0	// 000 111
	.byte	3*4	// 001 000
	.byte	0, 1*4, 0, 2*4, 0, 1*4, 0
	.byte	4*4	// 010 000
	.byte	0, 1*4, 0, 2*4, 0, 1*4, 0
	.byte	3*4	// 011 000
	.byte	0, 1*4, 0, 2*4, 0, 1*4, 0
	.byte	5*4	// 100 000
	.byte	0, 1*4, 0, 2*4, 0, 1*4, 0
	.byte	3*4	// 101 000
	.byte	0, 1*4, 0, 2*4, 0, 1*4, 0
	.byte	4*4	// 110 000
	.byte	0, 1*4, 0, 2*4, 0, 1*4, 0
	.byte	3*4	// 111 000
	.byte	0, 1*4, 0, 2*4, 0, 1*4, 0

IntrMask:
	.byte	0x00	// 00 0000	// for spurious interrupt
	.byte	0x3f	// 00 0001
	.byte	0x3e	// 00 0010
	.byte	0x3c	// 00 0100
	.byte	0x38	// 00 1000
	.byte	0x30	// 01 0000
	.byte	0x20	// 10 0000
	.byte	0x00	// padding
#endif

LEAF_ENTRY(StartUp)

        // Inititalize Status register:
        // Reset all CP usable bits (CP0 is always useable from kernel mode)
        // Set BEV
        // Clear Cache Parity Error bit
        // Clear all Int Mask bits,
        // Set current, previous & old modes to kernel
        // Disable interrupts
        .set noreorder

        li        a3, LED_BASE + KSEG1_BASE
		li        a2, 0x0F
        sb        a2, 0(a3)

        li      t0, (1<<PSR_DE) | (1 << PSR_BEV)
        mtc0    t0, psr                 // put CPU into kernel mode w/o interrupts
        mtc0    a1, compare             // Save the boot ROM flag
        la      t0, uncached_target
        li      t1, 0xA0000000
        or      t0, t1
        j       t0                      // be sure that we're running uncached.
        nop

uncached_target:

		li        a2, 0x0E
        sb        a2, 0(a3)

        //
        // initialize (invalidate) CPU caches
        //
        jal     CacheInit
        nop
        la      t0, KernelStart
        li      t1, 0xA0000000
        or      t0, t1
        j       t0                      // jump to KernelStart in uncached space
        nop

        .end    StartUp


LEAF_ENTRY(GetBootFlag)

        j      ra
        mfc0   v0, compare
		.end



/////////////////////////////////////////////////////////////////////////////////
//	Jump to takes an argument of where to jump to in a0.
//

LEAF_ENTRY(JumpTo)

	.set noreorder       
        jal     a0                      // Jump to where ever I am told to...
		nop        

        .end    JumpTo




⌨️ 快捷键说明

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