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

4.104.114.84.95
Last change on this file since 7f01f89 was 206e590, checked in by Ralf Corsepius <ralf.corsepius@…>, on 04/01/04 at 10:11:58

2004-04-01 Ralf Corsepius <ralf_corsepius@…>

  • startup/boardinit.S: Include <rtems/asm.h> instead of <asm.h>.
  • include/bsp.h: Include <rtems/clockdrv.h> instead of <clockdrv.h>.
  • include/bsp.h: Include <rtems/console.h> instead of <console.h>.
  • include/bsp.h: Include <rtems/iosupp.h> instead of <iosupp.h>.
  • console/console.c: Include <rtems/ringbuf.h> instead of <ringbuf.h>.
  • Property mode set to 100644
File size: 1.5 KB
Line 
1/*
2 *  boardinit.s
3 *
4 *  Start code for the LEON.
5 *
6 *  $Id$
7 */
8
9#include <rtems/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        or      %l2, 0x20, %l2  ! set 32-bit ram width by default
52        st      %l2, [%l0 + LEON_REG_MEMCFG2_OFFSET] ! set ram size in memcfg2
53
54        set     SYM(RAM_START), %l1  ! Cannot use RAM_END due to bug in linker
55        set     SYM(RAM_SIZE), %l2
56        add     %l1, %l2, %sp
57        set     49, %l2
58        st      %l2, [%l0 + LEON_REG_SCALER_LOAD_OFFSET] ! scaler reload register
59        st      %l2, [%l0 + LEON_REG_SCALERCNT_OFFSET] ! scaler counter register
60
612:
62        retl
63        nop
64
65/* end of file */
Note: See TracBrowser for help on using the repository browser.