2 * U-boot - i386 Startup Code
4 * Copyright (c) 2002 Omicron Ceti AB, Daniel Engström <denaiel@omicron.se>
6 * See file CREDITS for list of people who contributed to this
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License as
11 * published by the Free Software Foundation; either version 2 of
12 * the License, or (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
33 .type _start, @function
34 .globl _i386boot_start
37 movl $0x18,%eax /* Load our segement registes, the
38 * gdt have already been loaded by start16.S */
45 /* We call a few functions in the board support package
46 * since we have no stack yet we'll have to use %ebp
47 * to store the return address */
49 /* Early platform init (setup gpio, etc ) */
50 mov $early_board_init_ret, %ebp
54 /* The __port80 entry-point should be usabe by now */
55 /* so we try to indicate progress */
57 movl $.progress0, %ebp
58 jmp show_boot_progress
62 mov $mem_init_ret, %ebp
66 /* check ammount of configured memory
67 * (we need atleast bss start+bss size+stack size) */
68 movl $_i386boot_bss_start, %ecx /* BSS start */
69 addl $_i386boot_bss_size, %ecx /* BSS size */
70 addl $CFG_STACK_SIZE, %ecx
74 /* indicate (lack of) progress */
76 movl $.progress0a, %ebp
77 jmp show_boot_progress
82 /* indicate progress */
84 movl $.progress1, %ebp
85 jmp show_boot_progress
88 /* create a stack after the bss */
89 movl $_i386boot_bss_start, %eax
90 addl $_i386boot_bss_size, %eax
91 addl $CFG_STACK_SIZE, %eax
100 cmpl $0x55aa55aa, %ebx
104 /* indicate (lack of) progress */
106 movl $.progress1a, %ebp
107 jmp show_boot_progress
113 /* indicate progress */
115 movl $.progress2, %ebp
116 jmp show_boot_progress
119 /* copy data section to ram, size must be 4-byte aligned */
120 movl $_i386boot_romdata_dest, %edi /* destination address */
121 movl $_i386boot_romdata_start, %esi /* source address */
122 movl $_i386boot_romdata_size, %ecx /* number of bytes to copy */
127 shrl $2, %ecx /* copy 4 byte each time */
136 /* indicate (lack of) progress */
138 movl $.progress2a, %ebp
139 jmp show_boot_progress
145 /* indicate progress */
147 movl $.progress3, %ebp
148 jmp show_boot_progress
151 /* clear bss section in ram, size must be 4-byte aligned */
152 movl $_i386boot_bss_start, %edi /* MK_CHG BSS start */
153 movl $_i386boot_bss_size, %ecx /* BSS size */
157 shrl $2, %ecx /* clear 4 byte each time */
168 /* indicate (lack of) progress */
170 movl $.progress3a, %ebp
171 jmp show_boot_progress
180 /* indicate progress */
182 movl $.progress4, %ebp
183 jmp show_boot_progress
186 call start_i386boot /* Enter, U-boot! */
188 /* indicate (lack of) progress */
190 movl $.progress4a, %ebp
191 jmp show_boot_progress