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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-3.0/] [packages/] [hal/] [arm/] [e7t/] [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):   jskov
46
// Contributors:jskov
47
// Date:        2001-03-16
48
// Purpose:     E7T 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/plf_io.h>
57
 
58
#define CYGHWR_LED_MACRO                                                  \
59
        ldr     r0,=E7T_IOPDATA                                          ;\
60
        mov     r1, #((15 & (\x)) << 4)                                  ;\
61
        str     r1, [r0]                                                 ;
62
 
63
#if CYGNUM_HAL_COMMON_INTERRUPTS_STACK_SIZE==4096
64
// Override default to a more sensible value
65
#undef  CYGNUM_HAL_COMMON_INTERRUPTS_STACK_SIZE
66
#define CYGNUM_HAL_COMMON_INTERRUPTS_STACK_SIZE 2048
67
#endif
68
 
69
#if defined(CYG_HAL_STARTUP_ROM) || defined(CYG_HAL_STARTUP_ROMRAM)
70
#define PLATFORM_SETUP1                                                 ;\
71
        ldr     r1,=E7T_IOPMOD                                          ;\
72
        ldr     r2,=0x0001fcf0 /* set led + seg to output */            ;\
73
        str     r2,[r1,#0x00]                                           ;\
74
        ldr     r1,=E7T_IOPDATA                                         ;\
75
        ldr     r2,=0x00000050 /* set leds */                           ;\
76
        str     r2,[r1,#0x00]                                           ;\
77
                                                                        ;\
78
20:     ldr     lr,=33f                                                 ;\
79
        ldr     r0,=12f                                                 ;\
80
        ldmia   r0,{r1-r12}                                             ;\
81
        ldr     r0,=E7T_EXTDBWTH                                        ;\
82
        stmia   r0,{r1-r12}                                             ;\
83
        mov     pc,lr                                                   ;\
84
                                                                        ;\
85
        /* The below are set with a store-multiple instruction */       ;\
86
        /* Flash is 16 bit, SRAM is 32 bit */                           ;\
87
        /* .long   E7T_EXTDBWTH */                                      ;\
88
12:     .long  ( (E7T_EXTDBWTH_16BIT<<E7T_EXTDBWTH_DSR0_shift)           \
89
                |(E7T_EXTDBWTH_32BIT<<E7T_EXTDBWTH_DSR1_shift)           \
90
                |(E7T_EXTDBWTH_32BIT<<E7T_EXTDBWTH_DSR2_shift) )        ;\
91
        /* Flash at 0x01800000-0x01880000, 5 cycles, 4 cycles */        ;\
92
        /* .long   E7T_ROMCON0 */                                       ;\
93
        .long  ( (E7T_ROMCON_PMC_ROM)                                    \
94
                |(E7T_ROMCON_TPA_5C)                                     \
95
                |(E7T_ROMCON_TACC_4C)                                    \
96
                |((0x01800000 >> 16) << E7T_ROMCON_BASE_shift)           \
97
                |((0x01880000 >> 16) << E7T_ROMCON_NEXT_shift))         ;\
98
        /* SRAM at 0x00000000-0x00400000, 5 cycles, 2 cycles */         ;\
99
        /* .long   E7T_ROMCON1 */                                       ;\
100
        .long  ( (E7T_ROMCON_PMC_ROM)                                    \
101
                |(E7T_ROMCON_TPA_5C)                                     \
102
                |(E7T_ROMCON_TACC_2C)                                    \
103
                |((0x00000000 >> 16) << E7T_ROMCON_BASE_shift)           \
104
                |((0x00040000 >> 16) << E7T_ROMCON_NEXT_shift))         ;\
105
        /* SRAM at 0x00400000-0x00800000, 5 cycles, 2 cycles */         ;\
106
        /* .long   E7T_ROMCON2 */                                       ;\
107
        .long  ( (E7T_ROMCON_PMC_ROM)                                    \
108
                |(E7T_ROMCON_TPA_5C)                                     \
109
                |(E7T_ROMCON_TACC_2C)                                    \
110
                |((0x00040000 >> 16) << E7T_ROMCON_BASE_shift)           \
111
                |((0x00080000 >> 16) << E7T_ROMCON_NEXT_shift))         ;\
112
        /* Below values are what Boot Monitor sets up */                ;\
113
        /* .long   E7T_ROMCON3 */                                       ;\
114
        .long   0x08018020                                              ;\
115
        /* .long   E7T_ROMCON4 */                                       ;\
116
        .long   0x0a020040                                              ;\
117
        /* .long   E7T_ROMCON5 */                                       ;\
118
        .long   0x0c028040                                              ;\
119
        /* .long   E7T_DRAMCON0 */                                      ;\
120
        .long   0x00000000                                              ;\
121
        /* .long   E7T_DRAMCON1 */                                      ;\
122
        .long   0x00000000                                              ;\
123
        /* .long   E7T_DRAMCON2 */                                      ;\
124
        .long   0x00000000                                              ;\
125
        /* .long   E7T_DRAMCON3 */                                      ;\
126
        .long   0x00000000                                              ;\
127
        /* .long   E7T_REFEXTCON */                                     ;\
128
        .long   0x9c218360                                              ;\
129
                                                                        ;\
130
33:
131
#else
132
#define PLATFORM_SETUP1
133
#endif
134
 
135
//-----------------------------------------------------------------------------
136
// end of hal_platform_setup.h
137
#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.