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