source: rtems/c/src/lib/libbsp/sparc/leon/startup/boardinit.S @ f5f54cfa

4.104.114.84.95
Last change on this file since f5f54cfa was b21b0ab, checked in by Joel Sherrill <joel.sherrill@…>, on 11/13/00 at 22:40:29

2000-11-13 Jiri Gaisler <jgais@…>

  • .cvsignore, ChangeLog?, Makefile.am, README, bsp_specs, configure.in, times, clock/.cvsignore, clock/Makefile.am, clock/ckinit.c, console/.cvsignore, console/Makefile.am, console/console.c, console/consolereserveresources.c, console/debugputs.c, gnatsupp/.cvsignore, gnatsupp/Makefile.am, gnatsupp/gnatsupp.c, include/.cvsignore, include/Makefile.am, include/bsp.h, include/coverhd.h, include/leon.h, start/.cvsignore, start/Makefile.am, startup/.cvsignore, startup/Makefile.am, startup/boardinit.S, startup/linkcmds, startup/setvec.c, startup/spurious.c, timer/.cvsignore, timer/Makefile.am, timer/timer.c, tools/.cvsignore, tools/Makefile.am, tools/configure.in, tools/runtest.in, wrapup/.cvsignore, wrapup/Makefile.am: New file.
  • Property mode set to 100644
File size: 1.4 KB
Line 
1/*
2 *  boardinit.s
3 *
4 *  Start code for the LEON.
5 *
6 *  $Id$
7 */
8
9#include <asm.h>
10#include <leon.h>
11
12        .global __bsp_board_init
13
14__bsp_board_init:
15
16/* Check if LEON is initialised. If not, this means that we are
17   running on the simulator. Initiate some of the parameters
18   that are done by the boot-prom otherwise.
19*/
20
21        set     SYM(LEON_REG), %l0      ! %l0 = base address of peripherals
22        ld      [%l0+LEON_REG_CACHECTRL_OFFSET], %l1 ! Check if LEON has been initialised
23        andcc   %l1, 3, %g0             
24        bne     2f
25        nop
26
27
28        flush
29        set     0x1000f, %l1
30        st      %l1, [%l0 + LEON_REG_CACHECTRL_OFFSET]     ! enable caches
31        ld      [%l0 + LEON_REG_SIM_ROM_SIZE_OFFSET], %g1  ! load simulator rom size
32        clr     %l2
33        srl     %g1, 13, %g1            ! calculate appropriate rom size
341:
35        srl     %g1, 1, %g1
36        tst     %g1
37        bne,a   1b
38        inc     %l2
39        sll     %l2, 14, %l2
40        st      %l2, [%l0 + LEON_REG_MEMCFG1_OFFSET] ! set prom size in memcfg1
41
42        set     0, %l2
43        ld      [%l0 + LEON_REG_SIM_RAM_SIZE_OFFSET], %g2 ! load simulator ram size
44        srl     %g2, 13, %g1            ! calculate appropriate ram size
451:
46        srl     %g1, 1, %g1
47        tst     %g1
48        bne,a   1b
49        inc     %l2
50        sll     %l2, 9, %l2
51        st      %l2, [%l0 + LEON_REG_MEMCFG2_OFFSET] ! set ram size in memcfg2
52
53        set     SYM(RAM_START), %l1  ! Cannot use RAM_END due to bug in linker
54        set     SYM(RAM_SIZE), %l2
55        add     %l1, %l2, %sp
56        set     49, %l2
57        st      %l2, [%l0 + LEON_REG_SCALER_LOAD_OFFSET] ! scaler reload register
58        st      %l2, [%l0 + LEON_REG_SCALERCNT_OFFSET] ! scaler counter register
59
602:
61        retl
62        nop
63
64/* end of file */
Note: See TracBrowser for help on using the repository browser.