OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-3.0/] [packages/] [hal/] [arm/] [integrator/] [current/] [include/] [hal_platform_setup.h] - Blame information for rev 786

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 786 skrzyp
#ifndef CYGONCE_HAL_PLATFORM_SETUP_H
2
#define CYGONCE_HAL_PLATFORM_SETUP_H
3
 
4
/*=============================================================================
5
//
6
//      hal_platform_setup.h
7
//
8
//      Platform specific support for HAL (assembly code)
9
//
10
//=============================================================================
11
// ####ECOSGPLCOPYRIGHTBEGIN####
12
// -------------------------------------------
13
// This file is part of eCos, the Embedded Configurable Operating System.
14
// Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
15
//
16
// eCos is free software; you can redistribute it and/or modify it under
17
// the terms of the GNU General Public License as published by the Free
18
// Software Foundation; either version 2 or (at your option) any later
19
// version.
20
//
21
// eCos is distributed in the hope that it will be useful, but WITHOUT
22
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
23
// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
24
// for more details.
25
//
26
// You should have received a copy of the GNU General Public License
27
// along with eCos; if not, write to the Free Software Foundation, Inc.,
28
// 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
29
//
30
// As a special exception, if other files instantiate templates or use
31
// macros or inline functions from this file, or you compile this file
32
// and link it with other works to produce a work based on this file,
33
// this file does not by itself cause the resulting work to be covered by
34
// the GNU General Public License. However the source code for this file
35
// must still be made available in accordance with section (3) of the GNU
36
// General Public License v2.
37
//
38
// This exception does not invalidate any other reasons why a work based
39
// on this file might be covered by the GNU General Public License.
40
// -------------------------------------------
41
// ####ECOSGPLCOPYRIGHTEND####
42
//=============================================================================
43
//#####DESCRIPTIONBEGIN####
44
//
45
// Author(s):    David A Rusling
46
// Contributors: Philippe Robin
47
// Date:         November 7, 2000
48
// Purpose:     ARM INTEGRATOR platform specific support routines
49
// Description:
50
// Usage:       #include <cyg/hal/hal_platform_setup.h>
51
//
52
//####DESCRIPTIONEND####
53
//
54
//===========================================================================*/
55
 
56
#include <cyg/hal/hal_integrator.h>
57
 
58
#ifdef CYG_HAL_STARTUP_ROMRAM
59
#define CYGSEM_HAL_ROM_RESET_USES_JUMP
60
#endif
61
 
62
// Define macro used to diddle the LEDs during early initialization.
63
// Can use r0+r1. Argument in \x.
64
// Control the LEDs PP0-PP3. This requires the jumpers on pins 9-16 to
65
// be set on LK11 in order to be visible. Otherwise the parallel port
66
// data pins are diddled instead.
67
 
68
 
69
#ifdef CYGHWR_HAL_ARM_INTEGRATOR_DIAG_LEDS
70
#define CYGHWR_LED_MACRO                                \
71
        mov     r1, #(15 & (\x))                        ;\
72
        ldr     r0,=INTEGRATOR_DBG_BASE                 ;\
73
        strb    r1, [r0, #INTEGRATOR_DBG_LEDS_OFFSET]                    ;
74
#endif
75
 
76
#define PLATFORM_SETUP1 platform_setup1
77
 
78
        .macro  platform_setup1
79
#ifdef CYG_HAL_STARTUP_ROMRAM
80
        // This warps execution away from location 0+x to 0x24000000+x
81
        // so that we can turn the FLASH remapping off. 
82
        orr     pc,pc,#0x24000000
83
        nop
84
        nop
85
        nop
86
        nop
87
#endif
88
        ldr     r0,=INTEGRATOR_DBG_BASE
89
        ldr     r1,=0
90
        strb    r1, [r0, #INTEGRATOR_DBG_LEDS_OFFSET]                    
91
        ldr     r0, =INTEGRATOR_HDR_BASE
92
        ldr     r1, [r0, #INTEGRATOR_HDR_CTRL_OFFSET]                    
93
        orr     r1, r1, #INTEGRATOR_HDR_CTRL_REMAP                       
94
        str     r1, [r0, #INTEGRATOR_HDR_CTRL_OFFSET]                    
95
        ldr     r1, =INTEGRATOR_IRQCONT_BASE
96
        ldr     r0, =0xFFFFFFFF
97
        str     r0, [r1, #INTEGRATOR_IRQENABLECLEAR]                     
98
        str     r0, [r1, #INTEGRATOR_FIQENABLECLEAR]                     
99
        ldr     r0,=INTEGRATOR_DBG_BASE
100
        ldr     r1,=0xF
101
        strb    r1, [r0, #INTEGRATOR_DBG_LEDS_OFFSET]
102
 
103
        LED     7
104
#ifdef CYG_HAL_STARTUP_ROMRAM
105
#if 0
106
        // Compute [logical] base address of this image in ROM
107
        bl      10f
108
10:     mov     r9,lr                           // R9 = ROM address of 10:
109
        ldr     r8,=10b                         // R8 = RAM address of 10:
110
        sub     r9,r9,r8                        // R9 = ROM-RAM
111
        ldr     r0,=__exception_handlers        // R0 = RAM address of __exception_handlers
112
        add     r0,r0,r9                        // R0 = ROM address of __exception_handlers
113
#endif
114
 
115
        ldr     r0,=0x24000000
116
        ldr     r1,=__exception_handlers  // ram base & length
117
        ldr     r2,=__rom_data_end
118
20:     ldr     r3,[r0],#4
119
        str     r3,[r1],#4
120
        cmp     r1,r2
121
        bne     20b
122
        ldr     r0,=30f
123
        mov     pc,r0
124
        nop
125
        nop
126
        nop
127
        nop
128
30:
129
#endif
130
        LED     6
131
 
132
        .endm
133
 
134
/*---------------------------------------------------------------------------*/
135
/* end of hal_platform_setup.h                                               */
136
#endif /* CYGONCE_HAL_PLATFORM_SETUP_H */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.