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

Subversion Repositories openrisc

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 786 skrzyp
#ifndef CYGONCE_HAL_PLATFORM_EXTRAS_H
2
#define CYGONCE_HAL_PLATFORM_EXTRAS_H
3
 
4
/*=============================================================================
5
//
6
//      hal_platform_extras.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):    gthomas
46
// Contributors: gthomas, msalter
47
// Date:         1999-12-02
48
// Purpose:      Cogent CMA222 platform extras, in particular MMU tables
49
// Description:
50
// Usage:       #include <cyg/hal/hal_platform_extras.h>
51
//
52
//####DESCRIPTIONEND####
53
//
54
//===========================================================================*/
55
 
56
        .section ".mmu_tables","aw"
57
 
58
#define NEXT_PAGE                \
59
        .long   PTE                     ; \
60
        .set    PTE,PTE+MMU_PAGE_SIZE
61
 
62
_PT_0x0:
63
        .set    PTE,DRAM_PA_START|MMU_L2_TYPE_Small\
64
                    |MMU_AP_Any|MMU_Bufferable|MMU_Cacheable
65
        .rept   (0x2000000)/0x1000
66
        NEXT_PAGE
67
        .endr
68
        .balign 0x0400
69
 
70
// Too bad these macros don't work ['as' bug?] :-(
71
 
72
#define NEXT_SECTION                                            \
73
        .long   PTE+OFF                                        ;\
74
        .set    OFF,OFF+(MMU_SECTION_SIZE/MMU_PAGE_SIZE)*4
75
 
76
#define FILL_SEGMENT_(base)                     \
77
        .set    PTE,base                        \
78
        .set    OFF,0x00000000                  \
79
        .rept   0x10000000/MMU_SECTION_SIZE     \
80
            NEXT_SECTION                        \
81
        .endr
82
 
83
#define OFF     ((MMU_SECTION_SIZE/MMU_PAGE_SIZE)*4)
84
 
85
#define FILL_8M_SEGMENT(base,seg)               \
86
        .long   base+(OFF*(seg+0x00));          \
87
        .long   base+(OFF*(seg+0x01));          \
88
        .long   base+(OFF*(seg+0x02));          \
89
        .long   base+(OFF*(seg+0x03));          \
90
        .long   base+(OFF*(seg+0x04));          \
91
        .long   base+(OFF*(seg+0x05));          \
92
        .long   base+(OFF*(seg+0x06));          \
93
        .long   base+(OFF*(seg+0x07));          \
94
        .long   base+(OFF*(seg+0x08));
95
 
96
#define FILL_16M_SEGMENT(base,seg)              \
97
        .long   base+(OFF*(seg+0x00));          \
98
        .long   base+(OFF*(seg+0x01));          \
99
        .long   base+(OFF*(seg+0x02));          \
100
        .long   base+(OFF*(seg+0x03));          \
101
        .long   base+(OFF*(seg+0x04));          \
102
        .long   base+(OFF*(seg+0x05));          \
103
        .long   base+(OFF*(seg+0x06));          \
104
        .long   base+(OFF*(seg+0x07));          \
105
        .long   base+(OFF*(seg+0x08));          \
106
        .long   base+(OFF*(seg+0x09));          \
107
        .long   base+(OFF*(seg+0x0A));          \
108
        .long   base+(OFF*(seg+0x0B));          \
109
        .long   base+(OFF*(seg+0x0C));          \
110
        .long   base+(OFF*(seg+0x0D));          \
111
        .long   base+(OFF*(seg+0x0E));          \
112
        .long   base+(OFF*(seg+0x0F));
113
 
114
#define FILL_32M_SEGMENT(base,seg)              \
115
        FILL_16M_SEGMENT(base,0x00);            \
116
        FILL_16M_SEGMENT(base,0x10);
117
 
118
#define FILL_256M_SEGMENT(base)                 \
119
        FILL_16M_SEGMENT(base,0x00);            \
120
        FILL_16M_SEGMENT(base,0x10);            \
121
        FILL_16M_SEGMENT(base,0x20);            \
122
        FILL_16M_SEGMENT(base,0x30);            \
123
        FILL_16M_SEGMENT(base,0x40);            \
124
        FILL_16M_SEGMENT(base,0x50);            \
125
        FILL_16M_SEGMENT(base,0x60);            \
126
        FILL_16M_SEGMENT(base,0x70);            \
127
        FILL_16M_SEGMENT(base,0x80);            \
128
        FILL_16M_SEGMENT(base,0x90);            \
129
        FILL_16M_SEGMENT(base,0xA0);            \
130
        FILL_16M_SEGMENT(base,0xB0);            \
131
        FILL_16M_SEGMENT(base,0xC0);            \
132
        FILL_16M_SEGMENT(base,0xD0);            \
133
        FILL_16M_SEGMENT(base,0xE0);            \
134
        FILL_16M_SEGMENT(base,0xF0);
135
 
136
        .balign 0x4000
137
_MMU_table:
138
        FILL_32M_SEGMENT(_PT_0x0+MMU_L1_TYPE_Page,0x00)
139
        FILL_32M_SEGMENT(MMU_L1_TYPE_Fault,0x00)
140
        FILL_32M_SEGMENT(PCIMEM_PA|MMU_L1_TYPE_Section|MMU_AP_Any)
141
        FILL_32M_SEGMENT(MMU_L1_TYPE_Fault,0x00)
142
        FILL_32M_SEGMENT(MMU_L1_TYPE_Fault,0x00)
143
        FILL_32M_SEGMENT(MMU_L1_TYPE_Fault,0x00)
144
        FILL_32M_SEGMENT(MMU_L1_TYPE_Fault,0x00)
145
        FILL_8M_SEGMENT(ROM_PA|MMU_L1_TYPE_Section|MMU_AP_Any)
146
        FILL_16M_SEGMENT(MBIO_PA|MMU_L1_TYPE_Section|MMU_AP_Any)
147
        FILL_8M_SEGMENT(FLASH_PA|MMU_L1_TYPE_Section|MMU_AP_Any)
148
        FILL_256M_SEGMENT(MMU_L1_TYPE_Fault)
149
        FILL_256M_SEGMENT(MMU_L1_TYPE_Fault)
150
        FILL_256M_SEGMENT(MMU_L1_TYPE_Fault)
151
        FILL_256M_SEGMENT(MMU_L1_TYPE_Fault)
152
        FILL_256M_SEGMENT(MMU_L1_TYPE_Fault)
153
        FILL_256M_SEGMENT(MMU_L1_TYPE_Fault)
154
        FILL_256M_SEGMENT(MMU_L1_TYPE_Fault)
155
        FILL_256M_SEGMENT(MMU_L1_TYPE_Fault)
156
        FILL_256M_SEGMENT(MMU_L1_TYPE_Fault)
157
        FILL_256M_SEGMENT(MMU_L1_TYPE_Fault)
158
        FILL_256M_SEGMENT(MMU_L1_TYPE_Fault)
159
        FILL_256M_SEGMENT(MMU_L1_TYPE_Fault)
160
        FILL_256M_SEGMENT(MMU_L1_TYPE_Fault)
161
        FILL_256M_SEGMENT(MMU_L1_TYPE_Fault)
162
        FILL_256M_SEGMENT(MMU_L1_TYPE_Fault)
163
 
164
#endif // CYGONCE_HAL_PLATFORM_EXTRAS_H

powered by: WebSVN 2.1.0

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