Annotation of prex-old/boot/arm/cats/head.S, Revision 1.1
1.1 ! nbrk 1: /*-
! 2: * Copyright (c) 2005, Kohsuke Ohtani
! 3: * All rights reserved.
! 4: *
! 5: * Redistribution and use in source and binary forms, with or without
! 6: * modification, are permitted provided that the following conditions
! 7: * are met:
! 8: * 1. Redistributions of source code must retain the above copyright
! 9: * notice, this list of conditions and the following disclaimer.
! 10: * 2. Redistributions in binary form must reproduce the above copyright
! 11: * notice, this list of conditions and the following disclaimer in the
! 12: * documentation and/or other materials provided with the distribution.
! 13: * 3. Neither the name of the author nor the names of any co-contributors
! 14: * may be used to endorse or promote products derived from this software
! 15: * without specific prior written permission.
! 16: *
! 17: * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
! 18: * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
! 19: * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
! 20: * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
! 21: * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
! 22: * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
! 23: * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
! 24: * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
! 25: * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
! 26: * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
! 27: * SUCH DAMAGE.
! 28: */
! 29:
! 30: /*
! 31: * head.S - low level platform support
! 32: *
! 33: * This file contains the code from crt0.S which is released under
! 34: * public domain by Jeff Frohwein.
! 35: */
! 36:
! 37: /*
! 38: * I know that I'm a bit slacky, but this is the memory map for cats.
! 39: * GXemul> device list
! 40: * 0: ram @ 0x00041000000, len = 0x40000 (DYNTRANS R+W)
! 41: * 1: footbridge @ 0x00042000000, len = 0x400
! 42: * 2: ram @ 0x00050000000, len = 0x10000 (DYNTRANS R+W)
! 43: * 3: footbridge_isa @ 0x00079000000, len = 0x8
! 44: * 4: footbridge_pci @ 0x0007b000000, len = 0x1000000
! 45: * 5: 8259 @ 0x0007c000020, len = 0x2
! 46: * 6: 8253 @ 0x0007c000040, len = 0x4
! 47: * 7: pckbc @ 0x0007c000060, len = 0x10
! 48: * 8: pccmos @ 0x0007c000070, len = 0x4
! 49: * 9: 8259 [secondary] @ 0x0007c0000a0, len = 0x2
! 50: * 10: ns16550 [tty1] @ 0x0007c0002f8, len = 0x8
! 51: * 11: lpt [lpt] @ 0x0007c000378, len = 0x3
! 52: * 12: vga_ctrl @ 0x0007c0003c0, len = 0x20
! 53: * 13: ns16550 [tty0] @ 0x0007c0003f8, len = 0x8
! 54: * 14: dec21143 [10:20:30:00:00:10] @ 0x0007c010000, len = 0x100
! 55: * 15: ram @ 0x00080000000, len = 0x1000 (DYNTRANS R+W)
! 56: * 16: ram [mirror] @ 0x00080010000, len = 0x100 ()
! 57: * 17: vga_gfx @ 0x000800a0000, len = 0x18000 ()
! 58: * 18: vga_charcells @ 0x000800b8000, len = 0x8000 (DYNTRANS R+W)
! 59: * 19: ram [mirror] @ 0x000c0000000, len = 0x20000000 (DYNTRANS R+W)
! 60: * 20: ram [mirror] @ 0x000f0000000, len = 0x1000000 (DYNTRANS R+W)
! 61: * 21: fb [VGA] @ 0x01c00000000, len = 0xbb800 (DYNTRANS R+W)
! 62: * 22: mc146818 @ 0x01d00000000, len = 0x2
! 63: *
! 64: * Firmware loads us at 0xf0000000 with MMU on and TTB @0x006f8000.
! 65: */
! 66:
! 67: #include <conf/config.h>
! 68: #include <platform.h>
! 69:
! 70: #define ENTRY(x) .global x; .align; x##:
! 71:
! 72: .section ".text","ax"
! 73: .code 32
! 74: /*
! 75: * Kernel start point
! 76: */
! 77: ENTRY(boot_entry)
! 78: b start_vector
! 79:
! 80: stack_end: .word BOOT_STACK+0xf00
! 81:
! 82: start_vector:
! 83: mov r0, #0xd3 /* Enter SVC mode, Disable IRQ,FIQ */
! 84: msr cpsr_c, r0
! 85:
! 86: mrc p15, 0, r0, c1, c0
! 87: bic r0, r0, #1 /* disable MMU */
! 88: mcr p15, 0, r0, c1, c0
! 89:
! 90: ldr sp, stack_end
! 91:
! 92: /* initialize boot console */
! 93: bl bootcons_init
! 94:
! 95: ldr r0, =loader_main
! 96: bx r0 /* Change to ARM mode */
! 97:
! 98: /*
! 99: * Start kernel
! 100: */
! 101: ENTRY(start_kernel)
! 102: bx r0
! 103:
! 104: .section .tail,"ax"
! 105: dummy:
! 106: .byte 0xff
! 107:
! 108: .end
CVSweb