source: rtems/bsps/powerpc/virtex/start/start.S @ 84e59b7c

Last change on this file since 84e59b7c was 84e59b7c, checked in by Sebastian Huber <sebastian.huber@…>, on Nov 15, 2018 at 7:47:22 PM

bsps/powerpc: Use interrupt stack for init stack

Move start.o to separate file.

Update #3459.

  • Property mode set to 100644
File size: 2.0 KB
Line 
1/*
2 * Copyright (c) 2010-2013 embedded brains GmbH.  All rights reserved.
3 *
4 *  embedded brains GmbH
5 *  Dornierstr. 4
6 *  82178 Puchheim
7 *  Germany
8 *  <rtems@embedded-brains.de>
9 *
10 * The license and distribution terms for this file may be
11 * found in the file LICENSE in this distribution or at
12 * http://www.rtems.org/license/LICENSE.
13 */
14
15#include <rtems/asm.h>
16
17#include <bspopts.h>
18
19#include <libcpu/powerpc-utility.h>
20
21        .globl _start
22        .globl virtex_exc_vector_base
23
24        .section ".bsp_start_text", "ax"
25
26virtex_exc_vector_base:
27
28        b       _start
29
30        /* Critical Input 0x0100 */
31        /* Machine Check 0x0200 */
32        /* Data Storage 0x0300 */
33        /* Instruction Storage 0x0400 */
34        /* External 0x0500 */
35        /* Alignment 0x0600 */
36        /* Program 0x0700 */
37        /* FPU Unavailable 0x0800 */
38        /* System Call 0x0C00 */
39        /* APU Unavailable 0x0F20 */
40        /* Programmable-Interval Timer 0x1000 */
41        /* Fixed-Interval Timer 0x1010 */
42        /* Watchdog Timer 0x1020 */
43        /* Data TLB Miss 0x1100 */
44        /* Instruction TLB Miss 0x1200 */
45        /* Debug 0x2000 */
46.rept 0x2000 / 4 - 1
47        b       twiddle
48.endr
49
50_start:
51
52        /* Reset time base */
53        li      r0, 0
54        mtspr   TBWU, r0
55        mtspr   TBWL, r0
56
57        /*
58         * Initialize start stack.  The stacks are statically allocated and
59         * properly aligned.
60         */
61        LA      r1, _ISR_Stack_area_end
62        subi    r1, r1, PPC_DEFAULT_CACHE_LINE_SIZE
63        stw     r0, 0(r1)
64
65        /* Copy fast text */
66        LWI     r3, bsp_section_fast_text_begin
67        LWI     r4, bsp_section_fast_text_load_begin
68        LWI     r5, bsp_section_fast_text_size
69        bl      copy
70
71        /* Copy fast data */
72        LWI     r3, bsp_section_fast_data_begin
73        LWI     r4, bsp_section_fast_data_load_begin
74        LWI     r5, bsp_section_fast_data_size
75        bl      copy
76
77        /* Clear SBSS */
78        LWI     r3, bsp_section_sbss_begin
79        LWI     r4, bsp_section_sbss_size
80        bl      bsp_start_zero
81
82        /* Clear BSS */
83        LWI     r3, bsp_section_bss_begin
84        LWI     r4, bsp_section_bss_size
85        bl      bsp_start_zero
86
87        /* Set up EABI and SYSV environment */
88        bl      __eabi
89
90        /* Clear command line */
91        li      r3, 0
92
93        bl      boot_card
94
95twiddle:
96
97        bl      bsp_reset
98        b       twiddle
99
100copy:
101
102        cmpw    r3, r4
103        beqlr
104        b       memcpy
105
106        /* Reset entry */
107        .section ".virtex_reset", "ax"
108
109jump_to_start:
110
111        LWI     r3, _start
112        mtctr   r3
113        bctr
114        b       jump_to_start
Note: See TracBrowser for help on using the repository browser.