OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [uclinux/] [uClinux-2.0.x/] [arch/] [m68knommu/] [platform/] [68EZ328/] [ucsimm/] [crt0_ram.S] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 199 simons
        .global __text_start
2
        .global __main
3
        .global __bss_start
4
        .global __bss_end
5
        .global __ram_start
6
        .global __ram_end
7
        .global __rom_start
8
        .global __rom_end
9
        .global __data_start
10
        .global __data_end
11
 
12
        .global splash_bits
13
        .global _start
14
        .global _stext
15
 
16
#define DEBUG
17
#define ROM_OFFSET 0x10C00000
18
#define STACK_GAURD 0x10
19
 
20
        .text
21
 
22
_start:
23
_stext:
24
        movew   #0x2700, %sr            /* Exceptions off! */
25
 
26
        /* Init chip registers.  uCsimm specific */
27
        moveb   #0x00,   0xfffffb0b     /* Watchdog off */
28
        moveb   #0x10,   0xfffff000     /* SCR */
29
 
30
        movew   #0x2400, 0xfffff200     /* PLLCR */
31
        movew   #0x0123, 0xfffff202     /* PLLFSR */
32
 
33
        moveb   #0x00,   0xfffff40b     /* enable chip select */
34
        moveb   #0x00,   0xfffff423     /* enable /DWE */
35
        moveb   #0x08,   0xfffffd0d     /* disable hardmap */
36
        moveb   #0x07,   0xfffffd0e     /* level 7 interrupt clear */
37
 
38
        movew   #0x8600, 0xfffff100     /* FLASH at 0x10c00000 */
39
        movew   #0x018b, 0xfffff110     /* 2Meg, enable, 0ws */
40
 
41
        movew   #0x8f00, 0xfffffc00     /* DRAM configuration */
42
        movew   #0x9667, 0xfffffc02     /* DRAM control */
43
        movew   #0x0000, 0xfffff106     /* DRAM at 0x00000000 */
44
        movew   #0x068f, 0xfffff116     /* 8Meg, enable, 0ws */
45
 
46
        moveb   #0x40,   0xfffff300     /* IVR */
47
        movel   #0x007FFFFF, %d0        /* IMR */
48
        movel   %d0,     0xfffff304
49
 
50
        moveb   0xfffff42b, %d0
51
        andb    #0xe0,   %d0
52
        moveb   %d0,     0xfffff42b
53
 
54
        moveb   #0x08,   0xfffff907     /* Ignore CTS */
55
        movew   #0x010b, 0xfffff902     /* BAUD to 9600 */
56
        movew   #0xe100, 0xfffff900     /* enable */
57
 
58
        movew   #16384, %d0  /* PLL settle wait loop */
59
L0:
60
        subw    #1, %d0
61
        bne     L0
62
#ifdef DEBUG
63
        moveq   #70, %d7                /* 'F' */
64
        moveb   %d7,0xfffff907          /* No absolute addresses */
65
pclp1:
66
        movew   0xfffff906, %d7
67
        andw    #0x2000, %d7
68
        beq     pclp1
69
#endif /* DEBUG */
70
 
71
#ifdef CONFIG_RELOCATE
72
        /* Copy me to RAM */
73
        moveal  #__rom_start, %a0
74
        moveal  #__ram_start, %a1
75
        moveal  #__data_end, %a2
76
 
77
        /* Copy %a0 to %a1 until %a1 == %a2 */
78
LD1:
79
        movel   %a0@+, %d0
80
        movel   %d0, %a1@+
81
        cmpal   %a1, %a2
82
        bhi     LD1
83
 
84
#ifdef DEBUG
85
        moveq   #74, %d7                /* 'J' */
86
        moveb   %d7,0xfffff907          /* No absolute addresses */
87
pclp2:
88
        movew   0xfffff906, %d7
89
        andw    #0x2000, %d7
90
        beq     pclp2
91
#endif /* DEBUG */
92
        /* jump into the RAM copy */
93
        jmp     ram_jump
94
ram_jump:
95
 
96
#endif /* CONFIG_RELOCATE */
97
 
98
#ifdef DEBUG
99
        moveq   #82, %d7                /* 'R' */
100
        moveb   %d7,0xfffff907          /* No absolute addresses */
101
pclp3:
102
        movew   0xfffff906, %d7
103
        andw    #0x2000, %d7
104
        beq     pclp3
105
#endif /* DEBUG */
106
        moveal  #0x007ffff0, %ssp
107
        moveal  #__bss_start, %a0
108
        moveal  #__bss_end, %a1
109
 
110
        /* Copy 0 to %a0 until %a0 >= %a1 */
111
L1:
112
        movel   #0, %a0@+
113
        cmpal   %a0, %a1
114
        bhi     L1
115
 
116
#ifdef DEBUG
117
        moveq   #67, %d7                /* 'C' */
118
        jsr     putc
119
#endif /* DEBUG */
120
 
121
        pea     0
122
        pea     env
123
        pea     %sp@(4)
124
        pea     0
125
 
126
#ifdef DEBUG
127
        moveq   #70, %d7                /* 'F' */
128
        jsr     putc
129
#endif /* DEBUG */
130
 
131
lp:
132
        jsr     start_kernel
133
        jmp lp
134
_exit:
135
 
136
        jmp     _exit
137
 
138
__main:
139
        /* nothing */
140
        rts
141
 
142
#ifdef DEBUG
143
putc:
144
        moveb   %d7,0xfffff907
145
pclp:
146
        movew   0xfffff906, %d7
147
        andw    #0x2000, %d7
148
        beq     pclp
149
        rts
150
#endif /* DEBUG */
151
 
152
        .data
153
env:
154
        .long   0

powered by: WebSVN 2.1.0

© copyright 1999-2025 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.