1/**
2 * \file
3 * \brief Bootstrap the bootloader.
4 */
5
6/*
7 * Copyright (c) 2007-2010,2015, ETH Zurich.
8 * Copyright (c) 2015, Hewlett Packard Enterprise Development LP.
9 * All rights reserved.
10 *
11 * This file is distributed under the terms in the attached LICENSE file.
12 * If you do not find this file, copies can be found by writing to:
13 * ETH Zurich D-INFK, Universitaetstr. 6, CH-8092 Zurich. Attn: Systems Group.
14 */
15
16/*
17 * This is the entry point called from the gem5 bootloader. It loads and
18 * relocates the kernel image, and sets some global parameters passed along to
19 * the kernel On entry:
20 *
21 * x0 contains zero
22 * x1 contains board id
23 * x2 atags ptr
24 * x3 kernel start address
25 * x4 GIC address
26 * x5 flag register address
27 */
28	.text
29	.globl	aarch64_start, aarch64_to_kernel_transition
30
31        // ........................................
32        //
33        // Entry point.  Initialize a stack and branch to the
34        // C entry point in init.c
35aarch64_start:
36	ldr		x6, =aarch64_kernel_stack
37	add	    x6, x6, #2048//done in two steps to make sure it is thumb-compatible
38	add     x6, x6, #2048
39	mov     sp, x6
40	b		aarch64_init
41
42        // Never reached
43halt:
44	b	halt
45
46        // ........................................
47        //
48        // Transfer control to the proper kernel once it has
49        // been loaded and relocated.  The caller supplies the
50        // r0 value through which the kernel expects
51        // the core_data info.
52aarch64_to_kernel_transition:
53        mov     x30, x0
54        mov     x0, x1
55        br		x30
56
57        // ........................................
58        //
59        // Stack for use by the C molly kernel.
60
61        .data
62aarch64_kernel_stack:
63        .skip   4096
64
65