📄 startup.lst
字号:
ARM macroassembler Page:1
1 00000000 ;**********************************************************************
2 00000000 ;
3 00000000 ; Filename: startup.s
4 00000000 ;
5 00000000 ; Description: Initialization before the MMU gets turned. This is
6 00000000 ; the first code that gets executed.
7 00000000 ;
8 00000000 ; THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
9 00000000 ; ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
10 00000000 ; THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
11 00000000 ; PARTICULAR PURPOSE.
12 00000000 ;
13 00000000 ; Use of this source code is subject to the terms of the Cirrus end-user
14 00000000 ; license agreement (EULA) under which you licensed this SOFTWARE PRODUCT.
15 00000000 ; If you did not accept the terms of the EULA, you are not authorized to
16 00000000 ; use this source code. For a copy of the EULA, please see the
17 00000000 ; EULA.RTF on your install media.
18 00000000 ;
19 00000000 ; Copyright(c) Cirrus Logic Corporation 2002, All Rights Reserved
20 00000000 ;
21 00000000 ;**********************************************************************
22 00000000
25 00000000 OPT 1 ; reenable listing
26 00000000 OPT 128 ; disable listing of macro expansions
27 00000000
28 00000000
29 00000000 ;
30 00000000 ; ASync bus mode, little endian, MMU disabled
31 00000000 ;
32 00000000 ;CP15R1Init EQU 0xC0000078
33 00000000 CP15R1Init EQU 0xC0001078
34 00000000 CLKSET1DEFAULT EQU 0x000398e7
35 00000000
36 00000000 IMPORT KernelStart
37 00000000 IMPORT OEMAddressTable
38 00000000 IMPORT SysconSetup
39 00000000 IMPORT SdramCfg
40 00000000
41 00000000
42 00000000 ;**********************************************************************
43 00000000 ; StartUp routine to initialize the processor.
44 00000000 ;**********************************************************************
45 00000000 STARTUPTEXT
46 00000000 43 52 55 DCB "CRUS", 0
53 00
47 00000005
48 00000005 LEAF_ENTRY StartUp
49 00000006
50 00000006 ;
51 00000006 ; Kill watch dog timer. Before any thing else.
52 00000006 ;
53 00000006 00 00 *align
53 00000008 e59f0058 ldr r0, =0x80940000
54 0000000c e59f1058 ldr r1, =0xAA55
55 00000010 e5801000 str r1, [r0]
56 00000014
57 00000014 ;
58 00000014 ; ensure SVC32 mode with IRQ and FIQ disabled
59 00000014 ;
60 00000014
61 00000014 e3a000d3 mov r0, #0xd3
62 00000018 e121f000 msr cpsr_c, r0
63 0000001c
64 0000001c ;
65 0000001c ; Check to see if we are executing in flash, if so we may need to
66 0000001c ; setup SDRAM.
67 0000001c ;
68 0000001c e35f0206 cmp pc, #0x60000000
69 00000020 9a000005 bls DontConfigureSDRAM
70 00000024
71 00000024 ;
72 00000024 ; If we loaded through eboot, SDRAM is already configured.
73 00000024 ; Check the CLKSET1 register to see if it has been modified.
74 00000024 ;
75 00000024 e59f0044 ldr r0, =0x80930020
76 00000028 e5901000 ldr r1, [r0]
77 0000002c e59f0040 ldr r0, =CLKSET1DEFAULT
78 00000030 e1500001 cmp r0, r1
79 00000034 1a000000 bne DontConfigureSDRAM
80 00000038
81 00000038 ;
82 00000038 ;
83 00000038 ; Configure SDRAM
84 00000038 ;
85 00000038 eb000000 bl SdramCfg
86 0000003c
87 0000003c DontConfigureSDRAM
88 0000003c
89 0000003c ;
90 0000003c ; Turn off the MMU
91 0000003c ;
92 0000003c e59f0034 ldr r0, =0xC0001078
93 00000040 ee010f10 mcr p15, 0, r0, c1, c0, 0
94 00000044
95 00000044
96 00000044 ;
97 00000044 ; create a temporary stack below kernel memory from config.bib
98 00000044 ;
99 00000044 e3a0d701 mov sp, #0x40000
100 00000048 eb000000 bl SysconSetup
101 0000004c
102 0000004c ;
103 0000004c ; clear out magic words for memory and heap
104 0000004c ; (r0) = physical address of OEMAddressTable
105 0000004c ;
106 0000004c ;
107 0000004c ; Calculate the physical address of the table.
108 0000004c ;
109 0000004c ; r0 - Virtual address of OEMAddressTable
110 0000004c ; r1 - Physical Address of Startup
111 0000004c ; r2 - Virtual Address of Startup
112 0000004c ;
113 0000004c ; r0 = r0 - r2 + r1 = Physical address of OEMAddressTable
114 0000004c ;
115 0000004c e59f0028 ldr r0,=OEMAddressTable
116 00000050 e24f1052 adr r1,StartUp
117 00000054 e59f2024 ldr r2,=StartUp
118 00000058 e0800001 add r0, r0, r1
119 0000005c e0400002 sub r0, r0, r2
120 00000060 eb000000 bl KernelStart
121 00000064 ;
122 00000064 ; KernelStart should never return:
123 00000064 ;
124 00000064
125 00000064 eafffffe spin b spin
126 00000068
127 00000068
128 00000068
129 00000068 ;****************************************************************************
130 00000068 ; Include the appropriate memory map.
131 00000068 ;****************************************************************************
132 00000068 ; INCLUDE mmumap.inc
133 00000068
134 00000068 ; End of initialization code & data
135 00000068 TEXTAREA
136 00000000
137 00000000 END
Assembly terminated, errors: 0, warnings: 0
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -