Root/Examples/hello_sram/build/start.S

1/*
2 * Copyright (c) 2009, yajin <yajin@vm-kernel.org>
3 * Copyright (c) 2005-2008 Ingenic Semiconductor Inc.
4 * Author: <jlwei@ingenic.cn>
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation; either version 2 of
9 * the License, or (at your option) any later version.
10 */
11
12#include <jz4740.h>
13#include <board.h>
14
15    .text
16    .set noreorder
17    .global startup
18startup:
19    /*
20     * Disable all interrupts
21     */
22    la $8, 0xB0001004 /* INTC_IMR */
23    li $9, 0xffffffff
24    sw $9, 0($8)
25
26    /*
27     * CU0=UM=EXL=IE=0, BEV=ERL=1, IP2~7=1
28     */
29    li $26, 0x0040FC04
30    mtc0 $26, $12 /* CP0_STATUS */
31
32    /* IV=1, use the specical interrupt vector (0x200) */
33    li $26, 0x00800000
34    mtc0 $26, $13 /* CP0_CAUSE */
35
36    /* Setup stack pointer */
37    la $29, 0x81000000
38
39    /* Jump to the main routine */
40    j main_func
41    nop
42    .set reorder
43
44

Archive Download this file

Branches:
master



interactive