source: rtems/bsps/powerpc/virtex/start/start.S @ 65f868c

5
Last change on this file since 65f868c was fbcd7c8f, checked in by Sebastian Huber <sebastian.huber@…>, on 04/20/18 at 08:19:28

bsps: Move start files to bsps

This patch is a part of the BSP source reorganization.

Update #3285.

  • 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 stack area */
51.rept BSP_START_STACK_SIZE / 4
52        b       twiddle
53.endr
54
55_start:
56
57        /* Reset time base */
58        li      r0, 0
59        mtspr   TBWU, r0
60        mtspr   TBWL, r0
61
62        /* Initialize start stack */
63        LWI     r1, _start
64        stwu    r0, -4(r1)
65        stwu    r0, -4(r1)
66
67        /* Copy fast text */
68        LWI     r3, bsp_section_fast_text_begin
69        LWI     r4, bsp_section_fast_text_load_begin
70        LWI     r5, bsp_section_fast_text_size
71        bl      copy
72
73        /* Copy fast data */
74        LWI     r3, bsp_section_fast_data_begin
75        LWI     r4, bsp_section_fast_data_load_begin
76        LWI     r5, bsp_section_fast_data_size
77        bl      copy
78
79        /* Clear SBSS */
80        LWI     r3, bsp_section_sbss_begin
81        LWI     r4, bsp_section_sbss_size
82        bl      bsp_start_zero
83
84        /* Clear BSS */
85        LWI     r3, bsp_section_bss_begin
86        LWI     r4, bsp_section_bss_size
87        bl      bsp_start_zero
88
89        /* Set up EABI and SYSV environment */
90        bl      __eabi
91
92        /* Clear command line */
93        li      r3, 0
94
95        bl      boot_card
96
97twiddle:
98
99        bl      bsp_reset
100        b       twiddle
101
102copy:
103
104        cmpw    r3, r4
105        beqlr
106        b       memcpy
107
108        /* Reset entry */
109        .section ".virtex_reset", "ax"
110
111jump_to_start:
112
113        LWI     r3, _start
114        mtctr   r3
115        bctr
116        b       jump_to_start
Note: See TracBrowser for help on using the repository browser.