source: rtems/bsps/powerpc/mvme3100/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.3 KB
Line 
1/*
2 *  start.S :     RTEMS entry point
3 *
4 *  Copyright (C) 1999 Eric Valette. valette@crf.canon.fr
5 *
6 *  The license and distribution terms for this file may be
7 *  found in the file LICENSE in this distribution or at
8 *  http://www.rtems.org/license/LICENSE.
9 *
10 *  Modified for mvme3100 by T. Straumann, 2007.
11 *
12 */
13
14#include <rtems/asm.h>
15#include <libcpu/powerpc-utility.h>
16
17#include <bspopts.h>
18
19#define SYNC \
20        sync; \
21        isync
22
23#define KERNELBASE      0x0
24
25/* cannot include <bsp.h> from assembly :-( */
26#ifndef BSP_8540_CCSR_BASE
27#define BSP_8540_CCSR_BASE 0xe1000000
28#endif
29
30#define ERR_DISABLE_REG (BSP_8540_CCSR_BASE + 0x2e44)
31
32        .text
33        .globl  __rtems_entry_point
34        .type   __rtems_entry_point,@function
35__rtems_entry_point:
36        mr      r31,r3
37        mr      r30,r4
38        mr      r29,r5
39        mr      r28,r6
40        mr      r27,r7
41        /* disable checking for memory-select errors; motload has all TLBs
42         * mapping a possible larger area as memory (not-guarded, caching-enabled)
43         * than actual physical memory is available.
44         * In case of speculative loads this may cause 'memory-select' errors
45         * which seem to raise 'core_fault_in' (found no description in
46         * the manual but I experienced this problem).
47         * Such errors (if HID1[RFXE] is clear) may *stall* execution
48         * leading to mysterious 'hangs'.
49         * Note: enabling HID1[RFXE] at this point makes no sense since
50         *       exceptions are not configured yet. Therefore we disable
51         *       memory-select errors.
52         * Eventually (bspstart.c) we want to delete TLB entries for
53         * which no physical memory is present.
54         */
55        lis r3, ERR_DISABLE_REG@ha
56        lwz r4, ERR_DISABLE_REG@l(r3)
57        /* disable memory-select errors */
58        ori r4, r4, 1
59        stw r4, ERR_DISABLE_REG@l(r3)
60
61        /* Use MotLoad's TLB setup for now; caches are on already */
62        bl  __eabi      /* setup EABI and SYSV environment */
63        bl      zero_bss
64        /*
65         * restore original args
66         */
67        mr      r3,r31
68        mr      r4,r30
69        mr      r5,r29
70        mr      r6,r28
71        mr      r7,r27
72        bl      save_boot_params
73
74        /*
75         * Initialize start stack.  The stacks are statically allocated and
76         * properly aligned.
77         */
78        LA      r1, _ISR_Stack_area_end
79        subi    r1, r1, PPC_DEFAULT_CACHE_LINE_SIZE
80        li      r0, 0
81        stw     r0, 0(r1)
82
83        /*
84         * We are now in a environment that is totally independent from
85         * bootloader setup.
86         */
87    /* pass result of 'save_boot_params' to 'boot_card' in R3 */
88        bl      boot_card
89        /* point of no return: reset board here ? */
Note: See TracBrowser for help on using the repository browser.